query_name
stringlengths
13
55
code_file_path
stringlengths
14
194
context_blocks
list
answer_spans
list
supporting_fact_spans
list
example_type
int8
0
1
single_hop
bool
2 classes
subtokenized_input_sequence
sequence
label_sequence
sequence
Unused import
lbryio/lbry/lbrynet/lbrynet_daemon/LBRYDaemon.py
[ { "content": "import locale\nimport os\nimport sys\nimport simplejson as json\nimport binascii\nimport subprocess\nimport logging\nimport logging.handlers\nimport requests\nimport base64\nimport base58\nimport platform\nimport json\n\nfrom twisted.web import server, resource, static\nfrom twisted.internet import defer, threads, error, reactor\nfrom txjsonrpc import jsonrpclib\nfrom txjsonrpc.web import jsonrpc\nfrom txjsonrpc.web.jsonrpc import Handler\n\nfrom datetime import datetime\nfrom decimal import Decimal\nfrom appdirs import user_data_dir\nfrom urllib2 import urlopen\n\nfrom lbrynet import __version__ as lbrynet_version\nfrom lbryum.version import ELECTRUM_VERSION as lbryum_version\nfrom lbrynet.core.PaymentRateManager import PaymentRateManager\nfrom lbrynet.core.server.BlobAvailabilityHandler import BlobAvailabilityHandlerFactory\nfrom lbrynet.core.server.BlobRequestHandler import BlobRequestHandlerFactory\nfrom lbrynet.core.server.ServerProtocol import ServerProtocolFactory\nfrom lbrynet.lbrynet_console.ControlHandlers import get_time_behind_blockchain\nfrom lbrynet.core.Error import UnknownNameError\nfrom lbrynet.lbryfile.StreamDescriptor import LBRYFileStreamType\nfrom lbrynet.lbryfile.client.LBRYFileDownloader import LBRYFileSaverFactory, LBRYFileOpenerFactory\nfrom lbrynet.lbryfile.client.LBRYFileOptions import add_lbry_file_to_sd_identifier\nfrom lbrynet.lbrynet_daemon.LBRYDownloader import GetStream, FetcherDaemon\nfrom lbrynet.lbrynet_daemon.LBRYPublisher import Publisher\nfrom lbrynet.core.utils import generate_id\nfrom lbrynet.lbrynet_console.LBRYSettings import LBRYSettings\nfrom lbrynet.conf import MIN_BLOB_DATA_PAYMENT_RATE, DEFAULT_MAX_SEARCH_RESULTS, KNOWN_DHT_NODES, DEFAULT_MAX_KEY_FEE\nfrom lbrynet.conf import API_CONNECTION_STRING, API_PORT, API_ADDRESS, DEFAULT_TIMEOUT, UI_ADDRESS\nfrom lbrynet.core.StreamDescriptor import StreamDescriptorIdentifier, download_sd_blob\nfrom lbrynet.core.Session import LBRYSession\nfrom lbrynet.core.PTCWallet import PTCWallet\nfrom lbrynet.core.LBRYcrdWallet import LBRYcrdWallet, LBRYumWallet\nfrom lbrynet.lbryfilemanager.LBRYFileManager import LBRYFileManager\nfrom lbrynet.lbryfile.LBRYFileMetadataManager import DBLBRYFileMetadataManager, TempLBRYFileMetadataManager\n\n\nif sys.platform != \"darwin\":\n log_dir = os.path.join(os.path.expanduser(\"~\"), \".lbrynet\")\nelse:\n log_dir = user_data_dir(\"LBRY\")\n\nif not os.path.isdir(log_dir):\n os.mkdir(log_dir)\n\nLOG_FILENAME = os.path.join(log_dir, 'lbrynet-daemon.log')\n\nif os.path.isfile(LOG_FILENAME):\n f = open(LOG_FILENAME, 'r')\n PREVIOUS_LOG = len(f.read())\n f.close()\nelse:\n PREVIOUS_LOG = 0\n\nlog = logging.getLogger(__name__)\nhandler = logging.handlers.RotatingFileHandler(LOG_FILENAME, maxBytes=262144, backupCount=5)\nlog.addHandler(handler)\nlog.setLevel(logging.INFO)\n\nSTARTUP_STAGES = [\n ('initializing', 'Initializing...'),\n ('loading_db', 'Loading databases...'),\n ('loading_wallet', 'Catching up with the blockchain... %s'),\n ('loading_file_manager', 'Setting up file manager'),\n ('loading_server', 'Starting lbrynet'),\n ('started', 'Started lbrynet')\n ]\n\nALLOWED_DURING_STARTUP = ['is_running', 'is_first_run',\n 'get_time_behind_blockchain', 'stop',\n 'daemon_status', 'get_start_notice',\n 'version', 'check_for_new_version']\n\nBAD_REQUEST = 400\nNOT_FOUND = 404\nOK_CODE = 200\n# TODO add login credentials in a conf file\n# TODO alert if your copy of a lbry file is out of date with the name record\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class LBRYDaemon(jsonrpc.JSONRPC):\n \"\"\"\n LBRYnet daemon, a jsonrpc interface to lbry functions\n \"\"\"\n\n isLeaf = True\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n # def jsonrpc_stop_lbry_file(self, p):\n # params = Bunch(p)\n #\n # try:\n # lbry_file = [f for f in self.lbry_file_manager.lbry_files if f.stream_hash == params.stream_hash][0]\n # except IndexError:\n # return defer.fail(UnknownNameError)\n #\n # if not lbry_file.stopped:\n # d = self.lbry_file_manager.toggle_lbry_file_running(lbry_file)\n # d.addCallback(lambda _: self._render_response(\"Stream has been stopped\", OK_CODE))\n # d.addErrback(lambda err: self._render_response(err.getTraceback(), ))\n # return d\n # else:\n # return json.dumps({'result': 'Stream was already stopped'})\n #\n # def jsonrpc_start_lbry_file(self, p):\n # params = Bunch(p)\n #\n # try:\n # lbry_file = [f for f in self.lbry_file_manager.lbry_files if f.stream_hash == params.stream_hash][0]\n # except IndexError:\n # return defer.fail(UnknownNameError)\n #\n # if lbry_file.stopped:\n # d = self.lbry_file_manager.toggle_lbry_file_running(lbry_file)\n # d.callback(None)\n # return json.dumps({'result': 'Stream started'})\n # else:\n # return json.dumps({'result': 'Stream was already running'})\n\n\n\n\n\n\n\n\n # def jsonrpc_update_name(self, metadata):\n # def _disp(x):\n # print x\n # return x\n #\n # metadata = json.loads(metadata)\n #\n # required = ['name', 'file_path', 'bid']\n #\n # for r in required:\n # if not r in metadata.keys():\n # return defer.fail()\n #\n # d = defer.Deferred()\n # d.addCallback(lambda _: self.session.wallet.update_name(metadata))\n # d.addCallback(_disp)\n # d.callback(None)\n #\n # return d\n\n\n", "metadata": "root.LBRYDaemon", "header": "['module', '___EOS___']", "index": 93 }, { "content": " def __init__(self, ui_version_info, wallet_type=\"lbryum\"):\n jsonrpc.JSONRPC.__init__(self)\n reactor.addSystemEventTrigger('before', 'shutdown', self._shutdown)\n\n self.startup_status = STARTUP_STAGES[0]\n self.startup_message = None\n self.announced_startup = False\n self.query_handlers = {}\n self.ui_version = ui_version_info.replace('\\n', '')\n self.git_lbrynet_version = None\n self.git_lbryum_version = None\n self.wallet_type = wallet_type\n self.session_settings = None\n self.first_run = None\n self.log_file = LOG_FILENAME\n self.fetcher = None\n self.current_db_revision = 1\n self.run_server = True\n self.session = None\n self.known_dht_nodes = KNOWN_DHT_NODES\n self.platform_info = {\n \"processor\": platform.processor(),\n \"python_version: \": platform.python_version(),\n \"platform\": platform.platform(),\n \"os_release\": platform.release(),\n \"os_system\": platform.system(),\n \"lbrynet_version: \": lbrynet_version,\n \"lbryum_version: \": lbryum_version,\n \"ui_version\": self.ui_version,\n }\n try:\n self.platform_info['ip'] = json.load(urlopen('http://jsonip.com'))['ip']\n except:\n self.platform_info['ip'] = \"Could not determine\"\n\n if os.name == \"nt\":\n from lbrynet.winhelpers.knownpaths import get_path, FOLDERID, UserHandle\n self.download_directory = get_path(FOLDERID.Downloads, UserHandle.current)\n self.db_dir = os.path.join(get_path(FOLDERID.RoamingAppData, UserHandle.current), \"lbrynet\")\n self.lbrycrdd_path = \"lbrycrdd.exe\"\n if wallet_type == \"lbrycrd\":\n self.wallet_dir = os.path.join(get_path(FOLDERID.RoamingAppData, UserHandle.current), \"lbrycrd\")\n else:\n self.wallet_dir = os.path.join(get_path(FOLDERID.RoamingAppData, UserHandle.current), \"lbryum\")\n elif sys.platform == \"darwin\":\n self.download_directory = os.path.join(os.path.expanduser(\"~\"), 'Downloads')\n self.db_dir = user_data_dir(\"LBRY\")\n self.lbrycrdd_path = \"./lbrycrdd\"\n if wallet_type == \"lbrycrd\":\n self.wallet_dir = user_data_dir(\"lbrycrd\")\n else:\n self.wallet_dir = user_data_dir(\"LBRY\")\n else:\n self.download_directory = os.getcwd()\n self.db_dir = os.path.join(os.path.expanduser(\"~\"), \".lbrynet\")\n self.lbrycrdd_path = \"./lbrycrdd\"\n if wallet_type == \"lbrycrd\":\n self.wallet_dir = os.path.join(os.path.expanduser(\"~\"), \".lbrycrd\")\n else:\n self.wallet_dir = os.path.join(os.path.expanduser(\"~\"), \".lbryum\")\n\n self.created_data_dir = False\n if not os.path.exists(self.db_dir):\n os.mkdir(self.db_dir)\n self.created_data_dir = True\n\n self.blobfile_dir = os.path.join(self.db_dir, \"blobfiles\")\n self.lbrycrd_conf = os.path.join(self.wallet_dir, \"lbrycrd.conf\")\n self.autofetcher_conf = os.path.join(self.wallet_dir, \"autofetcher.conf\")\n self.daemon_conf = os.path.join(self.db_dir, 'daemon_settings.json')\n self.wallet_conf = os.path.join(self.wallet_dir, \"lbrycrd.conf\")\n self.wallet_user = None\n self.wallet_password = None\n\n self.sd_identifier = StreamDescriptorIdentifier()\n self.stream_info_manager = TempLBRYFileMetadataManager()\n self.settings = LBRYSettings(self.db_dir)\n self.blob_request_payment_rate_manager = None\n self.lbry_file_metadata_manager = None\n self.lbry_file_manager = None\n\n #defaults for settings otherwise loaded from daemon_settings.json\n self.default_settings = {\n 'run_on_startup': False,\n 'data_rate': MIN_BLOB_DATA_PAYMENT_RATE,\n 'max_key_fee': DEFAULT_MAX_KEY_FEE,\n 'default_download_directory': self.download_directory,\n 'max_upload': 0.0,\n 'max_download': 0.0,\n 'upload_log': True,\n 'search_timeout': 3.0,\n 'max_search_results': DEFAULT_MAX_SEARCH_RESULTS,\n 'wallet_type': wallet_type,\n 'delete_blobs_on_remove': True,\n 'peer_port': 3333,\n 'dht_node_port': 4444,\n 'use_upnp': True,\n 'start_lbrycrdd': True,\n 'requested_first_run_credits': False\n }", "metadata": "root.LBRYDaemon.__init__", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 100 }, { "content": " def render(self, request):\n request.content.seek(0, 0)\n # Unmarshal the JSON-RPC data.\n content = request.content.read()\n parsed = jsonrpclib.loads(content)\n functionPath = parsed.get(\"method\")\n args = parsed.get('params')\n\n #TODO convert args to correct types if possible\n\n id = parsed.get('id')\n version = parsed.get('jsonrpc')\n if version:\n version = int(float(version))\n elif id and not version:\n version = jsonrpclib.VERSION_1\n else:\n version = jsonrpclib.VERSION_PRE1\n # XXX this all needs to be re-worked to support logic for multiple\n # versions...\n\n if not self.announced_startup:\n if functionPath not in ALLOWED_DURING_STARTUP:\n return server.failure\n\n try:\n function = self._getFunction(functionPath)\n except jsonrpclib.Fault, f:\n self._cbRender(f, request, id, version)\n else:\n request.setHeader(\"Access-Control-Allow-Origin\", \"*\")\n request.setHeader(\"content-type\", \"text/json\")\n if args == [{}]:\n d = defer.maybeDeferred(function)\n else:\n d = defer.maybeDeferred(function, *args)\n d.addErrback(self._ebRender, id)\n d.addCallback(self._cbRender, request, id, version)\n return server.NOT_DONE_YET", "metadata": "root.LBRYDaemon.render", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 201 }, { "content": " def _cbRender(self, result, request, id, version):\n if isinstance(result, Handler):\n result = result.result\n\n if isinstance(result, dict):\n result = result['result']\n\n if version == jsonrpclib.VERSION_PRE1:\n if not isinstance(result, jsonrpclib.Fault):\n result = (result,)\n # Convert the result (python) to JSON-RPC\n try:\n s = jsonrpclib.dumps(result, version=version)\n except:\n f = jsonrpclib.Fault(self.FAILURE, \"can't serialize output\")\n s = jsonrpclib.dumps(f, version=version)\n request.setHeader(\"content-length\", str(len(s)))\n request.write(s)\n request.finish()", "metadata": "root.LBRYDaemon._cbRender", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 241 }, { "content": " def _ebRender(self, failure, id):\n if isinstance(failure.value, jsonrpclib.Fault):\n return failure.value\n log.error(failure)\n return jsonrpclib.Fault(self.FAILURE, \"error\")", "metadata": "root.LBRYDaemon._ebRender", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 261 }, { "content": " def setup(self):\n def _log_starting_vals():\n def _get_lbry_files_json():\n r = self._get_lbry_files()\n return json.dumps(r)\n\n def _get_lbryum_version():\n r = urlopen(\"https://raw.githubusercontent.com/lbryio/lbryum/master/lib/version.py\").read().split('\\n')\n version = next(line.split(\"=\")[1].split(\"#\")[0].replace(\" \", \"\")\n for line in r if \"ELECTRUM_VERSION\" in line)\n version = version.replace(\"'\", \"\")\n log.info(\"remote lbryum \" + str(version) + \" > local lbryum \" + str(lbryum_version) + \" = \" + str(\n version > lbryum_version))\n return version\n\n def _get_lbrynet_version():\n r = urlopen(\"https://raw.githubusercontent.com/lbryio/lbry/master/lbrynet/__init__.py\").read().split('\\n')\n vs = next(i for i in r if 'version =' in i).split(\"=\")[1].replace(\" \", \"\")\n vt = tuple(int(x) for x in vs[1:-1].split(','))\n vr = \".\".join([str(x) for x in vt])\n log.info(\"remote lbrynet \" + str(vr) + \" > local lbrynet \" + str(lbrynet_version) + \" = \" + str(\n vr > lbrynet_version))\n return vr\n\n self.git_lbrynet_version = _get_lbrynet_version()\n self.git_lbryum_version = _get_lbryum_version()\n\n log.info(\"LBRY Files: \" + _get_lbry_files_json())\n log.info(\"Starting balance: \" + str(self.session.wallet.wallet_balance))\n\n return defer.succeed(None)\n\n def _announce_startup():\n def _announce():\n self.announced_startup = True\n self.startup_status = STARTUP_STAGES[5]\n log.info(\"[\" + str(datetime.now()) + \"] Started lbrynet-daemon\")\n\n if self.first_run:\n d = self._upload_log(name_prefix=\"fr\")\n else:\n d = self._upload_log(exclude_previous=True, name_prefix=\"start\")\n\n if float(self.session.wallet.wallet_balance) == 0.0:\n d.addCallback(lambda _: self._check_first_run())\n d.addCallback(self._show_first_run_result)\n\n d.addCallback(lambda _: _announce())\n return d\n\n log.info(\"[\" + str(datetime.now()) + \"] Starting lbrynet-daemon\")\n\n d = defer.Deferred()\n d.addCallback(lambda _: self._initial_setup())\n d.addCallback(self._set_daemon_settings)\n d.addCallback(lambda _: threads.deferToThread(self._setup_data_directory))\n d.addCallback(lambda _: self._check_db_migration())\n d.addCallback(lambda _: self._get_settings())\n d.addCallback(lambda _: self._get_lbrycrdd_path())\n d.addCallback(lambda _: self._get_session())\n d.addCallback(lambda _: add_lbry_file_to_sd_identifier(self.sd_identifier))\n d.addCallback(lambda _: self._setup_stream_identifier())\n d.addCallback(lambda _: self._setup_lbry_file_manager())\n d.addCallback(lambda _: self._setup_lbry_file_opener())\n d.addCallback(lambda _: self._setup_query_handlers())\n d.addCallback(lambda _: self._setup_server())\n d.addCallback(lambda _: self._setup_fetcher())\n d.addCallback(lambda _: _log_starting_vals())\n d.addCallback(lambda _: _announce_startup())\n d.callback(None)\n\n return defer.succeed(None)", "metadata": "root.LBRYDaemon.setup", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 267 }, { "content": " def _initial_setup(self):\n def _log_platform():\n log.info(\"Platform: \" + json.dumps(self.platform_info))\n return defer.succeed(None)\n\n def _load_daemon_conf():\n if os.path.isfile(self.daemon_conf):\n f = open(self.daemon_conf, \"r\")\n loaded_settings = json.loads(f.read())\n f.close()\n missing_settings = {}\n for k in self.default_settings.keys():\n if k not in loaded_settings.keys():\n missing_settings[k] = self.default_settings[k]\n if missing_settings != {}:\n for k in missing_settings.keys():\n log.info(\"Adding missing setting: \" + k + \" with default value: \" + str(missing_settings[k]))\n loaded_settings[k] = missing_settings[k]\n f = open(self.daemon_conf, \"w\")\n f.write(json.dumps(loaded_settings))\n f.close()\n rsettings = loaded_settings\n else:\n log.info(\"Writing default settings : \" + json.dumps(self.default_settings) + \" --> \" + str(self.daemon_conf))\n f = open(self.daemon_conf, \"w\")\n f.write(json.dumps(self.default_settings))\n f.close()\n rsettings = self.default_settings\n for k in rsettings.keys():\n self.__dict__[k] = rsettings[k]\n return rsettings\n\n d = _log_platform()\n d.addCallback(lambda _: _load_daemon_conf())\n\n return d", "metadata": "root.LBRYDaemon._initial_setup", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 340 }, { "content": " def _set_daemon_settings(self, settings):\n self.session_settings = settings\n return defer.succeed(None)", "metadata": "root.LBRYDaemon._set_daemon_settings", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 377 }, { "content": " def _start_server(self):\n\n if self.peer_port is not None:\n\n server_factory = ServerProtocolFactory(self.session.rate_limiter,\n self.query_handlers,\n self.session.peer_manager)\n try:\n self.lbry_server_port = reactor.listenTCP(self.peer_port, server_factory)\n except error.CannotListenError as e:\n import traceback\n log.error(\"Couldn't bind to port %d. %s\", self.peer_port, traceback.format_exc())\n raise ValueError(\"%s lbrynet may already be running on your computer.\", str(e))\n return defer.succeed(True)", "metadata": "root.LBRYDaemon._start_server", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 381 }, { "content": " def _stop_server(self):\n if self.lbry_server_port is not None:\n self.lbry_server_port, p = None, self.lbry_server_port\n return defer.maybeDeferred(p.stopListening)\n else:\n return defer.succeed(True)", "metadata": "root.LBRYDaemon._stop_server", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 396 }, { "content": " def _setup_server(self):\n\n def restore_running_status(running):\n if running is True:\n return self._start_server()\n return defer.succeed(True)\n\n self.startup_status = STARTUP_STAGES[4]\n\n dl = self.settings.get_server_running_status()\n dl.addCallback(restore_running_status)\n return dl", "metadata": "root.LBRYDaemon._setup_server", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 403 }, { "content": " def _setup_query_handlers(self):\n handlers = [\n # CryptBlobInfoQueryHandlerFactory(self.lbry_file_metadata_manager, self.session.wallet,\n # self._server_payment_rate_manager),\n BlobAvailabilityHandlerFactory(self.session.blob_manager),\n # BlobRequestHandlerFactory(self.session.blob_manager, self.session.wallet,\n # self._server_payment_rate_manager),\n self.session.wallet.get_wallet_info_query_handler_factory(),\n ]\n\n def get_blob_request_handler_factory(rate):\n self.blob_request_payment_rate_manager = PaymentRateManager(\n self.session.base_payment_rate_manager, rate\n )\n handlers.append(BlobRequestHandlerFactory(self.session.blob_manager, self.session.wallet,\n self.blob_request_payment_rate_manager))\n\n d1 = self.settings.get_server_data_payment_rate()\n d1.addCallback(get_blob_request_handler_factory)\n\n dl = defer.DeferredList([d1])\n dl.addCallback(lambda _: self._add_query_handlers(handlers))\n return dl", "metadata": "root.LBRYDaemon._setup_query_handlers", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 416 }, { "content": " def _add_query_handlers(self, query_handlers):\n\n def _set_query_handlers(statuses):\n from future_builtins import zip\n for handler, (success, status) in zip(query_handlers, statuses):\n if success is True:\n self.query_handlers[handler] = status\n\n ds = []\n for handler in query_handlers:\n ds.append(self.settings.get_query_handler_status(handler.get_primary_query_identifier()))\n dl = defer.DeferredList(ds)\n dl.addCallback(_set_query_handlers)\n return dl", "metadata": "root.LBRYDaemon._add_query_handlers", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 440 }, { "content": " def _upload_log(self, name_prefix=None, exclude_previous=False):\n if name_prefix:\n name_prefix = name_prefix + \"-\" + platform.system()\n else:\n name_prefix = platform.system()\n\n if self.session_settings['upload_log']:\n LOG_URL = \"https://lbry.io/log-upload\"\n if exclude_previous:\n f = open(self.log_file, \"r\")\n f.seek(PREVIOUS_LOG)\n log_contents = f.read()\n f.close()\n else:\n f = open(self.log_file, \"r\")\n log_contents = f.read()\n f.close()\n t = datetime.now()\n log_name = name_prefix + \"-\" + base58.b58encode(self.lbryid)[:20] + \"-\" + str(t.month) + \"-\" + str(t.day) + \"-\" + str(t.year) + \"-\" + str(t.hour) + \"-\" + str(t.minute)\n params = {'name': log_name, 'log': log_contents}\n\n requests.post(LOG_URL, params)\n\n return defer.succeed(None)", "metadata": "root.LBRYDaemon._upload_log", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 455 }, { "content": " def _shutdown(self):\n log.info(\"Closing lbrynet session\")\n log.info(\"Status at time of shutdown: \" + self.startup_status[0])\n\n d = self._upload_log(name_prefix=\"close\", exclude_previous=False if self.first_run else True)\n d.addCallback(lambda _: self._stop_server())\n d.addErrback(lambda err: log.info(\"Bad server shutdown: \" + err.getTraceback()))\n if self.session is not None:\n d.addCallback(lambda _: self.session.shut_down())\n d.addErrback(lambda err: log.info(\"Bad session shutdown: \" + err.getTraceback()))\n return d", "metadata": "root.LBRYDaemon._shutdown", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 480 }, { "content": " def _update_settings(self, settings):\n for k in settings.keys():\n if k == 'run_on_startup':\n if type(settings['run_on_startup']) is bool:\n self.session_settings['run_on_startup'] = settings['run_on_startup']\n else:\n return defer.fail()\n elif k == 'data_rate':\n if type(settings['data_rate']) is float:\n self.session_settings['data_rate'] = settings['data_rate']\n elif type(settings['data_rate']) is int:\n self.session_settings['data_rate'] = float(settings['data_rate'])\n else:\n return defer.fail()\n elif k == 'max_key_fee':\n if type(settings['max_key_fee']) is float:\n self.session_settings['max_key_fee'] = settings['max_key_fee']\n elif type(settings['max_key_fee']) is int:\n self.session_settings['max_key_fee'] = float(settings['max_key_fee'])\n else:\n return defer.fail()\n elif k == 'default_download_directory':\n if type(settings['default_download_directory']) is unicode:\n if os.path.isdir(settings['default_download_directory']):\n self.session_settings['default_download_directory'] = settings['default_download_directory']\n else:\n pass\n else:\n return defer.fail()\n elif k == 'max_upload':\n if type(settings['max_upload']) is float:\n self.session_settings['max_upload'] = settings['max_upload']\n elif type(settings['max_upload']) is int:\n self.session_settings['max_upload'] = float(settings['max_upload'])\n else:\n return defer.fail()\n elif k == 'max_download':\n if type(settings['max_download']) is float:\n self.session_settings['max_download'] = settings['max_download']\n if type(settings['max_download']) is int:\n self.session_settings['max_download'] = float(settings['max_download'])\n else:\n return defer.fail()\n elif k == 'upload_log':\n if type(settings['upload_log']) is bool:\n self.session_settings['upload_log'] = settings['upload_log']\n else:\n return defer.fail()\n\n f = open(self.daemon_conf, \"w\")\n f.write(json.dumps(self.session_settings))\n f.close()\n\n return defer.succeed(True)", "metadata": "root.LBRYDaemon._update_settings", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 492 }, { "content": " def _setup_fetcher(self):\n self.fetcher = FetcherDaemon(self.session, self.lbry_file_manager, self.lbry_file_metadata_manager,\n self.session.wallet, self.sd_identifier, self.autofetcher_conf)\n return defer.succeed(None)", "metadata": "root.LBRYDaemon._setup_fetcher", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 547 }, { "content": " def _setup_data_directory(self):\n self.startup_status = STARTUP_STAGES[1]\n log.info(\"Loading databases...\")\n if self.created_data_dir:\n db_revision = open(os.path.join(self.db_dir, \"db_revision\"), mode='w')\n db_revision.write(str(self.current_db_revision))\n db_revision.close()\n log.debug(\"Created the db revision file: %s\", str(os.path.join(self.db_dir, \"db_revision\")))\n if not os.path.exists(self.blobfile_dir):\n os.mkdir(self.blobfile_dir)\n log.debug(\"Created the blobfile directory: %s\", str(self.blobfile_dir))", "metadata": "root.LBRYDaemon._setup_data_directory", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 552 }, { "content": " def _check_db_migration(self):\n old_revision = 0\n db_revision_file = os.path.join(self.db_dir, \"db_revision\")\n if os.path.exists(db_revision_file):\n old_revision = int(open(db_revision_file).read().strip())\n if old_revision < self.current_db_revision:\n from lbrynet.db_migrator import dbmigrator\n log.info(\"Upgrading your databases...\")\n d = threads.deferToThread(dbmigrator.migrate_db, self.db_dir, old_revision, self.current_db_revision)\n\n def print_success(old_dirs):\n success_string = \"Finished upgrading the databases. It is now safe to delete the\"\n success_string += \" following directories, if you feel like it. It won't make any\"\n success_string += \" difference.\\nAnyway here they are: \"\n for i, old_dir in enumerate(old_dirs):\n success_string += old_dir\n if i + 1 < len(old_dir):\n success_string += \", \"\n log.info(success_string)\n\n d.addCallback(print_success)\n return d\n return defer.succeed(True)", "metadata": "root.LBRYDaemon._check_db_migration", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 564 }, { "content": " def _get_settings(self):\n d = self.settings.start()\n d.addCallback(lambda _: self.settings.get_lbryid())\n d.addCallback(self._set_lbryid)\n d.addCallback(lambda _: self._get_lbrycrdd_path())\n return d", "metadata": "root.LBRYDaemon._get_settings", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 588 }, { "content": " def _set_lbryid(self, lbryid):\n if lbryid is None:\n return self._make_lbryid()\n else:\n log.info(\"LBRY ID: \" + base58.b58encode(lbryid))\n self.lbryid = lbryid", "metadata": "root.LBRYDaemon._set_lbryid", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 595 }, { "content": " def _make_lbryid(self):\n self.lbryid = generate_id()\n log.info(\"Generated new LBRY ID: \" + base58.b58encode(self.lbryid))\n d = self.settings.save_lbryid(self.lbryid)\n return d", "metadata": "root.LBRYDaemon._make_lbryid", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 602 }, { "content": " def _setup_lbry_file_manager(self):\n self.startup_status = STARTUP_STAGES[3]\n self.lbry_file_metadata_manager = DBLBRYFileMetadataManager(self.db_dir)\n d = self.lbry_file_metadata_manager.setup()\n\n def set_lbry_file_manager():\n self.lbry_file_manager = LBRYFileManager(self.session,\n self.lbry_file_metadata_manager,\n self.sd_identifier,\n delete_data=True)\n return self.lbry_file_manager.setup()\n\n d.addCallback(lambda _: set_lbry_file_manager())\n\n return d", "metadata": "root.LBRYDaemon._setup_lbry_file_manager", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 608 }, { "content": " def _get_session(self):\n def get_default_data_rate():\n d = self.settings.get_default_data_payment_rate()\n d.addCallback(lambda rate: {\"default_data_payment_rate\": rate if rate is not None else\n MIN_BLOB_DATA_PAYMENT_RATE})\n return d\n\n def get_wallet():\n if self.wallet_type == \"lbrycrd\":\n log.info(\"Using lbrycrd wallet\")\n lbrycrdd_path = None\n if self.start_lbrycrdd is True:\n lbrycrdd_path = self.lbrycrdd_path\n if not lbrycrdd_path:\n lbrycrdd_path = self.default_lbrycrdd_path\n d = defer.succeed(LBRYcrdWallet(self.db_dir, wallet_dir=self.wallet_dir, wallet_conf=self.lbrycrd_conf,\n lbrycrdd_path=lbrycrdd_path))\n elif self.wallet_type == \"lbryum\":\n log.info(\"Using lbryum wallet\")\n d = defer.succeed(LBRYumWallet(self.db_dir))\n elif self.wallet_type == \"ptc\":\n log.info(\"Using PTC wallet\")\n d = defer.succeed(PTCWallet(self.db_dir))\n else:\n d = defer.fail()\n\n d.addCallback(lambda wallet: {\"wallet\": wallet})\n return d\n\n d1 = get_default_data_rate()\n d2 = get_wallet()\n\n def combine_results(results):\n r = {}\n for success, result in results:\n if success is True:\n r.update(result)\n return r\n\n def create_session(results):\n self.session = LBRYSession(results['default_data_payment_rate'], db_dir=self.db_dir, lbryid=self.lbryid,\n blob_dir=self.blobfile_dir, dht_node_port=self.dht_node_port,\n known_dht_nodes=self.known_dht_nodes, peer_port=self.peer_port,\n use_upnp=self.use_upnp, wallet=results['wallet'])\n self.startup_status = STARTUP_STAGES[2]\n\n dl = defer.DeferredList([d1, d2], fireOnOneErrback=True)\n dl.addCallback(combine_results)\n dl.addCallback(create_session)\n dl.addCallback(lambda _: self.session.setup())\n\n return dl", "metadata": "root.LBRYDaemon._get_session", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 624 }, { "content": " def _check_first_run(self):\n def _set_first_run_false():\n log.info(\"Not first run\")\n self.first_run = False\n return 0.0\n\n d = self.session.wallet.is_first_run()\n d.addCallback(lambda is_first_run: self._do_first_run() if is_first_run or not self.requested_first_run_credits\n else _set_first_run_false())\n return d", "metadata": "root.LBRYDaemon._check_first_run", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 677 }, { "content": " def _do_first_run(self):\n def send_request(url, data):\n log.info(\"Requesting first run credits\")\n r = requests.post(url, json=data)\n if r.status_code == 200:\n self.requested_first_run_credits = True\n self.session_settings['requested_first_run_credits'] = True\n f = open(self.daemon_conf, \"w\")\n f.write(json.dumps(self.session_settings))\n f.close()\n return r.json()['credits_sent']\n return 0.0\n\n def log_error(err):\n log.warning(\"unable to request free credits. %s\", err.getErrorMessage())\n return 0.0\n\n def request_credits(address):\n url = \"http://credreq.lbry.io/requestcredits\"\n data = {\"address\": address}\n d = threads.deferToThread(send_request, url, data)\n d.addErrback(log_error)\n return d\n\n self.first_run = True\n d = self.session.wallet.get_new_address()\n d.addCallback(request_credits)\n\n return d", "metadata": "root.LBRYDaemon._do_first_run", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 688 }, { "content": " def _show_first_run_result(self, credits_received):\n if credits_received != 0.0:\n points_string = locale.format_string(\"%.2f LBC\", (round(credits_received, 2),), grouping=True)\n self.startup_message = \"Thank you for testing the alpha version of LBRY! You have been given %s for free because we love you. Please hang on for a few minutes for the next block to be mined. When you refresh this page and see your credits you're ready to go!.\" % points_string\n else:\n self.startup_message = None", "metadata": "root.LBRYDaemon._show_first_run_result", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 718 }, { "content": " def _get_lbrycrdd_path(self):\n def get_lbrycrdd_path_conf_file():\n lbrycrdd_path_conf_path = os.path.join(os.path.expanduser(\"~\"), \".lbrycrddpath.conf\")\n if not os.path.exists(lbrycrdd_path_conf_path):\n return \"\"\n lbrycrdd_path_conf = open(lbrycrdd_path_conf_path)\n lines = lbrycrdd_path_conf.readlines()\n return lines\n\n d = threads.deferToThread(get_lbrycrdd_path_conf_file)\n\n def load_lbrycrdd_path(conf):\n for line in conf:\n if len(line.strip()) and line.strip()[0] != \"#\":\n self.lbrycrdd_path = line.strip()\n\n d.addCallback(load_lbrycrdd_path)\n return d", "metadata": "root.LBRYDaemon._get_lbrycrdd_path", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 725 }, { "content": " def _setup_stream_identifier(self):\n file_saver_factory = LBRYFileSaverFactory(self.session.peer_finder, self.session.rate_limiter,\n self.session.blob_manager, self.stream_info_manager,\n self.session.wallet, self.session_settings['default_download_directory'])\n self.sd_identifier.add_stream_downloader_factory(LBRYFileStreamType, file_saver_factory)\n file_opener_factory = LBRYFileOpenerFactory(self.session.peer_finder, self.session.rate_limiter,\n self.session.blob_manager, self.stream_info_manager,\n self.session.wallet)\n self.sd_identifier.add_stream_downloader_factory(LBRYFileStreamType, file_opener_factory)\n return defer.succeed(None)", "metadata": "root.LBRYDaemon._setup_stream_identifier", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 744 }, { "content": " def _setup_lbry_file_opener(self):\n\n downloader_factory = LBRYFileOpenerFactory(self.session.peer_finder, self.session.rate_limiter,\n self.session.blob_manager, self.stream_info_manager,\n self.session.wallet)\n self.sd_identifier.add_stream_downloader_factory(LBRYFileStreamType, downloader_factory)\n return defer.succeed(True)", "metadata": "root.LBRYDaemon._setup_lbry_file_opener", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 755 }, { "content": " def _download_name(self, name, timeout=DEFAULT_TIMEOUT, download_directory=None):\n if not download_directory:\n download_directory = self.session_settings['default_download_directory']\n elif not os.path.isdir(download_directory):\n download_directory = self.session_settings['default_download_directory']\n\n def _disp_file(f):\n file_path = os.path.join(self.session_settings['default_download_directory'], f.file_name)\n log.info(\"[\" + str(datetime.now()) + \"] Already downloaded: \" + str(f.stream_hash) + \" --> \" + file_path)\n return defer.succeed(f)\n\n def _get_stream(name):\n def _disp(stream):\n stream_hash = stream['stream_hash']\n if isinstance(stream_hash, dict):\n stream_hash = stream_hash['sd_hash']\n\n log.info(\"[\" + str(datetime.now()) + \"] Start stream: \" + stream_hash)\n return stream\n\n d = self.session.wallet.get_stream_info_for_name(name)\n stream = GetStream(self.sd_identifier, self.session, self.session.wallet, self.lbry_file_manager,\n max_key_fee=self.max_key_fee, data_rate=self.data_rate, timeout=timeout,\n download_directory=download_directory)\n d.addCallback(_disp)\n d.addCallback(lambda stream_info: stream.start(stream_info))\n d.addCallback(lambda _: self._path_from_name(name))\n\n return d\n\n d = self._check_history(name)\n d.addCallback(lambda lbry_file: _get_stream(name) if not lbry_file else _disp_file(lbry_file))\n d.addCallback(lambda _: self._path_from_name(name))\n d.addErrback(lambda err: defer.fail(NOT_FOUND))\n\n return d", "metadata": "root.LBRYDaemon._download_name", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 763 }, { "content": " def _resolve_name(self, name):\n d = defer.Deferred()\n d.addCallback(lambda _: self.session.wallet.get_stream_info_for_name(name))\n d.addErrback(lambda _: defer.fail(UnknownNameError))\n\n return d", "metadata": "root.LBRYDaemon._resolve_name", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 800 }, { "content": " def _resolve_name_wc(self, name):\n d = defer.Deferred()\n d.addCallback(lambda _: self.session.wallet.get_stream_info_for_name(name))\n d.addErrback(lambda _: defer.fail(UnknownNameError))\n d.callback(None)\n\n return d", "metadata": "root.LBRYDaemon._resolve_name_wc", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 807 }, { "content": " def _check_history(self, name):\n def _get_lbry_file(path):\n f = open(path, 'r')\n l = json.loads(f.read())\n f.close()\n\n file_name = l['stream_name'].decode('hex')\n\n for lbry_file in self.lbry_file_manager.lbry_files:\n if lbry_file.stream_name == file_name:\n if sys.platform == \"darwin\":\n if os.path.isfile(os.path.join(self.session_settings['default_download_directory'], lbry_file.stream_name)):\n return lbry_file\n else:\n return False\n else:\n return lbry_file\n else:\n return False\n\n def _check(info):\n stream_hash = info['stream_hash']\n if isinstance(stream_hash, dict):\n stream_hash = stream_hash['sd_hash']\n\n path = os.path.join(self.blobfile_dir, stream_hash)\n if os.path.isfile(path):\n log.info(\"[\" + str(datetime.now()) + \"] Search for lbry_file, returning: \" + stream_hash)\n return defer.succeed(_get_lbry_file(path))\n else:\n log.info(\"[\" + str(datetime.now()) + \"] Search for lbry_file didn't return anything\")\n return defer.succeed(False)\n\n d = self._resolve_name(name)\n d.addCallback(_check)\n d.callback(None)\n\n return d", "metadata": "root.LBRYDaemon._check_history", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 815 }, { "content": " def _delete_lbry_file(self, lbry_file):\n d = self.lbry_file_manager.delete_lbry_file(lbry_file)\n\n def finish_deletion(lbry_file):\n d = lbry_file.delete_data()\n d.addCallback(lambda _: _delete_stream_data(lbry_file))\n return d\n\n def _delete_stream_data(lbry_file):\n s_h = lbry_file.stream_hash\n d = self.lbry_file_manager.get_count_for_stream_hash(s_h)\n # TODO: could possibly be a timing issue here\n d.addCallback(lambda c: self.stream_info_manager.delete_stream(s_h) if c == 0 else True)\n d.addCallback(lambda _: os.remove(os.path.join(self.session_settings['default_download_directory'], lbry_file.file_name)) if\n os.path.isfile(os.path.join(self.session_settings['default_download_directory'], lbry_file.file_name)) else defer.succeed(None))\n return d\n\n d.addCallback(lambda _: finish_deletion(lbry_file))\n return d", "metadata": "root.LBRYDaemon._delete_lbry_file", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 854 }, { "content": " def _path_from_name(self, name):\n d = self._check_history(name)\n d.addCallback(lambda lbry_file: {'stream_hash': lbry_file.stream_hash,\n 'path': os.path.join(self.session_settings['default_download_directory'], lbry_file.file_name)}\n if lbry_file else defer.fail(UnknownNameError))\n return d", "metadata": "root.LBRYDaemon._path_from_name", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 874 }, { "content": " def _path_from_lbry_file(self, lbry_file):\n if lbry_file:\n r = {'stream_hash': lbry_file.stream_hash,\n 'path': os.path.join(self.session_settings['default_download_directory'], lbry_file.file_name)}\n return defer.succeed(r)\n else:\n return defer.fail(UnknownNameError)", "metadata": "root.LBRYDaemon._path_from_lbry_file", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 881 }, { "content": " def _get_est_cost(self, name):\n def _check_est(d, name):\n if type(d.result) is float:\n log.info(\"[\" + str(datetime.now()) + \"] Cost est for lbry://\" + name + \": \" + str(d.result) + \"LBC\")\n else:\n log.info(\"[\" + str(datetime.now()) + \"] Timeout estimating cost for lbry://\" + name + \", using key fee\")\n d.cancel()\n return defer.succeed(None)\n\n def _add_key_fee(data_cost):\n d = self.session.wallet.get_stream_info_for_name(name)\n d.addCallback(lambda info: data_cost + info['key_fee'] if 'key_fee' in info.keys() else data_cost)\n return d\n\n d = self.session.wallet.get_stream_info_for_name(name)\n d.addCallback(lambda info: info['stream_hash'] if isinstance(info['stream_hash'], str)\n else info['stream_hash']['sd_hash'])\n d.addCallback(lambda sd_hash: download_sd_blob(self.session, sd_hash,\n self.blob_request_payment_rate_manager))\n d.addCallback(self.sd_identifier.get_metadata_for_sd_blob)\n d.addCallback(lambda metadata: metadata.validator.info_to_show())\n d.addCallback(lambda info: int(dict(info)['stream_size']) / 1000000 * self.data_rate)\n d.addCallback(_add_key_fee)\n d.addErrback(lambda _: _add_key_fee(0.0))\n reactor.callLater(self.search_timeout, _check_est, d, name)\n\n return d", "metadata": "root.LBRYDaemon._get_est_cost", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 889 }, { "content": " def _get_lbry_files(self):\n r = []\n for f in self.lbry_file_manager.lbry_files:\n if f.key:\n t = {'completed': f.completed, 'file_name': f.file_name, 'key': binascii.b2a_hex(f.key),\n 'points_paid': f.points_paid, 'stopped': f.stopped, 'stream_hash': f.stream_hash,\n 'stream_name': f.stream_name, 'suggested_file_name': f.suggested_file_name,\n 'upload_allowed': f.upload_allowed}\n\n else:\n t = {'completed': f.completed, 'file_name': f.file_name, 'key': None,\n 'points_paid': f.points_paid,\n 'stopped': f.stopped, 'stream_hash': f.stream_hash, 'stream_name': f.stream_name,\n 'suggested_file_name': f.suggested_file_name, 'upload_allowed': f.upload_allowed}\n\n r.append(t)\n return r", "metadata": "root.LBRYDaemon._get_lbry_files", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 917 }, { "content": " def _render_response(self, result, code):\n return defer.succeed({'result': result, 'code': code})", "metadata": "root.LBRYDaemon._render_response", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 935 }, { "content": " def jsonrpc_is_running(self):\n \"\"\"\n Check if lbrynet daemon is running\n\n Args:\n None\n Returns: true if daemon completed startup, otherwise false\n \"\"\"\n\n log.info(\"[\" + str(datetime.now()) + \"] is_running: \" + str(self.announced_startup))\n\n if self.announced_startup:\n return self._render_response(True, OK_CODE)\n else:\n return self._render_response(False, OK_CODE)", "metadata": "root.LBRYDaemon.jsonrpc_is_running", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 938 }, { "content": " def jsonrpc_daemon_status(self):\n \"\"\"\n Get lbrynet daemon status information\n\n Args:\n None\n Returns:\n 'status_message': startup status message\n 'status_code': status_code\n if status_code is 'loading_wallet', also contains key 'progress': blockchain catchup progress\n \"\"\"\n\n r = {'code': self.startup_status[0], 'message': self.startup_status[1], 'progress': None, 'is_lagging': None}\n if self.startup_status[0] == 'loading_wallet':\n r['is_lagging'] = self.session.wallet.is_lagging\n if r['is_lagging'] == True:\n r['message'] = \"Synchronization with the blockchain is lagging... if this continues try restarting LBRY\"\n else:\n r['message'] = r['message'] % (str(self.session.wallet.blocks_behind_alert) + \" blocks behind\")\n r['progress'] = self.session.wallet.catchup_progress\n\n log.info(\"[\" + str(datetime.now()) + \"] daemon status: \" + str(r))\n return self._render_response(r, OK_CODE)", "metadata": "root.LBRYDaemon.jsonrpc_daemon_status", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 954 }, { "content": " def jsonrpc_is_first_run(self):\n \"\"\"\n Check if this is the first time lbrynet daemon has been run\n\n Args:\n None\n Returns:\n True if first run, otherwise False\n \"\"\"\n\n log.info(\"[\" + str(datetime.now()) + \"] Check if is first run\")\n try:\n d = self.session.wallet.is_first_run()\n except:\n d = defer.fail(None)\n\n d.addCallbacks(lambda r: self._render_response(r, OK_CODE), lambda _: self._render_response(None, OK_CODE))\n\n return d", "metadata": "root.LBRYDaemon.jsonrpc_is_first_run", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 978 }, { "content": " def jsonrpc_get_start_notice(self):\n \"\"\"\n Get special message to be displayed at startup\n\n Args:\n None\n Returns:\n Startup message, such as first run notification\n \"\"\"\n\n log.info(\"[\" + str(datetime.now()) + \"] Get startup notice\")\n\n if self.first_run and not self.session.wallet.wallet_balance:\n return self._render_response(self.startup_message, OK_CODE)\n elif self.first_run:\n return self._render_response(None, OK_CODE)\n else:\n self._render_response(self.startup_message, OK_CODE)", "metadata": "root.LBRYDaemon.jsonrpc_get_start_notice", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 998 }, { "content": " def jsonrpc_version(self):\n \"\"\"\n Get lbry version information\n\n Args:\n None\n Returns:\n \"platform\": platform string\n \"os_release\": os release string\n \"os_system\": os name\n \"lbrynet_version: \": lbrynet_version,\n \"lbryum_version: \": lbryum_version,\n \"ui_version\": commit hash of ui version being used\n \"remote_lbrynet\": most recent lbrynet version available from github\n \"remote_lbryum\": most recent lbryum version available from github\n \"\"\"\n\n msg = {\n 'platform': self.platform_info['platform'],\n 'os_release': self.platform_info['os_release'],\n 'os_system': self.platform_info['os_system'],\n 'lbrynet_version': lbrynet_version,\n 'lbryum_version': lbryum_version,\n 'ui_version': self.ui_version,\n 'remote_lbrynet': self.git_lbrynet_version,\n 'remote_lbryum': self.git_lbryum_version\n }\n\n log.info(\"[\" + str(datetime.now()) + \"] Get version info: \" + json.dumps(msg))\n return self._render_response(msg, OK_CODE)", "metadata": "root.LBRYDaemon.jsonrpc_version", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 1017 }, { "content": " def jsonrpc_get_settings(self):\n \"\"\"\n Get lbrynet daemon settings\n\n Args:\n None\n Returns:\n 'run_on_startup': bool,\n 'data_rate': float,\n 'max_key_fee': float,\n 'default_download_directory': string,\n 'max_upload': float, 0.0 for unlimited\n 'max_download': float, 0.0 for unlimited\n 'upload_log': bool,\n 'search_timeout': float,\n 'max_search_results': int,\n 'wallet_type': string,\n 'delete_blobs_on_remove': bool,\n 'peer_port': int,\n 'dht_node_port': int,\n 'use_upnp': bool,\n 'start_lbrycrdd': bool,\n \"\"\"\n\n log.info(\"[\" + str(datetime.now()) + \"] Get daemon settings\")\n return self._render_response(self.session_settings, OK_CODE)", "metadata": "root.LBRYDaemon.jsonrpc_get_settings", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 1048 }, { "content": " def jsonrpc_set_settings(self, p):\n \"\"\"\n Set lbrynet daemon settings\n\n Args:\n 'run_on_startup': bool,\n 'data_rate': float,\n 'max_key_fee': float,\n 'default_download_directory': string,\n 'max_upload': float, 0.0 for unlimited\n 'max_download': float, 0.0 for unlimited\n 'upload_log': bool,\n 'search_timeout': float,\n 'max_search_results': int,\n 'wallet_type': string,\n 'delete_blobs_on_remove': bool,\n 'peer_port': int,\n 'dht_node_port': int,\n 'use_upnp': bool,\n 'start_lbrycrdd': bool,\n Returns:\n settings dict\n \"\"\"\n\n def _log_settings_change(params):\n log.info(\"[\" + str(datetime.now()) + \"] Set daemon settings to \" + str(params))\n\n d = self._update_settings(p)\n d.addCallback(lambda _: _log_settings_change(p))\n d.addCallback(lambda _: self._render_response(self.session_settings, OK_CODE))\n\n return d", "metadata": "root.LBRYDaemon.jsonrpc_set_settings", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 1075 }, { "content": " def jsonrpc_help(self, p=None):\n \"\"\"\n Function to retrieve docstring for API function\n\n Args:\n optional 'function': function to retrieve documentation for\n optional 'callable_during_startup':\n Returns:\n if given a function, returns given documentation\n if given callable_during_startup flag, returns list of functions callable during the startup sequence\n if no params are given, returns the list of callable functions\n \"\"\"\n\n if not p:\n return self._render_response(self._listFunctions(), OK_CODE)\n elif 'callable_during_start' in p.keys():\n return self._render_response(ALLOWED_DURING_STARTUP, OK_CODE)\n elif 'function' in p.keys():\n func_path = p['function']\n function = self._getFunction(func_path)\n return self._render_response(function.__doc__, OK_CODE)\n else:\n return self._render_response(self.jsonrpc_help.__doc__, OK_CODE)", "metadata": "root.LBRYDaemon.jsonrpc_help", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 1108 }, { "content": " def jsonrpc_start_fetcher(self):\n \"\"\"\n Start automatically downloading new name claims as they occur (off by default)\n\n Args:\n None\n Returns:\n confirmation message\n \"\"\"\n\n self.fetcher.start()\n log.info('[' + str(datetime.now()) + '] Start autofetcher')\n # self._log_to_slack('[' + str(datetime.now()) + '] Start autofetcher')\n return self._render_response(\"Started autofetching claims\", OK_CODE)", "metadata": "root.LBRYDaemon.jsonrpc_start_fetcher", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 1132 }, { "content": " def jsonrpc_stop_fetcher(self):\n \"\"\"\n Stop automatically downloading new name claims as they occur\n\n Args:\n None\n Returns:\n confirmation message\n \"\"\"\n\n self.fetcher.stop()\n log.info('[' + str(datetime.now()) + '] Stop autofetcher')\n return self._render_response(\"Stopped autofetching claims\", OK_CODE)", "metadata": "root.LBRYDaemon.jsonrpc_stop_fetcher", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 1147 }, { "content": " def jsonrpc_fetcher_status(self):\n \"\"\"\n Get fetcher status\n\n Args:\n None\n Returns:\n True/False\n \"\"\"\n\n log.info(\"[\" + str(datetime.now()) + \"] Get fetcher status\")\n return self._render_response(self.fetcher.check_if_running(), OK_CODE)", "metadata": "root.LBRYDaemon.jsonrpc_fetcher_status", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 1161 }, { "content": " def jsonrpc_get_balance(self):\n \"\"\"\n Get balance\n\n Args:\n None\n Returns:\n balance, float\n \"\"\"\n\n log.info(\"[\" + str(datetime.now()) + \"] Get balance\")\n return self._render_response(float(self.session.wallet.wallet_balance), OK_CODE)", "metadata": "root.LBRYDaemon.jsonrpc_get_balance", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 1174 }, { "content": " def jsonrpc_stop(self):\n \"\"\"\n Stop lbrynet-daemon\n\n Args:\n None\n Returns:\n shutdown message\n \"\"\"\n\n def _disp_shutdown():\n log.info(\"Shutting down lbrynet daemon\")\n\n d = self._shutdown()\n d.addCallback(lambda _: _disp_shutdown())\n d.addCallback(lambda _: reactor.callLater(1.0, reactor.stop))\n\n return self._render_response(\"Shutting down\", OK_CODE)", "metadata": "root.LBRYDaemon.jsonrpc_stop", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 1187 }, { "content": " def jsonrpc_get_lbry_files(self):\n \"\"\"\n Get LBRY files\n\n Args:\n None\n Returns:\n List of lbry files:\n 'completed': bool\n 'file_name': string\n 'key': hex string\n 'points_paid': float\n 'stopped': bool\n 'stream_hash': base 58 string\n 'stream_name': string\n 'suggested_file_name': string\n 'upload_allowed': bool\n \"\"\"\n\n r = self._get_lbry_files()\n log.info(\"[\" + str(datetime.now()) + \"] Get LBRY files\")\n return self._render_response(r, OK_CODE)", "metadata": "root.LBRYDaemon.jsonrpc_get_lbry_files", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 1206 }, { "content": " def jsonrpc_resolve_name(self, p):\n \"\"\"\n Resolve stream info from a LBRY uri\n\n Args:\n 'name': name to look up, string, do not include lbry:// prefix\n Returns:\n metadata from name claim\n \"\"\"\n\n if 'name' in p.keys():\n name = p['name']\n else:\n return self._render_response(None, BAD_REQUEST)\n\n def _disp(info):\n stream_hash = info['stream_hash']\n if isinstance(stream_hash, dict):\n stream_hash = stream_hash['sd_hash']\n\n log.info(\"[\" + str(datetime.now()) + \"] Resolved info: \" + stream_hash)\n\n return self._render_response(info, OK_CODE)\n\n d = self._resolve_name(name)\n d.addCallbacks(_disp, lambda _: server.failure)\n d.callback(None)\n return d", "metadata": "root.LBRYDaemon.jsonrpc_resolve_name", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 1229 }, { "content": " def jsonrpc_get(self, p):\n \"\"\"\n Download stream from a LBRY uri\n\n Args:\n 'name': name to download, string\n optional 'download_directory': path to directory where file will be saved, string\n Returns:\n 'stream_hash': hex string\n 'path': path of download\n \"\"\"\n\n if 'timeout' not in p.keys():\n timeout = DEFAULT_TIMEOUT\n else:\n timeout = p['timeout']\n\n if 'download_directory' not in p.keys():\n download_directory = self.session_settings['default_download_directory']\n else:\n download_directory = p['download_directory']\n\n if 'name' in p.keys():\n name = p['name']\n d = self._download_name(name=name, timeout=timeout, download_directory=download_directory)\n d.addCallbacks(lambda message: self._render_response(message, OK_CODE),\n lambda err: self._render_response('error', NOT_FOUND))\n else:\n d = self._render_response('error', BAD_REQUEST)\n\n return d", "metadata": "root.LBRYDaemon.jsonrpc_get", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 1258 }, { "content": " def jsonrpc_search_nametrie(self, p):\n \"\"\"\n Search the nametrie for claims beginning with search (yes, this is a dumb search, it'll be made better)\n\n Args:\n 'search': search query, string\n Returns:\n List of search results\n \"\"\"\n\n if 'search' in p.keys():\n search = p['search']\n else:\n return self._render_response(None, BAD_REQUEST)\n\n def _clean(n):\n t = []\n for i in n:\n if i[0]:\n if i[1][0][0] and i[1][1][0] and i[1][2][0]:\n i[1][0][1]['value'] = str(i[1][0][1]['value'])\n t.append([i[1][0][1], i[1][1][1], i[1][2][1]])\n return t\n\n def resolve_claims(claims):\n ds = []\n for claim in claims:\n d1 = defer.succeed(claim)\n d2 = self._resolve_name_wc(claim['name'])\n d3 = self._get_est_cost(claim['name'])\n dl = defer.DeferredList([d1, d2, d3], consumeErrors=True)\n ds.append(dl)\n return defer.DeferredList(ds)\n\n def _disp(results):\n log.info('[' + str(datetime.now()) + '] Found ' + str(len(results)) + ' search results')\n consolidated_results = []\n for r in results:\n t = {}\n t.update(r[0])\n if 'name' in r[1].keys():\n r[1]['stream_name'] = r[1]['name']\n del r[1]['name']\n t.update(r[1])\n t['cost_est'] = r[2]\n consolidated_results.append(t)\n # log.info(str(t))\n return consolidated_results\n\n log.info('[' + str(datetime.now()) + '] Search nametrie: ' + search)\n\n d = self.session.wallet.get_nametrie()\n d.addCallback(lambda trie: [claim for claim in trie if claim['name'].startswith(search) and 'txid' in claim])\n d.addCallback(lambda claims: claims[:self.max_search_results])\n d.addCallback(resolve_claims)\n d.addCallback(_clean)\n d.addCallback(_disp)\n d.addCallback(lambda results: self._render_response(results, OK_CODE))\n\n return d", "metadata": "root.LBRYDaemon.jsonrpc_search_nametrie", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 1321 }, { "content": " def jsonrpc_delete_lbry_file(self, p):\n \"\"\"\n Delete a lbry file\n\n Args:\n 'file_name': downloaded file name, string\n Returns:\n confirmation message\n \"\"\"\n\n def _disp(file_name):\n log.info(\"[\" + str(datetime.now()) + \"] Deleted: \" + file_name)\n return self._render_response(\"Deleted: \" + file_name, OK_CODE)\n\n if \"file_name\" in p.keys():\n lbry_files = [self._delete_lbry_file(f) for f in self.lbry_file_manager.lbry_files\n if p['file_name'] == f.file_name]\n d = defer.DeferredList(lbry_files)\n d.addCallback(lambda _: _disp(p['file_name']))\n return d", "metadata": "root.LBRYDaemon.jsonrpc_delete_lbry_file", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 1382 }, { "content": " def jsonrpc_publish(self, p):\n \"\"\"\n Make a new name claim\n\n Args:\n 'name': name to be claimed, string\n 'file_path': path to file to be associated with name, string\n 'bid': amount of credits to commit in this claim, float\n optional 'author': author, string\n optional 'title': title, description\n optional 'description': content description, string\n optional 'thumbnail': thumbnail image url\n optional 'key_fee': key fee to be paid to publisher, float (default 0.0)\n optional 'key_fee_address': address for key fee to be sent to, string (defaults on new address)\n optional 'content_license': content license string\n optional 'sources': alternative sources dict, keys 'lbry_sd_hash', 'btih', 'url'\n Returns:\n Confirmation message\n \"\"\"\n\n metadata_fields = [\"name\", \"file_path\", \"bid\", \"author\", \"title\",\n \"description\", \"thumbnail\", \"key_fee\", \"key_fee_address\",\n \"content_license\", \"sources\"]\n\n for k in metadata_fields:\n if k not in p.keys():\n p[k] = None\n\n pub = Publisher(self.session, self.lbry_file_manager, self.session.wallet)\n\n d = pub.start(p['name'],\n p['file_path'],\n p['bid'],\n title=p['title'],\n description=p['description'],\n thumbnail=p['thumbnail'],\n key_fee=p['key_fee'],\n key_fee_address=p['key_fee_address'],\n content_license=p['content_license'],\n author=p['author'],\n sources=p['sources'])\n\n d.addCallbacks(lambda msg: self._render_response(msg, OK_CODE),\n lambda err: self._render_response(err.getTraceback(), BAD_REQUEST))\n\n return d", "metadata": "root.LBRYDaemon.jsonrpc_publish", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 1403 }, { "content": " def jsonrpc_abandon_name(self, p):\n \"\"\"\n Abandon a name and reclaim credits from the claim\n\n Args:\n 'txid': txid of claim, string\n Return:\n Confirmation message\n \"\"\"\n\n if 'txid' in p.keys():\n txid = p['txid']\n else:\n return server.failure\n\n def _disp(x):\n log.info(\"[\" + str(datetime.now()) + \"] Abandoned name claim tx \" + str(x))\n return self._render_response(x, OK_CODE)\n\n d = defer.Deferred()\n d.addCallback(lambda _: self.session.wallet.abandon_name(txid))\n d.addCallback(_disp)\n d.callback(None)\n\n return d", "metadata": "root.LBRYDaemon.jsonrpc_abandon_name", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 1450 }, { "content": " def jsonrpc_get_name_claims(self):\n \"\"\"\n Get my name claims\n\n Args:\n None\n Returns\n list of name claims\n \"\"\"\n\n def _clean(claims):\n for c in claims:\n for k in c.keys():\n if isinstance(c[k], Decimal):\n c[k] = float(c[k])\n return defer.succeed(claims)\n\n d = self.session.wallet.get_name_claims()\n d.addCallback(_clean)\n d.addCallback(lambda claims: self._render_response(claims, OK_CODE))\n\n return d", "metadata": "root.LBRYDaemon.jsonrpc_get_name_claims", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 1476 }, { "content": " def jsonrpc_get_time_behind_blockchain(self):\n \"\"\"\n Get number of blocks behind the blockchain\n\n Args:\n None\n Returns:\n number of blocks behind blockchain, int\n \"\"\"\n\n def _get_time_behind():\n try:\n local_height = self.session.wallet.network.get_local_height()\n remote_height = self.session.wallet.network.get_server_height()\n return defer.succeed(remote_height - local_height)\n except:\n return defer.fail()\n\n d = _get_time_behind()\n d.addCallback(lambda r: self._render_response(r, OK_CODE))\n\n return d", "metadata": "root.LBRYDaemon.jsonrpc_get_time_behind_blockchain", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 1499 }, { "content": " def jsonrpc_get_new_address(self):\n \"\"\"\n Generate a new wallet address\n\n Args:\n None\n Returns:\n new wallet address, base 58 string\n \"\"\"\n\n def _disp(address):\n log.info(\"[\" + str(datetime.now()) + \"] Got new wallet address: \" + address)\n return defer.succeed(address)\n\n d = self.session.wallet.get_new_address()\n d.addCallback(_disp)\n d.addCallback(lambda address: self._render_response(address, OK_CODE))\n return d", "metadata": "root.LBRYDaemon.jsonrpc_get_new_address", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 1522 }, { "content": " def jsonrpc_toggle_fetcher_verbose(self):\n \"\"\"\n Toggle fetcher verbose mode\n\n Args:\n None\n Returns:\n Fetcher verbose status, bool\n \"\"\"\n\n if self.fetcher.verbose:\n self.fetcher.verbose = False\n else:\n self.fetcher.verbose = True\n\n return self._render_response(self.fetcher.verbose, OK_CODE)", "metadata": "root.LBRYDaemon.jsonrpc_toggle_fetcher_verbose", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 1561 }, { "content": " def jsonrpc_check_for_new_version(self):\n \"\"\"\n Checks local version against versions in __init__.py and version.py in the lbrynet and lbryum repos\n\n Args:\n None\n Returns:\n true/false, true meaning that there is a new version available\n \"\"\"\n\n\n\n def _check_version():\n if (lbrynet_version >= self.git_lbrynet_version) and (lbryum_version >= self.git_lbryum_version):\n log.info(\"[\" + str(datetime.now()) + \"] Up to date\")\n return self._render_response(False, OK_CODE)\n else:\n log.info(\"[\" + str(datetime.now()) + \"] Updates available\")\n return self._render_response(True, OK_CODE)\n\n return _check_version()", "metadata": "root.LBRYDaemon.jsonrpc_check_for_new_version", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 1578 }, { "content": " def jsonrpc_upload_log(self, p=None):\n if p:\n if 'name_prefix' in p.keys():\n prefix = p['name_prefix'] + '_api'\n else:\n prefix = None\n if 'exclude_previous' in p.keys:\n exclude_previous = p['exclude_previous']\n else:\n exclude_previous = True\n else:\n prefix = \"api\"\n exclude_previous = True\n\n d = self._upload_log(name_prefix=prefix, exclude_previous=exclude_previous)\n d.addCallback(lambda _: self._render_response(True, OK_CODE))\n return d", "metadata": "root.LBRYDaemon.jsonrpc_upload_log", "header": "['class', 'LBRYDaemon', '(', 'jsonrpc', '.', 'JSONRPC', ')', ':', '___EOS___']", "index": 1600 }, { "content": "class LBRYDaemonCommandHandler(object):\n", "metadata": "root.LBRYDaemonCommandHandler", "header": "['module', '___EOS___']", "index": 1619 }, { "content": " def __init__(self, command):\n self._api = jsonrpc.Proxy(API_CONNECTION_STRING)\n self.command = command", "metadata": "root.LBRYDaemonCommandHandler.__init__", "header": "['class', 'LBRYDaemonCommandHandler', '(', 'object', ')', ':', '___EOS___']", "index": 1620 }, { "content": " def run(self, params=None):\n if params:\n d = self._api.callRemote(self.command, params)\n else:\n d = self._api.callRemote(self.command)\n return d", "metadata": "root.LBRYDaemonCommandHandler.run", "header": "['class', 'LBRYDaemonCommandHandler', '(', 'object', ')', ':', '___EOS___']", "index": 1624 }, { "content": "class LBRYindex(resource.Resource):\n\n isLeaf = False\n\n\n", "metadata": "root.LBRYindex", "header": "['module', '___EOS___']", "index": 1632 }, { "content": " def __init__(self, ui_dir):\n resource.Resource.__init__(self)\n self.ui_dir = ui_dir", "metadata": "root.LBRYindex.__init__", "header": "['class', 'LBRYindex', '(', 'resource', '.', 'Resource', ')', ':', '___EOS___']", "index": 1633 }, { "content": " def _delayed_render(self, request, results):\n request.write(str(results))\n request.finish()", "metadata": "root.LBRYindex._delayed_render", "header": "['class', 'LBRYindex', '(', 'resource', '.', 'Resource', ')', ':', '___EOS___']", "index": 1639 }, { "content": " def getChild(self, name, request):\n if name == '':\n return self\n return resource.Resource.getChild(self, name, request)", "metadata": "root.LBRYindex.getChild", "header": "['class', 'LBRYindex', '(', 'resource', '.', 'Resource', ')', ':', '___EOS___']", "index": 1643 }, { "content": " def render_GET(self, request):\n return static.File(os.path.join(self.ui_dir, \"index.html\")).render_GET(request)", "metadata": "root.LBRYindex.render_GET", "header": "['class', 'LBRYindex', '(', 'resource', '.', 'Resource', ')', ':', '___EOS___']", "index": 1648 }, { "content": "class LBRYFileRender(resource.Resource):\n isLeaf = False\n", "metadata": "root.LBRYFileRender", "header": "['module', '___EOS___']", "index": 1652 }, { "content": " def render_GET(self, request):\n if 'name' in request.args.keys():\n api = jsonrpc.Proxy(API_CONNECTION_STRING)\n if request.args['name'][0] != 'lbry':\n d = api.callRemote(\"get\", {'name': request.args['name'][0]})\n d.addCallback(lambda results: static.File(results['path']).render_GET(request))\n else:\n request.redirect(UI_ADDRESS)\n request.finish()\n return server.NOT_DONE_YET\n else:\n return server.failure", "metadata": "root.LBRYFileRender.render_GET", "header": "['class', 'LBRYFileRender', '(', 'resource', '.', 'Resource', ')', ':', '___EOS___']", "index": 1655 } ]
[ { "span": "import subprocess", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 17 }, { "span": "import base64", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 13 }, { "span": "from lbrynet.lbrynet_console.ControlHandlers import get_time_behind_blockchain", "start_line": 31, "start_column": 0, "end_line": 31, "end_column": 78 }, { "span": "from lbrynet.conf import API_CONNECTION_STRING, API_PORT, API_ADDRESS, DEFAULT_TIMEOUT, UI_ADDRESS", "start_line": 41, "start_column": 0, "end_line": 41, "end_column": 98 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "locale_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "simplejson_", "as_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "binascii_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "._", "handlers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "requests_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "base64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "base", "58_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "platform_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "twisted_", "._", "web_", "import_", "server_", ",_", "resource_", ",_", "static_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "twisted_", "._", "internet_", "import_", "defer_", ",_", "threads_", ",_", "error_", ",_", "reactor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tx", "jsonrpc", "_", "import_", "jsonrpc", "lib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tx", "jsonrpc", "_", "._", "web_", "import_", "jsonrpc", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tx", "jsonrpc", "_", "._", "web_", "._", "jsonrpc", "_", "import_", "Handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "datetime_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "decimal_", "import_", "Decimal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "appd", "irs_", "import_", "user", "\\u", "data\\u", "dir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "urllib2_", "import_", "urlopen_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lbr", "yne", "t_", "import_", "\\u\\u", "version\\u\\u_", "as_", "lbr", "yne", "t", "\\u", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lbr", "yum", "_", "._", "version_", "import_", "ELECT", "RU", "M", "\\u", "VERSION_", "as_", "lbr", "yum", "\\u", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lbr", "yne", "t_", "._", "core_", "._", "Payment", "Rat", "e", "Manager_", "import_", "Payment", "Rat", "e", "Manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lbr", "yne", "t_", "._", "core_", "._", "server_", "._", "Blo", "b", "Avail", "abilit", "y", "Handler_", "import_", "Blo", "b", "Avail", "abilit", "y", "Handle", "r", "Factory_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lbr", "yne", "t_", "._", "core_", "._", "server_", "._", "Blo", "b", "Request", "Handler_", "import_", "Blo", "b", "Request", "Handle", "r", "Factory_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lbr", "yne", "t_", "._", "core_", "._", "server_", "._", "Server", "Protocol_", "import_", "Server", "Proto", "col", "Factory_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lbr", "yne", "t_", "._", "lbr", "yne", "t", "\\u", "console_", "._", "Control", "Handlers_", "import_", "get", "\\u", "time", "\\u", "beh", "ind", "\\u", "blockchain", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lbr", "yne", "t_", "._", "core_", "._", "Error_", "import_", "Un", "know", "n", "Name", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lbr", "yne", "t_", "._", "lbr", "yfile_", "._", "Stream", "Descriptor_", "import_", "LB", "RY", "File", "Stream", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lbr", "yne", "t_", "._", "lbr", "yfile_", "._", "client_", "._", "LB", "RY", "File", "Downloader_", "import_", "LB", "RY", "File", "Save", "r", "Factory_", ",_", "LB", "RY", "File", "Open", "er", "Factory_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lbr", "yne", "t_", "._", "lbr", "yfile_", "._", "client_", "._", "LB", "RY", "File", "Options_", "import_", "add", "\\u", "lbr", "y", "\\u", "file", "\\u", "to", "\\u", "sd", "\\u", "identifier_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lbr", "yne", "t_", "._", "lbr", "yne", "t", "\\u", "daemon_", "._", "LB", "RY", "Downloader_", "import_", "Get", "Stream_", ",_", "Fetche", "r", "Daemon_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lbr", "yne", "t_", "._", "lbr", "yne", "t", "\\u", "daemon_", "._", "LB", "RY", "Publisher_", "import_", "Publisher_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lbr", "yne", "t_", "._", "core_", "._", "utils_", "import_", "generat", "e\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lbr", "yne", "t_", "._", "lbr", "yne", "t", "\\u", "console_", "._", "LB", "RY", "Settings_", "import_", "LB", "RY", "Settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lbr", "yne", "t_", "._", "conf_", "import_", "MIN", "\\u", "BLOB", "\\u", "DATA", "\\u", "PAY", "MENT", "\\u", "RATE_", ",_", "DEF", "AUL", "T", "\\u", "MAX", "\\u", "SEARCH", "\\u", "RESULTS", "_", ",_", "KNOWN", "\\u", "DH", "T", "\\u", "NODES", "_", ",_", "DEF", "AUL", "T", "\\u", "MAX", "\\u", "KEY", "\\u", "FE", "E_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lbr", "yne", "t_", "._", "conf_", "import_", "API", "\\u", "CONNECTION", "\\u", "STRING_", ",_", "API", "\\u", "PORT_", ",_", "API", "\\u", "ADDRESS_", ",_", "DEF", "AUL", "T", "\\u", "TIMEOUT_", ",_", "UI", "\\u", "ADDRESS_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lbr", "yne", "t_", "._", "core_", "._", "Stream", "Descriptor_", "import_", "Stream", "Descrip", "tor", "Identifier_", ",_", "download", "\\u", "sd", "\\u", "blob_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lbr", "yne", "t_", "._", "core_", "._", "Session_", "import_", "LB", "RY", "Session_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lbr", "yne", "t_", "._", "core_", "._", "PT", "CW", "alle", "t_", "import_", "PT", "CW", "alle", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lbr", "yne", "t_", "._", "core_", "._", "LB", "RY", "crd", "Wallet_", "import_", "LB", "RY", "crd", "Wallet_", ",_", "LB", "RY", "um", "Wallet_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lbr", "yne", "t_", "._", "lbr", "yfi", "lema", "nage", "r_", "._", "LB", "RY", "File", "Manager_", "import_", "LB", "RY", "File", "Manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lbr", "yne", "t_", "._", "lbr", "yfile_", "._", "LB", "RY", "File", "Meta", "data", "Manager_", "import_", "DB", "LB", "RY", "File", "Meta", "data", "Manager_", ",_", "Temp", "LB", "RY", "File", "Meta", "data", "Manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "sys_", "._", "platform_", "!=_", "\"", "dar", "win", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log", "\\u", "dir_", "=_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "expanduser_", "(_", "\"~\"_", ")_", ",_", "\".", "lbr", "yne", "t", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log", "\\u", "dir_", "=_", "user", "\\u", "data\\u", "dir_", "(_", "\"", "LB", "RY", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "isdir_", "(_", "log", "\\u", "dir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "mkdir_", "(_", "log", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "LOG", "\\u", "FILENAME_", "=_", "os_", "._", "path_", "._", "join_", "(_", "log", "\\u", "dir_", ",_", "'", "lbr", "yne", "t", "-", "daemon", ".", "log", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "LOG", "\\u", "FILENAME_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "open_", "(_", "LOG", "\\u", "FILENAME_", ",_", "'", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PREVI", "OUS", "\\u", "LOG_", "=_", "len_", "(_", "f_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "PREVI", "OUS", "\\u", "LOG_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "=_", "logging_", "._", "get", "Logger_", "(_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "=_", "logging_", "._", "handlers_", "._", "Rot", "ati", "ng", "File", "Handler_", "(_", "LOG", "\\u", "FILENAME_", ",_", "max", "Bytes_", "=_", "262", "144_", ",_", "backup", "Count_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "add", "Handler_", "(_", "handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "set", "Level_", "(_", "logging_", "._", "INFO_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "START", "UP", "\\u", "STAGE", "S_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "initiali", "zin", "g", "'_", ",_", "'", "Initializ", "ing", "...'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "load", "ing", "\\u", "db", "'_", ",_", "'", "Load", "ing", " ", "databa", "ses", "...'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "load", "ing", "\\u", "walle", "t", "'_", ",_", "'", "Catch", "ing", " ", "up", " ", "with", " ", "the", " ", "blockchain", "...", " ", "%", "s", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "load", "ing", "\\u", "file", "\\u", "manage", "r", "'_", ",_", "'", "Sett", "ing", " ", "up", " ", "file", " ", "manage", "r", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "load", "ing", "\\u", "server", "'_", ",_", "'", "Start", "ing", " ", "lbr", "yne", "t", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "start", "ed", "'_", ",_", "'", "Start", "ed", " ", "lbr", "yne", "t", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ALLOWED", "\\u", "DU", "RING", "\\u", "START", "UP_", "=_", "[_", "'", "is", "\\u", "runn", "ing", "'_", ",_", "'", "is", "\\u", "first", "\\u", "run", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "get", "\\u", "time", "\\u", "beh", "ind", "\\u", "blockchain", "'_", ",_", "'", "stop", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "daemon", "\\u", "status", "'_", ",_", "'", "get", "\\u", "start", "\\u", "notice", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "version", "'_", ",_", "'", "check", "\\u", "for", "\\u", "new", "\\u", "version", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "BAD", "\\u", "REQUEST_", "=_", "400_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NOT", "\\u", "FOUND_", "=_", "404_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "OK", "\\u", "CODE_", "=_", "200_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", " ", "add", " ", "login", " ", "cred", "ential", "s", " ", "in", " ", "a", " ", "conf", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", " ", "alert", " ", "if", " ", "your", " ", "copy", " ", "of", " ", "a", " ", "lbr", "y", " ", "file", " ", "is", " ", "out", " ", "of", " ", "date", " ", "with", " ", "the", " ", "name", " ", "record_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "LB", "RY", "net", " ", "daemon", ",", " ", "a", " ", "jsonrpc", " ", "interface", " ", "to", " ", "lbr", "y", " ", "function", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "is", "Leaf_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\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\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "jsonrpc", "\\u", "stop", "\\u", "lbr", "y", "\\u", "file", "(", "self", ",", " ", "p", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "params", " ", "=", " ", "Bun", "ch", "(", "p", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "lbr", "y", "\\u", "file", " ", "=", " ", "[", "f", " ", "for", " ", "f", " ", "in", " ", "self", ".", "lbr", "y", "\\u", "file", "\\u", "manage", "r", ".", "lbr", "y", "\\u", "files", " ", "if", " ", "f", ".", "stream", "\\u", "hash", " ", "==", " ", "params", ".", "stream", "\\u", "hash", "][", "0", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "except", " ", "Index", "Error", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "defer", ".", "fail", "(", "Un", "know", "n", "Name", "Error", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "not", " ", "lbr", "y", "\\u", "file", ".", "stopp", "ed", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "d", " ", "=", " ", "self", ".", "lbr", "y", "\\u", "file", "\\u", "manage", "r", ".", "toggle", "\\u", "lbr", "y", "\\u", "file", "\\u", "runn", "ing", "(", "lbr", "y", "\\u", "file", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "d", ".", "add", "Call", "back", "(", "lambda", " ", "\\u", ":", " ", "self", ".\\u", "render", "\\u", "response", "(\"", "Stream", " ", "has", " ", "bee", "n", " ", "stopp", "ed", "\",", " ", "OK", "\\u", "CODE", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "d", ".", "add", "Err", "back", "(", "lambda", " ", "err", ":", " ", "self", ".\\u", "render", "\\u", "response", "(", "err", ".", "get", "Trace", "back", "()", ",", " ", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "json", ".", "dump", "s", "({", "'", "result", "':", " ", "'", "Stream", " ", "was", " ", "alr", "ead", "y", " ", "stopp", "ed", "'})", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "jsonrpc", "\\u", "start", "\\u", "lbr", "y", "\\u", "file", "(", "self", ",", " ", "p", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "params", " ", "=", " ", "Bun", "ch", "(", "p", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "lbr", "y", "\\u", "file", " ", "=", " ", "[", "f", " ", "for", " ", "f", " ", "in", " ", "self", ".", "lbr", "y", "\\u", "file", "\\u", "manage", "r", ".", "lbr", "y", "\\u", "files", " ", "if", " ", "f", ".", "stream", "\\u", "hash", " ", "==", " ", "params", ".", "stream", "\\u", "hash", "][", "0", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "except", " ", "Index", "Error", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "defer", ".", "fail", "(", "Un", "know", "n", "Name", "Error", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "lbr", "y", "\\u", "file", ".", "stopp", "ed", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "d", " ", "=", " ", "self", ".", "lbr", "y", "\\u", "file", "\\u", "manage", "r", ".", "toggle", "\\u", "lbr", "y", "\\u", "file", "\\u", "runn", "ing", "(", "lbr", "y", "\\u", "file", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "d", ".", "callback", "(", "Non", "e", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "json", ".", "dump", "s", "({", "'", "result", "':", " ", "'", "Stream", " ", "start", "ed", "'})", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "json", ".", "dump", "s", "({", "'", "result", "':", " ", "'", "Stream", " ", "was", " ", "alr", "ead", "y", " ", "runn", "ing", "'})", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "jsonrpc", "\\u", "update", "\\u", "name", "(", "self", ",", " ", "metadata", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "\\u", "disp", "(", "x", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "print", " ", "x_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "x_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "metadata", " ", "=", " ", "json", ".", "load", "s", "(", "metadata", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "require", "d", " ", "=", " ", "['", "name", "',", " ", "'", "file", "\\u", "path", "',", " ", "'", "bid", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "r", " ", "in", " ", "require", "d", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "if", " ", "not", " ", "r", " ", "in", " ", "metadata", ".", "keys", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "defer", ".", "fail", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "d", " ", "=", " ", "defer", ".", "Defe", "rre", "d", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "d", ".", "add", "Call", "back", "(", "lambda", " ", "\\u", ":", " ", "self", ".", "session", ".", "walle", "t", ".", "update", "\\u", "name", "(", "metadata", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "d", ".", "add", "Call", "back", "(\\u", "disp", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "d", ".", "callback", "(", "Non", "e", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "return", " ", "d_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "ui", "\\u", "version", "\\u", "info_", ",_", "walle", "t", "\\u", "type_", "=_", "\"", "lbr", "yum", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "jsonrpc", "_", "._", "JSONR", "PC_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reactor_", "._", "add", "System", "Event", "Trigger_", "(_", "'", "bef", "ore", "'_", ",_", "'", "shut", "down", "'_", ",_", "self_", "._", "\\u", "shutdown_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "start", "up", "\\u", "status_", "=_", "START", "UP", "\\u", "STAGE", "S_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "start", "up", "\\u", "message_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "announce", "d\\u", "startup_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "query", "\\u", "handlers_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ui", "\\u", "version_", "=_", "ui", "\\u", "version", "\\u", "info_", "._", "replace_", "(_", "'\\\\", "n", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "git", "\\u", "lbr", "yne", "t", "\\u", "version_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "git", "\\u", "lbr", "yum", "\\u", "version_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "walle", "t", "\\u", "type_", "=_", "walle", "t", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "session", "\\u", "settings_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "first", "\\u", "run_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "log", "\\u", "file_", "=_", "LOG", "\\u", "FILENAME_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fetcher_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "current", "\\u", "db", "\\u", "revision_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "run", "\\u", "server_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "session_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "know", "n", "\\u", "dht", "\\u", "nodes_", "=_", "KNOWN", "\\u", "DH", "T", "\\u", "NODES", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "platform", "\\u", "info_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "process", "or", "\"_", ":_", "platform_", "._", "processor_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "python", "\\u", "version", ":", " ", "\"_", ":_", "platform_", "._", "python", "\\u", "version_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "platform", "\"_", ":_", "platform_", "._", "platform_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "os", "\\u", "release", "\"_", ":_", "platform_", "._", "release_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "os", "\\u", "system", "\"_", ":_", "platform_", "._", "system_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "lbr", "yne", "t", "\\u", "version", ":", " ", "\"_", ":_", "lbr", "yne", "t", "\\u", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "lbr", "yum", "\\u", "version", ":", " ", "\"_", ":_", "lbr", "yum", "\\u", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ui", "\\u", "version", "\"_", ":_", "self_", "._", "ui", "\\u", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "platform", "\\u", "info_", "[_", "'", "ip", "'_", "]_", "=_", "json_", "._", "load_", "(_", "urlopen_", "(_", "'", "http", "://", "json", "ip", ".", "com", "'_", ")_", ")_", "[_", "'", "ip", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "platform", "\\u", "info_", "[_", "'", "ip", "'_", "]_", "=_", "\"", "Cou", "ld", " ", "not", " ", "dete", "rmin", "e", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "os_", "._", "name_", "==_", "\"", "nt", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "lbr", "yne", "t_", "._", "win", "helpers_", "._", "know", "npa", "ths_", "import_", "get", "\\u", "path_", ",_", "FOLDER", "ID_", ",_", "User", "Handle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "download", "\\u", "directory_", "=_", "get", "\\u", "path_", "(_", "FOLDER", "ID_", "._", "Down", "loads_", ",_", "User", "Handle_", "._", "current_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db", "\\u", "dir_", "=_", "os_", "._", "path_", "._", "join_", "(_", "get", "\\u", "path_", "(_", "FOLDER", "ID_", "._", "Roa", "ming", "App", "Data_", ",_", "User", "Handle_", "._", "current_", ")_", ",_", "\"", "lbr", "yne", "t", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "lbr", "yc", "rd", "d\\u", "path_", "=_", "\"", "lbr", "yc", "rd", "d", ".", "exe", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "walle", "t", "\\u", "type_", "==_", "\"", "lbr", "yc", "rd", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "walle", "t", "\\u", "dir_", "=_", "os_", "._", "path_", "._", "join_", "(_", "get", "\\u", "path_", "(_", "FOLDER", "ID_", "._", "Roa", "ming", "App", "Data_", ",_", "User", "Handle_", "._", "current_", ")_", ",_", "\"", "lbr", "yc", "rd", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "walle", "t", "\\u", "dir_", "=_", "os_", "._", "path_", "._", "join_", "(_", "get", "\\u", "path_", "(_", "FOLDER", "ID_", "._", "Roa", "ming", "App", "Data_", ",_", "User", "Handle_", "._", "current_", ")_", ",_", "\"", "lbr", "yum", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "sys_", "._", "platform_", "==_", "\"", "dar", "win", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "download", "\\u", "directory_", "=_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "expanduser_", "(_", "\"~\"_", ")_", ",_", "'", "Down", "load", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db", "\\u", "dir_", "=_", "user", "\\u", "data\\u", "dir_", "(_", "\"", "LB", "RY", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "lbr", "yc", "rd", "d\\u", "path_", "=_", "\"./", "lbr", "yc", "rd", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "walle", "t", "\\u", "type_", "==_", "\"", "lbr", "yc", "rd", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "walle", "t", "\\u", "dir_", "=_", "user", "\\u", "data\\u", "dir_", "(_", "\"", "lbr", "yc", "rd", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "walle", "t", "\\u", "dir_", "=_", "user", "\\u", "data\\u", "dir_", "(_", "\"", "LB", "RY", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "download", "\\u", "directory_", "=_", "os_", "._", "getcwd_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db", "\\u", "dir_", "=_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "expanduser_", "(_", "\"~\"_", ")_", ",_", "\".", "lbr", "yne", "t", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "lbr", "yc", "rd", "d\\u", "path_", "=_", "\"./", "lbr", "yc", "rd", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "walle", "t", "\\u", "type_", "==_", "\"", "lbr", "yc", "rd", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "walle", "t", "\\u", "dir_", "=_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "expanduser_", "(_", "\"~\"_", ")_", ",_", "\".", "lbr", "yc", "rd", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "walle", "t", "\\u", "dir_", "=_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "expanduser_", "(_", "\"~\"_", ")_", ",_", "\".", "lbr", "yum", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "created", "\\u", "data\\u", "dir_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "self_", "._", "db", "\\u", "dir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "mkdir_", "(_", "self_", "._", "db", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "created", "\\u", "data\\u", "dir_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "blob", "file", "\\u", "dir_", "=_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "db", "\\u", "dir_", ",_", "\"", "blob", "files", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "lbr", "yc", "rd", "\\u", "conf_", "=_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "walle", "t", "\\u", "dir_", ",_", "\"", "lbr", "yc", "rd", ".", "conf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "autof", "etch", "er", "\\u", "conf_", "=_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "walle", "t", "\\u", "dir_", ",_", "\"", "autof", "etch", "er", ".", "conf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "daemon", "\\u", "conf_", "=_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "db", "\\u", "dir_", ",_", "'", "daemon", "\\u", "settings", ".", "json", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "walle", "t", "\\u", "conf_", "=_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "walle", "t", "\\u", "dir_", ",_", "\"", "lbr", "yc", "rd", ".", "conf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "walle", "t", "\\u", "user_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "walle", "t", "\\u", "password_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "sd", "\\u", "identifier_", "=_", "Stream", "Descrip", "tor", "Identifier_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "stream", "\\u", "info", "\\u", "manager_", "=_", "Temp", "LB", "RY", "File", "Meta", "data", "Manager_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "settings_", "=_", "LB", "RY", "Settings_", "(_", "self_", "._", "db", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "blob", "\\u", "request", "\\u", "pay", "ment", "\\u", "rate", "\\u", "manager_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "lbr", "y", "\\u", "file", "\\u", "metadata", "\\u", "manager_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "lbr", "y", "\\u", "file", "\\u", "manager_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "default", "s", " ", "for", " ", "settings", " ", "other", "wis", "e", " ", "load", "ed", " ", "from", " ", "daemon", "\\u", "settings", ".", "json_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "default", "\\u", "settings_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "run", "\\u", "on", "\\u", "start", "up", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "data\\u", "rate", "'_", ":_", "MIN", "\\u", "BLOB", "\\u", "DATA", "\\u", "PAY", "MENT", "\\u", "RATE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "max", "\\u", "key", "\\u", "fe", "e", "'_", ":_", "DEF", "AUL", "T", "\\u", "MAX", "\\u", "KEY", "\\u", "FE", "E_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "default", "\\u", "download", "\\u", "director", "y", "'_", ":_", "self_", "._", "download", "\\u", "directory_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "max", "\\u", "upload", "'_", ":_", "0.0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "max", "\\u", "download", "'_", ":_", "0.0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "upload", "\\u", "log", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "search", "\\u", "timeo", "ut", "'_", ":_", "3.0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "max", "\\u", "search", "\\u", "results", "'_", ":_", "DEF", "AUL", "T", "\\u", "MAX", "\\u", "SEARCH", "\\u", "RESULTS", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "walle", "t", "\\u", "type", "'_", ":_", "walle", "t", "\\u", "type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "delete", "\\u", "blobs", "\\u", "on", "\\u", "remove", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "peer", "\\u", "port", "'_", ":_", "3333", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dht", "\\u", "node", "\\u", "port", "'_", ":_", "4444", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "use", "\\u", "upnp", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "start", "\\u", "lbr", "yc", "rd", "d", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "request", "ed", "\\u", "first", "\\u", "run", "\\u", "credits", "'_", ":_", "False_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "render_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "._", "content_", "._", "seek_", "(_", "0_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Unma", "rsh", "al", " ", "the", " ", "JSO", "N", "-", "RP", "C", " ", "data", "._", "\\u\\u\\uNL\\u\\u\\u_", "content_", "=_", "request_", "._", "content_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parsed_", "=_", "jsonrpc", "lib_", "._", "loads_", "(_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "function", "Path_", "=_", "parsed_", "._", "get_", "(_", "\"", "method", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "parsed_", "._", "get_", "(_", "'", "params", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "TOD", "O", " ", "convert", " ", "args", " ", "to", " ", "correct", " ", "types", " ", "if", " ", "possible_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "id_", "=_", "parsed_", "._", "get_", "(_", "'", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "version_", "=_", "parsed_", "._", "get_", "(_", "'", "jsonrpc", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "version_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version_", "=_", "int_", "(_", "float_", "(_", "version_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "id_", "and_", "not_", "version_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version_", "=_", "jsonrpc", "lib_", "._", "VERSI", "ON", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version_", "=_", "jsonrpc", "lib_", "._", "VERSI", "ON", "\\u", "PRE", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "XX", "X", " ", "this", " ", "all", " ", "need", "s", " ", "to", " ", "be", " ", "re", "-", "worked", " ", "to", " ", "support", " ", "logic", " ", "for", " ", "multiple_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "version", "s", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "self_", "._", "announce", "d\\u", "startup_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "function", "Path_", "not_", "in_", "ALLOWED", "\\u", "DU", "RING", "\\u", "START", "UP_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "server_", "._", "failure_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "function_", "=_", "self_", "._", "\\u", "get", "Function_", "(_", "function", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "jsonrpc", "lib_", "._", "Fault_", ",_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "cb", "Render_", "(_", "f_", ",_", "request_", ",_", "id_", ",_", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "._", "set", "Header_", "(_", "\"", "Access", "-", "Control", "-", "All", "ow", "-", "Orig", "in", "\"_", ",_", "\"*\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "set", "Header_", "(_", "\"", "content", "-", "type", "\"_", ",_", "\"", "text", "/", "json", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "args_", "==_", "[_", "{_", "}_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "defer_", "._", "may", "be", "Deferred_", "(_", "function_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "defer_", "._", "may", "be", "Deferred_", "(_", "function_", ",_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "._", "add", "Errback_", "(_", "self_", "._", "\\u", "eb", "Render_", ",_", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "\\u", "cb", "Render_", ",_", "request_", ",_", "id_", ",_", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "server_", "._", "NOT", "\\u", "DON", "E", "\\u", "YE", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "cb", "Render_", "(_", "self_", ",_", "result_", ",_", "request_", ",_", "id_", ",_", "version_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "result_", ",_", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "result_", "._", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "result_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "result_", "[_", "'", "result", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "version_", "==_", "jsonrpc", "lib_", "._", "VERSI", "ON", "\\u", "PRE", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "isinstance_", "(_", "result_", ",_", "jsonrpc", "lib_", "._", "Fault_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "(_", "result_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Convert", " ", "the", " ", "result", " ", "(", "python", ")", " ", "to", " ", "JSO", "N", "-", "RP", "C_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "jsonrpc", "lib_", "._", "dumps_", "(_", "result_", ",_", "version_", "=_", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "jsonrpc", "lib_", "._", "Fault_", "(_", "self_", "._", "FAILURE_", ",_", "\"", "can", "'", "t", " ", "serialize", " ", "output", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "jsonrpc", "lib_", "._", "dumps_", "(_", "f_", ",_", "version_", "=_", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "request_", "._", "set", "Header_", "(_", "\"", "content", "-", "length", "\"_", ",_", "str_", "(_", "len_", "(_", "s_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "write_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "finish_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "eb", "Render_", "(_", "self_", ",_", "failure_", ",_", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "failure_", "._", "value_", ",_", "jsonrpc", "lib_", "._", "Fault_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "failure_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "._", "error_", "(_", "failure_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "jsonrpc", "lib_", "._", "Fault_", "(_", "self_", "._", "FAILURE_", ",_", "\"", "error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "setup_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u", "log", "\\u", "startin", "g", "\\u", "vals_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u", "get", "\\u", "lbr", "y", "\\u", "files", "\\u", "json_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "self_", "._", "\\u", "get", "\\u", "lbr", "y", "\\u", "files_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "json_", "._", "dumps_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "lbr", "yum", "\\u", "version_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "urlopen_", "(_", "\"", "https", "://", "raw", ".", "git", "hub", "userco", "ntent", ".", "com", "/", "lbr", "yi", "o", "/", "lbr", "yum", "/", "master", "/", "lib", "/", "version", ".", "py", "\"_", ")_", "._", "read_", "(_", ")_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "version_", "=_", "next_", "(_", "line_", "._", "split_", "(_", "\"=\"_", ")_", "[_", "1_", "]_", "._", "split_", "(_", "\"#\"_", ")_", "[_", "0_", "]_", "._", "replace_", "(_", "\"", " ", "\"_", ",_", "\"\"_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "line_", "in_", "r_", "if_", "\"", "ELECT", "RU", "M", "\\u", "VERSI", "ON", "\"_", "in_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "version_", "=_", "version_", "._", "replace_", "(_", "\"'\"_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "\"", "remote", " ", "lbr", "yum", " ", "\"_", "+_", "str_", "(_", "version_", ")_", "+_", "\"", " ", ">", " ", "local", " ", "lbr", "yum", " ", "\"_", "+_", "str_", "(_", "lbr", "yum", "\\u", "version_", ")_", "+_", "\"", " ", "=", " ", "\"_", "+_", "str_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "version_", ">_", "lbr", "yum", "\\u", "version_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "lbr", "yne", "t", "\\u", "version_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "urlopen_", "(_", "\"", "https", "://", "raw", ".", "git", "hub", "userco", "ntent", ".", "com", "/", "lbr", "yi", "o", "/", "lbr", "y", "/", "master", "/", "lbr", "yne", "t", "/\\u", "\\u", "init", "\\u\\u", ".", "py", "\"_", ")_", "._", "read_", "(_", ")_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vs_", "=_", "next_", "(_", "i_", "for_", "i_", "in_", "r_", "if_", "'", "version", " ", "='_", "in_", "i_", ")_", "._", "split_", "(_", "\"=\"_", ")_", "[_", "1_", "]_", "._", "replace_", "(_", "\"", " ", "\"_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vt_", "=_", "tuple_", "(_", "int_", "(_", "x_", ")_", "for_", "x_", "in_", "vs_", "[_", "1_", ":_", "-_", "1_", "]_", "._", "split_", "(_", "','_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vr_", "=_", "\".\"_", "._", "join_", "(_", "[_", "str_", "(_", "x_", ")_", "for_", "x_", "in_", "vt_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "\"", "remote", " ", "lbr", "yne", "t", " ", "\"_", "+_", "str_", "(_", "vr_", ")_", "+_", "\"", " ", ">", " ", "local", " ", "lbr", "yne", "t", " ", "\"_", "+_", "str_", "(_", "lbr", "yne", "t", "\\u", "version_", ")_", "+_", "\"", " ", "=", " ", "\"_", "+_", "str_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "vr_", ">_", "lbr", "yne", "t", "\\u", "version_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "vr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "git", "\\u", "lbr", "yne", "t", "\\u", "version_", "=_", "\\u", "get", "\\u", "lbr", "yne", "t", "\\u", "version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "git", "\\u", "lbr", "yum", "\\u", "version_", "=_", "\\u", "get", "\\u", "lbr", "yum", "\\u", "version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "._", "info_", "(_", "\"", "LB", "RY", " ", "Files", ":", " ", "\"_", "+_", "\\u", "get", "\\u", "lbr", "y", "\\u", "files", "\\u", "json_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "\"", "Start", "ing", " ", "balance", ":", " ", "\"_", "+_", "str_", "(_", "self_", "._", "session_", "._", "wallet_", "._", "walle", "t", "\\u", "balance_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "defer_", "._", "succeed_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "announce", "\\u", "startup_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u", "announce", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "announce", "d\\u", "startup_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "start", "up", "\\u", "status_", "=_", "START", "UP", "\\u", "STAGE", "S_", "[_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "\"[\"_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "\"]", " ", "Start", "ed", " ", "lbr", "yne", "t", "-", "daemon", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "first", "\\u", "run_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "upload", "\\u", "log_", "(_", "name", "\\u", "prefix_", "=_", "\"", "fr", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "upload", "\\u", "log_", "(_", "exclu", "de", "\\u", "previous_", "=_", "True_", ",_", "name", "\\u", "prefix_", "=_", "\"", "start", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "float_", "(_", "self_", "._", "session_", "._", "wallet_", "._", "walle", "t", "\\u", "balance_", ")_", "==_", "0.0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "self_", "._", "\\u", "check", "\\u", "first", "\\u", "run_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "\\u", "show", "\\u", "first", "\\u", "run", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "\\u", "announce", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "._", "info_", "(_", "\"[\"_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "\"]", " ", "Start", "ing", " ", "lbr", "yne", "t", "-", "daemon", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "self_", "._", "\\u", "initial", "\\u", "setup_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "\\u", "set\\u", "daemon", "\\u", "settings_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "threads_", "._", "defer", "To", "Thread_", "(_", "self_", "._", "\\u", "setup", "\\u", "data\\u", "directory_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "self_", "._", "\\u", "check", "\\u", "db", "\\u", "migration_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "self_", "._", "\\u", "get", "\\u", "settings_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "self_", "._", "\\u", "get", "\\u", "lbr", "yc", "rd", "d\\u", "path_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "self_", "._", "\\u", "get", "\\u", "session_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "add", "\\u", "lbr", "y", "\\u", "file", "\\u", "to", "\\u", "sd", "\\u", "identifier_", "(_", "self_", "._", "sd", "\\u", "identifier_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "self_", "._", "\\u", "setup", "\\u", "stream", "\\u", "identifier_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "self_", "._", "\\u", "setup", "\\u", "lbr", "y", "\\u", "file", "\\u", "manager_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "self_", "._", "\\u", "setup", "\\u", "lbr", "y", "\\u", "file", "\\u", "opener_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "self_", "._", "\\u", "setup", "\\u", "query", "\\u", "handlers_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "self_", "._", "\\u", "setup", "\\u", "server_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "self_", "._", "\\u", "setup", "\\u", "fetcher_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "\\u", "log", "\\u", "startin", "g", "\\u", "vals_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "\\u", "announce", "\\u", "startup_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "callback_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "defer_", "._", "succeed_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "initial", "\\u", "setup_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u", "log", "\\u", "platform_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "\"", "Plat", "form", ":", " ", "\"_", "+_", "json_", "._", "dumps_", "(_", "self_", "._", "platform", "\\u", "info_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "defer_", "._", "succeed_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "load", "\\u", "daemon", "\\u", "conf_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "self_", "._", "daemon", "\\u", "conf_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "open_", "(_", "self_", "._", "daemon", "\\u", "conf_", ",_", "\"", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "load", "ed", "\\u", "settings_", "=_", "json_", "._", "loads_", "(_", "f_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "missi", "ng", "\\u", "settings_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", "in_", "self_", "._", "default", "\\u", "settings_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "k_", "not_", "in_", "load", "ed", "\\u", "settings_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "missi", "ng", "\\u", "settings_", "[_", "k_", "]_", "=_", "self_", "._", "default", "\\u", "settings_", "[_", "k_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "missi", "ng", "\\u", "settings_", "!=_", "{_", "}_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "k_", "in_", "missi", "ng", "\\u", "settings_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "log_", "._", "info_", "(_", "\"", "Add", "ing", " ", "missi", "ng", " ", "setti", "ng", ":", " ", "\"_", "+_", "k_", "+_", "\"", " ", "with", " ", "default", " ", "value", ":", " ", "\"_", "+_", "str_", "(_", "missi", "ng", "\\u", "settings_", "[_", "k_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "load", "ed", "\\u", "settings_", "[_", "k_", "]_", "=_", "missi", "ng", "\\u", "settings_", "[_", "k_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "f_", "=_", "open_", "(_", "self_", "._", "daemon", "\\u", "conf_", ",_", "\"", "w", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "json_", "._", "dumps_", "(_", "load", "ed", "\\u", "settings_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rse", "ttings_", "=_", "load", "ed", "\\u", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "\"", "Writ", "ing", " ", "default", " ", "settings", " ", ":", " ", "\"_", "+_", "json_", "._", "dumps_", "(_", "self_", "._", "default", "\\u", "settings_", ")_", "+_", "\"", " ", "-->", " ", "\"_", "+_", "str_", "(_", "self_", "._", "daemon", "\\u", "conf_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "open_", "(_", "self_", "._", "daemon", "\\u", "conf_", ",_", "\"", "w", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "json_", "._", "dumps_", "(_", "self_", "._", "default", "\\u", "settings_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rse", "ttings_", "=_", "self_", "._", "default", "\\u", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "k_", "in_", "rse", "ttings_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "dict\\u\\u_", "[_", "k_", "]_", "=_", "rse", "ttings_", "[_", "k_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "rse", "ttings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "\\u", "log", "\\u", "platform_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "\\u", "load", "\\u", "daemon", "\\u", "conf_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "set\\u", "daemon", "\\u", "settings_", "(_", "self_", ",_", "settings_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "session", "\\u", "settings_", "=_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "defer_", "._", "succeed_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "start", "\\u", "server_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "peer", "\\u", "port_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "server", "\\u", "factory_", "=_", "Server", "Proto", "col", "Factory_", "(_", "self_", "._", "session_", "._", "rate", "\\u", "limiter", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "query", "\\u", "handlers_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "session_", "._", "peer", "\\u", "manager_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "lbr", "y", "\\u", "server", "\\u", "port_", "=_", "reactor_", "._", "listen", "TCP_", "(_", "self_", "._", "peer", "\\u", "port_", ",_", "server", "\\u", "factory_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "error_", "._", "Cann", "ot", "Listen", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "traceback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "error_", "(_", "\"", "Cou", "ld", "n", "'", "t", " ", "bind", " ", "to", " ", "port", " ", "%", "d", ".", " ", "%", "s", "\"_", ",_", "self_", "._", "peer", "\\u", "port_", ",_", "traceback_", "._", "format\\u", "exc_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "\"%", "s", " ", "lbr", "yne", "t", " ", "may", " ", "alr", "ead", "y", " ", "be", " ", "runn", "ing", " ", "on", " ", "your", " ", "computer", ".\"_", ",_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "defer_", "._", "succeed_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "stop", "\\u", "server_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "lbr", "y", "\\u", "server", "\\u", "port_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "lbr", "y", "\\u", "server", "\\u", "port_", ",_", "p_", "=_", "None_", ",_", "self_", "._", "lbr", "y", "\\u", "server", "\\u", "port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "defer_", "._", "may", "be", "Deferred_", "(_", "p_", "._", "stop", "Listen", "ing_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "defer_", "._", "succeed_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "setup", "\\u", "server_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "restore", "\\u", "runn", "ing", "\\u", "status_", "(_", "running_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "running_", "is_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "start", "\\u", "server_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "defer_", "._", "succeed_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "start", "up", "\\u", "status_", "=_", "START", "UP", "\\u", "STAGE", "S_", "[_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dl_", "=_", "self_", "._", "settings_", "._", "get", "\\u", "server", "\\u", "runn", "ing", "\\u", "status_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dl_", "._", "add", "Callback_", "(_", "restore", "\\u", "runn", "ing", "\\u", "status_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "dl_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "setup", "\\u", "query", "\\u", "handlers_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "handlers_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Crypt", "Blo", "b", "Info", "Query", "Handle", "r", "Factor", "y", "(", "self", ".", "lbr", "y", "\\u", "file", "\\u", "metadata", "\\u", "manage", "r", ",", " ", "self", ".", "session", ".", "walle", "t", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", " ", " ", "self", ".\\u", "server", "\\u", "pay", "ment", "\\u", "rate", "\\u", "manage", "r", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "Blo", "b", "Avail", "abilit", "y", "Handle", "r", "Factory_", "(_", "self_", "._", "session_", "._", "blob", "\\u", "manager_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Blo", "b", "Request", "Handle", "r", "Factor", "y", "(", "self", ".", "session", ".", "blob", "\\u", "manage", "r", ",", " ", "self", ".", "session", ".", "walle", "t", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".\\u", "server", "\\u", "pay", "ment", "\\u", "rate", "\\u", "manage", "r", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "session_", "._", "wallet_", "._", "get", "\\u", "walle", "t", "\\u", "info", "\\u", "query", "\\u", "handler", "\\u", "factory_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "blob", "\\u", "request", "\\u", "handler", "\\u", "factory_", "(_", "rate_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "blob", "\\u", "request", "\\u", "pay", "ment", "\\u", "rate", "\\u", "manager_", "=_", "Payment", "Rat", "e", "Manager_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "session_", "._", "base", "\\u", "pay", "ment", "\\u", "rate", "\\u", "manager_", ",_", "rate_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handlers_", "._", "append_", "(_", "Blo", "b", "Request", "Handle", "r", "Factory_", "(_", "self_", "._", "session_", "._", "blob", "\\u", "manager_", ",_", "self_", "._", "session_", "._", "wallet_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "blob", "\\u", "request", "\\u", "pay", "ment", "\\u", "rate", "\\u", "manager_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d1_", "=_", "self_", "._", "settings_", "._", "get", "\\u", "server", "\\u", "data\\u", "pay", "ment", "\\u", "rate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d1_", "._", "add", "Callback_", "(_", "get", "\\u", "blob", "\\u", "request", "\\u", "handler", "\\u", "factory_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dl_", "=_", "defer_", "._", "Defe", "rre", "d", "List_", "(_", "[_", "d1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dl_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "self_", "._", "\\u", "add", "\\u", "query", "\\u", "handlers_", "(_", "handlers_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "dl_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "add", "\\u", "query", "\\u", "handlers_", "(_", "self_", ",_", "query", "\\u", "handlers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u", "set\\u", "query", "\\u", "handlers_", "(_", "statuses_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "future", "\\u", "builtins_", "import_", "zip_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "handler_", ",_", "(_", "success_", ",_", "status_", ")_", "in_", "zip_", "(_", "query", "\\u", "handlers_", ",_", "statuses_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "success_", "is_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "query", "\\u", "handlers_", "[_", "handler_", "]_", "=_", "status_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ds_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "handler_", "in_", "query", "\\u", "handlers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ds_", "._", "append_", "(_", "self_", "._", "settings_", "._", "get", "\\u", "query", "\\u", "handler", "\\u", "status_", "(_", "handler_", "._", "get", "\\u", "primary", "\\u", "query", "\\u", "identifier_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dl_", "=_", "defer_", "._", "Defe", "rre", "d", "List_", "(_", "ds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dl_", "._", "add", "Callback_", "(_", "\\u", "set\\u", "query", "\\u", "handlers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "dl_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "upload", "\\u", "log_", "(_", "self_", ",_", "name", "\\u", "prefix_", "=_", "None_", ",_", "exclu", "de", "\\u", "previous_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "name", "\\u", "prefix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name", "\\u", "prefix_", "=_", "name", "\\u", "prefix_", "+_", "\"-\"_", "+_", "platform_", "._", "system_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name", "\\u", "prefix_", "=_", "platform_", "._", "system_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "session", "\\u", "settings_", "[_", "'", "upload", "\\u", "log", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "LOG", "\\u", "URL_", "=_", "\"", "https", "://", "lbr", "y", ".", "io", "/", "log", "-", "upload", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "exclu", "de", "\\u", "previous_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "open_", "(_", "self_", "._", "log", "\\u", "file_", ",_", "\"", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "seek_", "(_", "PREVI", "OUS", "\\u", "LOG_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log", "\\u", "contents_", "=_", "f_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "open_", "(_", "self_", "._", "log", "\\u", "file_", ",_", "\"", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log", "\\u", "contents_", "=_", "f_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "t_", "=_", "datetime_", "._", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log", "\\u", "name_", "=_", "name", "\\u", "prefix_", "+_", "\"-\"_", "+_", "base", "58_", "._", "b5", "8e", "ncode", "_", "(_", "self_", "._", "lbr", "yi", "d_", ")_", "[_", ":_", "20_", "]_", "+_", "\"-\"_", "+_", "str_", "(_", "t_", "._", "month_", ")_", "+_", "\"-\"_", "+_", "str_", "(_", "t_", "._", "day_", ")_", "+_", "\"-\"_", "+_", "str_", "(_", "t_", "._", "year_", ")_", "+_", "\"-\"_", "+_", "str_", "(_", "t_", "._", "hour_", ")_", "+_", "\"-\"_", "+_", "str_", "(_", "t_", "._", "minute_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "=_", "{_", "'", "name", "'_", ":_", "log", "\\u", "name_", ",_", "'", "log", "'_", ":_", "log", "\\u", "contents_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "requests_", "._", "post_", "(_", "LOG", "\\u", "URL_", ",_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "defer_", "._", "succeed_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "shutdown_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "\"", "Clos", "ing", " ", "lbr", "yne", "t", " ", "session", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "\"", "Status", " ", "at", " ", "time", " ", "of", " ", "shut", "down", ":", " ", "\"_", "+_", "self_", "._", "start", "up", "\\u", "status_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "upload", "\\u", "log_", "(_", "name", "\\u", "prefix_", "=_", "\"", "close", "\"_", ",_", "exclu", "de", "\\u", "previous_", "=_", "False_", "if_", "self_", "._", "first", "\\u", "run_", "else_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "self_", "._", "\\u", "stop", "\\u", "server_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Errback_", "(_", "lambda_", "err_", ":_", "log_", "._", "info_", "(_", "\"", "Ba", "d", " ", "server", " ", "shut", "down", ":", " ", "\"_", "+_", "err_", "._", "get", "Trace", "back_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "session_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "self_", "._", "session_", "._", "shut", "\\u", "down_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Errback_", "(_", "lambda_", "err_", ":_", "log_", "._", "info_", "(_", "\"", "Ba", "d", " ", "session", " ", "shut", "down", ":", " ", "\"_", "+_", "err_", "._", "get", "Trace", "back_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "update", "\\u", "settings_", "(_", "self_", ",_", "settings_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "k_", "in_", "settings_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "k_", "==_", "'", "run", "\\u", "on", "\\u", "start", "up", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "settings_", "[_", "'", "run", "\\u", "on", "\\u", "start", "up", "'_", "]_", ")_", "is_", "bool_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "session", "\\u", "settings_", "[_", "'", "run", "\\u", "on", "\\u", "start", "up", "'_", "]_", "=_", "settings_", "[_", "'", "run", "\\u", "on", "\\u", "start", "up", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "defer_", "._", "fail_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "k_", "==_", "'", "data\\u", "rate", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "settings_", "[_", "'", "data\\u", "rate", "'_", "]_", ")_", "is_", "float_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "session", "\\u", "settings_", "[_", "'", "data\\u", "rate", "'_", "]_", "=_", "settings_", "[_", "'", "data\\u", "rate", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type_", "(_", "settings_", "[_", "'", "data\\u", "rate", "'_", "]_", ")_", "is_", "int_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "session", "\\u", "settings_", "[_", "'", "data\\u", "rate", "'_", "]_", "=_", "float_", "(_", "settings_", "[_", "'", "data\\u", "rate", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "defer_", "._", "fail_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "k_", "==_", "'", "max", "\\u", "key", "\\u", "fe", "e", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "settings_", "[_", "'", "max", "\\u", "key", "\\u", "fe", "e", "'_", "]_", ")_", "is_", "float_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "session", "\\u", "settings_", "[_", "'", "max", "\\u", "key", "\\u", "fe", "e", "'_", "]_", "=_", "settings_", "[_", "'", "max", "\\u", "key", "\\u", "fe", "e", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type_", "(_", "settings_", "[_", "'", "max", "\\u", "key", "\\u", "fe", "e", "'_", "]_", ")_", "is_", "int_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "session", "\\u", "settings_", "[_", "'", "max", "\\u", "key", "\\u", "fe", "e", "'_", "]_", "=_", "float_", "(_", "settings_", "[_", "'", "max", "\\u", "key", "\\u", "fe", "e", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "defer_", "._", "fail_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "k_", "==_", "'", "default", "\\u", "download", "\\u", "director", "y", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "settings_", "[_", "'", "default", "\\u", "download", "\\u", "director", "y", "'_", "]_", ")_", "is_", "unicode_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "os_", "._", "path_", "._", "isdir_", "(_", "settings_", "[_", "'", "default", "\\u", "download", "\\u", "director", "y", "'_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "session", "\\u", "settings_", "[_", "'", "default", "\\u", "download", "\\u", "director", "y", "'_", "]_", "=_", "settings_", "[_", "'", "default", "\\u", "download", "\\u", "director", "y", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "defer_", "._", "fail_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "k_", "==_", "'", "max", "\\u", "upload", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "settings_", "[_", "'", "max", "\\u", "upload", "'_", "]_", ")_", "is_", "float_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "session", "\\u", "settings_", "[_", "'", "max", "\\u", "upload", "'_", "]_", "=_", "settings_", "[_", "'", "max", "\\u", "upload", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type_", "(_", "settings_", "[_", "'", "max", "\\u", "upload", "'_", "]_", ")_", "is_", "int_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "session", "\\u", "settings_", "[_", "'", "max", "\\u", "upload", "'_", "]_", "=_", "float_", "(_", "settings_", "[_", "'", "max", "\\u", "upload", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "defer_", "._", "fail_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "k_", "==_", "'", "max", "\\u", "download", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "settings_", "[_", "'", "max", "\\u", "download", "'_", "]_", ")_", "is_", "float_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "session", "\\u", "settings_", "[_", "'", "max", "\\u", "download", "'_", "]_", "=_", "settings_", "[_", "'", "max", "\\u", "download", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type_", "(_", "settings_", "[_", "'", "max", "\\u", "download", "'_", "]_", ")_", "is_", "int_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "session", "\\u", "settings_", "[_", "'", "max", "\\u", "download", "'_", "]_", "=_", "float_", "(_", "settings_", "[_", "'", "max", "\\u", "download", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "defer_", "._", "fail_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "k_", "==_", "'", "upload", "\\u", "log", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "settings_", "[_", "'", "upload", "\\u", "log", "'_", "]_", ")_", "is_", "bool_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "session", "\\u", "settings_", "[_", "'", "upload", "\\u", "log", "'_", "]_", "=_", "settings_", "[_", "'", "upload", "\\u", "log", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "defer_", "._", "fail_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "f_", "=_", "open_", "(_", "self_", "._", "daemon", "\\u", "conf_", ",_", "\"", "w", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "json_", "._", "dumps_", "(_", "self_", "._", "session", "\\u", "settings_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "defer_", "._", "succeed_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "setup", "\\u", "fetcher_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fetcher_", "=_", "Fetche", "r", "Daemon_", "(_", "self_", "._", "session_", ",_", "self_", "._", "lbr", "y", "\\u", "file", "\\u", "manager_", ",_", "self_", "._", "lbr", "y", "\\u", "file", "\\u", "metadata", "\\u", "manager_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "session_", "._", "wallet_", ",_", "self_", "._", "sd", "\\u", "identifier_", ",_", "self_", "._", "autof", "etch", "er", "\\u", "conf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "defer_", "._", "succeed_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "setup", "\\u", "data\\u", "directory_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "start", "up", "\\u", "status_", "=_", "START", "UP", "\\u", "STAGE", "S_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "\"", "Load", "ing", " ", "databa", "ses", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "created", "\\u", "data\\u", "dir_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db", "\\u", "revision_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "db", "\\u", "dir_", ",_", "\"", "db", "\\u", "revis", "ion", "\"_", ")_", ",_", "mode_", "=_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "revision_", "._", "write_", "(_", "str_", "(_", "self_", "._", "current", "\\u", "db", "\\u", "revision_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "revision_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "debug_", "(_", "\"", "Creat", "ed", " ", "the", " ", "db", " ", "revis", "ion", " ", "file", ":", " ", "%", "s", "\"_", ",_", "str_", "(_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "db", "\\u", "dir_", ",_", "\"", "db", "\\u", "revis", "ion", "\"_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "self_", "._", "blob", "file", "\\u", "dir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "mkdir_", "(_", "self_", "._", "blob", "file", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "debug_", "(_", "\"", "Creat", "ed", " ", "the", " ", "blob", "file", " ", "director", "y", ":", " ", "%", "s", "\"_", ",_", "str_", "(_", "self_", "._", "blob", "file", "\\u", "dir_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "check", "\\u", "db", "\\u", "migration_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old", "\\u", "revision_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "revis", "ion", "\\u", "file_", "=_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "db", "\\u", "dir_", ",_", "\"", "db", "\\u", "revis", "ion", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "db", "\\u", "revis", "ion", "\\u", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old", "\\u", "revision_", "=_", "int_", "(_", "open_", "(_", "db", "\\u", "revis", "ion", "\\u", "file_", ")_", "._", "read_", "(_", ")_", "._", "strip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "old", "\\u", "revision_", "<_", "self_", "._", "current", "\\u", "db", "\\u", "revision_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "lbr", "yne", "t_", "._", "db", "\\u", "migr", "ator_", "import_", "dbm", "igra", "tor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "\"", "Up", "gradi", "ng", " ", "your", " ", "databa", "ses", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "threads_", "._", "defer", "To", "Thread_", "(_", "dbm", "igra", "tor_", "._", "migr", "ate", "\\u", "db_", ",_", "self_", "._", "db", "\\u", "dir_", ",_", "old", "\\u", "revision_", ",_", "self_", "._", "current", "\\u", "db", "\\u", "revision_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "print", "\\u", "success_", "(_", "old", "\\u", "dirs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "success", "\\u", "string_", "=_", "\"", "Finish", "ed", " ", "up", "gradi", "ng", " ", "the", " ", "databa", "ses", ".", " ", "It", " ", "is", " ", "now", " ", "safe", " ", "to", " ", "delete", " ", "the", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "success", "\\u", "string_", "+=_", "\"", " ", "follow", "ing", " ", "director", "ies", ",", " ", "if", " ", "you", " ", "feel", " ", "like", " ", "it", ".", " ", "It", " ", "won", "'", "t", " ", "make", " ", "any", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "success", "\\u", "string_", "+=_", "\"", " ", "difference", ".\\\\", "n", "Any", "way", " ", "here", " ", "the", "y", " ", "are", ":", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "old", "\\u", "dir_", "in_", "enumerate_", "(_", "old", "\\u", "dirs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "success", "\\u", "string_", "+=_", "old", "\\u", "dir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "i_", "+_", "1_", "<_", "len_", "(_", "old", "\\u", "dir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "success", "\\u", "string_", "+=_", "\",", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "._", "info_", "(_", "success", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "print", "\\u", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "defer_", "._", "succeed_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "settings_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "settings_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "self_", "._", "settings_", "._", "get", "\\u", "lbr", "yi", "d_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "\\u", "set\\u", "lbr", "yi", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "self_", "._", "\\u", "get", "\\u", "lbr", "yc", "rd", "d\\u", "path_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "set\\u", "lbr", "yi", "d_", "(_", "self_", ",_", "lbr", "yi", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "lbr", "yi", "d_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "make", "\\u", "lbr", "yi", "d_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "\"", "LB", "RY", " ", "ID", ":", " ", "\"_", "+_", "base", "58_", "._", "b5", "8e", "ncode", "_", "(_", "lbr", "yi", "d_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "lbr", "yi", "d_", "=_", "lbr", "yi", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "make", "\\u", "lbr", "yi", "d_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "lbr", "yi", "d_", "=_", "generat", "e\\u", "id_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "\"", "Generate", "d", " ", "new", " ", "LB", "RY", " ", "ID", ":", " ", "\"_", "+_", "base", "58_", "._", "b5", "8e", "ncode", "_", "(_", "self_", "._", "lbr", "yi", "d_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "settings_", "._", "save", "\\u", "lbr", "yi", "d_", "(_", "self_", "._", "lbr", "yi", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "setup", "\\u", "lbr", "y", "\\u", "file", "\\u", "manager_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "start", "up", "\\u", "status_", "=_", "START", "UP", "\\u", "STAGE", "S_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "lbr", "y", "\\u", "file", "\\u", "metadata", "\\u", "manager_", "=_", "DB", "LB", "RY", "File", "Meta", "data", "Manager_", "(_", "self_", "._", "db", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "lbr", "y", "\\u", "file", "\\u", "metadata", "\\u", "manager_", "._", "setup_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set\\u", "lbr", "y", "\\u", "file", "\\u", "manager_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "lbr", "y", "\\u", "file", "\\u", "manager_", "=_", "LB", "RY", "File", "Manager_", "(_", "self_", "._", "session_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "lbr", "y", "\\u", "file", "\\u", "metadata", "\\u", "manager_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "sd", "\\u", "identifier_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "delete", "\\u", "data_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "lbr", "y", "\\u", "file", "\\u", "manager_", "._", "setup_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "set\\u", "lbr", "y", "\\u", "file", "\\u", "manager_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "session_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get", "\\u", "default", "\\u", "data\\u", "rate_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "settings_", "._", "get", "\\u", "default", "\\u", "data\\u", "pay", "ment", "\\u", "rate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "rate_", ":_", "{_", "\"", "default", "\\u", "data\\u", "pay", "ment", "\\u", "rate", "\"_", ":_", "rate_", "if_", "rate_", "is_", "not_", "None_", "else_", "\\u\\u\\uNL\\u\\u\\u_", "MIN", "\\u", "BLOB", "\\u", "DATA", "\\u", "PAY", "MENT", "\\u", "RATE_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "wallet_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "walle", "t", "\\u", "type_", "==_", "\"", "lbr", "yc", "rd", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "\"", "Us", "ing", " ", "lbr", "yc", "rd", " ", "walle", "t", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lbr", "yc", "rd", "d\\u", "path_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "start", "\\u", "lbr", "yc", "rdd_", "is_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "lbr", "yc", "rd", "d\\u", "path_", "=_", "self_", "._", "lbr", "yc", "rd", "d\\u", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "lbr", "yc", "rd", "d\\u", "path_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "lbr", "yc", "rd", "d\\u", "path_", "=_", "self_", "._", "default", "\\u", "lbr", "yc", "rd", "d\\u", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "defer_", "._", "succeed_", "(_", "LB", "RY", "crd", "Wallet_", "(_", "self_", "._", "db", "\\u", "dir_", ",_", "walle", "t", "\\u", "dir_", "=_", "self_", "._", "walle", "t", "\\u", "dir_", ",_", "walle", "t", "\\u", "conf_", "=_", "self_", "._", "lbr", "yc", "rd", "\\u", "conf_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lbr", "yc", "rd", "d\\u", "path_", "=_", "lbr", "yc", "rd", "d\\u", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "walle", "t", "\\u", "type_", "==_", "\"", "lbr", "yum", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "\"", "Us", "ing", " ", "lbr", "yum", " ", "walle", "t", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "defer_", "._", "succeed_", "(_", "LB", "RY", "um", "Wallet_", "(_", "self_", "._", "db", "\\u", "dir_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "walle", "t", "\\u", "type_", "==_", "\"", "pt", "c", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "\"", "Us", "ing", " ", "PT", "C", " ", "walle", "t", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "defer_", "._", "succeed_", "(_", "PT", "CW", "alle", "t_", "(_", "self_", "._", "db", "\\u", "dir_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "defer_", "._", "fail_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "wallet_", ":_", "{_", "\"", "walle", "t", "\"_", ":_", "wallet_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d1_", "=_", "get", "\\u", "default", "\\u", "data\\u", "rate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d2_", "=_", "get", "\\u", "wallet_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "combin", "e\\u", "results_", "(_", "results_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "success_", ",_", "result_", "in_", "results_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "success_", "is_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "r_", "._", "update_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "session_", "(_", "results_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "session_", "=_", "LB", "RY", "Session_", "(_", "results_", "[_", "'", "default", "\\u", "data\\u", "pay", "ment", "\\u", "rate", "'_", "]_", ",_", "db", "\\u", "dir_", "=_", "self_", "._", "db", "\\u", "dir_", ",_", "lbr", "yi", "d_", "=_", "self_", "._", "lbr", "yi", "d_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "blob", "\\u", "dir_", "=_", "self_", "._", "blob", "file", "\\u", "dir_", ",_", "dht", "\\u", "node", "\\u", "port_", "=_", "self_", "._", "dht", "\\u", "node", "\\u", "port_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "know", "n", "\\u", "dht", "\\u", "nodes_", "=_", "self_", "._", "know", "n", "\\u", "dht", "\\u", "nodes_", ",_", "peer", "\\u", "port_", "=_", "self_", "._", "peer", "\\u", "port_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "\\u", "upnp", "_", "=_", "self_", "._", "use", "\\u", "upnp", "_", ",_", "wallet_", "=_", "results_", "[_", "'", "walle", "t", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "start", "up", "\\u", "status_", "=_", "START", "UP", "\\u", "STAGE", "S_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dl_", "=_", "defer_", "._", "Defe", "rre", "d", "List_", "(_", "[_", "d1_", ",_", "d2_", "]_", ",_", "fire", "On", "One", "Errback_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dl_", "._", "add", "Callback_", "(_", "combin", "e\\u", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dl_", "._", "add", "Callback_", "(_", "create", "\\u", "session_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dl_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "self_", "._", "session_", "._", "setup_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "dl_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "check", "\\u", "first", "\\u", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u", "set\\u", "first", "\\u", "run", "\\u", "false_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "\"", "Not", " ", "first", " ", "run", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "first", "\\u", "run_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "self_", "._", "session_", "._", "wallet_", "._", "is", "\\u", "first", "\\u", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "is", "\\u", "first", "\\u", "run_", ":_", "self_", "._", "\\u", "do", "\\u", "first", "\\u", "run_", "(_", ")_", "if_", "is", "\\u", "first", "\\u", "run_", "or_", "not_", "self_", "._", "request", "ed", "\\u", "first", "\\u", "run", "\\u", "credits", "_", "\\u\\u\\uNL\\u\\u\\u_", "else_", "\\u", "set\\u", "first", "\\u", "run", "\\u", "false_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "do", "\\u", "first", "\\u", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "send", "\\u", "request_", "(_", "url_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "\"", "Request", "ing", " ", "first", " ", "run", " ", "credits", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "requests_", "._", "post_", "(_", "url_", ",_", "json_", "=_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "r_", "._", "status", "\\u", "code_", "==_", "200_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "request", "ed", "\\u", "first", "\\u", "run", "\\u", "credits", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "session", "\\u", "settings_", "[_", "'", "request", "ed", "\\u", "first", "\\u", "run", "\\u", "credits", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "open_", "(_", "self_", "._", "daemon", "\\u", "conf_", ",_", "\"", "w", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "json_", "._", "dumps_", "(_", "self_", "._", "session", "\\u", "settings_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "r_", "._", "json_", "(_", ")_", "[_", "'", "credits", "\\u", "sent", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "log", "\\u", "error_", "(_", "err_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "warning_", "(_", "\"", "una", "ble", " ", "to", " ", "request", " ", "free", " ", "credits", ".", " ", "%", "s", "\"_", ",_", "err_", "._", "get", "Error", "Message_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "request", "\\u", "credits", "_", "(_", "address_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "\"", "http", "://", "cred", "req", ".", "lbr", "y", ".", "io", "/", "request", "credits", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\"", "address", "\"_", ":_", "address_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "threads_", "._", "defer", "To", "Thread_", "(_", "send", "\\u", "request_", ",_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Errback_", "(_", "log", "\\u", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "first", "\\u", "run_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "session_", "._", "wallet_", "._", "get", "\\u", "new", "\\u", "address_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "request", "\\u", "credits", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "show", "\\u", "first", "\\u", "run", "\\u", "result_", "(_", "self_", ",_", "credits", "\\u", "received_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "credits", "\\u", "received_", "!=_", "0.0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "points", "\\u", "string_", "=_", "locale_", "._", "format\\u", "string_", "(_", "\"%", ".2", "f", " ", "LB", "C", "\"_", ",_", "(_", "round_", "(_", "credits", "\\u", "received_", ",_", "2_", ")_", ",_", ")_", ",_", "grouping_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "start", "up", "\\u", "message_", "=_", "\"", "Than", "k", " ", "you", " ", "for", " ", "testi", "ng", " ", "the", " ", "alpha", " ", "version", " ", "of", " ", "LB", "RY", "!", " ", "You", " ", "have", " ", "bee", "n", " ", "give", "n", " ", "%", "s", " ", "for", " ", "free", " ", "bec", "aus", "e", " ", "we", " ", "love", " ", "you", ".", " ", "Ple", "ase", " ", "hang", " ", "on", " ", "for", " ", "a", " ", "few", " ", "minute", "s", " ", "for", " ", "the", " ", "next", " ", "block", " ", "to", " ", "be", " ", "mine", "d", ".", " ", "Whe", "n", " ", "you", " ", "refre", "sh", " ", "this", " ", "page", " ", "and", " ", "see", " ", "your", " ", "credits", " ", "you", "'", "re", " ", "read", "y", " ", "to", " ", "go", "!.", "\"_", "%_", "points", "\\u", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "start", "up", "\\u", "message_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "lbr", "yc", "rd", "d\\u", "path_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get", "\\u", "lbr", "yc", "rd", "d\\u", "path", "\\u", "conf", "\\u", "file_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lbr", "yc", "rd", "d\\u", "path", "\\u", "conf", "\\u", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "expanduser_", "(_", "\"~\"_", ")_", ",_", "\".", "lbr", "yc", "rd", "dpa", "th", ".", "conf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "lbr", "yc", "rd", "d\\u", "path", "\\u", "conf", "\\u", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "lbr", "yc", "rd", "d\\u", "path", "\\u", "conf_", "=_", "open_", "(_", "lbr", "yc", "rd", "d\\u", "path", "\\u", "conf", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "=_", "lbr", "yc", "rd", "d\\u", "path", "\\u", "conf_", "._", "readlines_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "lines_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "threads_", "._", "defer", "To", "Thread_", "(_", "get", "\\u", "lbr", "yc", "rd", "d\\u", "path", "\\u", "conf", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "load", "\\u", "lbr", "yc", "rd", "d\\u", "path_", "(_", "conf_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "line_", "in_", "conf_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "line_", "._", "strip_", "(_", ")_", ")_", "and_", "line_", "._", "strip_", "(_", ")_", "[_", "0_", "]_", "!=_", "\"#\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "lbr", "yc", "rd", "d\\u", "path_", "=_", "line_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "load", "\\u", "lbr", "yc", "rd", "d\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "setup", "\\u", "stream", "\\u", "identifier_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "file", "\\u", "saver", "\\u", "factory_", "=_", "LB", "RY", "File", "Save", "r", "Factory_", "(_", "self_", "._", "session_", "._", "peer", "\\u", "finder_", ",_", "self_", "._", "session_", "._", "rate", "\\u", "limiter", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "session_", "._", "blob", "\\u", "manager_", ",_", "self_", "._", "stream", "\\u", "info", "\\u", "manager_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "session_", "._", "wallet_", ",_", "self_", "._", "session", "\\u", "settings_", "[_", "'", "default", "\\u", "download", "\\u", "director", "y", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sd", "\\u", "identifier_", "._", "add", "\\u", "stream", "\\u", "downloader", "\\u", "factory_", "(_", "LB", "RY", "File", "Stream", "Type_", ",_", "file", "\\u", "saver", "\\u", "factory_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "opene", "r", "\\u", "factory_", "=_", "LB", "RY", "File", "Open", "er", "Factory_", "(_", "self_", "._", "session_", "._", "peer", "\\u", "finder_", ",_", "self_", "._", "session_", "._", "rate", "\\u", "limiter", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "session_", "._", "blob", "\\u", "manager_", ",_", "self_", "._", "stream", "\\u", "info", "\\u", "manager_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "session_", "._", "wallet_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sd", "\\u", "identifier_", "._", "add", "\\u", "stream", "\\u", "downloader", "\\u", "factory_", "(_", "LB", "RY", "File", "Stream", "Type_", ",_", "file", "\\u", "opene", "r", "\\u", "factory_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "defer_", "._", "succeed_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "setup", "\\u", "lbr", "y", "\\u", "file", "\\u", "opener_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "downloader", "\\u", "factory_", "=_", "LB", "RY", "File", "Open", "er", "Factory_", "(_", "self_", "._", "session_", "._", "peer", "\\u", "finder_", ",_", "self_", "._", "session_", "._", "rate", "\\u", "limiter", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "session_", "._", "blob", "\\u", "manager_", ",_", "self_", "._", "stream", "\\u", "info", "\\u", "manager_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "session_", "._", "wallet_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sd", "\\u", "identifier_", "._", "add", "\\u", "stream", "\\u", "downloader", "\\u", "factory_", "(_", "LB", "RY", "File", "Stream", "Type_", ",_", "downloader", "\\u", "factory_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "defer_", "._", "succeed_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "download", "\\u", "name_", "(_", "self_", ",_", "name_", ",_", "timeout_", "=_", "DEF", "AUL", "T", "\\u", "TIMEOUT_", ",_", "download", "\\u", "directory_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "download", "\\u", "directory_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "download", "\\u", "directory_", "=_", "self_", "._", "session", "\\u", "settings_", "[_", "'", "default", "\\u", "download", "\\u", "director", "y", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "os_", "._", "path_", "._", "isdir_", "(_", "download", "\\u", "directory_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "download", "\\u", "directory_", "=_", "self_", "._", "session", "\\u", "settings_", "[_", "'", "default", "\\u", "download", "\\u", "director", "y", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "disp", "\\u", "file_", "(_", "f_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "file", "\\u", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "session", "\\u", "settings_", "[_", "'", "default", "\\u", "download", "\\u", "director", "y", "'_", "]_", ",_", "f_", "._", "file", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "\"[\"_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "\"]", " ", "Al", "read", "y", " ", "download", "ed", ":", " ", "\"_", "+_", "str_", "(_", "f_", "._", "stream", "\\u", "hash_", ")_", "+_", "\"", " ", "-->", " ", "\"_", "+_", "file", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "defer_", "._", "succeed_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "stream_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u", "disp_", "(_", "stream_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stream", "\\u", "hash_", "=_", "stream_", "[_", "'", "stream", "\\u", "hash", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "stream", "\\u", "hash_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "stream", "\\u", "hash_", "=_", "stream", "\\u", "hash_", "[_", "'", "sd", "\\u", "hash", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "._", "info_", "(_", "\"[\"_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "\"]", " ", "Start", " ", "stream", ":", " ", "\"_", "+_", "stream", "\\u", "hash_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "stream_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "self_", "._", "session_", "._", "wallet_", "._", "get", "\\u", "stream", "\\u", "info", "\\u", "for", "\\u", "name_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stream_", "=_", "Get", "Stream_", "(_", "self_", "._", "sd", "\\u", "identifier_", ",_", "self_", "._", "session_", ",_", "self_", "._", "session_", "._", "wallet_", ",_", "self_", "._", "lbr", "y", "\\u", "file", "\\u", "manager_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "key", "\\u", "fee_", "=_", "self_", "._", "max", "\\u", "key", "\\u", "fee_", ",_", "data\\u", "rate_", "=_", "self_", "._", "data\\u", "rate_", ",_", "timeout_", "=_", "timeout_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "download", "\\u", "directory_", "=_", "download", "\\u", "directory_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "\\u", "disp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "stream", "\\u", "info_", ":_", "stream_", "._", "start_", "(_", "stream", "\\u", "info_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "self_", "._", "\\u", "path", "\\u", "from", "\\u", "name_", "(_", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "check", "\\u", "history_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "lbr", "y", "\\u", "file_", ":_", "\\u", "get", "\\u", "stream_", "(_", "name_", ")_", "if_", "not_", "lbr", "y", "\\u", "file_", "else_", "\\u", "disp", "\\u", "file_", "(_", "lbr", "y", "\\u", "file_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "self_", "._", "\\u", "path", "\\u", "from", "\\u", "name_", "(_", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Errback_", "(_", "lambda_", "err_", ":_", "defer_", "._", "fail_", "(_", "NOT", "\\u", "FOUND_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "resolve", "\\u", "name_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "self_", "._", "session_", "._", "wallet_", "._", "get", "\\u", "stream", "\\u", "info", "\\u", "for", "\\u", "name_", "(_", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Errback_", "(_", "lambda_", "\\u_", ":_", "defer_", "._", "fail_", "(_", "Un", "know", "n", "Name", "Error_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "resolve", "\\u", "name", "\\u", "wc_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "self_", "._", "session_", "._", "wallet_", "._", "get", "\\u", "stream", "\\u", "info", "\\u", "for", "\\u", "name_", "(_", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Errback_", "(_", "lambda_", "\\u_", ":_", "defer_", "._", "fail_", "(_", "Un", "know", "n", "Name", "Error_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "callback_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "check", "\\u", "history_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u", "get", "\\u", "lbr", "y", "\\u", "file_", "(_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "open_", "(_", "path_", ",_", "'", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "json_", "._", "loads_", "(_", "f_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "file", "\\u", "name_", "=_", "l_", "[_", "'", "stream", "\\u", "name", "'_", "]_", "._", "decode_", "(_", "'", "hex", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "lbr", "y", "\\u", "file_", "in_", "self_", "._", "lbr", "y", "\\u", "file", "\\u", "manager_", "._", "lbr", "y", "\\u", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "lbr", "y", "\\u", "file_", "._", "stream", "\\u", "name_", "==_", "file", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "sys_", "._", "platform_", "==_", "\"", "dar", "win", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "session", "\\u", "settings_", "[_", "'", "default", "\\u", "download", "\\u", "director", "y", "'_", "]_", ",_", "lbr", "y", "\\u", "file_", "._", "stream", "\\u", "name_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "return_", "lbr", "y", "\\u", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "return_", "lbr", "y", "\\u", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "check_", "(_", "info_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stream", "\\u", "hash_", "=_", "info_", "[_", "'", "stream", "\\u", "hash", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "stream", "\\u", "hash_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stream", "\\u", "hash_", "=_", "stream", "\\u", "hash_", "[_", "'", "sd", "\\u", "hash", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "blob", "file", "\\u", "dir_", ",_", "stream", "\\u", "hash_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "\"[\"_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "\"]", " ", "Sear", "ch", " ", "for", " ", "lbr", "y", "\\u", "file", ",", " ", "return", "ing", ":", " ", "\"_", "+_", "stream", "\\u", "hash_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "defer_", "._", "succeed_", "(_", "\\u", "get", "\\u", "lbr", "y", "\\u", "file_", "(_", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "\"[\"_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "\"]", " ", "Sear", "ch", " ", "for", " ", "lbr", "y", "\\u", "file", " ", "did", "n", "'", "t", " ", "return", " ", "anyt", "hing", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "defer_", "._", "succeed_", "(_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "resolve", "\\u", "name_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "\\u", "check_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "callback_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "delete", "\\u", "lbr", "y", "\\u", "file_", "(_", "self_", ",_", "lbr", "y", "\\u", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "lbr", "y", "\\u", "file", "\\u", "manager_", "._", "delete", "\\u", "lbr", "y", "\\u", "file_", "(_", "lbr", "y", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "finish", "\\u", "deletion_", "(_", "lbr", "y", "\\u", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "lbr", "y", "\\u", "file_", "._", "delete", "\\u", "data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "\\u", "delete", "\\u", "stream", "\\u", "data_", "(_", "lbr", "y", "\\u", "file_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "delete", "\\u", "stream", "\\u", "data_", "(_", "lbr", "y", "\\u", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s", "\\u", "h_", "=_", "lbr", "y", "\\u", "file_", "._", "stream", "\\u", "hash_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "lbr", "y", "\\u", "file", "\\u", "manager_", "._", "get", "\\u", "count", "\\u", "for", "\\u", "stream", "\\u", "hash_", "(_", "s", "\\u", "h_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "coul", "d", " ", "possib", "ly", " ", "be", " ", "a", " ", "tim", "ing", " ", "issue", " ", "here_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "c_", ":_", "self_", "._", "stream", "\\u", "info", "\\u", "manager_", "._", "delete", "\\u", "stream_", "(_", "s", "\\u", "h_", ")_", "if_", "c_", "==_", "0_", "else_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "os_", "._", "remove_", "(_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "session", "\\u", "settings_", "[_", "'", "default", "\\u", "download", "\\u", "director", "y", "'_", "]_", ",_", "lbr", "y", "\\u", "file_", "._", "file", "\\u", "name_", ")_", ")_", "if_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "path_", "._", "isfile_", "(_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "session", "\\u", "settings_", "[_", "'", "default", "\\u", "download", "\\u", "director", "y", "'_", "]_", ",_", "lbr", "y", "\\u", "file_", "._", "file", "\\u", "name_", ")_", ")_", "else_", "defer_", "._", "succeed_", "(_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "finish", "\\u", "deletion_", "(_", "lbr", "y", "\\u", "file_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "path", "\\u", "from", "\\u", "name_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "check", "\\u", "history_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "lbr", "y", "\\u", "file_", ":_", "{_", "'", "stream", "\\u", "hash", "'_", ":_", "lbr", "y", "\\u", "file_", "._", "stream", "\\u", "hash_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "path", "'_", ":_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "session", "\\u", "settings_", "[_", "'", "default", "\\u", "download", "\\u", "director", "y", "'_", "]_", ",_", "lbr", "y", "\\u", "file_", "._", "file", "\\u", "name_", ")_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "lbr", "y", "\\u", "file_", "else_", "defer_", "._", "fail_", "(_", "Un", "know", "n", "Name", "Error_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "path", "\\u", "from", "\\u", "lbr", "y", "\\u", "file_", "(_", "self_", ",_", "lbr", "y", "\\u", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "lbr", "y", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "{_", "'", "stream", "\\u", "hash", "'_", ":_", "lbr", "y", "\\u", "file_", "._", "stream", "\\u", "hash_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "path", "'_", ":_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "session", "\\u", "settings_", "[_", "'", "default", "\\u", "download", "\\u", "director", "y", "'_", "]_", ",_", "lbr", "y", "\\u", "file_", "._", "file", "\\u", "name_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "defer_", "._", "succeed_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "defer_", "._", "fail_", "(_", "Un", "know", "n", "Name", "Error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "est", "\\u", "cost_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u", "check", "\\u", "est_", "(_", "d_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "d_", "._", "result_", ")_", "is_", "float_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "\"[\"_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "\"]", " ", "Cost", " ", "est", " ", "for", " ", "lbr", "y", "://\"_", "+_", "name_", "+_", "\":", " ", "\"_", "+_", "str_", "(_", "d_", "._", "result_", ")_", "+_", "\"", "LB", "C", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "\"[\"_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "\"]", " ", "Time", "out", " ", "estimati", "ng", " ", "cost", " ", "for", " ", "lbr", "y", "://\"_", "+_", "name_", "+_", "\",", " ", "usi", "ng", " ", "key", " ", "fe", "e", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "cancel_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "defer_", "._", "succeed_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "add", "\\u", "key", "\\u", "fee_", "(_", "data\\u", "cost_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "session_", "._", "wallet_", "._", "get", "\\u", "stream", "\\u", "info", "\\u", "for", "\\u", "name_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "info_", ":_", "data\\u", "cost_", "+_", "info_", "[_", "'", "key", "\\u", "fe", "e", "'_", "]_", "if_", "'", "key", "\\u", "fe", "e", "'_", "in_", "info_", "._", "keys_", "(_", ")_", "else_", "data\\u", "cost_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "self_", "._", "session_", "._", "wallet_", "._", "get", "\\u", "stream", "\\u", "info", "\\u", "for", "\\u", "name_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "info_", ":_", "info_", "[_", "'", "stream", "\\u", "hash", "'_", "]_", "if_", "isinstance_", "(_", "info_", "[_", "'", "stream", "\\u", "hash", "'_", "]_", ",_", "str_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "else_", "info_", "[_", "'", "stream", "\\u", "hash", "'_", "]_", "[_", "'", "sd", "\\u", "hash", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "sd", "\\u", "hash_", ":_", "download", "\\u", "sd", "\\u", "blob_", "(_", "self_", "._", "session_", ",_", "sd", "\\u", "hash_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "blob", "\\u", "request", "\\u", "pay", "ment", "\\u", "rate", "\\u", "manager_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "sd", "\\u", "identifier_", "._", "get", "\\u", "metadata", "\\u", "for", "\\u", "sd", "\\u", "blob_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "metadata_", ":_", "metadata_", "._", "validator_", "._", "info", "\\u", "to", "\\u", "show_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "info_", ":_", "int_", "(_", "dict_", "(_", "info_", ")_", "[_", "'", "stream", "\\u", "size", "'_", "]_", ")_", "/_", "1000000_", "*_", "self_", "._", "data\\u", "rate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "\\u", "add", "\\u", "key", "\\u", "fee_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Errback_", "(_", "lambda_", "\\u_", ":_", "\\u", "add", "\\u", "key", "\\u", "fee_", "(_", "0.0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reactor_", "._", "call", "Later_", "(_", "self_", "._", "search", "\\u", "timeout_", ",_", "\\u", "check", "\\u", "est_", ",_", "d_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "lbr", "y", "\\u", "files_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "f_", "in_", "self_", "._", "lbr", "y", "\\u", "file", "\\u", "manager_", "._", "lbr", "y", "\\u", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "f_", "._", "key_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "{_", "'", "complete", "d", "'_", ":_", "f_", "._", "completed_", ",_", "'", "file", "\\u", "name", "'_", ":_", "f_", "._", "file", "\\u", "name_", ",_", "'", "key", "'_", ":_", "binascii_", "._", "b2", "a", "\\u", "hex_", "(_", "f_", "._", "key_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "points", "\\u", "paid", "'_", ":_", "f_", "._", "points", "\\u", "paid", "_", ",_", "'", "stopp", "ed", "'_", ":_", "f_", "._", "stopped_", ",_", "'", "stream", "\\u", "hash", "'_", ":_", "f_", "._", "stream", "\\u", "hash_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "stream", "\\u", "name", "'_", ":_", "f_", "._", "stream", "\\u", "name_", ",_", "'", "suggested", "\\u", "file", "\\u", "name", "'_", ":_", "f_", "._", "suggested", "\\u", "file", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "upload", "\\u", "allow", "ed", "'_", ":_", "f_", "._", "upload", "\\u", "allowed_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "{_", "'", "complete", "d", "'_", ":_", "f_", "._", "completed_", ",_", "'", "file", "\\u", "name", "'_", ":_", "f_", "._", "file", "\\u", "name_", ",_", "'", "key", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "points", "\\u", "paid", "'_", ":_", "f_", "._", "points", "\\u", "paid", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "stopp", "ed", "'_", ":_", "f_", "._", "stopped_", ",_", "'", "stream", "\\u", "hash", "'_", ":_", "f_", "._", "stream", "\\u", "hash_", ",_", "'", "stream", "\\u", "name", "'_", ":_", "f_", "._", "stream", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "suggested", "\\u", "file", "\\u", "name", "'_", ":_", "f_", "._", "suggested", "\\u", "file", "\\u", "name_", ",_", "'", "upload", "\\u", "allow", "ed", "'_", ":_", "f_", "._", "upload", "\\u", "allowed_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "r_", "._", "append_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "render", "\\u", "response_", "(_", "self_", ",_", "result_", ",_", "code_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "defer_", "._", "succeed_", "(_", "{_", "'", "result", "'_", ":_", "result_", ",_", "'", "code", "'_", ":_", "code_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "is", "\\u", "running_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Check", " ", "if", " ", "lbr", "yne", "t", " ", "daemon", " ", "is", " ", "runn", "ing", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", " ", "true", " ", "if", " ", "daemon", " ", "complete", "d", " ", "start", "up", ",", " ", "other", "wis", "e", " ", "fal", "se", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "._", "info_", "(_", "\"[\"_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "\"]", " ", "is", "\\u", "runn", "ing", ":", " ", "\"_", "+_", "str_", "(_", "self_", "._", "announce", "d\\u", "startup_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "announce", "d\\u", "startup_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "True_", ",_", "OK", "\\u", "CODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "False_", ",_", "OK", "\\u", "CODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "daemon", "\\u", "status_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "lbr", "yne", "t", " ", "daemon", " ", "status", " ", "informati", "on", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "'", "status", "\\u", "message", "':", " ", "start", "up", " ", "status", " ", "message", "\\", "10", ";", " ", " ", " ", " ", "'", "status", "\\u", "code", "':", " ", "status", "\\u", "code", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "status", "\\u", "code", " ", "is", " ", "'", "load", "ing", "\\u", "walle", "t", "',", " ", "als", "o", " ", "contain", "s", " ", "key", " ", "'", "progress", "':", " ", "blockchain", " ", "catch", "up", " ", "progress", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "=_", "{_", "'", "code", "'_", ":_", "self_", "._", "start", "up", "\\u", "status_", "[_", "0_", "]_", ",_", "'", "message", "'_", ":_", "self_", "._", "start", "up", "\\u", "status_", "[_", "1_", "]_", ",_", "'", "progress", "'_", ":_", "None_", ",_", "'", "is", "\\u", "lag", "ging", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "start", "up", "\\u", "status_", "[_", "0_", "]_", "==_", "'", "load", "ing", "\\u", "walle", "t", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "[_", "'", "is", "\\u", "lag", "ging", "'_", "]_", "=_", "self_", "._", "session_", "._", "wallet_", "._", "is", "\\u", "lag", "ging", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "r_", "[_", "'", "is", "\\u", "lag", "ging", "'_", "]_", "==_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "[_", "'", "message", "'_", "]_", "=_", "\"", "Synchronization", " ", "with", " ", "the", " ", "blockchain", " ", "is", " ", "lag", "ging", "...", " ", "if", " ", "this", " ", "continue", "s", " ", "try", " ", "restart", "ing", " ", "LB", "RY", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "[_", "'", "message", "'_", "]_", "=_", "r_", "[_", "'", "message", "'_", "]_", "%_", "(_", "str_", "(_", "self_", "._", "session_", "._", "wallet_", "._", "blocks", "\\u", "beh", "ind", "\\u", "alert_", ")_", "+_", "\"", " ", "blocks", " ", "beh", "ind", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "r_", "[_", "'", "progress", "'_", "]_", "=_", "self_", "._", "session_", "._", "wallet_", "._", "catch", "up", "\\u", "progress_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "._", "info_", "(_", "\"[\"_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "\"]", " ", "daemon", " ", "status", ":", " ", "\"_", "+_", "str_", "(_", "r_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "r_", ",_", "OK", "\\u", "CODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "is", "\\u", "first", "\\u", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Check", " ", "if", " ", "this", " ", "is", " ", "the", " ", "first", " ", "time", " ", "lbr", "yne", "t", " ", "daemon", " ", "has", " ", "bee", "n", " ", "run", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Tru", "e", " ", "if", " ", "first", " ", "run", ",", " ", "other", "wis", "e", " ", "Fal", "se", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "._", "info_", "(_", "\"[\"_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "\"]", " ", "Check", " ", "if", " ", "is", " ", "first", " ", "run", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "session_", "._", "wallet_", "._", "is", "\\u", "first", "\\u", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "defer_", "._", "fail_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "._", "add", "Callbacks_", "(_", "lambda_", "r_", ":_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "r_", ",_", "OK", "\\u", "CODE_", ")_", ",_", "lambda_", "\\u_", ":_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "None_", ",_", "OK", "\\u", "CODE_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "get", "\\u", "start", "\\u", "notice_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "special", " ", "message", " ", "to", " ", "be", " ", "displaye", "d", " ", "at", " ", "start", "up", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Start", "up", " ", "message", ",", " ", "suc", "h", " ", "as", " ", "first", " ", "run", " ", "notification", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "._", "info_", "(_", "\"[\"_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "\"]", " ", "Get", " ", "start", "up", " ", "notice", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "first", "\\u", "run_", "and_", "not_", "self_", "._", "session_", "._", "wallet_", "._", "walle", "t", "\\u", "balance_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "self_", "._", "start", "up", "\\u", "message_", ",_", "OK", "\\u", "CODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "first", "\\u", "run_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "None_", ",_", "OK", "\\u", "CODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "self_", "._", "start", "up", "\\u", "message_", ",_", "OK", "\\u", "CODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "version_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "lbr", "y", " ", "version", " ", "informati", "on", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "\"", "platform", "\":", " ", "platform", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "\"", "os", "\\u", "release", "\":", " ", "os", " ", "release", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "\"", "os", "\\u", "system", "\":", " ", "os", " ", "name", "\\", "10", ";", " ", " ", " ", " ", "\"", "lbr", "yne", "t", "\\u", "version", ":", " ", "\":", " ", "lbr", "yne", "t", "\\u", "version", ",", "\\", "10", ";", " ", " ", " ", " ", "\"", "lbr", "yum", "\\u", "version", ":", " ", "\":", " ", "lbr", "yum", "\\u", "version", ",", "\\", "10", ";", " ", " ", " ", " ", "\"", "ui", "\\u", "version", "\":", " ", "commit", " ", "hash", " ", "of", " ", "ui", " ", "version", " ", "bei", "ng", " ", "used", "\\", "10", ";", " ", " ", " ", " ", "\"", "remote", "\\u", "lbr", "yne", "t", "\":", " ", "most", " ", "recent", " ", "lbr", "yne", "t", " ", "version", " ", "avail", "able", " ", "from", " ", "git", "hub", "\\", "10", ";", " ", " ", " ", " ", "\"", "remote", "\\u", "lbr", "yum", "\":", " ", "most", " ", "recent", " ", "lbr", "yum", " ", "version", " ", "avail", "able", " ", "from", " ", "git", "hub", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "msg_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "platform", "'_", ":_", "self_", "._", "platform", "\\u", "info_", "[_", "'", "platform", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "os", "\\u", "release", "'_", ":_", "self_", "._", "platform", "\\u", "info_", "[_", "'", "os", "\\u", "release", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "os", "\\u", "system", "'_", ":_", "self_", "._", "platform", "\\u", "info_", "[_", "'", "os", "\\u", "system", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lbr", "yne", "t", "\\u", "version", "'_", ":_", "lbr", "yne", "t", "\\u", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lbr", "yum", "\\u", "version", "'_", ":_", "lbr", "yum", "\\u", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ui", "\\u", "version", "'_", ":_", "self_", "._", "ui", "\\u", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "remote", "\\u", "lbr", "yne", "t", "'_", ":_", "self_", "._", "git", "\\u", "lbr", "yne", "t", "\\u", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "remote", "\\u", "lbr", "yum", "'_", ":_", "self_", "._", "git", "\\u", "lbr", "yum", "\\u", "version_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "._", "info_", "(_", "\"[\"_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "\"]", " ", "Get", " ", "version", " ", "info", ":", " ", "\"_", "+_", "json_", "._", "dumps_", "(_", "msg_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "msg_", ",_", "OK", "\\u", "CODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "get", "\\u", "settings_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "lbr", "yne", "t", " ", "daemon", " ", "settings", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "'", "run", "\\u", "on", "\\u", "start", "up", "':", " ", "bool", ",", "\\", "10", ";", " ", " ", " ", " ", "'", "data\\u", "rate", "':", " ", "float", ",", "\\", "10", ";", " ", " ", " ", " ", "'", "max", "\\u", "key", "\\u", "fe", "e", "':", " ", "float", ",", "\\", "10", ";", " ", " ", " ", " ", "'", "default", "\\u", "download", "\\u", "director", "y", "':", " ", "string", ",", "\\", "10", ";", " ", " ", " ", " ", "'", "max", "\\u", "upload", "':", " ", "float", ",", " ", "0.", "0", " ", "for", " ", "unlimited", "\\", "10", ";", " ", " ", " ", " ", "'", "max", "\\u", "download", "':", " ", "float", ",", " ", "0.", "0", " ", "for", " ", "unlimited", "\\", "10", ";", " ", " ", " ", " ", "'", "upload", "\\u", "log", "':", " ", "bool", ",", "\\", "10", ";", " ", " ", " ", " ", "'", "search", "\\u", "timeo", "ut", "':", " ", "float", ",", "\\", "10", ";", " ", " ", " ", " ", "'", "max", "\\u", "search", "\\u", "results", "':", " ", "int", ",", "\\", "10", ";", " ", " ", " ", " ", "'", "walle", "t", "\\u", "type", "':", " ", "string", ",", "\\", "10", ";", " ", " ", " ", " ", "'", "delete", "\\u", "blobs", "\\u", "on", "\\u", "remove", "':", " ", "bool", ",", "\\", "10", ";", " ", " ", " ", " ", "'", "peer", "\\u", "port", "':", " ", "int", ",", "\\", "10", ";", " ", " ", " ", " ", "'", "dht", "\\u", "node", "\\u", "port", "':", " ", "int", ",", "\\", "10", ";", " ", " ", " ", " ", "'", "use", "\\u", "upnp", "':", " ", "bool", ",", "\\", "10", ";", " ", " ", " ", " ", "'", "start", "\\u", "lbr", "yc", "rd", "d", "':", " ", "bool", ",", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "._", "info_", "(_", "\"[\"_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "\"]", " ", "Get", " ", "daemon", " ", "settings", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "self_", "._", "session", "\\u", "settings_", ",_", "OK", "\\u", "CODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "set\\u", "settings_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", " ", "lbr", "yne", "t", " ", "daemon", " ", "settings", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "'", "run", "\\u", "on", "\\u", "start", "up", "':", " ", "bool", ",", "\\", "10", ";", " ", " ", " ", " ", "'", "data\\u", "rate", "':", " ", "float", ",", "\\", "10", ";", " ", " ", " ", " ", "'", "max", "\\u", "key", "\\u", "fe", "e", "':", " ", "float", ",", "\\", "10", ";", " ", " ", " ", " ", "'", "default", "\\u", "download", "\\u", "director", "y", "':", " ", "string", ",", "\\", "10", ";", " ", " ", " ", " ", "'", "max", "\\u", "upload", "':", " ", "float", ",", " ", "0.", "0", " ", "for", " ", "unlimited", "\\", "10", ";", " ", " ", " ", " ", "'", "max", "\\u", "download", "':", " ", "float", ",", " ", "0.", "0", " ", "for", " ", "unlimited", "\\", "10", ";", " ", " ", " ", " ", "'", "upload", "\\u", "log", "':", " ", "bool", ",", "\\", "10", ";", " ", " ", " ", " ", "'", "search", "\\u", "timeo", "ut", "':", " ", "float", ",", "\\", "10", ";", " ", " ", " ", " ", "'", "max", "\\u", "search", "\\u", "results", "':", " ", "int", ",", "\\", "10", ";", " ", " ", " ", " ", "'", "walle", "t", "\\u", "type", "':", " ", "string", ",", "\\", "10", ";", " ", " ", " ", " ", "'", "delete", "\\u", "blobs", "\\u", "on", "\\u", "remove", "':", " ", "bool", ",", "\\", "10", ";", " ", " ", " ", " ", "'", "peer", "\\u", "port", "':", " ", "int", ",", "\\", "10", ";", " ", " ", " ", " ", "'", "dht", "\\u", "node", "\\u", "port", "':", " ", "int", ",", "\\", "10", ";", " ", " ", " ", " ", "'", "use", "\\u", "upnp", "':", " ", "bool", ",", "\\", "10", ";", " ", " ", " ", " ", "'", "start", "\\u", "lbr", "yc", "rd", "d", "':", " ", "bool", ",", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "settings", " ", "dict", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "log", "\\u", "settings", "\\u", "change_", "(_", "params_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "\"[\"_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "\"]", " ", "Set", " ", "daemon", " ", "settings", " ", "to", " ", "\"_", "+_", "str_", "(_", "params_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "update", "\\u", "settings_", "(_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "\\u", "log", "\\u", "settings", "\\u", "change_", "(_", "p_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "self_", "._", "session", "\\u", "settings_", ",_", "OK", "\\u", "CODE_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "help_", "(_", "self_", ",_", "p_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Function", " ", "to", " ", "retrieve", " ", "docstr", "ing", " ", "for", " ", "API", " ", "function", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "option", "al", " ", "'", "function", "':", " ", "function", " ", "to", " ", "retrieve", " ", "documentation", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "option", "al", " ", "'", "callable\\u", "dur", "ing", "\\u", "start", "up", "':", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "give", "n", " ", "a", " ", "function", ",", " ", "return", "s", " ", "give", "n", " ", "documentation", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "give", "n", " ", "callable\\u", "dur", "ing", "\\u", "start", "up", " ", "flag", ",", " ", "return", "s", " ", "list", " ", "of", " ", "function", "s", " ", "calla", "ble", " ", "dur", "ing", " ", "the", " ", "start", "up", " ", "sequence", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "no", " ", "params", " ", "are", " ", "give", "n", ",", " ", "return", "s", " ", "the", " ", "list", " ", "of", " ", "calla", "ble", " ", "function", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "p_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "self_", "._", "\\u", "list", "Functions_", "(_", ")_", ",_", "OK", "\\u", "CODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'", "callable\\u", "dur", "ing", "\\u", "start", "'_", "in_", "p_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "ALLOWED", "\\u", "DU", "RING", "\\u", "START", "UP_", ",_", "OK", "\\u", "CODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'", "function", "'_", "in_", "p_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "func", "\\u", "path_", "=_", "p_", "[_", "'", "function", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "function_", "=_", "self_", "._", "\\u", "get", "Function_", "(_", "func", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "function_", "._", "\\u\\u", "doc\\u\\u_", ",_", "OK", "\\u", "CODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "self_", "._", "jsonrpc", "\\u", "help_", "._", "\\u\\u", "doc\\u\\u_", ",_", "OK", "\\u", "CODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "start", "\\u", "fetcher_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Start", " ", "automati", "call", "y", " ", "download", "ing", " ", "new", " ", "name", " ", "claim", "s", " ", "as", " ", "the", "y", " ", "occur", " ", "(", "off", " ", "by", " ", "default", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "confirmation", " ", "message", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fetcher_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "'['_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "']", " ", "Start", " ", "autof", "etch", "er", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".\\u", "log", "\\u", "to", "\\u", "slac", "k", "('", "['", " ", "+", " ", "str", "(", "datetime", ".", "now", "())", " ", "+", " ", "']", " ", "Start", " ", "autof", "etch", "er", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "\"", "Start", "ed", " ", "autof", "etch", "ing", " ", "claim", "s", "\"_", ",_", "OK", "\\u", "CODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "stop", "\\u", "fetcher_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Sto", "p", " ", "automati", "call", "y", " ", "download", "ing", " ", "new", " ", "name", " ", "claim", "s", " ", "as", " ", "the", "y", " ", "occur", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "confirmation", " ", "message", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fetcher_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "'['_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "']", " ", "Sto", "p", " ", "autof", "etch", "er", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "\"", "Stopp", "ed", " ", "autof", "etch", "ing", " ", "claim", "s", "\"_", ",_", "OK", "\\u", "CODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "fetch", "er", "\\u", "status_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "fetch", "er", " ", "status", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Tru", "e", "/", "Fal", "se", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "._", "info_", "(_", "\"[\"_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "\"]", " ", "Get", " ", "fetch", "er", " ", "status", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "self_", "._", "fetcher_", "._", "check", "\\u", "if", "\\u", "running_", "(_", ")_", ",_", "OK", "\\u", "CODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "get", "\\u", "balance_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "balance", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "balance", ",", " ", "float", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "._", "info_", "(_", "\"[\"_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "\"]", " ", "Get", " ", "balance", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "float_", "(_", "self_", "._", "session_", "._", "wallet_", "._", "walle", "t", "\\u", "balance_", ")_", ",_", "OK", "\\u", "CODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "stop_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Sto", "p", " ", "lbr", "yne", "t", "-", "daemon", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "shut", "down", " ", "message", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "disp", "\\u", "shutdown_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "\"", "Shutt", "ing", " ", "down", " ", "lbr", "yne", "t", " ", "daemon", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "shutdown_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "\\u", "disp", "\\u", "shutdown_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "reactor_", "._", "call", "Later_", "(_", "1.0_", ",_", "reactor_", "._", "stop_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "\"", "Shutt", "ing", " ", "down", "\"_", ",_", "OK", "\\u", "CODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "get", "\\u", "lbr", "y", "\\u", "files_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "LB", "RY", " ", "files", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "List", " ", "of", " ", "lbr", "y", " ", "files", ":", "\\", "10", ";", " ", " ", " ", " ", "'", "complete", "d", "':", " ", "bool", "\\", "10", ";", " ", " ", " ", " ", "'", "file", "\\u", "name", "':", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "'", "key", "':", " ", "hex", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "'", "points", "\\u", "paid", "':", " ", "float", "\\", "10", ";", " ", " ", " ", " ", "'", "stopp", "ed", "':", " ", "bool", "\\", "10", ";", " ", " ", " ", " ", "'", "stream", "\\u", "hash", "':", " ", "base", " ", "5", "8", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "'", "stream", "\\u", "name", "':", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "'", "suggested", "\\u", "file", "\\u", "name", "':", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "'", "upload", "\\u", "allow", "ed", "':", " ", "bool", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "=_", "self_", "._", "\\u", "get", "\\u", "lbr", "y", "\\u", "files_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "\"[\"_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "\"]", " ", "Get", " ", "LB", "RY", " ", "files", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "r_", ",_", "OK", "\\u", "CODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "resolve", "\\u", "name_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Resolv", "e", " ", "stream", " ", "info", " ", "from", " ", "a", " ", "LB", "RY", " ", "uri", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "'", "name", "':", " ", "name", " ", "to", " ", "look", " ", "up", ",", " ", "string", ",", " ", "do", " ", "not", " ", "include", " ", "lbr", "y", "://", " ", "prefix", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "metadata", " ", "from", " ", "name", " ", "claim", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "name", "'_", "in_", "p_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "p_", "[_", "'", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "None_", ",_", "BAD", "\\u", "REQUEST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "disp_", "(_", "info_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stream", "\\u", "hash_", "=_", "info_", "[_", "'", "stream", "\\u", "hash", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "stream", "\\u", "hash_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stream", "\\u", "hash_", "=_", "stream", "\\u", "hash_", "[_", "'", "sd", "\\u", "hash", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "._", "info_", "(_", "\"[\"_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "\"]", " ", "Resolved", " ", "info", ":", " ", "\"_", "+_", "stream", "\\u", "hash_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "info_", ",_", "OK", "\\u", "CODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "resolve", "\\u", "name_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callbacks_", "(_", "\\u", "disp_", ",_", "lambda_", "\\u_", ":_", "server_", "._", "failure_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "callback_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "get_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Down", "load", " ", "stream", " ", "from", " ", "a", " ", "LB", "RY", " ", "uri", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "'", "name", "':", " ", "name", " ", "to", " ", "download", ",", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "option", "al", " ", "'", "download", "\\u", "director", "y", "':", " ", "path", " ", "to", " ", "director", "y", " ", "where", " ", "file", " ", "will", " ", "be", " ", "saved", ",", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "'", "stream", "\\u", "hash", "':", " ", "hex", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "'", "path", "':", " ", "path", " ", "of", " ", "download", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "timeo", "ut", "'_", "not_", "in_", "p_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "timeout_", "=_", "DEF", "AUL", "T", "\\u", "TIMEOUT_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "timeout_", "=_", "p_", "[_", "'", "timeo", "ut", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "download", "\\u", "director", "y", "'_", "not_", "in_", "p_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "download", "\\u", "directory_", "=_", "self_", "._", "session", "\\u", "settings_", "[_", "'", "default", "\\u", "download", "\\u", "director", "y", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "download", "\\u", "directory_", "=_", "p_", "[_", "'", "download", "\\u", "director", "y", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "name", "'_", "in_", "p_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "p_", "[_", "'", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "download", "\\u", "name_", "(_", "name_", "=_", "name_", ",_", "timeout_", "=_", "timeout_", ",_", "download", "\\u", "directory_", "=_", "download", "\\u", "directory_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callbacks_", "(_", "lambda_", "message_", ":_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "message_", ",_", "OK", "\\u", "CODE_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lambda_", "err_", ":_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "'", "error", "'_", ",_", "NOT", "\\u", "FOUND_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "'", "error", "'_", ",_", "BAD", "\\u", "REQUEST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "search", "\\u", "name", "trie_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Sear", "ch", " ", "the", " ", "name", "trie", " ", "for", " ", "claim", "s", " ", "beginn", "ing", " ", "with", " ", "search", " ", "(", "ye", "s", ",", " ", "this", " ", "is", " ", "a", " ", "dumb", " ", "search", ",", " ", "it", "'", "ll", " ", "be", " ", "made", " ", "bett", "er", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "'", "search", "':", " ", "search", " ", "query", ",", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "List", " ", "of", " ", "search", " ", "results", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "search", "'_", "in_", "p_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "search_", "=_", "p_", "[_", "'", "search", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "None_", ",_", "BAD", "\\u", "REQUEST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "clean_", "(_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "n_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "i_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "i_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "0_", "]_", "and_", "i_", "[_", "1_", "]_", "[_", "1_", "]_", "[_", "0_", "]_", "and_", "i_", "[_", "1_", "]_", "[_", "2_", "]_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "i_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "1_", "]_", "[_", "'", "value", "'_", "]_", "=_", "str_", "(_", "i_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "1_", "]_", "[_", "'", "value", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "i_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "1_", "]_", ",_", "i_", "[_", "1_", "]_", "[_", "1_", "]_", "[_", "1_", "]_", ",_", "i_", "[_", "1_", "]_", "[_", "2_", "]_", "[_", "1_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "resolve", "\\u", "claims_", "(_", "claims_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ds_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "claim_", "in_", "claims_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d1_", "=_", "defer_", "._", "succeed_", "(_", "claim_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d2_", "=_", "self_", "._", "\\u", "resolve", "\\u", "name", "\\u", "wc_", "(_", "claim_", "[_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d3_", "=_", "self_", "._", "\\u", "get", "\\u", "est", "\\u", "cost_", "(_", "claim_", "[_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dl_", "=_", "defer_", "._", "Defe", "rre", "d", "List_", "(_", "[_", "d1_", ",_", "d2_", ",_", "d3_", "]_", ",_", "consume", "Errors_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ds_", "._", "append_", "(_", "dl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "defer_", "._", "Defe", "rre", "d", "List_", "(_", "ds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "disp_", "(_", "results_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "'['_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "']", " ", "Foun", "d", " ", "'_", "+_", "str_", "(_", "len_", "(_", "results_", ")_", ")_", "+_", "'", " ", "search", " ", "results", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "consolidat", "ed", "\\u", "results_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "r_", "in_", "results_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "update_", "(_", "r_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "name", "'_", "in_", "r_", "[_", "1_", "]_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "r_", "[_", "1_", "]_", "[_", "'", "stream", "\\u", "name", "'_", "]_", "=_", "r_", "[_", "1_", "]_", "[_", "'", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "r_", "[_", "1_", "]_", "[_", "'", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "t_", "._", "update_", "(_", "r_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "[_", "'", "cost", "\\u", "est", "'_", "]_", "=_", "r_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "consolidat", "ed", "\\u", "results_", "._", "append_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "log", ".", "info", "(", "str", "(", "t", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "consolidat", "ed", "\\u", "results_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "._", "info_", "(_", "'['_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "']", " ", "Sear", "ch", " ", "name", "trie", ":", " ", "'_", "+_", "search_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "=_", "self_", "._", "session_", "._", "wallet_", "._", "get", "\\u", "name", "trie_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "trie_", ":_", "[_", "claim_", "for_", "claim_", "in_", "trie_", "if_", "claim_", "[_", "'", "name", "'_", "]_", "._", "startswith_", "(_", "search_", ")_", "and_", "'", "txi", "d", "'_", "in_", "claim_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "claims_", ":_", "claims_", "[_", ":_", "self_", "._", "max", "\\u", "search", "\\u", "results_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "resolve", "\\u", "claims_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "\\u", "clean_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "\\u", "disp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "results_", ":_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "results_", ",_", "OK", "\\u", "CODE_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "delete", "\\u", "lbr", "y", "\\u", "file_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Delete", " ", "a", " ", "lbr", "y", " ", "file", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "'", "file", "\\u", "name", "':", " ", "download", "ed", " ", "file", " ", "name", ",", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "confirmation", " ", "message", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "disp_", "(_", "file", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "\"[\"_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "\"]", " ", "Delete", "d", ":", " ", "\"_", "+_", "file", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "\"", "Delete", "d", ":", " ", "\"_", "+_", "file", "\\u", "name_", ",_", "OK", "\\u", "CODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\"", "file", "\\u", "name", "\"_", "in_", "p_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lbr", "y", "\\u", "files_", "=_", "[_", "self_", "._", "\\u", "delete", "\\u", "lbr", "y", "\\u", "file_", "(_", "f_", ")_", "for_", "f_", "in_", "self_", "._", "lbr", "y", "\\u", "file", "\\u", "manager_", "._", "lbr", "y", "\\u", "files_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "p_", "[_", "'", "file", "\\u", "name", "'_", "]_", "==_", "f_", "._", "file", "\\u", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "defer_", "._", "Defe", "rre", "d", "List_", "(_", "lbr", "y", "\\u", "files_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "\\u", "disp_", "(_", "p_", "[_", "'", "file", "\\u", "name", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "publish_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Make", " ", "a", " ", "new", " ", "name", " ", "claim", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "'", "name", "':", " ", "name", " ", "to", " ", "be", " ", "claimed", ",", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "'", "file", "\\u", "path", "':", " ", "path", " ", "to", " ", "file", " ", "to", " ", "be", " ", "associate", "d", " ", "with", " ", "name", ",", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "'", "bid", "':", " ", "amo", "unt", " ", "of", " ", "credits", " ", "to", " ", "commit", " ", "in", " ", "this", " ", "claim", ",", " ", "float", "\\", "10", ";", " ", " ", " ", " ", "option", "al", " ", "'", "author", "':", " ", "author", ",", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "option", "al", " ", "'", "title", "':", " ", "title", ",", " ", "description", "\\", "10", ";", " ", " ", " ", " ", "option", "al", " ", "'", "description", "':", " ", "content", " ", "description", ",", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "option", "al", " ", "'", "thumbnail", "':", " ", "thumbnail", " ", "image", " ", "url", "\\", "10", ";", " ", " ", " ", " ", "option", "al", " ", "'", "key", "\\u", "fe", "e", "':", " ", "key", " ", "fe", "e", " ", "to", " ", "be", " ", "paid", " ", "to", " ", "publi", "sher", ",", " ", "float", " ", "(", "default", " ", "0.", "0", ")", "\\", "10", ";", " ", " ", " ", " ", "option", "al", " ", "'", "key", "\\u", "fe", "e\\u", "address", "':", " ", "address", " ", "for", " ", "key", " ", "fe", "e", " ", "to", " ", "be", " ", "sent", " ", "to", ",", " ", "string", " ", "(", "default", "s", " ", "on", " ", "new", " ", "address", ")", "\\", "10", ";", " ", " ", " ", " ", "option", "al", " ", "'", "content", "\\u", "license", "':", " ", "content", " ", "license", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "option", "al", " ", "'", "source", "s", "':", " ", "alternative", " ", "source", "s", " ", "dict", ",", " ", "keys", " ", "'", "lbr", "y", "\\u", "sd", "\\u", "hash", "',", " ", "'", "bt", "ih", "',", " ", "'", "url", "'", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Confirmation", " ", "message", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "metadata", "\\u", "fields_", "=_", "[_", "\"", "name", "\"_", ",_", "\"", "file", "\\u", "path", "\"_", ",_", "\"", "bid", "\"_", ",_", "\"", "author", "\"_", ",_", "\"", "title", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "description", "\"_", ",_", "\"", "thumbnail", "\"_", ",_", "\"", "key", "\\u", "fe", "e", "\"_", ",_", "\"", "key", "\\u", "fe", "e\\u", "address", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "content", "\\u", "license", "\"_", ",_", "\"", "source", "s", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "k_", "in_", "metadata", "\\u", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "k_", "not_", "in_", "p_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "k_", "]_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pub_", "=_", "Publisher_", "(_", "self_", "._", "session_", ",_", "self_", "._", "lbr", "y", "\\u", "file", "\\u", "manager_", ",_", "self_", "._", "session_", "._", "wallet_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "=_", "pub_", "._", "start_", "(_", "p_", "[_", "'", "name", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "[_", "'", "file", "\\u", "path", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "[_", "'", "bid", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "title_", "=_", "p_", "[_", "'", "title", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "p_", "[_", "'", "description", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "thumbnail_", "=_", "p_", "[_", "'", "thumbnail", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "key", "\\u", "fee_", "=_", "p_", "[_", "'", "key", "\\u", "fe", "e", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "key", "\\u", "fe", "e\\u", "address_", "=_", "p_", "[_", "'", "key", "\\u", "fe", "e\\u", "address", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "content", "\\u", "license_", "=_", "p_", "[_", "'", "content", "\\u", "license", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "author_", "=_", "p_", "[_", "'", "author", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sources_", "=_", "p_", "[_", "'", "source", "s", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "._", "add", "Callbacks_", "(_", "lambda_", "msg_", ":_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "msg_", ",_", "OK", "\\u", "CODE_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lambda_", "err_", ":_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "err_", "._", "get", "Trace", "back_", "(_", ")_", ",_", "BAD", "\\u", "REQUEST_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "aband", "on", "\\u", "name_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Ab", "ando", "n", " ", "a", " ", "name", " ", "and", " ", "recl", "aim", " ", "credits", " ", "from", " ", "the", " ", "claim", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "'", "txi", "d", "':", " ", "txi", "d", " ", "of", " ", "claim", ",", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "Return", ":", "\\", "10", ";", " ", " ", " ", " ", "Confirmation", " ", "message", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "txi", "d", "'_", "in_", "p_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "txid_", "=_", "p_", "[_", "'", "txi", "d", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "server_", "._", "failure_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "disp_", "(_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "\"[\"_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "\"]", " ", "Ab", "ando", "ned", " ", "name", " ", "claim", " ", "tx", " ", "\"_", "+_", "str_", "(_", "x_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "x_", ",_", "OK", "\\u", "CODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "self_", "._", "session_", "._", "wallet_", "._", "aband", "on", "\\u", "name_", "(_", "txid_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "\\u", "disp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "callback_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "get", "\\u", "name", "\\u", "claims_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "my", " ", "name", " ", "claim", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", "\\", "10", ";", " ", " ", " ", " ", "list", " ", "of", " ", "name", " ", "claim", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "clean_", "(_", "claims_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "c_", "in_", "claims_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "k_", "in_", "c_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "isinstance_", "(_", "c_", "[_", "k_", "]_", ",_", "Decimal_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "c_", "[_", "k_", "]_", "=_", "float_", "(_", "c_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "defer_", "._", "succeed_", "(_", "claims_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "self_", "._", "session_", "._", "wallet_", "._", "get", "\\u", "name", "\\u", "claims_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "\\u", "clean_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "claims_", ":_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "claims_", ",_", "OK", "\\u", "CODE_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "get", "\\u", "time", "\\u", "beh", "ind", "\\u", "blockchain", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "number", " ", "of", " ", "blocks", " ", "beh", "ind", " ", "the", " ", "blockchain", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "number", " ", "of", " ", "blocks", " ", "beh", "ind", " ", "blockchain", ",", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "get", "\\u", "time", "\\u", "beh", "ind_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "local", "\\u", "height_", "=_", "self_", "._", "session_", "._", "wallet_", "._", "network_", "._", "get", "\\u", "local", "\\u", "height_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "remote", "\\u", "height_", "=_", "self_", "._", "session_", "._", "wallet_", "._", "network_", "._", "get", "\\u", "server", "\\u", "height_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "defer_", "._", "succeed_", "(_", "remote", "\\u", "height_", "-_", "local", "\\u", "height_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "defer_", "._", "fail_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "\\u", "get", "\\u", "time", "\\u", "beh", "ind_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "r_", ":_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "r_", ",_", "OK", "\\u", "CODE_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "get", "\\u", "new", "\\u", "address_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Generate", " ", "a", " ", "new", " ", "walle", "t", " ", "address", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "new", " ", "walle", "t", " ", "address", ",", " ", "base", " ", "5", "8", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "disp_", "(_", "address_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "\"[\"_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "\"]", " ", "Got", " ", "new", " ", "walle", "t", " ", "address", ":", " ", "\"_", "+_", "address_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "defer_", "._", "succeed_", "(_", "address_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "self_", "._", "session_", "._", "wallet_", "._", "get", "\\u", "new", "\\u", "address_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "\\u", "disp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "address_", ":_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "address_", ",_", "OK", "\\u", "CODE_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "toggle", "\\u", "fetch", "er", "\\u", "verbose_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Toggle", " ", "fetch", "er", " ", "verbo", "se", " ", "mode", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Fetche", "r", " ", "verbo", "se", " ", "status", ",", " ", "bool", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "fetcher_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fetcher_", "._", "verbose_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fetcher_", "._", "verbose_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "self_", "._", "fetcher_", "._", "verbose_", ",_", "OK", "\\u", "CODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "check", "\\u", "for", "\\u", "new", "\\u", "version_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Check", "s", " ", "local", " ", "version", " ", "against", " ", "version", "s", " ", "in", " ", "\\u\\u", "init", "\\u\\u", ".", "py", " ", "and", " ", "version", ".", "py", " ", "in", " ", "the", " ", "lbr", "yne", "t", " ", "and", " ", "lbr", "yum", " ", "repos", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "true", "/", "fal", "se", ",", " ", "true", " ", "meaning", " ", "tha", "t", " ", "there", " ", "is", " ", "a", " ", "new", " ", "version", " ", "avail", "able", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "check", "\\u", "version_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "lbr", "yne", "t", "\\u", "version_", ">=_", "self_", "._", "git", "\\u", "lbr", "yne", "t", "\\u", "version_", ")_", "and_", "(_", "lbr", "yum", "\\u", "version_", ">=_", "self_", "._", "git", "\\u", "lbr", "yum", "\\u", "version_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "\"[\"_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "\"]", " ", "Up", " ", "to", " ", "date", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "False_", ",_", "OK", "\\u", "CODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "\"[\"_", "+_", "str_", "(_", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "\"]", " ", "Update", "s", " ", "avail", "able", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "True_", ",_", "OK", "\\u", "CODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u", "check", "\\u", "version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Daemon_", "(_", "jsonrpc", "_", "._", "JSONR", "PC_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jsonrpc", "\\u", "upload", "\\u", "log_", "(_", "self_", ",_", "p_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "p_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "name", "\\u", "prefix", "'_", "in_", "p_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prefix_", "=_", "p_", "[_", "'", "name", "\\u", "prefix", "'_", "]_", "+_", "'\\u", "api", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prefix_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "exclu", "de", "\\u", "previ", "ous", "'_", "in_", "p_", "._", "keys_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exclu", "de", "\\u", "previous_", "=_", "p_", "[_", "'", "exclu", "de", "\\u", "previ", "ous", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exclu", "de", "\\u", "previous_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prefix_", "=_", "\"", "api", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exclu", "de", "\\u", "previous_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "upload", "\\u", "log_", "(_", "name", "\\u", "prefix_", "=_", "prefix_", ",_", "exclu", "de", "\\u", "previous_", "=_", "exclu", "de", "\\u", "previous_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "\\u_", ":_", "self_", "._", "\\u", "render", "\\u", "response_", "(_", "True_", ",_", "OK", "\\u", "CODE_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "LB", "RY", "Da", "emo", "n", "Command", "Handler_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Da", "emo", "n", "Command", "Handler_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "command_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "api_", "=_", "jsonrpc", "_", "._", "Proxy_", "(_", "API", "\\u", "CONNECTION", "\\u", "STRING_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "command_", "=_", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "Da", "emo", "n", "Command", "Handler_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "self_", ",_", "params_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "params_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "api_", "._", "call", "Remote_", "(_", "self_", "._", "command_", ",_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "\\u", "api_", "._", "call", "Remote_", "(_", "self_", "._", "command_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "LB", "RY", "index_", "(_", "resource_", "._", "Resource_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "is", "Leaf_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "index_", "(_", "resource_", "._", "Resource_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "ui", "\\u", "dir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resource_", "._", "Resource_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ui", "\\u", "dir_", "=_", "ui", "\\u", "dir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "index_", "(_", "resource_", "._", "Resource_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "delayed", "\\u", "render_", "(_", "self_", ",_", "request_", ",_", "results_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "._", "write_", "(_", "str_", "(_", "results_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "finish_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "index_", "(_", "resource_", "._", "Resource_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Child_", "(_", "self_", ",_", "name_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "name_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "resource_", "._", "Resource_", "._", "get", "Child_", "(_", "self_", ",_", "name_", ",_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "index_", "(_", "resource_", "._", "Resource_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "render", "\\u", "GET_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "static_", "._", "File_", "(_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "ui", "\\u", "dir_", ",_", "\"", "index", ".", "html", "\"_", ")_", ")_", "._", "render", "\\u", "GET_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "LB", "RY", "File", "Render_", "(_", "resource_", "._", "Resource_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "is", "Leaf_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "LB", "RY", "File", "Render_", "(_", "resource_", "._", "Resource_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "render", "\\u", "GET_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "name", "'_", "in_", "request_", "._", "args_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "api_", "=_", "jsonrpc", "_", "._", "Proxy_", "(_", "API", "\\u", "CONNECTION", "\\u", "STRING_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "request_", "._", "args_", "[_", "'", "name", "'_", "]_", "[_", "0_", "]_", "!=_", "'", "lbr", "y", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "api_", "._", "call", "Remote_", "(_", "\"", "get", "\"_", ",_", "{_", "'", "name", "'_", ":_", "request_", "._", "args_", "[_", "'", "name", "'_", "]_", "[_", "0_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "lambda_", "results_", ":_", "static_", "._", "File_", "(_", "results_", "[_", "'", "path", "'_", "]_", ")_", "._", "render", "\\u", "GET_", "(_", "request_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "._", "redirect_", "(_", "UI", "\\u", "ADDRESS_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "finish_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "server_", "._", "NOT", "\\u", "DON", "E", "\\u", "YE", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "server_", "._", "failure_" ]
[ 4, 4, 4, 4, 4, 2, 2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 2, 2, 2, 2, 2, 2, 2 ]
Unused import
PyHDI/Pyverilog/tests/dataflow_test/test_dat_case_in_func.py
[ { "content": "from __future__ import absolute_import\nfrom __future__ import print_function\nimport os\nimport sys\nfrom pyverilog.dataflow.dataflow_analyzer import VerilogDataflowAnalyzer\nfrom pyverilog.dataflow.optimizer import VerilogDataflowOptimizer\nfrom pyverilog.controlflow.controlflow_analyzer import VerilogControlflowAnalyzer\n\ncodedir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/verilogcode/'\n\nexpected = \"\"\"\\\nTOP.IN1: TOP_IN1\nTOP.SEL: TOP_SEL\nTOP.bit: (((TOP_SEL=='d0))? TOP_IN1 : 1'd0)\nTOP.md_always0.al_block0.al_functioncall0._rn0_func1: TOP_IN1\nTOP.md_always0.al_block0.al_functioncall0._rn1_func1: 1'd0\nTOP.md_always0.al_block0.al_functioncall0.func1: (((TOP_SEL=='d0))? TOP_IN1 : 1'd0)\nTOP.md_always0.al_block0.al_functioncall0.in1: TOP_IN1\nTOP.md_always0.al_block0.al_functioncall0.sel: TOP_SEL\n\"\"\"\n\n\nif __name__ == '__main__':\n test()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def test():\n filelist = [codedir + 'case_in_func.v']\n topmodule = 'TOP'\n noreorder = False\n nobind = False\n include = None\n define = None\n\n analyzer = VerilogDataflowAnalyzer(filelist, topmodule,\n noreorder=noreorder,\n nobind=nobind,\n preprocess_include=include,\n preprocess_define=define)\n analyzer.generate()\n\n directives = analyzer.get_directives()\n instances = analyzer.getInstances()\n terms = analyzer.getTerms()\n binddict = analyzer.getBinddict()\n\n optimizer = VerilogDataflowOptimizer(terms, binddict)\n optimizer.resolveConstant()\n\n c_analyzer = VerilogControlflowAnalyzer(topmodule, terms,\n binddict,\n resolved_terms=optimizer.getResolvedTerms(),\n resolved_binddict=optimizer.getResolvedBinddict(),\n constlist=optimizer.getConstlist()\n )\n\n output = []\n for tk in sorted(c_analyzer.resolved_terms.keys(), key=lambda x:str(x)):\n tree = c_analyzer.makeTree(tk)\n output.append(str(tk) + ': ' + tree.tocode())\n\n rslt = '\\n'.join(output) + '\\n'\n\n print(rslt)\n \n assert(expected == rslt)", "metadata": "root.test", "header": "['module', '___EOS___']", "index": 21 } ]
[ { "span": "import sys", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 10 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "abs", "olute", "\\u", "import_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "print", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyv", "eri", "log_", "._", "dataflow", "_", "._", "dataflow", "\\u", "analyzer_", "import_", "Veri", "log", "Dataf", "low", "Analyzer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyv", "eri", "log_", "._", "dataflow", "_", "._", "optimizer_", "import_", "Veri", "log", "Dataf", "low", "Optimizer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyv", "eri", "log_", "._", "control", "flow_", "._", "control", "flow", "\\u", "analyzer_", "import_", "Veri", "log", "Control", "flow", "Analyzer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "code", "dir_", "=_", "os_", "._", "path_", "._", "dirname_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "os_", "._", "path_", "._", "abspath_", "(_", "\\u\\u", "file\\u\\u_", ")_", ")_", ")_", ")_", "+_", "'/", "veri", "logc", "ode", "/'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "\"\"\"", "\\\\", "\\", "10", ";", "TOP", ".", "IN", "1", ":", " ", "TOP", "\\u", "IN", "1", "\\", "10", ";", "TOP", ".", "SEL", ":", " ", "TOP", "\\u", "SEL", "\\", "10", ";", "TOP", ".", "bit", ":", " ", "(((", "TOP", "\\u", "SEL", "=='", "d0", "))", "?", " ", "TOP", "\\u", "IN", "1", " ", ":", " ", "1", "'", "d0", ")", "\\", "10", ";", "TOP", ".", "md", "\\u", "alw", "ay", "s0", ".", "al", "\\u", "block", "0.", "al", "\\u", "function", "call", "0.", "\\u", "rn", "0", "\\u", "func", "1", ":", " ", "TOP", "\\u", "IN", "1", "\\", "10", ";", "TOP", ".", "md", "\\u", "alw", "ay", "s0", ".", "al", "\\u", "block", "0.", "al", "\\u", "function", "call", "0.", "\\u", "rn", "1", "\\u", "func", "1", ":", " ", "1", "'", "d0", "\\", "10", ";", "TOP", ".", "md", "\\u", "alw", "ay", "s0", ".", "al", "\\u", "block", "0.", "al", "\\u", "function", "call", "0.", "func", "1", ":", " ", "(((", "TOP", "\\u", "SEL", "=='", "d0", "))", "?", " ", "TOP", "\\u", "IN", "1", " ", ":", " ", "1", "'", "d0", ")", "\\", "10", ";", "TOP", ".", "md", "\\u", "alw", "ay", "s0", ".", "al", "\\u", "block", "0.", "al", "\\u", "function", "call", "0.", "in1", ":", " ", "TOP", "\\u", "IN", "1", "\\", "10", ";", "TOP", ".", "md", "\\u", "alw", "ay", "s0", ".", "al", "\\u", "block", "0.", "al", "\\u", "function", "call", "0.", "sel", ":", " ", "TOP", "\\u", "SEL", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filelist_", "=_", "[_", "code", "dir_", "+_", "'", "case", "\\u", "in", "\\u", "func", ".", "v", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top", "module_", "=_", "'", "TOP", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nore", "order_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nob", "ind_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "include_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "define_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "analyzer_", "=_", "Veri", "log", "Dataf", "low", "Analyzer_", "(_", "filelist_", ",_", "top", "module_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "nore", "order_", "=_", "nore", "order_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "nob", "ind_", "=_", "nob", "ind_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "preproc", "ess", "\\u", "include_", "=_", "include_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "preproc", "ess", "\\u", "define_", "=_", "define_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "analyzer_", "._", "generate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "directives_", "=_", "analyzer_", "._", "get", "\\u", "directives_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "instances_", "=_", "analyzer_", "._", "get", "Instances_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "terms_", "=_", "analyzer_", "._", "get", "Term", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bind", "dict_", "=_", "analyzer_", "._", "get", "Bind", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "optimizer_", "=_", "Veri", "log", "Dataf", "low", "Optimizer_", "(_", "terms_", ",_", "bind", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "optimizer_", "._", "resolve", "Constant_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c\\u", "analyzer_", "=_", "Veri", "log", "Control", "flow", "Analyzer_", "(_", "top", "module_", ",_", "terms_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bind", "dict_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "resolve", "d\\u", "terms_", "=_", "optimizer_", "._", "get", "Resolved", "Term", "s_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "resolve", "d\\u", "bind", "dict_", "=_", "optimizer_", "._", "get", "Resolved", "Bind", "dict_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "const", "list_", "=_", "optimizer_", "._", "get", "Const", "list_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "output_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "tk_", "in_", "sorted_", "(_", "c\\u", "analyzer_", "._", "resolve", "d\\u", "terms_", "._", "keys_", "(_", ")_", ",_", "key_", "=_", "lambda_", "x_", ":_", "str_", "(_", "x_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tree_", "=_", "c\\u", "analyzer_", "._", "make", "Tree_", "(_", "tk_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output_", "._", "append_", "(_", "str_", "(_", "tk_", ")_", "+_", "':", " ", "'_", "+_", "tree_", "._", "toco", "de_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rsl", "t_", "=_", "'\\\\", "n", "'_", "._", "join_", "(_", "output_", ")_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "rsl", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "(_", "expected_", "==_", "rsl", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
bslatkin/dpxdt/tests/workers_test.py
[ { "content": " def testMultiLevelWorkflow(self):\n \"\"\"Tests a multi-level workflow.\"\"\"\n work = RootWorkflow(5)\n work.root = True\n self.coordinator.input_queue.put(work)\n finished = self.coordinator.output_queue.get()\n\n self.assertTrue(work is finished)\n finished.check_result() # Did not raise\n self.assertEquals(4 + 3 + 2 + 1 + 0, work.result)", "metadata": "root.WorkflowThreadTest.testMultiLevelWorkflow", "header": "['class', 'WorkflowThreadTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 333 }, { "content": " def testMultiLevelWorkflowException(self):\n \"\"\"Tests when a child of a child raises an exception.\"\"\"\n work = RootWorkflow(5, die_on=3)\n work.root = True\n self.coordinator.input_queue.put(work)\n finished = self.coordinator.output_queue.get()\n\n self.assertTrue(work is finished)\n try:\n finished.check_result()\n except Exception, e:\n self.assertEquals('Dying on 3', str(e))", "metadata": "root.WorkflowThreadTest.testMultiLevelWorkflowException", "header": "['class', 'WorkflowThreadTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 344 }, { "content": " def testWorkflowExceptionPropagation(self):\n \"\"\"Tests when workflow items in a hierarchy re-raise exceptions.\"\"\"\n work = RootGeneratorExceptionWorkflow()\n work.root = True\n self.coordinator.input_queue.put(work)\n finished = self.coordinator.output_queue.get()\n\n self.assertTrue(work is finished)\n finished.check_result()\n self.assertEquals('good', work.result)", "metadata": "root.WorkflowThreadTest.testWorkflowExceptionPropagation", "header": "['class', 'WorkflowThreadTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 357 }, { "content": " def testWaitAll(self):\n \"\"\"Tests waiting on all items in a list of work.\"\"\"\n work = RootWaitAllWorkflow(4)\n work.root = True\n self.coordinator.input_queue.put(work)\n finished = self.coordinator.output_queue.get()\n self.assertTrue(work is finished)\n finished.check_result()\n self.assertEquals(6, work.result)", "metadata": "root.WorkflowThreadTest.testWaitAll", "header": "['class', 'WorkflowThreadTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 368 }, { "content": " def testWaitAny(self):\n \"\"\"Tests using the WaitAny class.\"\"\"\n work = RootWaitAnyWorkflow()\n work.root = True\n self.coordinator.input_queue.put(work)\n finished = self.coordinator.output_queue.get()\n self.assertTrue(work is finished)\n finished.check_result()\n self.assertEquals('Donezo', work.result)", "metadata": "root.WorkflowThreadTest.testWaitAny", "header": "['class', 'WorkflowThreadTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 378 }, { "content": " def testWaitAnyException(self):\n \"\"\"Tests using the WaitAny class when an exception is raised.\"\"\"\n work = RootWaitAnyExceptionWorkflow()\n work.root = True\n self.coordinator.input_queue.put(work)\n finished = self.coordinator.output_queue.get()\n self.assertTrue(work is finished)\n finished.check_result()\n self.assertEquals('Dying on 42', work.result)", "metadata": "root.WorkflowThreadTest.testWaitAnyException", "header": "['class', 'WorkflowThreadTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 388 }, { "content": " def testFireAndForget(self):\n \"\"\"Tests running fire-and-forget WorkItems.\"\"\"\n work = RootFireAndForgetWorkflow()\n work.root = True\n self.coordinator.input_queue.put(work)\n finished = self.coordinator.output_queue.get()\n self.assertTrue(work is finished)\n finished.check_result()\n self.assertEquals('Okay', work.result)", "metadata": "root.WorkflowThreadTest.testFireAndForget", "header": "['class', 'WorkflowThreadTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 398 }, { "content": " def testFireAndForgetException(self):\n \"\"\"Tests that exceptions from fire-and-forget WorkItems are ignored.\"\"\"\n work = RootFireAndForgetExceptionWorkflow()\n work.root = True\n self.coordinator.input_queue.put(work)\n finished = self.coordinator.output_queue.get()\n self.assertTrue(work is finished)\n finished.check_result()\n self.assertEquals('No fire and forget error', work.result)", "metadata": "root.WorkflowThreadTest.testFireAndForgetException", "header": "['class', 'WorkflowThreadTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 408 }, { "content": " def testFireAndForgetException_MultiLevel(self):\n \"\"\"Tests exceptions in multi-level fire-and-forget work items.\"\"\"\n work = RootFireAndForgetMultipleExceptionWorkflow()\n work.root = True\n self.coordinator.input_queue.put(work)\n finished = self.coordinator.output_queue.get()\n self.assertTrue(work is finished)\n finished.check_result()\n self.assertEquals('All errors seen', work.result)", "metadata": "root.WorkflowThreadTest.testFireAndForgetException_MultiLevel", "header": "['class', 'WorkflowThreadTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 418 }, { "content": " def testWaitAnyFireAndForget(self):\n \"\"\"Tests wait any with a mix of blocking and non-blocking items.\"\"\"\n work = RootWaitAnyFireAndForget()\n work.root = True\n self.coordinator.input_queue.put(work)\n finished = self.coordinator.output_queue.get()\n self.assertTrue(work is finished)\n finished.check_result()\n self.assertEquals('All done', work.result)", "metadata": "root.WorkflowThreadTest.testWaitAnyFireAndForget", "header": "['class', 'WorkflowThreadTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 428 }, { "content": " def testWaitAllFireAndForget(self):\n \"\"\"Tests wait all with a mix of blocking and non-blocking items.\"\"\"\n work = RootWaitAllFireAndForget()\n work.root = True\n self.coordinator.input_queue.put(work)\n finished = self.coordinator.output_queue.get()\n self.assertTrue(work is finished)\n finished.check_result()\n self.assertEquals('Waited for all of them', work.result)", "metadata": "root.WorkflowThreadTest.testWaitAllFireAndForget", "header": "['class', 'WorkflowThreadTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 438 } ]
[ { "span": "self.assertTrue(work is finished)", "start_line": 340, "start_column": 8, "end_line": 340, "end_column": 41 }, { "span": "self.assertTrue(work is finished)", "start_line": 351, "start_column": 8, "end_line": 351, "end_column": 41 }, { "span": "self.assertTrue(work is finished)", "start_line": 364, "start_column": 8, "end_line": 364, "end_column": 41 }, { "span": "self.assertTrue(work is finished)", "start_line": 374, "start_column": 8, "end_line": 374, "end_column": 41 }, { "span": "self.assertTrue(work is finished)", "start_line": 384, "start_column": 8, "end_line": 384, "end_column": 41 }, { "span": "self.assertTrue(work is finished)", "start_line": 394, "start_column": 8, "end_line": 394, "end_column": 41 }, { "span": "self.assertTrue(work is finished)", "start_line": 404, "start_column": 8, "end_line": 404, "end_column": 41 }, { "span": "self.assertTrue(work is finished)", "start_line": 414, "start_column": 8, "end_line": 414, "end_column": 41 }, { "span": "self.assertTrue(work is finished)", "start_line": 424, "start_column": 8, "end_line": 424, "end_column": 41 }, { "span": "self.assertTrue(work is finished)", "start_line": 434, "start_column": 8, "end_line": 434, "end_column": 41 }, { "span": "self.assertTrue(work is finished)", "start_line": 444, "start_column": 8, "end_line": 444, "end_column": 41 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Work", "flow", "Thread", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Multi", "Leve", "l", "Workflow_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "a", " ", "multi", "-", "level", " ", "workf", "low", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "work_", "=_", "Roo", "t", "Workflow_", "(_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "work_", "._", "root_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "coordinator", "_", "._", "input", "\\u", "queue_", "._", "put_", "(_", "work_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finished_", "=_", "self_", "._", "coordinator", "_", "._", "output", "\\u", "queue_", "._", "get_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "work_", "is_", "finished_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finished_", "._", "check", "\\u", "result_", "(_", ")_", "#", " ", "Di", "d", " ", "not", " ", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "4_", "+_", "3_", "+_", "2_", "+_", "1_", "+_", "0_", ",_", "work_", "._", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Work", "flow", "Thread", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Multi", "Leve", "l", "Work", "flow", "Exception_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "whe", "n", " ", "a", " ", "child", " ", "of", " ", "a", " ", "child", " ", "raise", "s", " ", "an", " ", "exception", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "work_", "=_", "Roo", "t", "Workflow_", "(_", "5_", ",_", "die", "\\u", "on_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "work_", "._", "root_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "coordinator", "_", "._", "input", "\\u", "queue_", "._", "put_", "(_", "work_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finished_", "=_", "self_", "._", "coordinator", "_", "._", "output", "\\u", "queue_", "._", "get_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "work_", "is_", "finished_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "finished_", "._", "check", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "'", "Dy", "ing", " ", "on", " ", "3", "'_", ",_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Work", "flow", "Thread", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Work", "flow", "Except", "ion", "Propag", "ation_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "whe", "n", " ", "workf", "low", " ", "items", " ", "in", " ", "a", " ", "hier", "arch", "y", " ", "re", "-", "raise", " ", "exception", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "work_", "=_", "Roo", "t", "Generat", "or", "Except", "ion", "Workflow_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "work_", "._", "root_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "coordinator", "_", "._", "input", "\\u", "queue_", "._", "put_", "(_", "work_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finished_", "=_", "self_", "._", "coordinator", "_", "._", "output", "\\u", "queue_", "._", "get_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "work_", "is_", "finished_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finished_", "._", "check", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "'", "good", "'_", ",_", "work_", "._", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Work", "flow", "Thread", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Wait", "All_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "wait", "ing", " ", "on", " ", "all", " ", "items", " ", "in", " ", "a", " ", "list", " ", "of", " ", "work", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "work_", "=_", "Roo", "t", "Wait", "All", "Workflow_", "(_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "work_", "._", "root_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "coordinator", "_", "._", "input", "\\u", "queue_", "._", "put_", "(_", "work_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finished_", "=_", "self_", "._", "coordinator", "_", "._", "output", "\\u", "queue_", "._", "get_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "work_", "is_", "finished_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finished_", "._", "check", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "6_", ",_", "work_", "._", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Work", "flow", "Thread", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Wait", "Any_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "usi", "ng", " ", "the", " ", "Wait", "Any", " ", "class", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "work_", "=_", "Roo", "t", "Wait", "Any", "Workflow_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "work_", "._", "root_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "coordinator", "_", "._", "input", "\\u", "queue_", "._", "put_", "(_", "work_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finished_", "=_", "self_", "._", "coordinator", "_", "._", "output", "\\u", "queue_", "._", "get_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "work_", "is_", "finished_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finished_", "._", "check", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "'", "Don", "ez", "o", "'_", ",_", "work_", "._", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Work", "flow", "Thread", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Wait", "Any", "Exception_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "usi", "ng", " ", "the", " ", "Wait", "Any", " ", "class", " ", "whe", "n", " ", "an", " ", "exception", " ", "is", " ", "raise", "d", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "work_", "=_", "Roo", "t", "Wait", "Any", "Except", "ion", "Workflow_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "work_", "._", "root_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "coordinator", "_", "._", "input", "\\u", "queue_", "._", "put_", "(_", "work_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finished_", "=_", "self_", "._", "coordinator", "_", "._", "output", "\\u", "queue_", "._", "get_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "work_", "is_", "finished_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finished_", "._", "check", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "'", "Dy", "ing", " ", "on", " ", "4", "2", "'_", ",_", "work_", "._", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Work", "flow", "Thread", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Fire", "And", "Forg", "et_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "runn", "ing", " ", "fire", "-", "and", "-", "forget", " ", "Work", "Item", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "work_", "=_", "Roo", "t", "Fire", "And", "Forg", "et", "Workflow_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "work_", "._", "root_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "coordinator", "_", "._", "input", "\\u", "queue_", "._", "put_", "(_", "work_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finished_", "=_", "self_", "._", "coordinator", "_", "._", "output", "\\u", "queue_", "._", "get_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "work_", "is_", "finished_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finished_", "._", "check", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "'", "Ok", "ay", "'_", ",_", "work_", "._", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Work", "flow", "Thread", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Fire", "And", "Forg", "et", "Exception_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "exception", "s", " ", "from", " ", "fire", "-", "and", "-", "forget", " ", "Work", "Item", "s", " ", "are", " ", "ignore", "d", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "work_", "=_", "Roo", "t", "Fire", "And", "Forg", "et", "Except", "ion", "Workflow_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "work_", "._", "root_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "coordinator", "_", "._", "input", "\\u", "queue_", "._", "put_", "(_", "work_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finished_", "=_", "self_", "._", "coordinator", "_", "._", "output", "\\u", "queue_", "._", "get_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "work_", "is_", "finished_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finished_", "._", "check", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "'", "No", " ", "fire", " ", "and", " ", "forget", " ", "error", "'_", ",_", "work_", "._", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Work", "flow", "Thread", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Fire", "And", "Forg", "et", "Except", "ion", "\\u", "Multi", "Level_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "exception", "s", " ", "in", " ", "multi", "-", "level", " ", "fire", "-", "and", "-", "forget", " ", "work", " ", "items", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "work_", "=_", "Roo", "t", "Fire", "And", "Forg", "et", "Multipl", "e", "Except", "ion", "Workflow_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "work_", "._", "root_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "coordinator", "_", "._", "input", "\\u", "queue_", "._", "put_", "(_", "work_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finished_", "=_", "self_", "._", "coordinator", "_", "._", "output", "\\u", "queue_", "._", "get_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "work_", "is_", "finished_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finished_", "._", "check", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "'", "All", " ", "error", "s", " ", "see", "n", "'_", ",_", "work_", "._", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Work", "flow", "Thread", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Wait", "Any", "Fire", "And", "Forg", "et_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "wait", " ", "any", " ", "with", " ", "a", " ", "mix", " ", "of", " ", "blockin", "g", " ", "and", " ", "non", "-", "blockin", "g", " ", "items", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "work_", "=_", "Roo", "t", "Wait", "Any", "Fire", "And", "Forg", "et_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "work_", "._", "root_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "coordinator", "_", "._", "input", "\\u", "queue_", "._", "put_", "(_", "work_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finished_", "=_", "self_", "._", "coordinator", "_", "._", "output", "\\u", "queue_", "._", "get_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "work_", "is_", "finished_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finished_", "._", "check", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "'", "All", " ", "don", "e", "'_", ",_", "work_", "._", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Work", "flow", "Thread", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Wait", "All", "Fire", "And", "Forg", "et_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "wait", " ", "all", " ", "with", " ", "a", " ", "mix", " ", "of", " ", "blockin", "g", " ", "and", " ", "non", "-", "blockin", "g", " ", "items", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "work_", "=_", "Roo", "t", "Wait", "All", "Fire", "And", "Forg", "et_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "work_", "._", "root_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "coordinator", "_", "._", "input", "\\u", "queue_", "._", "put_", "(_", "work_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finished_", "=_", "self_", "._", "coordinator", "_", "._", "output", "\\u", "queue_", "._", "get_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "work_", "is_", "finished_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finished_", "._", "check", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
miguelgrinberg/api-pycon2014/tests/test_api.py
[ { "content": " def test_password_auth(self):\n self.app.config['USE_TOKEN_AUTH'] = False\n good_client = TestClient(self.app, self.default_username,\n self.default_password)\n rv, json = good_client.get('/api/v1.0/students/')\n self.assertTrue(rv.status_code == 200)\n\n self.app.config['USE_TOKEN_AUTH'] = True\n u = User.query.get(1)\n good_client = TestClient(self.app, u.generate_auth_token(), '')\n rv, json = good_client.get('/api/v1.0/students/')\n self.assertTrue(rv.status_code == 200)", "metadata": "root.TestAPI.test_password_auth", "header": "['class', 'TestAPI', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 29 }, { "content": " def test_bad_auth(self):\n bad_client = TestClient(self.app, 'abc', 'def')\n rv, json = bad_client.get('/api/v1.0/students/')\n self.assertTrue(rv.status_code == 401)\n\n self.app.config['USE_TOKEN_AUTH'] = True\n bad_client = TestClient(self.app, 'bad_token', '')\n rv, json = bad_client.get('/api/v1.0/students/')\n self.assertTrue(rv.status_code == 401)", "metadata": "root.TestAPI.test_bad_auth", "header": "['class', 'TestAPI', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 42 }, { "content": " def test_students(self):\n # get collection\n rv, json = self.client.get('/api/v1.0/students/')\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(json['urls'] == [])\n\n # create new\n rv, json = self.client.post('/api/v1.0/students/',\n data={'name': 'susan'})\n self.assertTrue(rv.status_code == 201)\n susan_url = rv.headers['Location']\n\n # get\n rv, json = self.client.get(susan_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(json['name'] == 'susan')\n self.assertTrue(json['url'] == susan_url)\n\n # create new\n rv, json = self.client.post('/api/v1.0/students/',\n data={'name': 'david'})\n self.assertTrue(rv.status_code == 201)\n david_url = rv.headers['Location']\n\n # get\n rv, json = self.client.get(david_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(json['name'] == 'david')\n self.assertTrue(json['url'] == david_url)\n\n # create bad request\n rv,json = self.client.post('/api/v1.0/students/', data={})\n self.assertTrue(rv.status_code == 400)\n\n self.assertRaises(ValidationError, lambda:\n self.client.post('/api/v1.0/students/',\n data={'not-name': 'david'}))\n\n # modify\n rv, json = self.client.put(david_url, data={'name': 'david2'})\n self.assertTrue(rv.status_code == 200)\n\n # get\n rv, json = self.client.get(david_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(json['name'] == 'david2')\n\n # get collection\n rv, json = self.client.get('/api/v1.0/students/')\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(susan_url in json['urls'])\n self.assertTrue(david_url in json['urls'])\n self.assertTrue(len(json['urls']) == 2)\n\n # delete\n rv, json = self.client.delete(susan_url)\n self.assertTrue(rv.status_code == 200)\n\n # get collection\n rv, json = self.client.get('/api/v1.0/students/')\n self.assertTrue(rv.status_code == 200)\n self.assertFalse(susan_url in json['urls'])\n self.assertTrue(david_url in json['urls'])\n self.assertTrue(len(json['urls']) == 1)", "metadata": "root.TestAPI.test_students", "header": "['class', 'TestAPI', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 52 }, { "content": " def test_classes(self):\n # get collection\n rv, json = self.client.get('/api/v1.0/classes/')\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(json['urls'] == [])\n\n # create new\n rv, json = self.client.post('/api/v1.0/classes/',\n data={'name': 'algebra'})\n self.assertTrue(rv.status_code == 201)\n algebra_url = rv.headers['Location']\n\n # get\n rv, json = self.client.get(algebra_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(json['name'] == 'algebra')\n self.assertTrue(json['url'] == algebra_url)\n\n # create new\n rv, json = self.client.post('/api/v1.0/classes/',\n data={'name': 'lit'})\n self.assertTrue(rv.status_code == 201)\n lit_url = rv.headers['Location']\n\n # get\n rv, json = self.client.get(lit_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(json['name'] == 'lit')\n self.assertTrue(json['url'] == lit_url)\n\n # create bad\n rv,json = self.client.post('/api/v1.0/classes/', data={})\n self.assertTrue(rv.status_code == 400)\n\n self.assertRaises(ValidationError, lambda:\n self.client.post('/api/v1.0/classes/', data={'not-name': 'lit'}))\n\n # modify\n rv, json = self.client.put(lit_url, data={'name': 'lit2'})\n self.assertTrue(rv.status_code == 200)\n\n # get\n rv, json = self.client.get(lit_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(json['name'] == 'lit2')\n\n # get collection\n rv, json = self.client.get('/api/v1.0/classes/')\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(algebra_url in json['urls'])\n self.assertTrue(lit_url in json['urls'])\n self.assertTrue(len(json['urls']) == 2)\n\n # delete\n rv, json = self.client.delete(lit_url)\n self.assertTrue(rv.status_code == 200)\n\n # get collection\n rv, json = self.client.get('/api/v1.0/classes/')\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(algebra_url in json['urls'])\n self.assertFalse(lit_url in json['urls'])\n self.assertTrue(len(json['urls']) == 1)", "metadata": "root.TestAPI.test_classes", "header": "['class', 'TestAPI', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 117 }, { "content": " def test_registrations(self):\n # create new students\n rv, json = self.client.post('/api/v1.0/students/',\n data={'name': 'susan'})\n self.assertTrue(rv.status_code == 201)\n susan_url = rv.headers['Location']\n\n rv, json = self.client.post('/api/v1.0/students/',\n data={'name': 'david'})\n self.assertTrue(rv.status_code == 201)\n david_url = rv.headers['Location']\n\n # create new classes\n rv, json = self.client.post('/api/v1.0/classes/',\n data={'name': 'algebra'})\n self.assertTrue(rv.status_code == 201)\n algebra_url = rv.headers['Location']\n\n rv, json = self.client.post('/api/v1.0/classes/',\n data={'name': 'lit'})\n self.assertTrue(rv.status_code == 201)\n lit_url = rv.headers['Location']\n\n # register students to classes\n rv, json = self.client.post('/api/v1.0/registrations/',\n data={'student': susan_url,\n 'class': algebra_url})\n self.assertTrue(rv.status_code == 201)\n susan_in_algebra_url = rv.headers['Location']\n\n rv, json = self.client.post('/api/v1.0/registrations/',\n data={'student': susan_url,\n 'class': lit_url})\n self.assertTrue(rv.status_code == 201)\n susan_in_lit_url = rv.headers['Location']\n\n rv, json = self.client.post('/api/v1.0/registrations/',\n data={'student': david_url,\n 'class': algebra_url})\n self.assertTrue(rv.status_code == 201)\n david_in_algebra_url = rv.headers['Location']\n\n # get registration\n rv, json = self.client.get(susan_in_lit_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(json['student'] == susan_url)\n self.assertTrue(json['class'] == lit_url)\n\n # get collection\n rv, json = self.client.get('/api/v1.0/registrations/')\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(susan_in_algebra_url in json['urls'])\n self.assertTrue(susan_in_lit_url in json['urls'])\n self.assertTrue(david_in_algebra_url in json['urls'])\n self.assertTrue(len(json['urls']) == 3)\n\n # bad registrations\n rv,json = self.client.post('/api/v1.0/registrations/', data={})\n self.assertTrue(rv.status_code == 400)\n\n self.assertRaises(ValidationError, lambda:\n self.client.post('/api/v1.0/registrations/',\n data={'student': david_url}))\n\n self.assertRaises(ValidationError, lambda:\n self.client.post('/api/v1.0/registrations/',\n data={'class': algebra_url}))\n\n self.assertRaises(ValidationError, lambda:\n self.client.post('/api/v1.0/registrations/',\n data={'student': david_url, 'class': 'bad-url'}))\n\n self.assertRaises(ValidationError, lambda:\n self.client.post('/api/v1.0/registrations/',\n data={'student': david_url,\n 'class': algebra_url + '1'}))\n db.session.remove()\n\n # get classes from each student\n rv, json = self.client.get(susan_url)\n self.assertTrue(rv.status_code == 200)\n susans_reg_url = json['registrations']\n rv, json = self.client.get(susans_reg_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(susan_in_algebra_url in json['urls'])\n self.assertTrue(susan_in_lit_url in json['urls'])\n self.assertTrue(len(json['urls']) == 2)\n\n rv, json = self.client.get(david_url)\n self.assertTrue(rv.status_code == 200)\n davids_reg_url = json['registrations']\n rv, json = self.client.get(davids_reg_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(david_in_algebra_url in json['urls'])\n self.assertTrue(len(json['urls']) == 1)\n\n # get students for each class\n rv, json = self.client.get(algebra_url)\n self.assertTrue(rv.status_code == 200)\n algebras_reg_url = json['registrations']\n rv, json = self.client.get(algebras_reg_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(susan_in_algebra_url in json['urls'])\n self.assertTrue(david_in_algebra_url in json['urls'])\n self.assertTrue(len(json['urls']) == 2)\n\n rv, json = self.client.get(lit_url)\n self.assertTrue(rv.status_code == 200)\n lits_reg_url = json['registrations']\n rv, json = self.client.get(lits_reg_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(susan_in_lit_url in json['urls'])\n self.assertTrue(len(json['urls']) == 1)\n\n # unregister students\n rv, json = self.client.delete(susan_in_algebra_url)\n self.assertTrue(rv.status_code == 200)\n\n rv, json = self.client.delete(david_in_algebra_url)\n self.assertTrue(rv.status_code == 200)\n\n # get collection\n rv, json = self.client.get('/api/v1.0/registrations/')\n self.assertTrue(rv.status_code == 200)\n self.assertFalse(susan_in_algebra_url in json['urls'])\n self.assertTrue(susan_in_lit_url in json['urls'])\n self.assertFalse(david_in_algebra_url in json['urls'])\n self.assertTrue(len(json['urls']) == 1)\n\n # delete student\n rv, json = self.client.delete(susan_url)\n self.assertTrue(rv.status_code == 200)\n\n # get collection\n rv, json = self.client.get('/api/v1.0/registrations/')\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(len(json['urls']) == 0)", "metadata": "root.TestAPI.test_registrations", "header": "['class', 'TestAPI', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 181 }, { "content": " def test_rate_limits(self):\n self.app.config['USE_RATE_LIMITS'] = True\n\n rv, json = self.client.get('/api/v1.0/registrations/')\n self.assertTrue(rv.status_code == 200)\n self.assertTrue('X-RateLimit-Remaining' in rv.headers)\n self.assertTrue('X-RateLimit-Limit' in rv.headers)\n self.assertTrue('X-RateLimit-Reset' in rv.headers)\n self.assertTrue(int(rv.headers['X-RateLimit-Limit']) == int(rv.headers['X-RateLimit-Remaining']) + 1)\n while int(rv.headers['X-RateLimit-Remaining']) > 0:\n rv, json = self.client.get('/api/v1.0/registrations/')\n self.assertTrue(rv.status_code == 429)", "metadata": "root.TestAPI.test_rate_limits", "header": "['class', 'TestAPI', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 319 }, { "content": " def test_pagination(self):\n # create several students\n rv, json = self.client.post('/api/v1.0/students/',\n data={'name': 'one'})\n self.assertTrue(rv.status_code == 201)\n one_url = rv.headers['Location']\n rv, json = self.client.post('/api/v1.0/students/',\n data={'name': 'two'})\n self.assertTrue(rv.status_code == 201)\n two_url = rv.headers['Location']\n rv, json = self.client.post('/api/v1.0/students/',\n data={'name': 'three'})\n self.assertTrue(rv.status_code == 201)\n three_url = rv.headers['Location']\n rv, json = self.client.post('/api/v1.0/students/',\n data={'name': 'four'})\n self.assertTrue(rv.status_code == 201)\n four_url = rv.headers['Location']\n rv, json = self.client.post('/api/v1.0/students/',\n data={'name': 'five'})\n self.assertTrue(rv.status_code == 201)\n five_url = rv.headers['Location']\n\n # get collection in pages\n rv, json = self.client.get('/api/v1.0/students/?page=1&per_page=2')\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(one_url in json['urls'])\n self.assertTrue(two_url in json['urls'])\n self.assertTrue(len(json['urls']) == 2)\n self.assertTrue('total' in json['meta'])\n self.assertTrue(json['meta']['total'] == 5)\n self.assertTrue('prev' in json['meta'])\n self.assertTrue(json['meta']['prev'] is None)\n first_url = json['meta']['first'].replace('http://localhost', '')\n last_url = json['meta']['last'].replace('http://localhost', '')\n next_url = json['meta']['next'].replace('http://localhost', '')\n\n rv, json = self.client.get(first_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(one_url in json['urls'])\n self.assertTrue(two_url in json['urls'])\n self.assertTrue(len(json['urls']) == 2)\n\n rv, json = self.client.get(next_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(three_url in json['urls'])\n self.assertTrue(four_url in json['urls'])\n self.assertTrue(len(json['urls']) == 2)\n next_url = json['meta']['next'].replace('http://localhost', '')\n\n rv, json = self.client.get(next_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(five_url in json['urls'])\n self.assertTrue(len(json['urls']) == 1)\n\n rv, json = self.client.get(last_url)\n self.assertTrue(rv.status_code == 200)\n self.assertTrue(five_url in json['urls'])\n self.assertTrue(len(json['urls']) == 1)", "metadata": "root.TestAPI.test_pagination", "header": "['class', 'TestAPI', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 332 }, { "content": " def test_cache_control(self):\n client = TestClient(self.app, self.default_username,\n self.default_password)\n rv, json = client.get('/auth/request-token')\n self.assertTrue(rv.status_code == 200)\n self.assertTrue('Cache-Control' in rv.headers)\n cache = [c.strip() for c in rv.headers['Cache-Control'].split(',')]\n self.assertTrue('no-cache' in cache)\n self.assertTrue('no-store' in cache)\n self.assertTrue('max-age=0' in cache)\n self.assertTrue(len(cache) == 3)", "metadata": "root.TestAPI.test_cache_control", "header": "['class', 'TestAPI', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 392 }, { "content": " def test_etag(self):\n # create two students\n rv, json = self.client.post('/api/v1.0/students/',\n data={'name': 'one'})\n self.assertTrue(rv.status_code == 201)\n one_url = rv.headers['Location']\n rv, json = self.client.post('/api/v1.0/students/',\n data={'name': 'two'})\n self.assertTrue(rv.status_code == 201)\n two_url = rv.headers['Location']\n\n # get their etags\n rv, json = self.client.get(one_url)\n self.assertTrue(rv.status_code == 200)\n one_etag = rv.headers['ETag']\n rv, json = self.client.get(two_url)\n self.assertTrue(rv.status_code == 200)\n two_etag = rv.headers['ETag']\n\n # send If-None-Match header\n rv, json = self.client.get(one_url, headers={\n 'If-None-Match': one_etag})\n self.assertTrue(rv.status_code == 304)\n rv, json = self.client.get(one_url, headers={\n 'If-None-Match': one_etag + ', ' + two_etag})\n self.assertTrue(rv.status_code == 304)\n rv, json = self.client.get(one_url, headers={\n 'If-None-Match': two_etag})\n self.assertTrue(rv.status_code == 200)\n rv, json = self.client.get(one_url, headers={\n 'If-None-Match': two_etag + ', *'})\n self.assertTrue(rv.status_code == 304)\n\n # send If-Match header\n rv, json = self.client.get(one_url, headers={\n 'If-Match': one_etag})\n self.assertTrue(rv.status_code == 200)\n rv, json = self.client.get(one_url, headers={\n 'If-Match': one_etag + ', ' + two_etag})\n self.assertTrue(rv.status_code == 200)\n rv, json = self.client.get(one_url, headers={\n 'If-Match': two_etag})\n self.assertTrue(rv.status_code == 412)\n rv, json = self.client.get(one_url, headers={\n 'If-Match': '*'})\n self.assertTrue(rv.status_code == 200)\n\n # change a resource\n rv, json = self.client.put(one_url, data={'name': 'not-one'})\n self.assertTrue(rv.status_code == 200)\n\n # use stale etag\n rv, json = self.client.get(one_url, headers={\n 'If-None-Match': one_etag})\n self.assertTrue(rv.status_code == 200)", "metadata": "root.TestAPI.test_etag", "header": "['class', 'TestAPI', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 404 } ]
[ { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 34, "start_column": 8, "end_line": 34, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 40, "start_column": 8, "end_line": 40, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 401)", "start_line": 45, "start_column": 8, "end_line": 45, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 401)", "start_line": 50, "start_column": 8, "end_line": 50, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 55, "start_column": 8, "end_line": 55, "end_column": 46 }, { "span": "self.assertTrue(json['urls'] == [])", "start_line": 56, "start_column": 8, "end_line": 56, "end_column": 43 }, { "span": "self.assertTrue(rv.status_code == 201)", "start_line": 61, "start_column": 8, "end_line": 61, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 66, "start_column": 8, "end_line": 66, "end_column": 46 }, { "span": "self.assertTrue(json['name'] == 'susan')", "start_line": 67, "start_column": 8, "end_line": 67, "end_column": 48 }, { "span": "self.assertTrue(json['url'] == susan_url)", "start_line": 68, "start_column": 8, "end_line": 68, "end_column": 49 }, { "span": "self.assertTrue(rv.status_code == 201)", "start_line": 73, "start_column": 8, "end_line": 73, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 78, "start_column": 8, "end_line": 78, "end_column": 46 }, { "span": "self.assertTrue(json['name'] == 'david')", "start_line": 79, "start_column": 8, "end_line": 79, "end_column": 48 }, { "span": "self.assertTrue(json['url'] == david_url)", "start_line": 80, "start_column": 8, "end_line": 80, "end_column": 49 }, { "span": "self.assertTrue(rv.status_code == 400)", "start_line": 84, "start_column": 8, "end_line": 84, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 92, "start_column": 8, "end_line": 92, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 96, "start_column": 8, "end_line": 96, "end_column": 46 }, { "span": "self.assertTrue(json['name'] == 'david2')", "start_line": 97, "start_column": 8, "end_line": 97, "end_column": 49 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 101, "start_column": 8, "end_line": 101, "end_column": 46 }, { "span": "self.assertTrue(susan_url in json['urls'])", "start_line": 102, "start_column": 8, "end_line": 102, "end_column": 50 }, { "span": "self.assertTrue(david_url in json['urls'])", "start_line": 103, "start_column": 8, "end_line": 103, "end_column": 50 }, { "span": "self.assertTrue(len(json['urls']) == 2)", "start_line": 104, "start_column": 8, "end_line": 104, "end_column": 47 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 108, "start_column": 8, "end_line": 108, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 112, "start_column": 8, "end_line": 112, "end_column": 46 }, { "span": "self.assertFalse(susan_url in json['urls'])", "start_line": 113, "start_column": 8, "end_line": 113, "end_column": 51 }, { "span": "self.assertTrue(david_url in json['urls'])", "start_line": 114, "start_column": 8, "end_line": 114, "end_column": 50 }, { "span": "self.assertTrue(len(json['urls']) == 1)", "start_line": 115, "start_column": 8, "end_line": 115, "end_column": 47 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 120, "start_column": 8, "end_line": 120, "end_column": 46 }, { "span": "self.assertTrue(json['urls'] == [])", "start_line": 121, "start_column": 8, "end_line": 121, "end_column": 43 }, { "span": "self.assertTrue(rv.status_code == 201)", "start_line": 126, "start_column": 8, "end_line": 126, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 131, "start_column": 8, "end_line": 131, "end_column": 46 }, { "span": "self.assertTrue(json['name'] == 'algebra')", "start_line": 132, "start_column": 8, "end_line": 132, "end_column": 50 }, { "span": "self.assertTrue(json['url'] == algebra_url)", "start_line": 133, "start_column": 8, "end_line": 133, "end_column": 51 }, { "span": "self.assertTrue(rv.status_code == 201)", "start_line": 138, "start_column": 8, "end_line": 138, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 143, "start_column": 8, "end_line": 143, "end_column": 46 }, { "span": "self.assertTrue(json['name'] == 'lit')", "start_line": 144, "start_column": 8, "end_line": 144, "end_column": 46 }, { "span": "self.assertTrue(json['url'] == lit_url)", "start_line": 145, "start_column": 8, "end_line": 145, "end_column": 47 }, { "span": "self.assertTrue(rv.status_code == 400)", "start_line": 149, "start_column": 8, "end_line": 149, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 156, "start_column": 8, "end_line": 156, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 160, "start_column": 8, "end_line": 160, "end_column": 46 }, { "span": "self.assertTrue(json['name'] == 'lit2')", "start_line": 161, "start_column": 8, "end_line": 161, "end_column": 47 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 165, "start_column": 8, "end_line": 165, "end_column": 46 }, { "span": "self.assertTrue(algebra_url in json['urls'])", "start_line": 166, "start_column": 8, "end_line": 166, "end_column": 52 }, { "span": "self.assertTrue(lit_url in json['urls'])", "start_line": 167, "start_column": 8, "end_line": 167, "end_column": 48 }, { "span": "self.assertTrue(len(json['urls']) == 2)", "start_line": 168, "start_column": 8, "end_line": 168, "end_column": 47 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 172, "start_column": 8, "end_line": 172, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 176, "start_column": 8, "end_line": 176, "end_column": 46 }, { "span": "self.assertTrue(algebra_url in json['urls'])", "start_line": 177, "start_column": 8, "end_line": 177, "end_column": 52 }, { "span": "self.assertFalse(lit_url in json['urls'])", "start_line": 178, "start_column": 8, "end_line": 178, "end_column": 49 }, { "span": "self.assertTrue(len(json['urls']) == 1)", "start_line": 179, "start_column": 8, "end_line": 179, "end_column": 47 }, { "span": "self.assertTrue(rv.status_code == 201)", "start_line": 185, "start_column": 8, "end_line": 185, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 201)", "start_line": 190, "start_column": 8, "end_line": 190, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 201)", "start_line": 196, "start_column": 8, "end_line": 196, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 201)", "start_line": 201, "start_column": 8, "end_line": 201, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 201)", "start_line": 208, "start_column": 8, "end_line": 208, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 201)", "start_line": 214, "start_column": 8, "end_line": 214, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 201)", "start_line": 220, "start_column": 8, "end_line": 220, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 225, "start_column": 8, "end_line": 225, "end_column": 46 }, { "span": "self.assertTrue(json['student'] == susan_url)", "start_line": 226, "start_column": 8, "end_line": 226, "end_column": 53 }, { "span": "self.assertTrue(json['class'] == lit_url)", "start_line": 227, "start_column": 8, "end_line": 227, "end_column": 49 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 231, "start_column": 8, "end_line": 231, "end_column": 46 }, { "span": "self.assertTrue(susan_in_algebra_url in json['urls'])", "start_line": 232, "start_column": 8, "end_line": 232, "end_column": 61 }, { "span": "self.assertTrue(susan_in_lit_url in json['urls'])", "start_line": 233, "start_column": 8, "end_line": 233, "end_column": 57 }, { "span": "self.assertTrue(david_in_algebra_url in json['urls'])", "start_line": 234, "start_column": 8, "end_line": 234, "end_column": 61 }, { "span": "self.assertTrue(len(json['urls']) == 3)", "start_line": 235, "start_column": 8, "end_line": 235, "end_column": 47 }, { "span": "self.assertTrue(rv.status_code == 400)", "start_line": 239, "start_column": 8, "end_line": 239, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 261, "start_column": 8, "end_line": 261, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 264, "start_column": 8, "end_line": 264, "end_column": 46 }, { "span": "self.assertTrue(susan_in_algebra_url in json['urls'])", "start_line": 265, "start_column": 8, "end_line": 265, "end_column": 61 }, { "span": "self.assertTrue(susan_in_lit_url in json['urls'])", "start_line": 266, "start_column": 8, "end_line": 266, "end_column": 57 }, { "span": "self.assertTrue(len(json['urls']) == 2)", "start_line": 267, "start_column": 8, "end_line": 267, "end_column": 47 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 270, "start_column": 8, "end_line": 270, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 273, "start_column": 8, "end_line": 273, "end_column": 46 }, { "span": "self.assertTrue(david_in_algebra_url in json['urls'])", "start_line": 274, "start_column": 8, "end_line": 274, "end_column": 61 }, { "span": "self.assertTrue(len(json['urls']) == 1)", "start_line": 275, "start_column": 8, "end_line": 275, "end_column": 47 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 279, "start_column": 8, "end_line": 279, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 282, "start_column": 8, "end_line": 282, "end_column": 46 }, { "span": "self.assertTrue(susan_in_algebra_url in json['urls'])", "start_line": 283, "start_column": 8, "end_line": 283, "end_column": 61 }, { "span": "self.assertTrue(david_in_algebra_url in json['urls'])", "start_line": 284, "start_column": 8, "end_line": 284, "end_column": 61 }, { "span": "self.assertTrue(len(json['urls']) == 2)", "start_line": 285, "start_column": 8, "end_line": 285, "end_column": 47 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 288, "start_column": 8, "end_line": 288, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 291, "start_column": 8, "end_line": 291, "end_column": 46 }, { "span": "self.assertTrue(susan_in_lit_url in json['urls'])", "start_line": 292, "start_column": 8, "end_line": 292, "end_column": 57 }, { "span": "self.assertTrue(len(json['urls']) == 1)", "start_line": 293, "start_column": 8, "end_line": 293, "end_column": 47 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 297, "start_column": 8, "end_line": 297, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 300, "start_column": 8, "end_line": 300, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 304, "start_column": 8, "end_line": 304, "end_column": 46 }, { "span": "self.assertFalse(susan_in_algebra_url in json['urls'])", "start_line": 305, "start_column": 8, "end_line": 305, "end_column": 62 }, { "span": "self.assertTrue(susan_in_lit_url in json['urls'])", "start_line": 306, "start_column": 8, "end_line": 306, "end_column": 57 }, { "span": "self.assertFalse(david_in_algebra_url in json['urls'])", "start_line": 307, "start_column": 8, "end_line": 307, "end_column": 62 }, { "span": "self.assertTrue(len(json['urls']) == 1)", "start_line": 308, "start_column": 8, "end_line": 308, "end_column": 47 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 312, "start_column": 8, "end_line": 312, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 316, "start_column": 8, "end_line": 316, "end_column": 46 }, { "span": "self.assertTrue(len(json['urls']) == 0)", "start_line": 317, "start_column": 8, "end_line": 317, "end_column": 47 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 323, "start_column": 8, "end_line": 323, "end_column": 46 }, { "span": "self.assertTrue('X-RateLimit-Remaining' in rv.headers)", "start_line": 324, "start_column": 8, "end_line": 324, "end_column": 62 }, { "span": "self.assertTrue('X-RateLimit-Limit' in rv.headers)", "start_line": 325, "start_column": 8, "end_line": 325, "end_column": 58 }, { "span": "self.assertTrue('X-RateLimit-Reset' in rv.headers)", "start_line": 326, "start_column": 8, "end_line": 326, "end_column": 58 }, { "span": "self.assertTrue(int(rv.headers['X-RateLimit-Limit']) == int(rv.headers['X-RateLimit-Remaining']) + 1)", "start_line": 327, "start_column": 8, "end_line": 327, "end_column": 109 }, { "span": "self.assertTrue(rv.status_code == 429)", "start_line": 330, "start_column": 8, "end_line": 330, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 201)", "start_line": 336, "start_column": 8, "end_line": 336, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 201)", "start_line": 340, "start_column": 8, "end_line": 340, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 201)", "start_line": 344, "start_column": 8, "end_line": 344, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 201)", "start_line": 348, "start_column": 8, "end_line": 348, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 201)", "start_line": 352, "start_column": 8, "end_line": 352, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 357, "start_column": 8, "end_line": 357, "end_column": 46 }, { "span": "self.assertTrue(one_url in json['urls'])", "start_line": 358, "start_column": 8, "end_line": 358, "end_column": 48 }, { "span": "self.assertTrue(two_url in json['urls'])", "start_line": 359, "start_column": 8, "end_line": 359, "end_column": 48 }, { "span": "self.assertTrue(len(json['urls']) == 2)", "start_line": 360, "start_column": 8, "end_line": 360, "end_column": 47 }, { "span": "self.assertTrue('total' in json['meta'])", "start_line": 361, "start_column": 8, "end_line": 361, "end_column": 48 }, { "span": "self.assertTrue(json['meta']['total'] == 5)", "start_line": 362, "start_column": 8, "end_line": 362, "end_column": 51 }, { "span": "self.assertTrue('prev' in json['meta'])", "start_line": 363, "start_column": 8, "end_line": 363, "end_column": 47 }, { "span": "self.assertTrue(json['meta']['prev'] is None)", "start_line": 364, "start_column": 8, "end_line": 364, "end_column": 53 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 370, "start_column": 8, "end_line": 370, "end_column": 46 }, { "span": "self.assertTrue(one_url in json['urls'])", "start_line": 371, "start_column": 8, "end_line": 371, "end_column": 48 }, { "span": "self.assertTrue(two_url in json['urls'])", "start_line": 372, "start_column": 8, "end_line": 372, "end_column": 48 }, { "span": "self.assertTrue(len(json['urls']) == 2)", "start_line": 373, "start_column": 8, "end_line": 373, "end_column": 47 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 376, "start_column": 8, "end_line": 376, "end_column": 46 }, { "span": "self.assertTrue(three_url in json['urls'])", "start_line": 377, "start_column": 8, "end_line": 377, "end_column": 50 }, { "span": "self.assertTrue(four_url in json['urls'])", "start_line": 378, "start_column": 8, "end_line": 378, "end_column": 49 }, { "span": "self.assertTrue(len(json['urls']) == 2)", "start_line": 379, "start_column": 8, "end_line": 379, "end_column": 47 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 383, "start_column": 8, "end_line": 383, "end_column": 46 }, { "span": "self.assertTrue(five_url in json['urls'])", "start_line": 384, "start_column": 8, "end_line": 384, "end_column": 49 }, { "span": "self.assertTrue(len(json['urls']) == 1)", "start_line": 385, "start_column": 8, "end_line": 385, "end_column": 47 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 388, "start_column": 8, "end_line": 388, "end_column": 46 }, { "span": "self.assertTrue(five_url in json['urls'])", "start_line": 389, "start_column": 8, "end_line": 389, "end_column": 49 }, { "span": "self.assertTrue(len(json['urls']) == 1)", "start_line": 390, "start_column": 8, "end_line": 390, "end_column": 47 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 396, "start_column": 8, "end_line": 396, "end_column": 46 }, { "span": "self.assertTrue('Cache-Control' in rv.headers)", "start_line": 397, "start_column": 8, "end_line": 397, "end_column": 54 }, { "span": "self.assertTrue('no-cache' in cache)", "start_line": 399, "start_column": 8, "end_line": 399, "end_column": 44 }, { "span": "self.assertTrue('no-store' in cache)", "start_line": 400, "start_column": 8, "end_line": 400, "end_column": 44 }, { "span": "self.assertTrue('max-age=0' in cache)", "start_line": 401, "start_column": 8, "end_line": 401, "end_column": 45 }, { "span": "self.assertTrue(len(cache) == 3)", "start_line": 402, "start_column": 8, "end_line": 402, "end_column": 40 }, { "span": "self.assertTrue(rv.status_code == 201)", "start_line": 408, "start_column": 8, "end_line": 408, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 201)", "start_line": 412, "start_column": 8, "end_line": 412, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 417, "start_column": 8, "end_line": 417, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 420, "start_column": 8, "end_line": 420, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 304)", "start_line": 426, "start_column": 8, "end_line": 426, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 304)", "start_line": 429, "start_column": 8, "end_line": 429, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 432, "start_column": 8, "end_line": 432, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 304)", "start_line": 435, "start_column": 8, "end_line": 435, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 440, "start_column": 8, "end_line": 440, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 443, "start_column": 8, "end_line": 443, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 412)", "start_line": 446, "start_column": 8, "end_line": 446, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 449, "start_column": 8, "end_line": 449, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 453, "start_column": 8, "end_line": 453, "end_column": 46 }, { "span": "self.assertTrue(rv.status_code == 200)", "start_line": 458, "start_column": 8, "end_line": 458, "end_column": 46 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "API_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "password", "\\u", "auth_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "app_", "._", "config_", "[_", "'", "USE", "\\u", "TOKEN", "\\u", "AUTH", "'_", "]_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "good", "\\u", "client_", "=_", "Test", "Client_", "(_", "self_", "._", "app_", ",_", "self_", "._", "default", "\\u", "username_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "default", "\\u", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "good", "\\u", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "app_", "._", "config_", "[_", "'", "USE", "\\u", "TOKEN", "\\u", "AUTH", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "=_", "User_", "._", "query_", "._", "get_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "good", "\\u", "client_", "=_", "Test", "Client_", "(_", "self_", "._", "app_", ",_", "u_", "._", "generat", "e\\u", "auth", "\\u", "token_", "(_", ")_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "good", "\\u", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "API_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "bad", "\\u", "auth_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bad", "\\u", "client_", "=_", "Test", "Client_", "(_", "self_", "._", "app_", ",_", "'", "abc", "'_", ",_", "'", "def", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "bad", "\\u", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "401_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "app_", "._", "config_", "[_", "'", "USE", "\\u", "TOKEN", "\\u", "AUTH", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bad", "\\u", "client_", "=_", "Test", "Client_", "(_", "self_", "._", "app_", ",_", "'", "bad", "\\u", "token", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "bad", "\\u", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "401_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "API_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "students_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "collection_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "urls", "'_", "]_", "==_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "new_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "sus", "an", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sus", "an", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "sus", "an", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "name", "'_", "]_", "==_", "'", "sus", "an", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "url", "'_", "]_", "==_", "sus", "an", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "new_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "davi", "d", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "davi", "d\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "davi", "d\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "name", "'_", "]_", "==_", "'", "davi", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "url", "'_", "]_", "==_", "davi", "d\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "bad", " ", "request_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "data_", "=_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "lambda_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "not", "-", "name", "'_", ":_", "'", "davi", "d", "'_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "modify_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "put_", "(_", "davi", "d\\u", "url_", ",_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "davi", "d2", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "davi", "d\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "name", "'_", "]_", "==_", "'", "davi", "d2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "collection_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "sus", "an", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "davi", "d\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "delete_", "(_", "sus", "an", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "collection_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "sus", "an", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "davi", "d\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "API_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "classes_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "collection_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "classe", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "urls", "'_", "]_", "==_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "new_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "classe", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "algebra", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "algebra", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "algebra", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "name", "'_", "]_", "==_", "'", "algebra", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "url", "'_", "]_", "==_", "algebra", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "new_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "classe", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "lit", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lit", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "lit", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "name", "'_", "]_", "==_", "'", "lit", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "url", "'_", "]_", "==_", "lit", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "bad_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "classe", "s", "/'_", ",_", "data_", "=_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "lambda_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "classe", "s", "/'_", ",_", "data_", "=_", "{_", "'", "not", "-", "name", "'_", ":_", "'", "lit", "'_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "modify_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "put_", "(_", "lit", "\\u", "url_", ",_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "lit", "2", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "lit", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "name", "'_", "]_", "==_", "'", "lit", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "collection_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "classe", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "algebra", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "lit", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "delete_", "(_", "lit", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "collection_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "classe", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "algebra", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "lit", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "API_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "registration", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "create", " ", "new", " ", "students_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "sus", "an", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sus", "an", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "davi", "d", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "davi", "d\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "new", " ", "classes_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "classe", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "algebra", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "algebra", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "classe", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "lit", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lit", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "register", " ", "student", "s", " ", "to", " ", "classes_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "student", "'_", ":_", "sus", "an", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "class", "'_", ":_", "algebra", "\\u", "url_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sus", "an", "\\u", "in", "\\u", "algebra", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "student", "'_", ":_", "sus", "an", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "class", "'_", ":_", "lit", "\\u", "url_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sus", "an", "\\u", "in", "\\u", "lit", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "student", "'_", ":_", "davi", "d\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "class", "'_", ":_", "algebra", "\\u", "url_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "davi", "d\\u", "in", "\\u", "algebra", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "registration_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "sus", "an", "\\u", "in", "\\u", "lit", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "student", "'_", "]_", "==_", "sus", "an", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "class", "'_", "]_", "==_", "lit", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "collection_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "sus", "an", "\\u", "in", "\\u", "algebra", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "sus", "an", "\\u", "in", "\\u", "lit", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "davi", "d\\u", "in", "\\u", "algebra", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bad", " ", "registration", "s_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ",_", "data_", "=_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "lambda_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "student", "'_", ":_", "davi", "d\\u", "url_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "lambda_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "class", "'_", ":_", "algebra", "\\u", "url_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "lambda_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "student", "'_", ":_", "davi", "d\\u", "url_", ",_", "'", "class", "'_", ":_", "'", "bad", "-", "url", "'_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "lambda_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "student", "'_", ":_", "davi", "d\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "class", "'_", ":_", "algebra", "\\u", "url_", "+_", "'", "1", "'_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "session_", "._", "remove_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "classe", "s", " ", "from", " ", "each", " ", "student_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "sus", "an", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sus", "ans", "\\u", "reg", "\\u", "url_", "=_", "json_", "[_", "'", "registration", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "sus", "ans", "\\u", "reg", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "sus", "an", "\\u", "in", "\\u", "algebra", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "sus", "an", "\\u", "in", "\\u", "lit", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "davi", "d\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "davi", "ds", "\\u", "reg", "\\u", "url_", "=_", "json_", "[_", "'", "registration", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "davi", "ds", "\\u", "reg", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "davi", "d\\u", "in", "\\u", "algebra", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "student", "s", " ", "for", " ", "each", " ", "class_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "algebra", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "algebra", "s", "\\u", "reg", "\\u", "url_", "=_", "json_", "[_", "'", "registration", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "algebra", "s", "\\u", "reg", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "sus", "an", "\\u", "in", "\\u", "algebra", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "davi", "d\\u", "in", "\\u", "algebra", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "lit", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lit", "s", "\\u", "reg", "\\u", "url_", "=_", "json_", "[_", "'", "registration", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "lit", "s", "\\u", "reg", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "sus", "an", "\\u", "in", "\\u", "lit", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "unregister", " ", "students_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "delete_", "(_", "sus", "an", "\\u", "in", "\\u", "algebra", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "delete_", "(_", "davi", "d\\u", "in", "\\u", "algebra", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "collection_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "sus", "an", "\\u", "in", "\\u", "algebra", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "sus", "an", "\\u", "in", "\\u", "lit", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "davi", "d\\u", "in", "\\u", "algebra", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", " ", "student_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "delete_", "(_", "sus", "an", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "collection_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "API_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "rate", "\\u", "limits_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "app_", "._", "config_", "[_", "'", "USE", "\\u", "RAT", "E", "\\u", "LIMIT", "S", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "X", "-", "Rat", "e", "Limit", "-", "Rema", "inin", "g", "'_", "in_", "rv_", "._", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "X", "-", "Rat", "e", "Limit", "-", "Limit", "'_", "in_", "rv_", "._", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "X", "-", "Rat", "e", "Limit", "-", "Reset", "'_", "in_", "rv_", "._", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "int_", "(_", "rv_", "._", "headers_", "[_", "'", "X", "-", "Rat", "e", "Limit", "-", "Limit", "'_", "]_", ")_", "==_", "int_", "(_", "rv_", "._", "headers_", "[_", "'", "X", "-", "Rat", "e", "Limit", "-", "Rema", "inin", "g", "'_", "]_", ")_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "int_", "(_", "rv_", "._", "headers_", "[_", "'", "X", "-", "Rat", "e", "Limit", "-", "Rema", "inin", "g", "'_", "]_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "registration", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "429", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "API_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "pagination_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "create", " ", "sever", "al", " ", "students_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "one", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "one", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "two", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "two", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "three", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "three", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "four", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "four", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "five", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "five", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "collection", " ", "in", " ", "pages_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/?", "page", "=", "1", "&", "per", "\\u", "page", "=", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "one", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "two", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "total", "'_", "in_", "json_", "[_", "'", "meta", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "meta", "'_", "]_", "[_", "'", "total", "'_", "]_", "==_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "prev", "'_", "in_", "json_", "[_", "'", "meta", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "[_", "'", "meta", "'_", "]_", "[_", "'", "prev", "'_", "]_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "first", "\\u", "url_", "=_", "json_", "[_", "'", "meta", "'_", "]_", "[_", "'", "first", "'_", "]_", "._", "replace_", "(_", "'", "http", "://", "local", "host", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "url_", "=_", "json_", "[_", "'", "meta", "'_", "]_", "[_", "'", "last", "'_", "]_", "._", "replace_", "(_", "'", "http", "://", "local", "host", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "next", "\\u", "url_", "=_", "json_", "[_", "'", "meta", "'_", "]_", "[_", "'", "next", "'_", "]_", "._", "replace_", "(_", "'", "http", "://", "local", "host", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "first", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "one", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "two", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "next", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "three", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "four", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "next", "\\u", "url_", "=_", "json_", "[_", "'", "meta", "'_", "]_", "[_", "'", "next", "'_", "]_", "._", "replace_", "(_", "'", "http", "://", "local", "host", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "next", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "five", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "last", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "five", "\\u", "url_", "in_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "json_", "[_", "'", "urls", "'_", "]_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "API_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "cache", "\\u", "control_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "=_", "Test", "Client_", "(_", "self_", "._", "app_", ",_", "self_", "._", "default", "\\u", "username_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "default", "\\u", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "client_", "._", "get_", "(_", "'/", "auth", "/", "request", "-", "token", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "Cache", "-", "Control", "'_", "in_", "rv_", "._", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cache_", "=_", "[_", "c_", "._", "strip_", "(_", ")_", "for_", "c_", "in_", "rv_", "._", "headers_", "[_", "'", "Cache", "-", "Control", "'_", "]_", "._", "split_", "(_", "','_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "no", "-", "cache", "'_", "in_", "cache_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "no", "-", "store", "'_", "in_", "cache_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "max", "-", "age", "=", "0", "'_", "in_", "cache_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "cache_", ")_", "==_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "API_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "etag_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "create", " ", "two", " ", "students_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "one", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "one", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "post_", "(_", "'/", "api", "/", "v1", ".0", "/", "student", "s", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "two", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "201_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "two", "\\u", "url_", "=_", "rv_", "._", "headers_", "[_", "'", "Locat", "ion", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "thei", "r", " ", "eta", "gs_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "one", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "one", "\\u", "etag_", "=_", "rv_", "._", "headers_", "[_", "'", "ET", "ag", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "two", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "two", "\\u", "etag_", "=_", "rv_", "._", "headers_", "[_", "'", "ET", "ag", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "send", " ", "If", "-", "Non", "e-", "Match", " ", "header_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "one", "\\u", "url_", ",_", "headers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "If", "-", "Non", "e-", "Match", "'_", ":_", "one", "\\u", "etag_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "304_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "one", "\\u", "url_", ",_", "headers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "If", "-", "Non", "e-", "Match", "'_", ":_", "one", "\\u", "etag_", "+_", "',", " ", "'_", "+_", "two", "\\u", "etag_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "304_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "one", "\\u", "url_", ",_", "headers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "If", "-", "Non", "e-", "Match", "'_", ":_", "two", "\\u", "etag_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "one", "\\u", "url_", ",_", "headers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "If", "-", "Non", "e-", "Match", "'_", ":_", "two", "\\u", "etag_", "+_", "',", " ", "*'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "304_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "send", " ", "If", "-", "Match", " ", "header_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "one", "\\u", "url_", ",_", "headers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "If", "-", "Match", "'_", ":_", "one", "\\u", "etag_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "one", "\\u", "url_", ",_", "headers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "If", "-", "Match", "'_", ":_", "one", "\\u", "etag_", "+_", "',", " ", "'_", "+_", "two", "\\u", "etag_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "one", "\\u", "url_", ",_", "headers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "If", "-", "Match", "'_", ":_", "two", "\\u", "etag_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "412", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "one", "\\u", "url_", ",_", "headers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "If", "-", "Match", "'_", ":_", "'*'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "change", " ", "a", " ", "resource_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "put_", "(_", "one", "\\u", "url_", ",_", "data_", "=_", "{_", "'", "name", "'_", ":_", "'", "not", "-", "one", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "use", " ", "stale", " ", "etag_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", ",_", "json_", "=_", "self_", "._", "client_", "._", "get_", "(_", "one", "\\u", "url_", ",_", "headers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "If", "-", "Non", "e-", "Match", "'_", ":_", "one", "\\u", "etag_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rv_", "._", "status", "\\u", "code_", "==_", "200_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
Import of deprecated module
fogleman/FeedNotifier/patch/mf.py
[ { "content": "\"\"\"Find modules used by a script, using introspection.\"\"\"\n# This module should be kept compatible with Python 2.2, see PEP 291.\n\nfrom __future__ import generators\nimport dis\nimport imp\nimport marshal\nimport os\nimport sys\nimport types\nimport struct\n\nif hasattr(sys.__stdout__, \"newlines\"):\n READ_MODE = \"U\" # universal line endings\nelse:\n # remain compatible with Python < 2.3\n READ_MODE = \"r\"\n\nLOAD_CONST = chr(dis.opname.index('LOAD_CONST'))\nIMPORT_NAME = chr(dis.opname.index('IMPORT_NAME'))\nSTORE_NAME = chr(dis.opname.index('STORE_NAME'))\nSTORE_GLOBAL = chr(dis.opname.index('STORE_GLOBAL'))\nSTORE_OPS = [STORE_NAME, STORE_GLOBAL]\nHAVE_ARGUMENT = chr(dis.HAVE_ARGUMENT)\n\n# !!! NOTE BEFORE INCLUDING IN PYTHON DISTRIBUTION !!!\n# To clear up issues caused by the duplication of data structures between\n# the real Python modulefinder and this duplicate version, packagePathMap\n# and replacePackageMap are imported from the actual modulefinder. This\n# should be changed back to the assigments that are commented out below.\n# There are also py2exe specific pieces at the bottom of this file.\n\n\n# Modulefinder does a good job at simulating Python's, but it can not\n# handle __path__ modifications packages make at runtime. Therefore there\n# is a mechanism whereby you can register extra paths in this map for a\n# package, and it will be honored.\n\n# Note this is a mapping is lists of paths.\n#~ packagePathMap = {}\nfrom modulefinder import packagePathMap\n\n# A Public interface\n\n#~ replacePackageMap = {}\nfrom modulefinder import replacePackageMap\n\n# This ReplacePackage mechanism allows modulefinder to work around the\n# way the _xmlplus package injects itself under the name \"xml\" into\n# sys.modules at runtime by calling ReplacePackage(\"_xmlplus\", \"xml\")\n# before running ModuleFinder.\n\n\n\n\n\n\n\n\nif __name__ == '__main__':\n try:\n mf = test()\n except KeyboardInterrupt:\n print \"\\n[interrupt]\"\n\n\n\n# py2exe specific portion - this should be removed before inclusion in the\n# Python distribution\n\nimport tempfile\nimport urllib\n\ntry:\n set\nexcept NameError:\n from sets import Set as set\n\nBase = ModuleFinder\ndel ModuleFinder\n\n# Much inspired by Toby Dickenson's code:\n# http://www.tarind.com/depgraph.html\n\n\nTYPES = {imp.C_BUILTIN: \"(builtin module)\",\n imp.C_EXTENSION: \"extension module\",\n imp.IMP_HOOK: \"IMP_HOOK\",\n imp.PKG_DIRECTORY: \"package directory\",\n imp.PY_CODERESOURCE: \"PY_CODERESOURCE\",\n imp.PY_COMPILED: \"compiled python module\",\n imp.PY_FROZEN: \"frozen module\",\n imp.PY_RESOURCE: \"PY_RESOURCE\",\n imp.PY_SOURCE: \"python module\",\n imp.SEARCH_ERROR: \"SEARCH_ERROR\"\n }\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "sets ", "start_line": 695, "start_column": 9, "end_line": 695, "end_column": 13 } ]
[]
1
true
[ "[CLS]_", "Import_", "of_", "deprecated_", "module_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "Fin", "d", " ", "module", "s", " ", "used", " ", "by", " ", "a", " ", "script", ",", " ", "usi", "ng", " ", "introspect", "ion", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "module", " ", "shou", "ld", " ", "be", " ", "kep", "t", " ", "compatible", " ", "with", " ", "Pyth", "on", " ", "2.2", ",", " ", "see", " ", "PE", "P", " ", "291", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "generators_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "dis_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "imp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "marshal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "types_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "struct_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hasattr_", "(_", "sys_", "._", "\\u\\u", "stdout", "\\u\\u_", ",_", "\"", "newline", "s", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "READ", "\\u", "MODE_", "=_", "\"", "U", "\"_", "#", " ", "universal", " ", "line", " ", "ending", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "rema", "in", " ", "compatible", " ", "with", " ", "Pyth", "on", " ", " ", "<", " ", "2.3_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "READ", "\\u", "MODE_", "=_", "\"", "r", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "LOAD", "\\u", "CONST", "_", "=_", "chr_", "(_", "dis_", "._", "opname", "_", "._", "index_", "(_", "'", "LOAD", "\\u", "CONST", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "IMPORT", "\\u", "NAME_", "=_", "chr_", "(_", "dis_", "._", "opname", "_", "._", "index_", "(_", "'", "IMPORT", "\\u", "NAME", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STORE", "\\u", "NAME_", "=_", "chr_", "(_", "dis_", "._", "opname", "_", "._", "index_", "(_", "'", "STORE", "\\u", "NAME", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STORE", "\\u", "GLOBAL_", "=_", "chr_", "(_", "dis_", "._", "opname", "_", "._", "index_", "(_", "'", "STORE", "\\u", "GLOB", "AL", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STORE", "\\u", "OPS", "_", "=_", "[_", "STORE", "\\u", "NAME_", ",_", "STORE", "\\u", "GLOBAL_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "HA", "VE", "\\u", "ARGUMENT", "_", "=_", "chr_", "(_", "dis_", "._", "HA", "VE", "\\u", "ARGUMENT", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "!!!", " ", "NOTE", " ", "BEFORE", " ", "INC", "LU", "DING", " ", "IN", " ", "PYTHON", " ", "DISTRI", "BUT", "ION", " ", "!!!", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "To", " ", "clear", " ", "up", " ", "issue", "s", " ", "caus", "ed", " ", "by", " ", "the", " ", "duplicat", "ion", " ", "of", " ", "data", " ", "structure", "s", " ", "between_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "real", " ", "Pyth", "on", " ", "module", "finde", "r", " ", "and", " ", "this", " ", "duplicat", "e", " ", "version", ",", " ", "package", "Path", "Map_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "replace", "Packa", "ge", "Map", " ", "are", " ", "import", "ed", " ", "from", " ", "the", " ", "actual", " ", "module", "finde", "r", ".", " ", "Thi", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "shou", "ld", " ", "be", " ", "change", "d", " ", "back", " ", "to", " ", "the", " ", "assi", "gment", "s", " ", "tha", "t", " ", "are", " ", "commente", "d", " ", "out", " ", "belo", "w", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "There", " ", "are", " ", "als", "o", " ", "py2", "exe", " ", "specific", " ", "piece", "s", " ", "at", " ", "the", " ", "bottom", " ", "of", " ", "this", " ", "file", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Modul", "efin", "der", " ", "doe", "s", " ", "a", " ", "good", " ", "job", " ", "at", " ", "simulati", "ng", " ", "Pyth", "on", "'", "s", ",", " ", "but", " ", "it", " ", "can", " ", "not_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "handle", " ", "\\u\\u", "path", "\\u\\u", " ", "modification", "s", " ", "package", "s", " ", "make", " ", "at", " ", "runt", "ime", ".", " ", " ", "There", "fore", " ", "there", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "is", " ", "a", " ", "mechanism", " ", "where", "by", " ", "you", " ", "can", " ", "register", " ", "extra", " ", "path", "s", " ", "in", " ", "this", " ", "map", " ", "for", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "package", ",", " ", "and", " ", "it", " ", "will", " ", "be", " ", "honor", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Not", "e", " ", "this", " ", "is", " ", "a", " ", "mapping", " ", "is", " ", "lists", " ", "of", " ", "path", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "~", " ", "package", "Path", "Map", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "module", "finder_", "import_", "package", "Path", "Map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "Public", " ", "interface_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "~", " ", "replace", "Packa", "ge", "Map", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "module", "finder_", "import_", "replace", "Packa", "ge", "Map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "Replace", "Packa", "ge", " ", "mechanism", " ", "allow", "s", " ", "module", "finde", "r", " ", "to", " ", "work", " ", "aro", "und", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "way", " ", "the", " ", "\\u", "xml", "plus", " ", "package", " ", "inject", "s", " ", "its", "elf", " ", "under", " ", "the", " ", "name", " ", "\"", "xml", "\"", " ", "into_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sys", ".", "module", "s", " ", "at", " ", "runt", "ime", " ", "by", " ", "calling", " ", "Replace", "Packa", "ge", "(\"", "\\u", "xml", "plus", "\",", " ", "\"", "xml", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bef", "ore", " ", "runn", "ing", " ", "Modul", "e", "Fin", "der", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mf_", "=_", "test_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"\\\\", "n", "[", "interrupt", "]\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "py2", "exe", " ", "specific", " ", "porti", "on", " ", "-", " ", "this", " ", "shou", "ld", " ", "be", " ", "remove", "d", " ", "bef", "ore", " ", "inclusion", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "distribution_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "set_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Name", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "sets_", "import_", "Set_", "as_", "set_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Base_", "=_", "Modul", "e", "Finder_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "Modul", "e", "Finder_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Mu", "ch", " ", "inspire", "d", " ", "by", " ", "To", "by", " ", "Dic", "ken", "son", "'", "s", " ", "code", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "www", ".", "tari", "nd", ".", "com", "/", "dep", "graph", ".", "html_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "TYPES_", "=_", "{_", "imp_", "._", "C", "\\u", "BUILT", "IN_", ":_", "\"(", "bui", "lti", "n", " ", "module", ")\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "imp_", "._", "C", "\\u", "EXTENSION", "_", ":_", "\"", "extensi", "on", " ", "module", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "imp_", "._", "IMP", "\\u", "HOOK", "_", ":_", "\"", "IMP", "\\u", "HOOK", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "imp_", "._", "PKG", "\\u", "DIRECTORY_", ":_", "\"", "package", " ", "director", "y", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "imp_", "._", "PY", "\\u", "CODE", "RESOURCE_", ":_", "\"", "PY", "\\u", "CODE", "RES", "OUR", "CE", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "imp_", "._", "PY", "\\u", "COMPIL", "ED_", ":_", "\"", "compile", "d", " ", "python", " ", "module", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "imp_", "._", "PY", "\\u", "FR", "OZ", "EN_", ":_", "\"", "frozen", " ", "module", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "imp_", "._", "PY", "\\u", "RESOURCE_", ":_", "\"", "PY", "\\u", "RES", "OUR", "CE", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "imp_", "._", "PY", "\\u", "SOURCE_", ":_", "\"", "python", " ", "module", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "imp_", "._", "SEARCH", "\\u", "ERROR_", ":_", "\"", "SEARCH", "\\u", "ERROR", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
coderanger/pychef/chef/tests/test_fabric.py
[ { "content": "import mock\n\nfrom chef.fabric import chef_roledefs\nfrom chef.tests import ChefTestCase, mockSearch\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class FabricTestCase(ChefTestCase):\n \n", "metadata": "root.FabricTestCase", "header": "['module', '___EOS___']", "index": 5 }, { "content": " @mock.patch('chef.search.Search')\n def test_roledef(self, MockSearch):\n search_data = {\n ('role', '*:*'): {},\n }\n search_mock_memo = {}\n def search_mock(index, q='*:*', *args, **kwargs):\n data = search_data[index, q]\n search_mock_inst = search_mock_memo.get((index, q))\n if search_mock_inst is None:\n search_mock_inst = search_mock_memo[index, q] = mock.Mock()\n search_mock_inst.data = data\n return search_mock_inst\n MockSearch.side_effect = search_mock\n print(MockSearch('role').data)", "metadata": "root.FabricTestCase.test_roledef", "header": "['class', 'FabricTestCase', '(', 'ChefTestCase', ')', ':', '___EOS___']", "index": 6 }, { "content": " @mockSearch({('role', '*:*'): {1:2}})\n def test_roledef2(self, MockSearch):\n print(MockSearch('role').data)", "metadata": "root.FabricTestCase.test_roledef2", "header": "['class', 'FabricTestCase', '(', 'ChefTestCase', ')', ':', '___EOS___']", "index": 23 } ]
[ { "span": "from chef.fabric import chef_roledefs", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 37 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "mock_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "chef", "_", "._", "fabric_", "import_", "chef", "\\u", "role", "defs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "chef", "_", "._", "tests_", "import_", "Che", "f", "Test", "Case_", ",_", "mock", "Search_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Fabric", "Test", "Case_", "(_", "Che", "f", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Fabric", "Test", "Case_", "(_", "Che", "f", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "mock_", "._", "patch_", "(_", "'", "chef", ".", "search", ".", "Sear", "ch", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "role", "def_", "(_", "self_", ",_", "Moc", "k", "Search_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "search", "\\u", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "role", "'_", ",_", "'*", ":*", "'_", ")_", ":_", "{_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "search", "\\u", "mock", "\\u", "memo_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "search", "\\u", "mock_", "(_", "index_", ",_", "q_", "=_", "'*", ":*", "'_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "search", "\\u", "data_", "[_", "index_", ",_", "q_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "search", "\\u", "mock", "\\u", "inst_", "=_", "search", "\\u", "mock", "\\u", "memo_", "._", "get_", "(_", "(_", "index_", ",_", "q_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "search", "\\u", "mock", "\\u", "inst_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "search", "\\u", "mock", "\\u", "inst_", "=_", "search", "\\u", "mock", "\\u", "memo_", "[_", "index_", ",_", "q_", "]_", "=_", "mock_", "._", "Mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "search", "\\u", "mock", "\\u", "inst_", "._", "data_", "=_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "search", "\\u", "mock", "\\u", "inst_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Moc", "k", "Search_", "._", "side", "\\u", "effect_", "=_", "search", "\\u", "mock_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "Moc", "k", "Search_", "(_", "'", "role", "'_", ")_", "._", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fabric", "Test", "Case_", "(_", "Che", "f", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock", "Search_", "(_", "{_", "(_", "'", "role", "'_", ",_", "'*", ":*", "'_", ")_", ":_", "{_", "1_", ":_", "2_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "role", "def", "2_", "(_", "self_", ",_", "Moc", "k", "Search_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "Moc", "k", "Search_", "(_", "'", "role", "'_", ")_", "._", "data_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Variable defined multiple times
django-bmf/django-bmf/tests/workflow/tests.py
[ { "content": " def test_validation(self):\n\n # catch validations =======================================================\n\n msg = \"States-class no defined\"\n with self.assertRaises(ImproperlyConfigured, msg=msg):\n class TestWF(Workflow):\n class Transitions:\n pass\n\n msg = \"Transitions-class no defined\"\n with self.assertRaises(ImproperlyConfigured, msg=msg):\n class TestWF(Workflow):\n class States:\n pass\n\n msg = \"States-class is empty\"\n with self.assertRaises(ImproperlyConfigured, msg=msg):\n class TestWF(Workflow):\n class States:\n pass\n\n class Transitions:\n pass\n\n msg = \"No default State set\"\n with self.assertRaises(ImproperlyConfigured, msg=msg):\n class TestWF(Workflow):\n class States:\n test = State('Test', default=False)\n\n class Transitions:\n pass\n\n msg = \"Two default States set\"\n with self.assertRaises(ImproperlyConfigured, msg=msg):\n class TestWF(Workflow):\n class States:\n test1 = State('Test 1', default=True)\n test2 = State('Test 2', default=True)\n\n class Transitions:\n pass\n\n msg = \"Transition-State is not valid\"\n with self.assertRaises(ImproperlyConfigured, msg=msg):\n class TestWF(Workflow):\n class States:\n test1 = State('Test 1', default=True)\n test2 = State('Test 2')\n\n class Transitions:\n trans1 = Transition('Transition 1', 'test1', 'test3')\n\n msg = \"reserved name: instance\"\n with self.assertRaises(ImproperlyConfigured, msg=msg):\n class TestWF(Workflow):\n class States:\n test1 = State('Test 1', default=True)\n test2 = State('Test 2')\n\n class Transitions:\n instance = Transition('Transition 1', 'test1', 'test2')\n\n msg = \"transition name starts with underscrore\"\n with self.assertRaises(ImproperlyConfigured, msg=msg):\n class TestWF(Workflow):\n class States:\n test1 = State('Test 1', default=True)\n test2 = State('Test 2')\n\n class Transitions:\n _test = Transition('Transition 1', 'test1', 'test2')\n\n msg = \"reserved name: user\"\n with self.assertRaises(ImproperlyConfigured, msg=msg):\n class TestWF(Workflow):\n class States:\n test1 = State('Test 1', default=True)\n test2 = State('Test 2')\n\n class Transitions:\n user = Transition('Transition 1', 'test1', 'test2')", "metadata": "root.ClassTests.test_validation", "header": "['class', 'ClassTests', '(', 'TestCase', ')', ':', '___EOS___']", "index": 41 } ]
[ { "span": "TestWF(", "start_line": 47, "start_column": 18, "end_line": 47, "end_column": 24 }, { "span": "TestWF(", "start_line": 53, "start_column": 18, "end_line": 53, "end_column": 24 }, { "span": "TestWF(", "start_line": 59, "start_column": 18, "end_line": 59, "end_column": 24 }, { "span": "TestWF(", "start_line": 68, "start_column": 18, "end_line": 68, "end_column": 24 }, { "span": "TestWF(", "start_line": 77, "start_column": 18, "end_line": 77, "end_column": 24 }, { "span": "TestWF(", "start_line": 87, "start_column": 18, "end_line": 87, "end_column": 24 }, { "span": "TestWF(", "start_line": 97, "start_column": 18, "end_line": 97, "end_column": 24 }, { "span": "TestWF(", "start_line": 107, "start_column": 18, "end_line": 107, "end_column": 24 } ]
[ { "span": "TestWF(", "start_line": 117, "start_column": 18, "end_line": 117, "end_column": 24 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Class", "Tests_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "validation_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "catch", " ", "validation", "s", " ", "==============", "==============", "==============", "============", "=_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "\"", "State", "s", "-", "class", " ", "no", " ", "defin", "ed", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Impro", "perl", "y", "Configured_", ",_", "msg_", "=_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Test", "WF", "_", "(_", "Workflow_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Transiti", "ons_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "msg_", "=_", "\"", "Transiti", "ons", "-", "class", " ", "no", " ", "defin", "ed", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Impro", "perl", "y", "Configured_", ",_", "msg_", "=_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Test", "WF", "_", "(_", "Workflow_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "States_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "msg_", "=_", "\"", "State", "s", "-", "class", " ", "is", " ", "empty", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Impro", "perl", "y", "Configured_", ",_", "msg_", "=_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Test", "WF", "_", "(_", "Workflow_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "States_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Transiti", "ons_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "msg_", "=_", "\"", "No", " ", "default", " ", "State", " ", "set", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Impro", "perl", "y", "Configured_", ",_", "msg_", "=_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Test", "WF", "_", "(_", "Workflow_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "States_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "test_", "=_", "State_", "(_", "'", "Test", "'_", ",_", "default_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Transiti", "ons_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "msg_", "=_", "\"", "Tw", "o", " ", "default", " ", "State", "s", " ", "set", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Impro", "perl", "y", "Configured_", ",_", "msg_", "=_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Test", "WF", "_", "(_", "Workflow_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "States_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "test1_", "=_", "State_", "(_", "'", "Test", " ", "1", "'_", ",_", "default_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test2_", "=_", "State_", "(_", "'", "Test", " ", "2", "'_", ",_", "default_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Transiti", "ons_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "msg_", "=_", "\"", "Transiti", "on", "-", "State", " ", "is", " ", "not", " ", "valid", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Impro", "perl", "y", "Configured_", ",_", "msg_", "=_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Test", "WF", "_", "(_", "Workflow_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "States_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "test1_", "=_", "State_", "(_", "'", "Test", " ", "1", "'_", ",_", "default_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test2_", "=_", "State_", "(_", "'", "Test", " ", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Transiti", "ons_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "trans", "1_", "=_", "Transition_", "(_", "'", "Transiti", "on", " ", "1", "'_", ",_", "'", "test", "1", "'_", ",_", "'", "test", "3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "msg_", "=_", "\"", "reserve", "d", " ", "name", ":", " ", "instance", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Impro", "perl", "y", "Configured_", ",_", "msg_", "=_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Test", "WF", "_", "(_", "Workflow_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "States_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "test1_", "=_", "State_", "(_", "'", "Test", " ", "1", "'_", ",_", "default_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test2_", "=_", "State_", "(_", "'", "Test", " ", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Transiti", "ons_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "instance_", "=_", "Transition_", "(_", "'", "Transiti", "on", " ", "1", "'_", ",_", "'", "test", "1", "'_", ",_", "'", "test", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "msg_", "=_", "\"", "transiti", "on", " ", "name", " ", "starts", " ", "with", " ", "under", "scr", "ore", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Impro", "perl", "y", "Configured_", ",_", "msg_", "=_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Test", "WF", "_", "(_", "Workflow_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "States_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "test1_", "=_", "State_", "(_", "'", "Test", " ", "1", "'_", ",_", "default_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test2_", "=_", "State_", "(_", "'", "Test", " ", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Transiti", "ons_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "\\u", "test_", "=_", "Transition_", "(_", "'", "Transiti", "on", " ", "1", "'_", ",_", "'", "test", "1", "'_", ",_", "'", "test", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "msg_", "=_", "\"", "reserve", "d", " ", "name", ":", " ", "user", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Impro", "perl", "y", "Configured_", ",_", "msg_", "=_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Test", "WF", "_", "(_", "Workflow_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "States_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "test1_", "=_", "State_", "(_", "'", "Test", " ", "1", "'_", ",_", "default_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test2_", "=_", "State_", "(_", "'", "Test", " ", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Transiti", "ons_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "user_", "=_", "Transition_", "(_", "'", "Transiti", "on", " ", "1", "'_", ",_", "'", "test", "1", "'_", ",_", "'", "test", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Variable defined multiple times
daeilkim/refinery/refinery/bnpy/bnpy-dev/tests/suffstats/TestParamBag.py
[ { "content": " def test_insertEmptyComps_K1_D1(self, K=1, D=1):\n A = ParamBag(K=K, D=D)\n s = 123\n N = np.zeros(K)\n x = np.zeros((K,D))\n xxT = np.zeros((K,D,D))\n W = np.zeros((K,K))\n A.setField('s', s)\n A.setField('N', N, dims='K')\n A.setField('x', x, dims=('K','D'))\n A.setField('xxT', xxT, dims=('K','D','D'))\n A.setField('W', W, dims=('K','K'))\n A.insertEmptyComps(2)\n assert np.allclose(A.s, 123)\n assert np.allclose(A.N, np.zeros(K+2))\n assert np.allclose(A.x, np.zeros(K+2))\n assert np.allclose(A.xxT, np.zeros(K+2))\n assert np.allclose(A.W, np.zeros((K+2,K+2)))", "metadata": "root.TestParamBag.test_insertEmptyComps_K1_D1", "header": "['class', 'TestParamBag', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 32 }, { "content": " def test_insertEmptyComps_K1_D1(self, K=1, D=2):\n A = ParamBag(K=K, D=D)\n s = 123\n N = np.zeros(K)\n x = np.zeros((K,D))\n xxT = np.zeros((K,D,D))\n W = np.zeros((K,K))\n A.setField('s', s)\n A.setField('N', N, dims='K')\n A.setField('x', x, dims=('K','D'))\n A.setField('xxT', xxT, dims=('K','D','D'))\n A.setField('W', W, dims=('K','K'))\n A.insertEmptyComps(2)\n assert np.allclose(A.s, 123)\n assert np.allclose(A.N, np.zeros(K+2))\n assert np.allclose(A.x, np.zeros((K+2,D)))\n assert np.allclose(A.xxT, np.zeros((K+2,D,D)))\n assert np.allclose(A.W, np.zeros((K+2,K+2)))", "metadata": "root.TestParamBag.test_insertEmptyComps_K1_D1", "header": "['class', 'TestParamBag', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 51 }, { "content": " def test_parseArr_dim0_fails(self):\n ''' Verify fails for 0-dim input when K > 1\n '''\n PB2 = ParamBag(K=2, D=1)\n with self.assertRaises(ValueError):\n x = PB2.parseArr(1.23, dims=('K'))\n with self.assertRaises(ValueError):\n x = PB2.parseArr(1.23, dims='K')", "metadata": "root.TestParamBag.test_parseArr_dim0_fails", "header": "['class', 'TestParamBag', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 305 }, { "content": " def test_parseArr_dim1_fails(self):\n PB1 = ParamBag(K=1, D=1)\n with self.assertRaises(ValueError):\n x = PB1.parseArr([1.23], dims=('K','D'))\n\n PB2 = ParamBag(K=2, D=1)\n with self.assertRaises(ValueError):\n x = PB2.parseArr([1.23], dims=('K'))\n with self.assertRaises(ValueError):\n x = PB2.parseArr([1.23], dims=('K','D'))\n\n PB3 = ParamBag(K=1, D=3)\n with self.assertRaises(ValueError):\n x = PB3.parseArr([1.,2.], dims=('K','D'))\n\n PB3 = ParamBag(K=2, D=3)\n with self.assertRaises(ValueError):\n x = PB3.parseArr([1.,2.,3.,4.,5.,6.], dims=('K','D'))", "metadata": "root.TestParamBag.test_parseArr_dim1_fails", "header": "['class', 'TestParamBag', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 343 }, { "content": " def test_parseArr_dim2_fails(self):\n PB2 = ParamBag(K=2, D=2) \n with self.assertRaises(ValueError):\n x = PB2.parseArr([[1.,2]], dims=('K'))\n\n with self.assertRaises(ValueError):\n x = PB2.parseArr([[1.,2]], dims=('K','D'))\n\n with self.assertRaises(ValueError):\n x = PB2.parseArr(np.eye(3), dims=('K','D'))\n\n PB1 = ParamBag(K=1, D=2)\n with self.assertRaises(ValueError):\n # should be 1x2x2, not 2x2\n x = PB1.parseArr(np.eye(2), dims=('K','D','D'))", "metadata": "root.TestParamBag.test_parseArr_dim2_fails", "header": "['class', 'TestParamBag', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 373 }, { "content": " def test_parseArr_dim3_fails(self):\n PB = ParamBag(K=2, D=2) \n with self.assertRaises(ValueError):\n x = PB.parseArr([[[1.,2]]], dims=('K'))\n\n with self.assertRaises(ValueError):\n x = PB.parseArr([[[1.,2]]], dims=('K','D'))\n\n with self.assertRaises(ValueError):\n x = PB.parseArr(np.random.randn(3,3,3), dims=('K','D'))\n\n with self.assertRaises(ValueError):\n x = PB.parseArr(np.random.randn(3,3,3), dims=('K','D','D'))", "metadata": "root.TestParamBag.test_parseArr_dim3_fails", "header": "['class', 'TestParamBag', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 412 } ]
[ { "span": "test_insertEmptyComps_K1_D1(", "start_line": 32, "start_column": 6, "end_line": 32, "end_column": 33 }, { "span": "x ", "start_line": 310, "start_column": 6, "end_line": 310, "end_column": 7 }, { "span": "x ", "start_line": 346, "start_column": 6, "end_line": 346, "end_column": 7 }, { "span": "x ", "start_line": 350, "start_column": 6, "end_line": 350, "end_column": 7 }, { "span": "x ", "start_line": 352, "start_column": 6, "end_line": 352, "end_column": 7 }, { "span": "x ", "start_line": 356, "start_column": 6, "end_line": 356, "end_column": 7 }, { "span": "x ", "start_line": 376, "start_column": 6, "end_line": 376, "end_column": 7 }, { "span": "x ", "start_line": 379, "start_column": 6, "end_line": 379, "end_column": 7 }, { "span": "x ", "start_line": 382, "start_column": 6, "end_line": 382, "end_column": 7 }, { "span": "x ", "start_line": 415, "start_column": 6, "end_line": 415, "end_column": 7 }, { "span": "x ", "start_line": 418, "start_column": 6, "end_line": 418, "end_column": 7 }, { "span": "x ", "start_line": 421, "start_column": 6, "end_line": 421, "end_column": 7 } ]
[ { "span": "test_insertEmptyComps_K1_D1(", "start_line": 51, "start_column": 6, "end_line": 51, "end_column": 33 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Test", "Param", "Bag", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "insert", "Emp", "ty", "Comp", "s", "\\u", "K1", "\\u", "D1_", "(_", "self_", ",_", "K_", "=_", "1_", ",_", "D_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "A_", "=_", "Param", "Bag", "_", "(_", "K_", "=_", "K_", ",_", "D_", "=_", "D_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "123_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "N_", "=_", "np_", "._", "zeros_", "(_", "K_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "np_", "._", "zeros_", "(_", "(_", "K_", ",_", "D_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xx", "T_", "=_", "np_", "._", "zeros_", "(_", "(_", "K_", ",_", "D_", ",_", "D_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "W_", "=_", "np_", "._", "zeros_", "(_", "(_", "K_", ",_", "K_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A_", "._", "set", "Field_", "(_", "'", "s", "'_", ",_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A_", "._", "set", "Field_", "(_", "'", "N", "'_", ",_", "N_", ",_", "dims_", "=_", "'", "K", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A_", "._", "set", "Field_", "(_", "'", "x", "'_", ",_", "x_", ",_", "dims_", "=_", "(_", "'", "K", "'_", ",_", "'", "D", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A_", "._", "set", "Field_", "(_", "'", "xx", "T", "'_", ",_", "xx", "T_", ",_", "dims_", "=_", "(_", "'", "K", "'_", ",_", "'", "D", "'_", ",_", "'", "D", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A_", "._", "set", "Field_", "(_", "'", "W", "'_", ",_", "W_", ",_", "dims_", "=_", "(_", "'", "K", "'_", ",_", "'", "K", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A_", "._", "insert", "Emp", "ty", "Comp", "s_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "np_", "._", "allclose_", "(_", "A_", "._", "s_", ",_", "123_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "np_", "._", "allclose_", "(_", "A_", "._", "N_", ",_", "np_", "._", "zeros_", "(_", "K_", "+_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "np_", "._", "allclose_", "(_", "A_", "._", "x_", ",_", "np_", "._", "zeros_", "(_", "K_", "+_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "np_", "._", "allclose_", "(_", "A_", "._", "xx", "T_", ",_", "np_", "._", "zeros_", "(_", "K_", "+_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "np_", "._", "allclose_", "(_", "A_", "._", "W_", ",_", "np_", "._", "zeros_", "(_", "(_", "K_", "+_", "2_", ",_", "K_", "+_", "2_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Bag", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "insert", "Emp", "ty", "Comp", "s", "\\u", "K1", "\\u", "D1_", "(_", "self_", ",_", "K_", "=_", "1_", ",_", "D_", "=_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "A_", "=_", "Param", "Bag", "_", "(_", "K_", "=_", "K_", ",_", "D_", "=_", "D_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "123_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "N_", "=_", "np_", "._", "zeros_", "(_", "K_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "np_", "._", "zeros_", "(_", "(_", "K_", ",_", "D_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xx", "T_", "=_", "np_", "._", "zeros_", "(_", "(_", "K_", ",_", "D_", ",_", "D_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "W_", "=_", "np_", "._", "zeros_", "(_", "(_", "K_", ",_", "K_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A_", "._", "set", "Field_", "(_", "'", "s", "'_", ",_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A_", "._", "set", "Field_", "(_", "'", "N", "'_", ",_", "N_", ",_", "dims_", "=_", "'", "K", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A_", "._", "set", "Field_", "(_", "'", "x", "'_", ",_", "x_", ",_", "dims_", "=_", "(_", "'", "K", "'_", ",_", "'", "D", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A_", "._", "set", "Field_", "(_", "'", "xx", "T", "'_", ",_", "xx", "T_", ",_", "dims_", "=_", "(_", "'", "K", "'_", ",_", "'", "D", "'_", ",_", "'", "D", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A_", "._", "set", "Field_", "(_", "'", "W", "'_", ",_", "W_", ",_", "dims_", "=_", "(_", "'", "K", "'_", ",_", "'", "K", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A_", "._", "insert", "Emp", "ty", "Comp", "s_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "np_", "._", "allclose_", "(_", "A_", "._", "s_", ",_", "123_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "np_", "._", "allclose_", "(_", "A_", "._", "N_", ",_", "np_", "._", "zeros_", "(_", "K_", "+_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "np_", "._", "allclose_", "(_", "A_", "._", "x_", ",_", "np_", "._", "zeros_", "(_", "(_", "K_", "+_", "2_", ",_", "D_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "np_", "._", "allclose_", "(_", "A_", "._", "xx", "T_", ",_", "np_", "._", "zeros_", "(_", "(_", "K_", "+_", "2_", ",_", "D_", ",_", "D_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "np_", "._", "allclose_", "(_", "A_", "._", "W_", ",_", "np_", "._", "zeros_", "(_", "(_", "K_", "+_", "2_", ",_", "K_", "+_", "2_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Bag", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "parse", "Arr", "\\u", "dim", "0", "\\u", "fails_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Verify", " ", "fail", "s", " ", "for", " ", "0", "-", "dim", " ", "input", " ", "whe", "n", " ", "K", " ", ">", " ", "1", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PB", "2_", "=_", "Param", "Bag", "_", "(_", "K_", "=_", "2_", ",_", "D_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "PB", "2_", "._", "parse", "Arr_", "(_", "1.23", "_", ",_", "dims_", "=_", "(_", "'", "K", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "PB", "2_", "._", "parse", "Arr_", "(_", "1.23", "_", ",_", "dims_", "=_", "'", "K", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Bag", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "parse", "Arr", "\\u", "dim", "1", "\\u", "fails_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "PB", "1_", "=_", "Param", "Bag", "_", "(_", "K_", "=_", "1_", ",_", "D_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "PB", "1_", "._", "parse", "Arr_", "(_", "[_", "1.23", "_", "]_", ",_", "dims_", "=_", "(_", "'", "K", "'_", ",_", "'", "D", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "PB", "2_", "=_", "Param", "Bag", "_", "(_", "K_", "=_", "2_", ",_", "D_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "PB", "2_", "._", "parse", "Arr_", "(_", "[_", "1.23", "_", "]_", ",_", "dims_", "=_", "(_", "'", "K", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "PB", "2_", "._", "parse", "Arr_", "(_", "[_", "1.23", "_", "]_", ",_", "dims_", "=_", "(_", "'", "K", "'_", ",_", "'", "D", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "PB", "3_", "=_", "Param", "Bag", "_", "(_", "K_", "=_", "1_", ",_", "D_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "PB", "3_", "._", "parse", "Arr_", "(_", "[_", "1._", ",_", "2._", "]_", ",_", "dims_", "=_", "(_", "'", "K", "'_", ",_", "'", "D", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "PB", "3_", "=_", "Param", "Bag", "_", "(_", "K_", "=_", "2_", ",_", "D_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "PB", "3_", "._", "parse", "Arr_", "(_", "[_", "1._", ",_", "2._", ",_", "3._", ",_", "4._", ",_", "5._", ",_", "6._", "]_", ",_", "dims_", "=_", "(_", "'", "K", "'_", ",_", "'", "D", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Bag", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "parse", "Arr", "\\u", "dim", "2", "\\u", "fails_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "PB", "2_", "=_", "Param", "Bag", "_", "(_", "K_", "=_", "2_", ",_", "D_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "PB", "2_", "._", "parse", "Arr_", "(_", "[_", "[_", "1._", ",_", "2_", "]_", "]_", ",_", "dims_", "=_", "(_", "'", "K", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "PB", "2_", "._", "parse", "Arr_", "(_", "[_", "[_", "1._", ",_", "2_", "]_", "]_", ",_", "dims_", "=_", "(_", "'", "K", "'_", ",_", "'", "D", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "PB", "2_", "._", "parse", "Arr_", "(_", "np_", "._", "eye_", "(_", "3_", ")_", ",_", "dims_", "=_", "(_", "'", "K", "'_", ",_", "'", "D", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "PB", "1_", "=_", "Param", "Bag", "_", "(_", "K_", "=_", "1_", ",_", "D_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "shou", "ld", " ", "be", " ", "1x", "2x", "2", ",", " ", "not", " ", "2x", "2_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "PB", "1_", "._", "parse", "Arr_", "(_", "np_", "._", "eye_", "(_", "2_", ")_", ",_", "dims_", "=_", "(_", "'", "K", "'_", ",_", "'", "D", "'_", ",_", "'", "D", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Bag", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "parse", "Arr", "\\u", "dim", "3", "\\u", "fails_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "PB", "_", "=_", "Param", "Bag", "_", "(_", "K_", "=_", "2_", ",_", "D_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "PB", "_", "._", "parse", "Arr_", "(_", "[_", "[_", "[_", "1._", ",_", "2_", "]_", "]_", "]_", ",_", "dims_", "=_", "(_", "'", "K", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "PB", "_", "._", "parse", "Arr_", "(_", "[_", "[_", "[_", "1._", ",_", "2_", "]_", "]_", "]_", ",_", "dims_", "=_", "(_", "'", "K", "'_", ",_", "'", "D", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "PB", "_", "._", "parse", "Arr_", "(_", "np_", "._", "random_", "._", "randn_", "(_", "3_", ",_", "3_", ",_", "3_", ")_", ",_", "dims_", "=_", "(_", "'", "K", "'_", ",_", "'", "D", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "PB", "_", "._", "parse", "Arr_", "(_", "np_", "._", "random_", "._", "randn_", "(_", "3_", ",_", "3_", ",_", "3_", ")_", ",_", "dims_", "=_", "(_", "'", "K", "'_", ",_", "'", "D", "'_", ",_", "'", "D", "'_", ")_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
osrg/ryu/ryu/tests/unit/ofproto/test_parser_ofpstats.py
[ { "content": "def _add_tests():\n import functools\n import itertools\n\n class Field(object):\n pass\n\n class Int1(Field):\n @staticmethod\n def generate():\n yield 0\n yield 0xff\n\n class Int2(Field):\n @staticmethod\n def generate():\n yield 0\n yield 0x1234\n yield 0xffff\n\n class Int3(Field):\n @staticmethod\n def generate():\n yield 0\n yield 0x123456\n yield 0xffffff\n\n class Int4(Field):\n @staticmethod\n def generate():\n yield 0\n yield 0x12345678\n yield 0xffffffff\n\n class Int4double(Field):\n @staticmethod\n def generate():\n # Note: If yield value as a tuple, flatten_one() will reduce it\n # into a single value. So the followings avoid this problem by\n # using a list value.\n yield [0, 1]\n yield [0x12345678, 0x23456789]\n yield [0xffffffff, 0xfffffffe]\n\n class Int8(Field):\n @staticmethod\n def generate():\n yield 0\n yield 0x123456789abcdef0\n yield 0xffffffffffffffff\n\n class Mac(Field):\n @staticmethod\n def generate():\n yield '00:00:00:00:00:00'\n yield 'f2:0b:a4:7d:f8:ea'\n yield 'ff:ff:ff:ff:ff:ff'\n\n class IPv4(Field):\n @staticmethod\n def generate():\n yield '0.0.0.0'\n yield '192.0.2.1'\n yield '255.255.255.255'\n\n class IPv6(Field):\n @staticmethod\n def generate():\n yield '::'\n yield 'fe80::f00b:a4ff:fed0:3f70'\n yield 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'\n\n class B64(Field):\n @staticmethod\n def generate():\n yield 'aG9nZWhvZ2U='\n yield 'ZnVnYWZ1Z2E='\n\n ofpps = [ofproto_v1_5_parser]\n common = [\n ('duration', Int4double),\n ('idle_time', Int4double),\n ('flow_count', Int4),\n ('packet_count', Int8),\n ('byte_count', Int8),\n ('field_100', B64),\n ]\n L = {}\n L[ofproto_v1_5_parser] = common\n\n def flatten_one(l, i):\n if isinstance(i, tuple):\n return l + flatten(i)\n else:\n return l + [i]\n flatten = lambda l: reduce(flatten_one, l, [])\n\n for ofpp in ofpps:\n for n in range(1, 3):\n for C in itertools.combinations(L[ofpp], n):\n l = [1]\n keys = []\n clss = []\n for (k, cls) in C:\n l = itertools.product(l, cls.generate())\n keys.append(k)\n clss.append(cls)\n l = [flatten(x)[1:] for x in l]\n for values in l:\n d = dict(zip(keys, values))\n for n, uv in d.items():\n if isinstance(uv, list):\n # XXX\n # OFPStats returns value as tuple when field is\n # 'duration' or 'idle_time'. Then convert list\n # value into tuple here.\n d[n] = tuple(uv)\n mod = ofpp.__name__.split('.')[-1]\n method_name = 'test_' + mod\n for k in sorted(dict(d).keys()):\n method_name += '_' + str(k)\n method_name += '_' + str(d[k])\n method_name = method_name.replace(':', '_')\n method_name = method_name.replace('.', '_')\n method_name = method_name.replace('(', '_')\n method_name = method_name.replace(')', '_')\n method_name = method_name.replace(',', '_')\n method_name = method_name.replace(\"'\", '_')\n method_name = method_name.replace(' ', '_')\n\n def _run(self, name, ofpp, d):\n print('processing %s ...' % name)\n if six.PY3:\n self._test(self, name, ofpp, d)\n else:\n self._test(name, ofpp, d)\n print('adding %s ...' % method_name)\n f = functools.partial(_run, name=method_name,\n ofpp=ofpp, d=d)\n test_lib.add_method(Test_Parser_OFPStats,\n method_name, f)", "metadata": "root._add_tests", "header": "['module', '___EOS___']", "index": 64 } ]
[ { "span": "Int1(", "start_line": 71, "start_column": 10, "end_line": 71, "end_column": 14 }, { "span": "Int2(", "start_line": 77, "start_column": 10, "end_line": 77, "end_column": 14 }, { "span": "Int3(", "start_line": 84, "start_column": 10, "end_line": 84, "end_column": 14 }, { "span": "Mac(", "start_line": 115, "start_column": 10, "end_line": 115, "end_column": 13 }, { "span": "IPv4(", "start_line": 122, "start_column": 10, "end_line": 122, "end_column": 14 }, { "span": "IPv6(", "start_line": 129, "start_column": 10, "end_line": 129, "end_column": 14 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "add", "\\u", "tests_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "functools_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "itertools_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Field_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Int", "1_", "(_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "generate_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "0xff_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Int", "2_", "(_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "generate_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "0x12", "34_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "0xffff_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Int", "3_", "(_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "generate_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "0x12", "3456", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "0xfff", "fff", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Int", "4_", "(_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "generate_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "0x12", "3456", "78_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "0xffffffff_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Int", "4d", "ou", "ble_", "(_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "generate_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Not", "e", ":", " ", "If", " ", "yield", " ", "value", " ", "as", " ", "a", " ", "tuple", ",", " ", "flat", "ten", "\\u", "one", "()", " ", "will", " ", "reduce", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "int", "o", " ", "a", " ", "single", " ", "value", ".", " ", "So", " ", "the", " ", "follow", "ings", " ", "avoid", " ", "this", " ", "problem", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "usi", "ng", " ", "a", " ", "list", " ", "value", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "[_", "0_", ",_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "[_", "0x12", "3456", "78_", ",_", "0x23", "4567", "89_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "[_", "0xffffffff_", ",_", "0xfff", "fff", "fe_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Int8_", "(_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "generate_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "0x12", "3456", "789", "abcde", "f0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "0xfff", "ffffffffff", "fff", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Mac", "_", "(_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "generate_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "'", "00", ":", "00", ":", "00", ":", "00", ":", "00", ":", "00", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "'", "f2", ":", "0b", ":", "a4", ":", "7d", ":", "f8", ":", "ea", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "'", "ff", ":", "ff", ":", "ff", ":", "ff", ":", "ff", ":", "ff", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "IP", "v4_", "(_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "generate_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "'", "0.", "0.", "0.", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "'", "192", ".0", ".2", ".1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "'", "255.", "255.", "255.", "255", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "IP", "v6_", "(_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "generate_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "'::'", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "'", "fe", "80", "::", "f0", "0b", ":", "a4", "ff", ":", "fed", "0", ":", "3f", "7", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "'", "fff", "f", ":", "fff", "f", ":", "fff", "f", ":", "fff", "f", ":", "fff", "f", ":", "fff", "f", ":", "fff", "f", ":", "fff", "f", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "B6", "4_", "(_", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "generate_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "'", "a", "G", "9", "n", "ZW", "hv", "Z2", "U", "='_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "'", "Z", "n", "Vn", "Y", "WZ", "1", "Z2", "E", "='_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ofp", "ps_", "=_", "[_", "ofproto", "\\u", "v1", "\\u", "5", "\\u", "parser_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "common_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "duration", "'_", ",_", "Int", "4d", "ou", "ble_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "idle", "\\u", "time", "'_", ",_", "Int", "4d", "ou", "ble_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "flow", "\\u", "count", "'_", ",_", "Int", "4_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "packet", "\\u", "count", "'_", ",_", "Int8_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "byte", "\\u", "count", "'_", ",_", "Int8_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "field", "\\u", "100", "'_", ",_", "B6", "4_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "L_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "L_", "[_", "ofproto", "\\u", "v1", "\\u", "5", "\\u", "parser_", "]_", "=_", "common_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "flat", "ten", "\\u", "one_", "(_", "l_", ",_", "i_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "i_", ",_", "tuple_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "l_", "+_", "flatten_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "l_", "+_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "flatten_", "=_", "lambda_", "l_", ":_", "reduce_", "(_", "flat", "ten", "\\u", "one_", ",_", "l_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "ofp", "p_", "in_", "ofp", "ps_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "n_", "in_", "range_", "(_", "1_", ",_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "C_", "in_", "itertools_", "._", "combinations_", "(_", "L_", "[_", "ofp", "p_", "]_", ",_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "l_", "=_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keys_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "k_", ",_", "cls_", ")_", "in_", "C_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "l_", "=_", "itertools_", "._", "product_", "(_", "l_", ",_", "cls_", "._", "generate_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keys_", "._", "append_", "(_", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls", "s_", "._", "append_", "(_", "cls_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "l_", "=_", "[_", "flatten_", "(_", "x_", ")_", "[_", "1_", ":_", "]_", "for_", "x_", "in_", "l_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "values_", "in_", "l_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "d_", "=_", "dict_", "(_", "zip_", "(_", "keys_", ",_", "values_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "n_", ",_", "uv_", "in_", "d_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "isinstance_", "(_", "uv_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "XX", "X_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "OFP", "Stat", "s", " ", "return", "s", " ", "value", " ", "as", " ", "tuple", " ", "whe", "n", " ", "field", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "'", "duration", "'", " ", "or", " ", "'", "idle", "\\u", "time", "'.", " ", "The", "n", " ", "convert", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "value", " ", "int", "o", " ", "tuple", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "d_", "[_", "n_", "]_", "=_", "tuple_", "(_", "uv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mod_", "=_", "ofp", "p_", "._", "\\u\\u", "name\\u\\u_", "._", "split_", "(_", "'.'_", ")_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "method", "\\u", "name_", "=_", "'", "test\\u", "'_", "+_", "mod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", "in_", "sorted_", "(_", "dict_", "(_", "d_", ")_", "._", "keys_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "method", "\\u", "name_", "+=_", "'\\u'_", "+_", "str_", "(_", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "method", "\\u", "name_", "+=_", "'\\u'_", "+_", "str_", "(_", "d_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "method", "\\u", "name_", "=_", "method", "\\u", "name_", "._", "replace_", "(_", "':'_", ",_", "'\\u'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "method", "\\u", "name_", "=_", "method", "\\u", "name_", "._", "replace_", "(_", "'.'_", ",_", "'\\u'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "method", "\\u", "name_", "=_", "method", "\\u", "name_", "._", "replace_", "(_", "'('_", ",_", "'\\u'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "method", "\\u", "name_", "=_", "method", "\\u", "name_", "._", "replace_", "(_", "')'_", ",_", "'\\u'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "method", "\\u", "name_", "=_", "method", "\\u", "name_", "._", "replace_", "(_", "','_", ",_", "'\\u'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "method", "\\u", "name_", "=_", "method", "\\u", "name_", "._", "replace_", "(_", "\"'\"_", ",_", "'\\u'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "method", "\\u", "name_", "=_", "method", "\\u", "name_", "._", "replace_", "(_", "'", " ", "'_", ",_", "'\\u'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "run_", "(_", "self_", ",_", "name_", ",_", "ofp", "p_", ",_", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "(_", "'", "process", "ing", " ", "%", "s", " ", "...'_", "%_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "six_", "._", "PY", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "\\u", "test_", "(_", "self_", ",_", "name_", ",_", "ofp", "p_", ",_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "\\u", "test_", "(_", "name_", ",_", "ofp", "p_", ",_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "'", "addin", "g", " ", "%", "s", " ", "...'_", "%_", "method", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "functools_", "._", "partial_", "(_", "\\u", "run_", ",_", "name_", "=_", "method", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ofp", "p_", "=_", "ofp", "p_", ",_", "d_", "=_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "lib_", "._", "add", "\\u", "method_", "(_", "Test", "\\u", "Parser", "\\u", "OFP", "Stats_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "method", "\\u", "name_", ",_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
amrdraz/kodr/app/brython/www/src/Lib/test/test_tools.py
[ { "content": "\"\"\"Tests for scripts in the Tools directory.\n\nThis file contains regression tests for some of the scripts found in the\nTools directory of a Python checkout or tarball, such as reindent.py.\n\"\"\"\n\nimport os\nimport sys\nimport importlib.machinery\nimport unittest\nfrom unittest import mock\nimport shutil\nimport subprocess\nimport sysconfig\nimport tempfile\nimport textwrap\nfrom test import support\nfrom test.script_helper import assert_python_ok, temp_dir\n\nif not sysconfig.is_python_build():\n # XXX some installers do contain the tools, should we detect that\n # and run the tests in that case too?\n raise unittest.SkipTest('test irrelevant for an installed Python')\n\nbasepath = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))),\n 'Tools')\nscriptsdir = os.path.join(basepath, 'scripts')\n\n\n\n\n\n\n\n\n\n\n\n\n# Run the tests in Tools/parser/test_unparse.py\nwith support.DirsOnSysPath(os.path.join(basepath, 'parser')):\n from test_unparse import UnparseTestCase\n from test_unparse import DirectoryTestCase\n\n\n\n\nif __name__ == '__main__':\n unittest.main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class ReindentTests(unittest.TestCase):\n script = os.path.join(scriptsdir, 'reindent.py')\n\n", "metadata": "root.ReindentTests", "header": "['module', '___EOS___']", "index": 29 }, { "content": " def test_noargs(self):\n assert_python_ok(self.script)", "metadata": "root.ReindentTests.test_noargs", "header": "['class', 'ReindentTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 32 }, { "content": " def test_help(self):\n rc, out, err = assert_python_ok(self.script, '-h')\n self.assertEqual(out, b'')\n self.assertGreater(err, b'')", "metadata": "root.ReindentTests.test_help", "header": "['class', 'ReindentTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 35 }, { "content": "class PindentTests(unittest.TestCase):\n script = os.path.join(scriptsdir, 'pindent.py')\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.PindentTests", "header": "['module', '___EOS___']", "index": 41 }, { "content": " def assertFileEqual(self, fn1, fn2):\n with open(fn1) as f1, open(fn2) as f2:\n self.assertEqual(f1.readlines(), f2.readlines())", "metadata": "root.PindentTests.assertFileEqual", "header": "['class', 'PindentTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 44 }, { "content": " def pindent(self, source, *args):\n with subprocess.Popen(\n (sys.executable, self.script) + args,\n stdin=subprocess.PIPE, stdout=subprocess.PIPE,\n universal_newlines=True) as proc:\n out, err = proc.communicate(source)\n self.assertIsNone(err)\n return out", "metadata": "root.PindentTests.pindent", "header": "['class', 'PindentTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 48 }, { "content": " def lstriplines(self, data):\n return '\\n'.join(line.lstrip() for line in data.splitlines()) + '\\n'", "metadata": "root.PindentTests.lstriplines", "header": "['class', 'PindentTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 57 }, { "content": " def test_selftest(self):\n self.maxDiff = None\n with temp_dir() as directory:\n data_path = os.path.join(directory, '_test.py')\n with open(self.script) as f:\n closed = f.read()\n with open(data_path, 'w') as f:\n f.write(closed)\n\n rc, out, err = assert_python_ok(self.script, '-d', data_path)\n self.assertEqual(out, b'')\n self.assertEqual(err, b'')\n backup = data_path + '~'\n self.assertTrue(os.path.exists(backup))\n with open(backup) as f:\n self.assertEqual(f.read(), closed)\n with open(data_path) as f:\n clean = f.read()\n compile(clean, '_test.py', 'exec')\n self.assertEqual(self.pindent(clean, '-c'), closed)\n self.assertEqual(self.pindent(closed, '-d'), clean)\n\n rc, out, err = assert_python_ok(self.script, '-c', data_path)\n self.assertEqual(out, b'')\n self.assertEqual(err, b'')\n with open(backup) as f:\n self.assertEqual(f.read(), clean)\n with open(data_path) as f:\n self.assertEqual(f.read(), closed)\n\n broken = self.lstriplines(closed)\n with open(data_path, 'w') as f:\n f.write(broken)\n rc, out, err = assert_python_ok(self.script, '-r', data_path)\n self.assertEqual(out, b'')\n self.assertEqual(err, b'')\n with open(backup) as f:\n self.assertEqual(f.read(), broken)\n with open(data_path) as f:\n indented = f.read()\n compile(indented, '_test.py', 'exec')\n self.assertEqual(self.pindent(broken, '-r'), indented)", "metadata": "root.PindentTests.test_selftest", "header": "['class', 'PindentTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 60 }, { "content": " def pindent_test(self, clean, closed):\n self.assertEqual(self.pindent(clean, '-c'), closed)\n self.assertEqual(self.pindent(closed, '-d'), clean)\n broken = self.lstriplines(closed)\n self.assertEqual(self.pindent(broken, '-r', '-e', '-s', '4'), closed)", "metadata": "root.PindentTests.pindent_test", "header": "['class', 'PindentTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 103 }, { "content": " def test_statements(self):\n clean = textwrap.dedent(\"\"\"\\\n if a:\n pass\n\n if a:\n pass\n else:\n pass\n\n if a:\n pass\n elif:\n pass\n else:\n pass\n\n while a:\n break\n\n while a:\n break\n else:\n pass\n\n for i in a:\n break\n\n for i in a:\n break\n else:\n pass\n\n try:\n pass\n finally:\n pass\n\n try:\n pass\n except TypeError:\n pass\n except ValueError:\n pass\n else:\n pass\n\n try:\n pass\n except TypeError:\n pass\n except ValueError:\n pass\n finally:\n pass\n\n with a:\n pass\n\n class A:\n pass\n\n def f():\n pass\n \"\"\")\n\n closed = textwrap.dedent(\"\"\"\\\n if a:\n pass\n # end if\n\n if a:\n pass\n else:\n pass\n # end if\n\n if a:\n pass\n elif:\n pass\n else:\n pass\n # end if\n\n while a:\n break\n # end while\n\n while a:\n break\n else:\n pass\n # end while\n\n for i in a:\n break\n # end for\n\n for i in a:\n break\n else:\n pass\n # end for\n\n try:\n pass\n finally:\n pass\n # end try\n\n try:\n pass\n except TypeError:\n pass\n except ValueError:\n pass\n else:\n pass\n # end try\n\n try:\n pass\n except TypeError:\n pass\n except ValueError:\n pass\n finally:\n pass\n # end try\n\n with a:\n pass\n # end with\n\n class A:\n pass\n # end class A\n\n def f():\n pass\n # end def f\n \"\"\")\n self.pindent_test(clean, closed)", "metadata": "root.PindentTests.test_statements", "header": "['class', 'PindentTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 109 }, { "content": " def test_multilevel(self):\n clean = textwrap.dedent(\"\"\"\\\n def foobar(a, b):\n if a == b:\n a = a+1\n elif a < b:\n b = b-1\n if b > a: a = a-1\n else:\n print 'oops!'\n \"\"\")\n closed = textwrap.dedent(\"\"\"\\\n def foobar(a, b):\n if a == b:\n a = a+1\n elif a < b:\n b = b-1\n if b > a: a = a-1\n # end if\n else:\n print 'oops!'\n # end if\n # end def foobar\n \"\"\")\n self.pindent_test(clean, closed)", "metadata": "root.PindentTests.test_multilevel", "header": "['class', 'PindentTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 254 }, { "content": " def test_preserve_indents(self):\n clean = textwrap.dedent(\"\"\"\\\n if a:\n if b:\n pass\n \"\"\")\n closed = textwrap.dedent(\"\"\"\\\n if a:\n if b:\n pass\n # end if\n # end if\n \"\"\")\n self.assertEqual(self.pindent(clean, '-c'), closed)\n self.assertEqual(self.pindent(closed, '-d'), clean)\n broken = self.lstriplines(closed)\n self.assertEqual(self.pindent(broken, '-r', '-e', '-s', '9'), closed)\n clean = textwrap.dedent(\"\"\"\\\n if a:\n \\tif b:\n \\t\\tpass\n \"\"\")\n closed = textwrap.dedent(\"\"\"\\\n if a:\n \\tif b:\n \\t\\tpass\n \\t# end if\n # end if\n \"\"\")\n self.assertEqual(self.pindent(clean, '-c'), closed)\n self.assertEqual(self.pindent(closed, '-d'), clean)\n broken = self.lstriplines(closed)\n self.assertEqual(self.pindent(broken, '-r'), closed)", "metadata": "root.PindentTests.test_preserve_indents", "header": "['class', 'PindentTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 280 }, { "content": " def test_escaped_newline(self):\n clean = textwrap.dedent(\"\"\"\\\n class\\\\\n \\\\\n A:\n def\\\n \\\\\n f:\n pass\n \"\"\")\n closed = textwrap.dedent(\"\"\"\\\n class\\\\\n \\\\\n A:\n def\\\n \\\\\n f:\n pass\n # end def f\n # end class A\n \"\"\")\n self.assertEqual(self.pindent(clean, '-c'), closed)\n self.assertEqual(self.pindent(closed, '-d'), clean)", "metadata": "root.PindentTests.test_escaped_newline", "header": "['class', 'PindentTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 314 }, { "content": " def test_empty_line(self):\n clean = textwrap.dedent(\"\"\"\\\n if a:\n\n pass\n \"\"\")\n closed = textwrap.dedent(\"\"\"\\\n if a:\n\n pass\n # end if\n \"\"\")\n self.pindent_test(clean, closed)", "metadata": "root.PindentTests.test_empty_line", "header": "['class', 'PindentTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 338 }, { "content": " def test_oneline(self):\n clean = textwrap.dedent(\"\"\"\\\n if a: pass\n \"\"\")\n closed = textwrap.dedent(\"\"\"\\\n if a: pass\n # end if\n \"\"\")\n self.pindent_test(clean, closed)", "metadata": "root.PindentTests.test_oneline", "header": "['class', 'PindentTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 352 }, { "content": "class TestSundryScripts(unittest.TestCase):\n # At least make sure the rest don't have syntax errors. When tests are\n # added for a script it should be added to the whitelist below.\n\n # scripts that have independent tests.\n whitelist = ['reindent.py', 'pdeps.py', 'gprof2html']\n # scripts that can't be imported without running\n blacklist = ['make_ctype.py']\n # scripts that use windows-only modules\n windows_only = ['win_add2path.py']\n # blacklisted for other reasons\n other = ['analyze_dxp.py']\n\n skiplist = blacklist + whitelist + windows_only + other\n\n\n\n", "metadata": "root.TestSundryScripts", "header": "['module', '___EOS___']", "index": 363 }, { "content": " def setUp(self):\n cm = support.DirsOnSysPath(scriptsdir)\n cm.__enter__()\n self.addCleanup(cm.__exit__)", "metadata": "root.TestSundryScripts.setUp", "header": "['class', 'TestSundryScripts', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', \"# At least make sure the rest don't have syntax errors. When tests are\", '___NL___', '# added for a script it should be added to the whitelist below.', '___NL___', '___NL___', '# scripts that have independent tests.', '___NL___', '___EOS___']", "index": 378 }, { "content": " def test_sundry(self):\n for fn in os.listdir(scriptsdir):\n if fn.endswith('.py') and fn not in self.skiplist:\n __import__(fn[:-3])", "metadata": "root.TestSundryScripts.test_sundry", "header": "['class', 'TestSundryScripts', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', \"# At least make sure the rest don't have syntax errors. When tests are\", '___NL___', '# added for a script it should be added to the whitelist below.', '___NL___', '___NL___', '# scripts that have independent tests.', '___NL___', '___EOS___']", "index": 383 }, { "content": " @unittest.skipIf(sys.platform != \"win32\", \"Windows-only test\")\n def test_sundry_windows(self):\n for fn in self.windows_only:\n __import__(fn[:-3])", "metadata": "root.TestSundryScripts.test_sundry_windows", "header": "['class', 'TestSundryScripts', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', \"# At least make sure the rest don't have syntax errors. When tests are\", '___NL___', '# added for a script it should be added to the whitelist below.', '___NL___', '___NL___', '# scripts that have independent tests.', '___NL___', '___EOS___']", "index": 388 }, { "content": " @unittest.skipIf(not support.threading, \"test requires _thread module\")\n def test_analyze_dxp_import(self):\n if hasattr(sys, 'getdxp'):\n import analyze_dxp\n else:\n with self.assertRaises(RuntimeError):\n import analyze_dxp", "metadata": "root.TestSundryScripts.test_analyze_dxp_import", "header": "['class', 'TestSundryScripts', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', \"# At least make sure the rest don't have syntax errors. When tests are\", '___NL___', '# added for a script it should be added to the whitelist below.', '___NL___', '___NL___', '# scripts that have independent tests.', '___NL___', '___EOS___']", "index": 393 }, { "content": "class PdepsTests(unittest.TestCase):\n\n\n\n", "metadata": "root.PdepsTests", "header": "['module', '___EOS___']", "index": 402 }, { "content": " @classmethod\n def setUpClass(self):\n path = os.path.join(scriptsdir, 'pdeps.py')\n loader = importlib.machinery.SourceFileLoader('pdeps', path)\n self.pdeps = loader.load_module()", "metadata": "root.PdepsTests.setUpClass", "header": "['class', 'PdepsTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 404 }, { "content": " @classmethod\n def tearDownClass(self):\n if 'pdeps' in sys.modules:\n del sys.modules['pdeps']", "metadata": "root.PdepsTests.tearDownClass", "header": "['class', 'PdepsTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 410 }, { "content": " def test_process_errors(self):\n # Issue #14492: m_import.match(line) can be None.\n with tempfile.TemporaryDirectory() as tmpdir:\n fn = os.path.join(tmpdir, 'foo')\n with open(fn, 'w') as stream:\n stream.write(\"#!/this/will/fail\")\n self.pdeps.process(fn, {})", "metadata": "root.PdepsTests.test_process_errors", "header": "['class', 'PdepsTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 415 }, { "content": " def test_inverse_attribute_error(self):\n # Issue #14492: this used to fail with an AttributeError.\n self.pdeps.inverse({'a': []})", "metadata": "root.PdepsTests.test_inverse_attribute_error", "header": "['class', 'PdepsTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 423 }, { "content": "class Gprof2htmlTests(unittest.TestCase):\n\n", "metadata": "root.Gprof2htmlTests", "header": "['module', '___EOS___']", "index": 428 }, { "content": " def setUp(self):\n path = os.path.join(scriptsdir, 'gprof2html.py')\n loader = importlib.machinery.SourceFileLoader('gprof2html', path)\n self.gprof = loader.load_module()\n oldargv = sys.argv\n def fixup():\n sys.argv = oldargv\n self.addCleanup(fixup)\n sys.argv = []", "metadata": "root.Gprof2htmlTests.setUp", "header": "['class', 'Gprof2htmlTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 430 }, { "content": " def test_gprof(self):\n # Issue #14508: this used to fail with an NameError.\n with mock.patch.object(self.gprof, 'webbrowser') as wmock, \\\n tempfile.TemporaryDirectory() as tmpdir:\n fn = os.path.join(tmpdir, 'abc')\n open(fn, 'w').close()\n sys.argv = ['gprof2html', fn]\n self.gprof.main()\n self.assertTrue(wmock.open.called)", "metadata": "root.Gprof2htmlTests.test_gprof", "header": "['class', 'Gprof2htmlTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 440 }, { "content": "def test_main():\n support.run_unittest(*[obj for obj in globals().values()\n if isinstance(obj, type)])", "metadata": "root.test_main", "header": "['module', '___EOS___']", "index": 457 } ]
[ { "span": "import shutil", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 13 }, { "span": "from test_unparse import UnparseTestCase", "start_line": 453, "start_column": 4, "end_line": 453, "end_column": 44 }, { "span": "from test_unparse import DirectoryTestCase", "start_line": 454, "start_column": 4, "end_line": 454, "end_column": 46 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "Test", "s", " ", "for", " ", "scripts", " ", "in", " ", "the", " ", "Tool", "s", " ", "director", "y", ".", "\\", "10", ";", "\\", "10", ";", "Thi", "s", " ", "file", " ", "contain", "s", " ", "regress", "ion", " ", "tests", " ", "for", " ", "some", " ", "of", " ", "the", " ", "scripts", " ", "found", " ", "in", " ", "the", "\\", "10", ";", "Tool", "s", " ", "director", "y", " ", "of", " ", "a", " ", "Pyth", "on", " ", "check", "out", " ", "or", " ", "tarball", ",", " ", "suc", "h", " ", "as", " ", "rein", "dent", ".", "py", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "importlib_", "._", "machine", "ry_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "unittest_", "import_", "mock_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "shutil_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sysconfig", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "textwrap_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "test_", "import_", "support_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "test_", "._", "script", "\\u", "helper_", "import_", "assert", "\\u", "python", "\\u", "ok_", ",_", "temp", "\\u", "dir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "sysconfig", "_", "._", "is", "\\u", "python", "\\u", "build_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "XX", "X", " ", "some", " ", "installer", "s", " ", "do", " ", "contain", " ", "the", " ", "tool", "s", ",", " ", "shou", "ld", " ", "we", " ", "detect", " ", "that_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "run", " ", "the", " ", "tests", " ", "in", " ", "tha", "t", " ", "case", " ", "too", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "unittest_", "._", "Ski", "p", "Test_", "(_", "'", "test", " ", "irre", "lev", "ant", " ", "for", " ", "an", " ", "install", "ed", " ", "Pyth", "on", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "basepath_", "=_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "\\u\\u", "file\\u\\u_", ")_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Tool", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scripts", "dir_", "=_", "os_", "._", "path_", "._", "join_", "(_", "basepath_", ",_", "'", "scripts", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Run", " ", "the", " ", "tests", " ", "in", " ", "Tool", "s", "/", "parser", "/", "test\\u", "unparse", ".", "py_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "support_", "._", "Dir", "s", "On", "Sys", "Path_", "(_", "os_", "._", "path_", "._", "join_", "(_", "basepath_", ",_", "'", "parser", "'_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "test\\u", "unparse", "_", "import_", "Unp", "arse", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "test\\u", "unparse", "_", "import_", "Director", "y", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unittest_", "._", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Rein", "dent", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "script_", "=_", "os_", "._", "path_", "._", "join_", "(_", "scripts", "dir_", ",_", "'", "rein", "dent", ".", "py", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Rein", "dent", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "noar", "gs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert", "\\u", "python", "\\u", "ok_", "(_", "self_", "._", "script_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rein", "dent", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "help_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rc_", ",_", "out_", ",_", "err_", "=_", "assert", "\\u", "python", "\\u", "ok_", "(_", "self_", "._", "script_", ",_", "'-", "h", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "out_", ",_", "b", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Greater_", "(_", "err_", ",_", "b", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Pin", "dent", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "script_", "=_", "os_", "._", "path_", "._", "join_", "(_", "scripts", "dir_", ",_", "'", "pin", "dent", ".", "py", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Pin", "dent", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "assert", "File", "Equal_", "(_", "self_", ",_", "fn", "1_", ",_", "fn", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "fn", "1_", ")_", "as_", "f1_", ",_", "open_", "(_", "fn", "2_", ")_", "as_", "f2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "f1_", "._", "readlines_", "(_", ")_", ",_", "f2_", "._", "readlines_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pin", "dent", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pin", "dent_", "(_", "self_", ",_", "source_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "subprocess_", "._", "Popen_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "sys_", "._", "executable_", ",_", "self_", "._", "script_", ")_", "+_", "args_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stdin_", "=_", "subprocess_", "._", "PIPE_", ",_", "stdout_", "=_", "subprocess_", "._", "PIPE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "universal", "\\u", "newlines_", "=_", "True_", ")_", "as_", "proc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", ",_", "err_", "=_", "proc_", "._", "communicate_", "(_", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Is", "None_", "(_", "err_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "out_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pin", "dent", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "lst", "rip", "lines_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'\\\\", "n", "'_", "._", "join_", "(_", "line_", "._", "lstrip_", "(_", ")_", "for_", "line_", "in_", "data_", "._", "splitlines_", "(_", ")_", ")_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pin", "dent", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "self", "test_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "max", "Diff_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "temp", "\\u", "dir_", "(_", ")_", "as_", "directory_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data\\u", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "directory_", ",_", "'\\u", "test", ".", "py", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "self_", "._", "script_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "closed_", "=_", "f_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "open_", "(_", "data\\u", "path_", ",_", "'", "w", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "._", "write_", "(_", "closed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rc_", ",_", "out_", ",_", "err_", "=_", "assert", "\\u", "python", "\\u", "ok_", "(_", "self_", "._", "script_", ",_", "'-", "d", "'_", ",_", "data\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "out_", ",_", "b", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "err_", ",_", "b", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "backup_", "=_", "data\\u", "path_", "+_", "'~'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "os_", "._", "path_", "._", "exists_", "(_", "backup_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "backup_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "f_", "._", "read_", "(_", ")_", ",_", "closed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "open_", "(_", "data\\u", "path_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "clean_", "=_", "f_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "compile_", "(_", "clean_", ",_", "'\\u", "test", ".", "py", "'_", ",_", "'", "exec", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "pin", "dent_", "(_", "clean_", ",_", "'-", "c", "'_", ")_", ",_", "closed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "pin", "dent_", "(_", "closed_", ",_", "'-", "d", "'_", ")_", ",_", "clean_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rc_", ",_", "out_", ",_", "err_", "=_", "assert", "\\u", "python", "\\u", "ok_", "(_", "self_", "._", "script_", ",_", "'-", "c", "'_", ",_", "data\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "out_", ",_", "b", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "err_", ",_", "b", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "backup_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "f_", "._", "read_", "(_", ")_", ",_", "clean_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "open_", "(_", "data\\u", "path_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "f_", "._", "read_", "(_", ")_", ",_", "closed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "broken", "_", "=_", "self_", "._", "lst", "rip", "lines_", "(_", "closed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "data\\u", "path_", ",_", "'", "w", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "._", "write_", "(_", "broken", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rc_", ",_", "out_", ",_", "err_", "=_", "assert", "\\u", "python", "\\u", "ok_", "(_", "self_", "._", "script_", ",_", "'-", "r", "'_", ",_", "data\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "out_", ",_", "b", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "err_", ",_", "b", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "backup_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "f_", "._", "read_", "(_", ")_", ",_", "broken", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "open_", "(_", "data\\u", "path_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "indented", "_", "=_", "f_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "compile_", "(_", "indented", "_", ",_", "'\\u", "test", ".", "py", "'_", ",_", "'", "exec", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "pin", "dent_", "(_", "broken", "_", ",_", "'-", "r", "'_", ")_", ",_", "indented", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pin", "dent", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pin", "dent", "\\u", "test_", "(_", "self_", ",_", "clean_", ",_", "closed_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "pin", "dent_", "(_", "clean_", ",_", "'-", "c", "'_", ")_", ",_", "closed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "pin", "dent_", "(_", "closed_", ",_", "'-", "d", "'_", ")_", ",_", "clean_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "broken", "_", "=_", "self_", "._", "lst", "rip", "lines_", "(_", "closed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "pin", "dent_", "(_", "broken", "_", ",_", "'-", "r", "'_", ",_", "'-", "e", "'_", ",_", "'-", "s", "'_", ",_", "'", "4", "'_", ")_", ",_", "closed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pin", "dent", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "statements_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "clean_", "=_", "textwrap_", "._", "dedent_", "(_", "\"\"\"", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "a", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "a", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "else", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "a", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "eli", "f", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "else", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "whi", "le", " ", "a", ":", "\\", "10", ";", " ", " ", " ", " ", "break", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "whi", "le", " ", "a", ":", "\\", "10", ";", " ", " ", " ", " ", "break", "\\", "10", ";", " ", " ", " ", " ", "else", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "i", " ", "in", " ", "a", ":", "\\", "10", ";", " ", " ", " ", " ", "break", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "i", " ", "in", " ", "a", ":", "\\", "10", ";", " ", " ", " ", " ", "break", "\\", "10", ";", " ", " ", " ", " ", "else", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "try", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "final", "ly", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "try", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "except", " ", "Type", "Error", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "except", " ", "Value", "Error", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "else", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "try", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "except", " ", "Type", "Error", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "except", " ", "Value", "Error", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "final", "ly", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "with", " ", "a", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "class", " ", "A", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "def", " ", "f", "():", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "closed_", "=_", "textwrap_", "._", "dedent_", "(_", "\"\"\"", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "a", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "end", " ", "if", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "a", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "else", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "end", " ", "if", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "a", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "eli", "f", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "else", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "end", " ", "if", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "whi", "le", " ", "a", ":", "\\", "10", ";", " ", " ", " ", " ", "break", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "end", " ", "whi", "le", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "whi", "le", " ", "a", ":", "\\", "10", ";", " ", " ", " ", " ", "break", "\\", "10", ";", " ", " ", " ", " ", "else", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "end", " ", "whi", "le", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "i", " ", "in", " ", "a", ":", "\\", "10", ";", " ", " ", " ", " ", "break", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "end", " ", "for", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "i", " ", "in", " ", "a", ":", "\\", "10", ";", " ", " ", " ", " ", "break", "\\", "10", ";", " ", " ", " ", " ", "else", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "end", " ", "for", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "try", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "final", "ly", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "end", " ", "try", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "try", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "except", " ", "Type", "Error", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "except", " ", "Value", "Error", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "else", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "end", " ", "try", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "try", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "except", " ", "Type", "Error", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "except", " ", "Value", "Error", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "final", "ly", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "end", " ", "try", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "with", " ", "a", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "end", " ", "with", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "class", " ", "A", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "end", " ", "class", " ", "A", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "def", " ", "f", "():", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "end", " ", "def", " ", "f", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "pin", "dent", "\\u", "test_", "(_", "clean_", ",_", "closed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pin", "dent", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "multil", "evel_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "clean_", "=_", "textwrap_", "._", "dedent_", "(_", "\"\"\"", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "def", " ", "fooba", "r", "(", "a", ",", " ", "b", "):", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "a", " ", "==", " ", "b", ":", "\\", "10", ";", " ", " ", "a", " ", "=", " ", "a", "+", "1", "\\", "10", ";", " ", " ", " ", " ", "eli", "f", " ", "a", " ", "<", " ", "b", ":", "\\", "10", ";", " ", " ", "b", " ", "=", " ", "b", "-1", "\\", "10", ";", " ", " ", "if", " ", "b", " ", ">", " ", "a", ":", " ", "a", " ", "=", " ", "a", "-1", "\\", "10", ";", " ", " ", " ", " ", "else", ":", "\\", "10", ";", " ", " ", "print", " ", "'", "oop", "s", "!'", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "closed_", "=_", "textwrap_", "._", "dedent_", "(_", "\"\"\"", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "def", " ", "fooba", "r", "(", "a", ",", " ", "b", "):", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "a", " ", "==", " ", "b", ":", "\\", "10", ";", " ", " ", "a", " ", "=", " ", "a", "+", "1", "\\", "10", ";", " ", " ", " ", " ", "eli", "f", " ", "a", " ", "<", " ", "b", ":", "\\", "10", ";", " ", " ", "b", " ", "=", " ", "b", "-1", "\\", "10", ";", " ", " ", "if", " ", "b", " ", ">", " ", "a", ":", " ", "a", " ", "=", " ", "a", "-1", "\\", "10", ";", " ", " ", "#", " ", "end", " ", "if", "\\", "10", ";", " ", " ", " ", " ", "else", ":", "\\", "10", ";", " ", " ", "print", " ", "'", "oop", "s", "!'", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "end", " ", "if", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "end", " ", "def", " ", "fooba", "r", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "pin", "dent", "\\u", "test_", "(_", "clean_", ",_", "closed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pin", "dent", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "preserve", "\\u", "indent", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "clean_", "=_", "textwrap_", "._", "dedent_", "(_", "\"\"\"", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "a", ":", "\\", "10", ";", " ", " ", " ", "if", " ", "b", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "closed_", "=_", "textwrap_", "._", "dedent_", "(_", "\"\"\"", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "a", ":", "\\", "10", ";", " ", " ", " ", "if", " ", "b", ":", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", "#", " ", "end", " ", "if", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "end", " ", "if", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "pin", "dent_", "(_", "clean_", ",_", "'-", "c", "'_", ")_", ",_", "closed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "pin", "dent_", "(_", "closed_", ",_", "'-", "d", "'_", ")_", ",_", "clean_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "broken", "_", "=_", "self_", "._", "lst", "rip", "lines_", "(_", "closed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "pin", "dent_", "(_", "broken", "_", ",_", "'-", "r", "'_", ",_", "'-", "e", "'_", ",_", "'-", "s", "'_", ",_", "'", "9", "'_", ")_", ",_", "closed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "clean_", "=_", "textwrap_", "._", "dedent_", "(_", "\"\"\"", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "a", ":", "\\", "10", ";", " ", " ", " ", " ", "\\\\", "tif", " ", "b", ":", "\\", "10", ";", " ", " ", " ", " ", "\\\\", "t", "\\\\", "tpa", "ss", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "closed_", "=_", "textwrap_", "._", "dedent_", "(_", "\"\"\"", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "a", ":", "\\", "10", ";", " ", " ", " ", " ", "\\\\", "tif", " ", "b", ":", "\\", "10", ";", " ", " ", " ", " ", "\\\\", "t", "\\\\", "tpa", "ss", "\\", "10", ";", " ", " ", " ", " ", "\\\\", "t", "#", " ", "end", " ", "if", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "end", " ", "if", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "pin", "dent_", "(_", "clean_", ",_", "'-", "c", "'_", ")_", ",_", "closed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "pin", "dent_", "(_", "closed_", ",_", "'-", "d", "'_", ")_", ",_", "clean_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "broken", "_", "=_", "self_", "._", "lst", "rip", "lines_", "(_", "closed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "pin", "dent_", "(_", "broken", "_", ",_", "'-", "r", "'_", ")_", ",_", "closed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pin", "dent", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "escaped", "\\u", "newline_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "clean_", "=_", "textwrap_", "._", "dedent_", "(_", "\"\"\"", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "class", "\\\\\\\\", "\\", "10", ";", " ", " ", " ", " ", "\\\\\\\\", "\\", "10", ";", " ", " ", " ", " ", " ", "A", ":", "\\", "10", ";", " ", " ", " ", "def", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "\\\\\\\\", "\\", "10", ";", " ", " ", " ", " ", "f", ":", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "closed_", "=_", "textwrap_", "._", "dedent_", "(_", "\"\"\"", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "class", "\\\\\\\\", "\\", "10", ";", " ", " ", " ", " ", "\\\\\\\\", "\\", "10", ";", " ", " ", " ", " ", " ", "A", ":", "\\", "10", ";", " ", " ", " ", "def", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "\\\\\\\\", "\\", "10", ";", " ", " ", " ", " ", "f", ":", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", "#", " ", "end", " ", "def", " ", "f", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "end", " ", "class", " ", "A", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "pin", "dent_", "(_", "clean_", ",_", "'-", "c", "'_", ")_", ",_", "closed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "pin", "dent_", "(_", "closed_", ",_", "'-", "d", "'_", ")_", ",_", "clean_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pin", "dent", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "empty", "\\u", "line_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "clean_", "=_", "textwrap_", "._", "dedent_", "(_", "\"\"\"", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "a", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "closed_", "=_", "textwrap_", "._", "dedent_", "(_", "\"\"\"", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "a", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "end", " ", "if", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "pin", "dent", "\\u", "test_", "(_", "clean_", ",_", "closed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pin", "dent", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "one", "line_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "clean_", "=_", "textwrap_", "._", "dedent_", "(_", "\"\"\"", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "a", ":", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "closed_", "=_", "textwrap_", "._", "dedent_", "(_", "\"\"\"", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "a", ":", " ", "pass", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "end", " ", "if", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "pin", "dent", "\\u", "test_", "(_", "clean_", ",_", "closed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Sun", "dry", "Script", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "At", " ", "leas", "t", " ", "make", " ", "sure", " ", "the", " ", "rest", " ", "don", "'", "t", " ", "have", " ", "synta", "x", " ", "error", "s", ".", " ", " ", "Whe", "n", " ", "tests", " ", "are", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "adde", "d", " ", "for", " ", "a", " ", "script", " ", "it", " ", "shou", "ld", " ", "be", " ", "adde", "d", " ", "to", " ", "the", " ", "whitelist", " ", "belo", "w", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "scripts", " ", "tha", "t", " ", "have", " ", "independent", " ", "tests", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "whitelist_", "=_", "[_", "'", "rein", "dent", ".", "py", "'_", ",_", "'", "pde", "ps", ".", "py", "'_", ",_", "'", "gpr", "of", "2h", "tml", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "scripts", " ", "tha", "t", " ", "can", "'", "t", " ", "be", " ", "import", "ed", " ", "with", "out", " ", "running_", "\\u\\u\\uNL\\u\\u\\u_", "blacklist_", "=_", "[_", "'", "make", "\\u", "ctype", ".", "py", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "scripts", " ", "tha", "t", " ", "use", " ", "windows", "-", "only", " ", "modules_", "\\u\\u\\uNL\\u\\u\\u_", "windows", "\\u", "only_", "=_", "[_", "'", "win", "\\u", "add", "2p", "ath", ".", "py", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "blacklisted", " ", "for", " ", "other", " ", "reasons", "_", "\\u\\u\\uNL\\u\\u\\u_", "other_", "=_", "[_", "'", "analyze", "\\u", "dxp", ".", "py", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "skip", "list_", "=_", "blacklist_", "+_", "whitelist_", "+_", "windows", "\\u", "only_", "+_", "other_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Sun", "dry", "Script", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "At", " ", "leas", "t", " ", "make", " ", "sure", " ", "the", " ", "rest", " ", "don", "'", "t", " ", "have", " ", "synta", "x", " ", "error", "s", ".", " ", " ", "Whe", "n", " ", "tests", " ", "are", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "adde", "d", " ", "for", " ", "a", " ", "script", " ", "it", " ", "shou", "ld", " ", "be", " ", "adde", "d", " ", "to", " ", "the", " ", "whitelist", " ", "belo", "w", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "scripts", " ", "tha", "t", " ", "have", " ", "independent", " ", "tests", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cm_", "=_", "support_", "._", "Dir", "s", "On", "Sys", "Path_", "(_", "scripts", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cm_", "._", "\\u\\u", "enter\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Cleanup_", "(_", "cm_", "._", "\\u\\u", "exit\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Sun", "dry", "Script", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "At", " ", "leas", "t", " ", "make", " ", "sure", " ", "the", " ", "rest", " ", "don", "'", "t", " ", "have", " ", "synta", "x", " ", "error", "s", ".", " ", " ", "Whe", "n", " ", "tests", " ", "are", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "adde", "d", " ", "for", " ", "a", " ", "script", " ", "it", " ", "shou", "ld", " ", "be", " ", "adde", "d", " ", "to", " ", "the", " ", "whitelist", " ", "belo", "w", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "scripts", " ", "tha", "t", " ", "have", " ", "independent", " ", "tests", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "sund", "ry_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "fn_", "in_", "os_", "._", "listdir_", "(_", "scripts", "dir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "fn_", "._", "endswith_", "(_", "'.", "py", "'_", ")_", "and_", "fn_", "not_", "in_", "self_", "._", "skip", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "import\\u\\u_", "(_", "fn_", "[_", ":_", "-_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Sun", "dry", "Script", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "At", " ", "leas", "t", " ", "make", " ", "sure", " ", "the", " ", "rest", " ", "don", "'", "t", " ", "have", " ", "synta", "x", " ", "error", "s", ".", " ", " ", "Whe", "n", " ", "tests", " ", "are", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "adde", "d", " ", "for", " ", "a", " ", "script", " ", "it", " ", "shou", "ld", " ", "be", " ", "adde", "d", " ", "to", " ", "the", " ", "whitelist", " ", "belo", "w", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "scripts", " ", "tha", "t", " ", "have", " ", "independent", " ", "tests", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "unittest_", "._", "skip", "If_", "(_", "sys_", "._", "platform_", "!=_", "\"", "win32", "\"_", ",_", "\"", "Window", "s", "-", "only", " ", "test", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "sund", "ry", "\\u", "windows_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "fn_", "in_", "self_", "._", "windows", "\\u", "only_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "import\\u\\u_", "(_", "fn_", "[_", ":_", "-_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Sun", "dry", "Script", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "At", " ", "leas", "t", " ", "make", " ", "sure", " ", "the", " ", "rest", " ", "don", "'", "t", " ", "have", " ", "synta", "x", " ", "error", "s", ".", " ", " ", "Whe", "n", " ", "tests", " ", "are", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "adde", "d", " ", "for", " ", "a", " ", "script", " ", "it", " ", "shou", "ld", " ", "be", " ", "adde", "d", " ", "to", " ", "the", " ", "whitelist", " ", "belo", "w", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "scripts", " ", "tha", "t", " ", "have", " ", "independent", " ", "tests", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "unittest_", "._", "skip", "If_", "(_", "not_", "support_", "._", "threading_", ",_", "\"", "test", " ", "require", "s", " ", "\\u", "thread", " ", "module", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "analyze", "\\u", "dxp", "\\u", "import_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "sys_", ",_", "'", "getd", "xp", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "analyze", "\\u", "dxp", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "self_", "._", "assert", "Raises_", "(_", "Run", "time", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "analyze", "\\u", "dxp", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Pd", "eps", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Pd", "eps", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "set", "Up", "Class_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "scripts", "dir_", ",_", "'", "pde", "ps", ".", "py", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loader_", "=_", "importlib_", "._", "machine", "ry_", "._", "Sou", "rce", "File", "Loader_", "(_", "'", "pde", "ps", "'_", ",_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "pde", "ps_", "=_", "loader_", "._", "load", "\\u", "module_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pd", "eps", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "tear", "Down", "Class_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "pde", "ps", "'_", "in_", "sys_", "._", "modules_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "sys_", "._", "modules_", "[_", "'", "pde", "ps", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pd", "eps", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "process", "\\u", "errors_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Issue", " ", "#", "144", "9", "2", ":", " ", "m", "\\u", "import", ".", "match", "(", "line", ")", " ", "can", " ", "be", " ", "Non", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "tempfile_", "._", "Tempora", "ry", "Directory_", "(_", ")_", "as_", "tmpdir_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fn_", "=_", "os_", "._", "path_", "._", "join_", "(_", "tmpdir_", ",_", "'", "foo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "fn_", ",_", "'", "w", "'_", ")_", "as_", "stream_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stream_", "._", "write_", "(_", "\"#", "!", "/", "this", "/", "will", "/", "fail", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "pde", "ps_", "._", "process_", "(_", "fn_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pd", "eps", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "inv", "erse", "\\u", "attribute", "\\u", "error_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Issue", " ", "#", "144", "9", "2", ":", " ", "this", " ", "used", " ", "to", " ", "fail", " ", "with", " ", "an", " ", "Attribute", "Error", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "pde", "ps_", "._", "inverse_", "(_", "{_", "'", "a", "'_", ":_", "[_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Gp", "rof", "2h", "tml", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Gp", "rof", "2h", "tml", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "scripts", "dir_", ",_", "'", "gpr", "of", "2h", "tml", ".", "py", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loader_", "=_", "importlib_", "._", "machine", "ry_", "._", "Sou", "rce", "File", "Loader_", "(_", "'", "gpr", "of", "2h", "tml", "'_", ",_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "gpr", "of_", "=_", "loader_", "._", "load", "\\u", "module_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "argv_", "=_", "sys_", "._", "argv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "fixup", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "argv_", "=_", "old", "argv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "add", "Cleanup_", "(_", "fixup", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "argv_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gp", "rof", "2h", "tml", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "gpr", "of_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Issue", " ", "#", "145", "0", "8", ":", " ", "this", " ", "used", " ", "to", " ", "fail", " ", "with", " ", "an", " ", "Name", "Error", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "mock_", "._", "patch_", "._", "object_", "(_", "self_", "._", "gpr", "of_", ",_", "'", "web", "browse", "r", "'_", ")_", "as_", "wm", "ock_", ",_", "tempfile_", "._", "Tempora", "ry", "Directory_", "(_", ")_", "as_", "tmpdir_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fn_", "=_", "os_", "._", "path_", "._", "join_", "(_", "tmpdir_", ",_", "'", "abc", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "open_", "(_", "fn_", ",_", "'", "w", "'_", ")_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "argv_", "=_", "[_", "'", "gpr", "of", "2h", "tml", "'_", ",_", "fn_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "gpr", "of_", "._", "main_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "wm", "ock_", "._", "open_", "._", "called_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "support_", "._", "run", "\\u", "unittest_", "(_", "*_", "[_", "obj_", "for_", "obj_", "in_", "globals_", "(_", ")_", "._", "values_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "obj_", ",_", "type_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
tangentlabs/django-fancypages/fancypages/south_migrations/0015_auto__del_field_pagenavigationblock_is_relative.py
[ { "content": "# -*- coding: utf-8 -*-\nfrom south.utils import datetime_utils as datetime\nfrom south.db import db\nfrom south.v2 import SchemaMigration\nfrom django.db import models\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Migration(SchemaMigration):\n\n\n\n\n\n models = {\n u'assets.imageasset': {\n 'Meta': {'object_name': 'ImageAsset'},\n 'creator': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['auth.User']\"}),\n 'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),\n 'date_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),\n 'description': ('django.db.models.fields.TextField', [], {'default': \"''\"}),\n 'height': ('django.db.models.fields.IntegerField', [], {'blank': 'True'}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),\n 'size': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'uuid': ('shortuuidfield.fields.ShortUUIDField', [], {'db_index': 'True', 'max_length': '22', 'blank': 'True'}),\n 'width': ('django.db.models.fields.IntegerField', [], {'blank': 'True'})\n },\n u'auth.group': {\n 'Meta': {'object_name': 'Group'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),\n 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u\"orm['auth.Permission']\", 'symmetrical': 'False', 'blank': 'True'})\n },\n u'auth.permission': {\n 'Meta': {'ordering': \"(u'content_type__app_label', u'content_type__model', u'codename')\", 'unique_together': \"((u'content_type', u'codename'),)\", 'object_name': 'Permission'},\n 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['contenttypes.ContentType']\"}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})\n },\n u'auth.user': {\n 'Meta': {'object_name': 'User'},\n 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\n 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),\n 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),\n 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': \"u'user_set'\", 'blank': 'True', 'to': u\"orm['auth.Group']\"}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\n 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),\n 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),\n 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': \"u'user_set'\", 'blank': 'True', 'to': u\"orm['auth.Permission']\"}),\n 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})\n },\n u'contenttypes.contenttype': {\n 'Meta': {'ordering': \"('name',)\", 'unique_together': \"(('app_label', 'model'),)\", 'object_name': 'ContentType', 'db_table': \"'django_content_type'\"},\n 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})\n },\n u'fancypages.carouselblock': {\n 'Meta': {'ordering': \"[u'display_order']\", 'object_name': 'CarouselBlock', '_ormbases': [u'fancypages.ContentBlock']},\n u'contentblock_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u\"orm['fancypages.ContentBlock']\", 'unique': 'True', 'primary_key': 'True'}),\n 'image_1': ('fancypages.assets.fields.AssetKey', [], {'blank': 'True', 'related_name': \"'+'\", 'null': 'True', 'to': u\"orm['assets.ImageAsset']\"}),\n 'image_10': ('fancypages.assets.fields.AssetKey', [], {'blank': 'True', 'related_name': \"'+'\", 'null': 'True', 'to': u\"orm['assets.ImageAsset']\"}),\n 'image_2': ('fancypages.assets.fields.AssetKey', [], {'blank': 'True', 'related_name': \"'+'\", 'null': 'True', 'to': u\"orm['assets.ImageAsset']\"}),\n 'image_3': ('fancypages.assets.fields.AssetKey', [], {'blank': 'True', 'related_name': \"'+'\", 'null': 'True', 'to': u\"orm['assets.ImageAsset']\"}),\n 'image_4': ('fancypages.assets.fields.AssetKey', [], {'blank': 'True', 'related_name': \"'+'\", 'null': 'True', 'to': u\"orm['assets.ImageAsset']\"}),\n 'image_5': ('fancypages.assets.fields.AssetKey', [], {'blank': 'True', 'related_name': \"'+'\", 'null': 'True', 'to': u\"orm['assets.ImageAsset']\"}),\n 'image_6': ('fancypages.assets.fields.AssetKey', [], {'blank': 'True', 'related_name': \"'+'\", 'null': 'True', 'to': u\"orm['assets.ImageAsset']\"}),\n 'image_7': ('fancypages.assets.fields.AssetKey', [], {'blank': 'True', 'related_name': \"'+'\", 'null': 'True', 'to': u\"orm['assets.ImageAsset']\"}),\n 'image_8': ('fancypages.assets.fields.AssetKey', [], {'blank': 'True', 'related_name': \"'+'\", 'null': 'True', 'to': u\"orm['assets.ImageAsset']\"}),\n 'image_9': ('fancypages.assets.fields.AssetKey', [], {'blank': 'True', 'related_name': \"'+'\", 'null': 'True', 'to': u\"orm['assets.ImageAsset']\"}),\n 'link_url_1': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}),\n 'link_url_10': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}),\n 'link_url_2': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}),\n 'link_url_3': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}),\n 'link_url_4': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}),\n 'link_url_5': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}),\n 'link_url_6': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}),\n 'link_url_7': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}),\n 'link_url_8': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}),\n 'link_url_9': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'})\n },\n 'fancypages.container': {\n 'Meta': {'unique_together': \"(('name', 'content_type', 'object_id', 'language_code'),)\", 'object_name': 'Container'},\n 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['contenttypes.ContentType']\", 'null': 'True'}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'language_code': ('django.db.models.fields.CharField', [], {'default': \"u'en-us'\", 'max_length': '7'}),\n 'name': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'blank': 'True'}),\n 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),\n 'title': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),\n 'uuid': ('shortuuidfield.fields.ShortUUIDField', [], {'db_index': 'True', 'max_length': '22', 'blank': 'True'})\n },\n u'fancypages.contentblock': {\n 'Meta': {'ordering': \"[u'display_order']\", 'object_name': 'ContentBlock'},\n 'container': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'blocks'\", 'to': \"orm['fancypages.Container']\"}),\n 'display_order': ('django.db.models.fields.PositiveIntegerField', [], {}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'uuid': ('shortuuidfield.fields.ShortUUIDField', [], {'db_index': 'True', 'max_length': '22', 'blank': 'True'})\n },\n 'fancypages.fancypage': {\n 'Meta': {'object_name': 'FancyPage'},\n 'date_visible_end': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),\n 'date_visible_start': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),\n 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': \"'pages'\", 'symmetrical': 'False', 'to': \"orm['fancypages.PageGroup']\"}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'keywords': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),\n 'node': ('django.db.models.fields.related.OneToOneField', [], {'related_name': \"'page'\", 'unique': 'True', 'null': 'True', 'to': \"orm['fancypages.PageNode']\"}),\n 'page_type': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': \"'pages'\", 'null': 'True', 'to': \"orm['fancypages.PageType']\"}),\n 'status': ('django.db.models.fields.CharField', [], {'max_length': '15', 'blank': 'True'}),\n 'uuid': ('shortuuidfield.fields.ShortUUIDField', [], {'db_index': 'True', 'max_length': '22', 'blank': 'True'})\n },\n 'fancypages.fourcolumnlayoutblock': {\n 'Meta': {'object_name': 'FourColumnLayoutBlock'},\n u'contentblock_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u\"orm['fancypages.ContentBlock']\", 'unique': 'True', 'primary_key': 'True'})\n },\n 'fancypages.horizontalseparatorblock': {\n 'Meta': {'ordering': \"[u'display_order']\", 'object_name': 'HorizontalSeparatorBlock', '_ormbases': [u'fancypages.ContentBlock']},\n u'contentblock_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u\"orm['fancypages.ContentBlock']\", 'unique': 'True', 'primary_key': 'True'})\n },\n u'fancypages.imageandtextblock': {\n 'Meta': {'object_name': 'ImageAndTextBlock', '_ormbases': [u'fancypages.ContentBlock']},\n 'alt_text': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n u'contentblock_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u\"orm['fancypages.ContentBlock']\", 'unique': 'True', 'primary_key': 'True'}),\n 'image_asset': ('fancypages.assets.fields.AssetKey', [], {'blank': 'True', 'related_name': \"u'image_text_blocks'\", 'null': 'True', 'to': u\"orm['assets.ImageAsset']\"}),\n 'link': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}),\n 'text': ('django.db.models.fields.TextField', [], {'default': \"u'Your text goes here.'\"}),\n 'title': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'})\n },\n u'fancypages.imageblock': {\n 'Meta': {'object_name': 'ImageBlock', '_ormbases': [u'fancypages.ContentBlock']},\n 'alt_text': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n u'contentblock_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u\"orm['fancypages.ContentBlock']\", 'unique': 'True', 'primary_key': 'True'}),\n 'image_asset': ('fancypages.assets.fields.AssetKey', [], {'blank': 'True', 'related_name': \"u'image_blocks'\", 'null': 'True', 'to': u\"orm['assets.ImageAsset']\"}),\n 'link': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}),\n 'title': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'})\n },\n 'fancypages.orderedcontainer': {\n 'Meta': {'object_name': 'OrderedContainer', '_ormbases': ['fancypages.Container']},\n u'container_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': \"orm['fancypages.Container']\", 'unique': 'True', 'primary_key': 'True'}),\n 'display_order': ('django.db.models.fields.PositiveIntegerField', [], {})\n },\n 'fancypages.pagegroup': {\n 'Meta': {'object_name': 'PageGroup'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),\n 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),\n 'uuid': ('shortuuidfield.fields.ShortUUIDField', [], {'db_index': 'True', 'max_length': '22', 'blank': 'True'})\n },\n u'fancypages.pagenavigationblock': {\n 'Meta': {'ordering': \"[u'display_order']\", 'object_name': 'PageNavigationBlock', '_ormbases': [u'fancypages.ContentBlock']},\n u'contentblock_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u\"orm['fancypages.ContentBlock']\", 'unique': 'True', 'primary_key': 'True'}),\n 'depth': ('django.db.models.fields.PositiveIntegerField', [], {'default': '2'}),\n 'origin': ('django.db.models.fields.CharField', [], {'default': \"u'absolute'\", 'max_length': '50'})\n },\n 'fancypages.pagenode': {\n 'Meta': {'object_name': 'PageNode'},\n 'depth': ('django.db.models.fields.PositiveIntegerField', [], {}),\n 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),\n 'numchild': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),\n 'path': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),\n 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255'})\n },\n 'fancypages.pagetype': {\n 'Meta': {'object_name': 'PageType'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),\n 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '128'}),\n 'template_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),\n 'uuid': ('shortuuidfield.fields.ShortUUIDField', [], {'db_index': 'True', 'max_length': '22', 'blank': 'True'})\n },\n 'fancypages.tabblock': {\n 'Meta': {'ordering': \"[u'display_order']\", 'object_name': 'TabBlock', '_ormbases': [u'fancypages.ContentBlock']},\n u'contentblock_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u\"orm['fancypages.ContentBlock']\", 'unique': 'True', 'primary_key': 'True'})\n },\n u'fancypages.textblock': {\n 'Meta': {'ordering': \"[u'display_order']\", 'object_name': 'TextBlock', '_ormbases': [u'fancypages.ContentBlock']},\n u'contentblock_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u\"orm['fancypages.ContentBlock']\", 'unique': 'True', 'primary_key': 'True'}),\n 'text': ('django.db.models.fields.TextField', [], {'default': \"u'Your text goes here.'\"})\n },\n 'fancypages.threecolumnlayoutblock': {\n 'Meta': {'object_name': 'ThreeColumnLayoutBlock'},\n u'contentblock_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u\"orm['fancypages.ContentBlock']\", 'unique': 'True', 'primary_key': 'True'})\n },\n u'fancypages.titletextblock': {\n 'Meta': {'ordering': \"[u'display_order']\", 'object_name': 'TitleTextBlock', '_ormbases': [u'fancypages.ContentBlock']},\n u'contentblock_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u\"orm['fancypages.ContentBlock']\", 'unique': 'True', 'primary_key': 'True'}),\n 'text': ('django.db.models.fields.TextField', [], {'default': \"u'Your text goes here.'\"}),\n 'title': ('django.db.models.fields.CharField', [], {'default': \"u'Your title goes here.'\", 'max_length': '100'})\n },\n 'fancypages.twitterblock': {\n 'Meta': {'ordering': \"[u'display_order']\", 'object_name': 'TwitterBlock', '_ormbases': [u'fancypages.ContentBlock']},\n u'contentblock_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u\"orm['fancypages.ContentBlock']\", 'unique': 'True', 'primary_key': 'True'}),\n 'max_tweets': ('django.db.models.fields.PositiveIntegerField', [], {'default': '5'}),\n 'username': ('django.db.models.fields.CharField', [], {'max_length': '50'})\n },\n 'fancypages.twocolumnlayoutblock': {\n 'Meta': {'object_name': 'TwoColumnLayoutBlock'},\n u'contentblock_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u\"orm['fancypages.ContentBlock']\", 'unique': 'True', 'primary_key': 'True'}),\n 'left_width': ('django.db.models.fields.PositiveIntegerField', [], {'default': '6', 'max_length': '3'})\n },\n 'fancypages.videoblock': {\n 'Meta': {'ordering': \"[u'display_order']\", 'object_name': 'VideoBlock', '_ormbases': [u'fancypages.ContentBlock']},\n u'contentblock_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u\"orm['fancypages.ContentBlock']\", 'unique': 'True', 'primary_key': 'True'}),\n 'source': ('django.db.models.fields.CharField', [], {'max_length': '50'}),\n 'video_code': ('django.db.models.fields.CharField', [], {'max_length': '50'})\n }\n }\n\n complete_apps = ['fancypages']", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 7 }, { "content": " def forwards(self, orm):\n # Deleting field 'PageNavigationBlock.is_relative'\n db.delete_column(u'fancypages_pagenavigationblock', 'is_relative')", "metadata": "root.Migration.forwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 9 }, { "content": " def backwards(self, orm):\n # Adding field 'PageNavigationBlock.is_relative'\n db.add_column(u'fancypages_pagenavigationblock', 'is_relative',\n self.gf('django.db.models.fields.BooleanField')(default=False),\n keep_default=False)", "metadata": "root.Migration.backwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 14 } ]
[ { "span": "from south.utils import datetime_utils as datetime", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 50 }, { "span": "from django.db import models", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 28 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "south_", "._", "utils_", "import_", "datetime", "\\u", "utils_", "as_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "south_", "._", "db_", "import_", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "south_", "._", "v2_", "import_", "Schema", "Migration_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "models_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "asset", "s", ".", "image", "asset", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Image", "Asset", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "creat", "or", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "auth", ".", "User", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "created", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "\\u", "add", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "modifi", "ed", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"''\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "height", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "image", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "files", ".", "Image", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "uuid", "'_", ":_", "(_", "'", "short", "uuid", "field", ".", "fields", ".", "Short", "UU", "IDF", "iel", "d", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "2", "2", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "widt", "h", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "auth", ".", "group", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Group", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "80", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "permissi", "ons", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "auth", ".", "Permi", "ssion", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "auth", ".", "permissi", "on", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "u", "'", "content", "\\u", "type\\u\\u", "app", "\\u", "label", "',", " ", "u", "'", "content", "\\u", "type\\u\\u", "model", "',", " ", "u", "'", "code", "name", "')\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "(", "u", "'", "content", "\\u", "type", "',", " ", "u", "'", "code", "name", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Permi", "ssion", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "code", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "contenttype", "s", ".", "Conten", "t", "Type", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "auth", ".", "user", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "User", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "joine", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Ema", "il", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "7", "5", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "first", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"", "u", "'", "user", "\\u", "set", "'\"_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "auth", ".", "Group", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "active", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "sta", "ff", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "super", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "login", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "password", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "128", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "\\u", "permissi", "ons", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"", "u", "'", "user", "\\u", "set", "'\"_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "auth", ".", "Permi", "ssion", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "contenttype", "s", ".", "contenttype", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "name", "',)\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "app", "\\u", "label", "',", " ", "'", "model", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Conten", "t", "Type", "'_", ",_", "'", "db", "\\u", "table", "'_", ":_", "\"'", "django", "\\u", "content", "\\u", "type", "'\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "app", "\\u", "label", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "model", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "fancy", "page", "s", ".", "caro", "usel", "block", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "u", "'", "display", "\\u", "order", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Car", "ouse", "l", "Block", "'_", ",_", "'\\u", "ormbase", "s", "'_", ":_", "[_", "u", "'", "fancy", "page", "s", ".", "Conten", "t", "Block", "'_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "content", "block", "\\u", "ptr", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "fancy", "page", "s", ".", "Conten", "t", "Block", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "image", "\\u", "1", "'_", ":_", "(_", "'", "fancy", "page", "s", ".", "asset", "s", ".", "fields", ".", "Asset", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "+'\"", "_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "asset", "s", ".", "Image", "Asset", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "image", "\\u", "10", "'_", ":_", "(_", "'", "fancy", "page", "s", ".", "asset", "s", ".", "fields", ".", "Asset", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "+'\"", "_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "asset", "s", ".", "Image", "Asset", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "image", "\\u", "2", "'_", ":_", "(_", "'", "fancy", "page", "s", ".", "asset", "s", ".", "fields", ".", "Asset", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "+'\"", "_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "asset", "s", ".", "Image", "Asset", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "image", "\\u", "3", "'_", ":_", "(_", "'", "fancy", "page", "s", ".", "asset", "s", ".", "fields", ".", "Asset", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "+'\"", "_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "asset", "s", ".", "Image", "Asset", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "image", "\\u", "4", "'_", ":_", "(_", "'", "fancy", "page", "s", ".", "asset", "s", ".", "fields", ".", "Asset", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "+'\"", "_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "asset", "s", ".", "Image", "Asset", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "image", "\\u", "5", "'_", ":_", "(_", "'", "fancy", "page", "s", ".", "asset", "s", ".", "fields", ".", "Asset", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "+'\"", "_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "asset", "s", ".", "Image", "Asset", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "image", "\\u", "6", "'_", ":_", "(_", "'", "fancy", "page", "s", ".", "asset", "s", ".", "fields", ".", "Asset", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "+'\"", "_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "asset", "s", ".", "Image", "Asset", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "image", "\\u", "7", "'_", ":_", "(_", "'", "fancy", "page", "s", ".", "asset", "s", ".", "fields", ".", "Asset", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "+'\"", "_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "asset", "s", ".", "Image", "Asset", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "image", "\\u", "8", "'_", ":_", "(_", "'", "fancy", "page", "s", ".", "asset", "s", ".", "fields", ".", "Asset", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "+'\"", "_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "asset", "s", ".", "Image", "Asset", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "image", "\\u", "9", "'_", ":_", "(_", "'", "fancy", "page", "s", ".", "asset", "s", ".", "fields", ".", "Asset", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "+'\"", "_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "asset", "s", ".", "Image", "Asset", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "url", "\\u", "1", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "500", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "url", "\\u", "10", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "500", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "url", "\\u", "2", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "500", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "url", "\\u", "3", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "500", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "url", "\\u", "4", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "500", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "url", "\\u", "5", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "500", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "url", "\\u", "6", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "500", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "url", "\\u", "7", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "500", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "url", "\\u", "8", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "500", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "url", "\\u", "9", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "500", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fancy", "page", "s", ".", "container", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "name", "',", " ", "'", "content", "\\u", "type", "',", " ", "'", "object\\u", "id", "',", " ", "'", "language", "\\u", "code", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Containe", "r", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "contenttype", "s", ".", "Conten", "t", "Type", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "language", "\\u", "code", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"", "u", "'", "en", "-", "us", "'\"_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "7", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Sl", "ug", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object\\u", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Posi", "tiv", "e", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "uuid", "'_", ":_", "(_", "'", "short", "uuid", "field", ".", "fields", ".", "Short", "UU", "IDF", "iel", "d", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "2", "2", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "fancy", "page", "s", ".", "content", "block", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "u", "'", "display", "\\u", "order", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Conten", "t", "Block", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "blocks", "'\"_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "fancy", "page", "s", ".", "Containe", "r", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "display", "\\u", "order", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Posi", "tiv", "e", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "uuid", "'_", ":_", "(_", "'", "short", "uuid", "field", ".", "fields", ".", "Short", "UU", "IDF", "iel", "d", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "2", "2", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fancy", "page", "s", ".", "fancy", "page", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Fan", "cy", "Page", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "visi", "ble", "\\u", "end", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "visi", "ble", "\\u", "start", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "page", "s", "'\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "fancy", "page", "s", ".", "Page", "Group", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "keywords", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "node", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "page", "'\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "fancy", "page", "s", ".", "Page", "Node", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "page", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "page", "s", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "fancy", "page", "s", ".", "Page", "Type", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "15", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "uuid", "'_", ":_", "(_", "'", "short", "uuid", "field", ".", "fields", ".", "Short", "UU", "IDF", "iel", "d", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "2", "2", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fancy", "page", "s", ".", "four", "column", "layout", "block", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Four", "Colum", "n", "Lay", "out", "Block", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "content", "block", "\\u", "ptr", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "fancy", "page", "s", ".", "Conten", "t", "Block", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fancy", "page", "s", ".", "horizon", "tal", "separator", "block", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "u", "'", "display", "\\u", "order", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Horiz", "onta", "l", "Sepa", "rator", "Block", "'_", ",_", "'\\u", "ormbase", "s", "'_", ":_", "[_", "u", "'", "fancy", "page", "s", ".", "Conten", "t", "Block", "'_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "content", "block", "\\u", "ptr", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "fancy", "page", "s", ".", "Conten", "t", "Block", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "fancy", "page", "s", ".", "image", "and", "textb", "lock", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Image", "And", "Text", "Block", "'_", ",_", "'\\u", "ormbase", "s", "'_", ":_", "[_", "u", "'", "fancy", "page", "s", ".", "Conten", "t", "Block", "'_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "alt", "\\u", "text", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "content", "block", "\\u", "ptr", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "fancy", "page", "s", ".", "Conten", "t", "Block", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "image", "\\u", "asset", "'_", ":_", "(_", "'", "fancy", "page", "s", ".", "asset", "s", ".", "fields", ".", "Asset", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"", "u", "'", "image", "\\u", "text", "\\u", "blocks", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "asset", "s", ".", "Image", "Asset", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "500", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "text", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"", "u", "'", "You", "r", " ", "text", " ", "go", "es", " ", "here", ".'", "\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "fancy", "page", "s", ".", "image", "block", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Image", "Block", "'_", ",_", "'\\u", "ormbase", "s", "'_", ":_", "[_", "u", "'", "fancy", "page", "s", ".", "Conten", "t", "Block", "'_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "alt", "\\u", "text", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "content", "block", "\\u", "ptr", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "fancy", "page", "s", ".", "Conten", "t", "Block", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "image", "\\u", "asset", "'_", ":_", "(_", "'", "fancy", "page", "s", ".", "asset", "s", ".", "fields", ".", "Asset", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"", "u", "'", "image", "\\u", "blocks", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "asset", "s", ".", "Image", "Asset", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "500", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fancy", "page", "s", ".", "order", "edc", "onta", "iner", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Order", "ed", "Containe", "r", "'_", ",_", "'\\u", "ormbase", "s", "'_", ":_", "[_", "'", "fancy", "page", "s", ".", "Containe", "r", "'_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "container", "\\u", "ptr", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "fancy", "page", "s", ".", "Containe", "r", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "display", "\\u", "order", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Posi", "tiv", "e", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fancy", "page", "s", ".", "page", "group", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Page", "Group", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "128", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slug", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Sl", "ug", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "128", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "uuid", "'_", ":_", "(_", "'", "short", "uuid", "field", ".", "fields", ".", "Short", "UU", "IDF", "iel", "d", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "2", "2", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "fancy", "page", "s", ".", "pagen", "avi", "gati", "on", "block", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "u", "'", "display", "\\u", "order", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Page", "Navigat", "ion", "Block", "'_", ",_", "'\\u", "ormbase", "s", "'_", ":_", "[_", "u", "'", "fancy", "page", "s", ".", "Conten", "t", "Block", "'_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "content", "block", "\\u", "ptr", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "fancy", "page", "s", ".", "Conten", "t", "Block", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "depth", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Posi", "tiv", "e", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "2", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "orig", "in", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"", "u", "'", "abs", "olute", "'\"_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fancy", "page", "s", ".", "pagen", "ode", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Page", "Node", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "depth", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Posi", "tiv", "e", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "image", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "files", ".", "Image", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "numc", "hild", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Posi", "tiv", "e", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "path", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slug", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Sl", "ug", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fancy", "page", "s", ".", "page", "type", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Page", "Type", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "128", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slug", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Sl", "ug", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "128", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "template", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "uuid", "'_", ":_", "(_", "'", "short", "uuid", "field", ".", "fields", ".", "Short", "UU", "IDF", "iel", "d", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "2", "2", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fancy", "page", "s", ".", "tab", "block", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "u", "'", "display", "\\u", "order", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Tab", "Block", "'_", ",_", "'\\u", "ormbase", "s", "'_", ":_", "[_", "u", "'", "fancy", "page", "s", ".", "Conten", "t", "Block", "'_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "content", "block", "\\u", "ptr", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "fancy", "page", "s", ".", "Conten", "t", "Block", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "fancy", "page", "s", ".", "textb", "lock", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "u", "'", "display", "\\u", "order", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Text", "Block", "'_", ",_", "'\\u", "ormbase", "s", "'_", ":_", "[_", "u", "'", "fancy", "page", "s", ".", "Conten", "t", "Block", "'_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "content", "block", "\\u", "ptr", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "fancy", "page", "s", ".", "Conten", "t", "Block", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "text", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"", "u", "'", "You", "r", " ", "text", " ", "go", "es", " ", "here", ".'", "\"_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fancy", "page", "s", ".", "three", "column", "layout", "block", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Thre", "e", "Colum", "n", "Lay", "out", "Block", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "content", "block", "\\u", "ptr", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "fancy", "page", "s", ".", "Conten", "t", "Block", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "fancy", "page", "s", ".", "title", "textb", "lock", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "u", "'", "display", "\\u", "order", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Tit", "le", "Text", "Block", "'_", ",_", "'\\u", "ormbase", "s", "'_", ":_", "[_", "u", "'", "fancy", "page", "s", ".", "Conten", "t", "Block", "'_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "content", "block", "\\u", "ptr", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "fancy", "page", "s", ".", "Conten", "t", "Block", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "text", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"", "u", "'", "You", "r", " ", "text", " ", "go", "es", " ", "here", ".'", "\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"", "u", "'", "You", "r", " ", "title", " ", "go", "es", " ", "here", ".'", "\"_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fancy", "page", "s", ".", "twit", "ter", "block", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "u", "'", "display", "\\u", "order", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Twit", "ter", "Block", "'_", ",_", "'\\u", "ormbase", "s", "'_", ":_", "[_", "u", "'", "fancy", "page", "s", ".", "Conten", "t", "Block", "'_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "content", "block", "\\u", "ptr", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "fancy", "page", "s", ".", "Conten", "t", "Block", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "max", "\\u", "tweet", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Posi", "tiv", "e", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "5", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fancy", "page", "s", ".", "two", "column", "layout", "block", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Tw", "o", "Colum", "n", "Lay", "out", "Block", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "content", "block", "\\u", "ptr", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "fancy", "page", "s", ".", "Conten", "t", "Block", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "left", "\\u", "widt", "h", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Posi", "tiv", "e", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "6", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "3", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fancy", "page", "s", ".", "video", "block", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "u", "'", "display", "\\u", "order", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Vid", "eo", "Block", "'_", ",_", "'\\u", "ormbase", "s", "'_", ":_", "[_", "u", "'", "fancy", "page", "s", ".", "Conten", "t", "Block", "'_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "content", "block", "\\u", "ptr", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "fancy", "page", "s", ".", "Conten", "t", "Block", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "source", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "video", "\\u", "code", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "complete", "\\u", "apps_", "=_", "[_", "'", "fancy", "page", "s", "'_", "]_", "[SEP]_", "class_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "forwards_", "(_", "self_", ",_", "orm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "field", " ", "'", "Page", "Navigat", "ion", "Block", ".", "is", "\\u", "relative", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "delete", "\\u", "column_", "(_", "u", "'", "fancy", "page", "s", "\\u", "pagen", "avi", "gati", "on", "block", "'_", ",_", "'", "is", "\\u", "relative", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "backwards_", "(_", "self_", ",_", "orm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Add", "ing", " ", "field", " ", "'", "Page", "Navigat", "ion", "Block", ".", "is", "\\u", "relative", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "add", "\\u", "column_", "(_", "u", "'", "fancy", "page", "s", "\\u", "pagen", "avi", "gati", "on", "block", "'_", ",_", "'", "is", "\\u", "relative", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ")_", "(_", "default_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "keep", "\\u", "default_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Migration(migrations.Migration):\n\n dependencies = [\n ('djangobmf_timesheet', '0003_version_0_2_0'),\n ]\n\n operations = [\n migrations.RemoveField(\n model_name='timesheet',\n name='uuid',\n ),\n ]", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 6 } ]
[ { "span": "from django.db import models, migrations", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 40 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "unicode", "\\u", "literals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", ",_", "migrations_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Migration_", "(_", "migrations_", "._", "Migration_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dependencies_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "django", "bm", "f", "\\u", "timesh", "eet", "'_", ",_", "'", "0003", "\\u", "version", "\\u", "0", "\\u", "2", "\\u", "0", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "operations_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "migrations_", "._", "Remove", "Field_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "model", "\\u", "name_", "=_", "'", "timesh", "eet", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "uuid", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
sdispater/orator/tests/orm/relations/test_morph.py
[ { "content": "# -*- coding: utf-8 -*-\n\nimport arrow\nfrom flexmock import flexmock, flexmock_teardown\nfrom ... import OratorTestCase\n\nfrom orator.query.builder import QueryBuilder\nfrom orator.query.grammars import QueryGrammar\nfrom orator.query.expression import QueryExpression\nfrom orator.orm.builder import Builder\nfrom orator.orm.model import Model\nfrom orator.orm.relations import MorphOne, MorphMany\nfrom orator.orm.collection import Collection\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class OrmMorphTestCase(OratorTestCase):\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.OrmMorphTestCase", "header": "['module', '___EOS___']", "index": 15 }, { "content": " def tearDown(self):\n flexmock_teardown()", "metadata": "root.OrmMorphTestCase.tearDown", "header": "['class', 'OrmMorphTestCase', '(', 'OratorTestCase', ')', ':', '___EOS___']", "index": 17 }, { "content": " def test_morph_one_sets_proper_constraints(self):\n self._get_one_relation()", "metadata": "root.OrmMorphTestCase.test_morph_one_sets_proper_constraints", "header": "['class', 'OrmMorphTestCase', '(', 'OratorTestCase', ')', ':', '___EOS___']", "index": 20 }, { "content": " def test_morph_one_eager_constraints_are_properly_added(self):\n relation = self._get_one_relation()\n relation.get_query().get_query().should_receive('where_in').once().with_args('table.morph_id', [1, 2])\n relation.get_query().should_receive('where').once()\\\n .with_args('table.morph_type', relation.get_parent().__class__.__name__)\n\n model1 = Model()\n model1.id = 1\n model2 = Model()\n model2.id = 2\n relation.add_eager_constraints([model1, model2])", "metadata": "root.OrmMorphTestCase.test_morph_one_eager_constraints_are_properly_added", "header": "['class', 'OrmMorphTestCase', '(', 'OratorTestCase', ')', ':', '___EOS___']", "index": 23 }, { "content": " def test_morph_many_sets_proper_constraints(self):\n self._get_many_relation()", "metadata": "root.OrmMorphTestCase.test_morph_many_sets_proper_constraints", "header": "['class', 'OrmMorphTestCase', '(', 'OratorTestCase', ')', ':', '___EOS___']", "index": 35 }, { "content": " def test_morph_many_eager_constraints_are_properly_added(self):\n relation = self._get_many_relation()\n relation.get_query().get_query().should_receive('where_in').once().with_args('table.morph_id', [1, 2])\n relation.get_query().should_receive('where').once()\\\n .with_args('table.morph_type', relation.get_parent().__class__.__name__)\n\n model1 = Model()\n model1.id = 1\n model2 = Model()\n model2.id = 2\n relation.add_eager_constraints([model1, model2])", "metadata": "root.OrmMorphTestCase.test_morph_many_eager_constraints_are_properly_added", "header": "['class', 'OrmMorphTestCase', '(', 'OratorTestCase', ')', ':', '___EOS___']", "index": 38 }, { "content": " def test_create(self):\n relation = self._get_one_relation()\n created = flexmock(Model())\n created.should_receive('set_attribute').once().with_args('morph_id', 1)\n created.should_receive('set_attribute').once()\\\n .with_args('morph_type', relation.get_parent().__class__.__name__)\n relation.get_related().should_receive('new_instance').once().with_args({'name': 'john'}).and_return(created)\n created.should_receive('save').once().and_return(True)\n\n self.assertEqual(created, relation.create(name='john'))", "metadata": "root.OrmMorphTestCase.test_create", "header": "['class', 'OrmMorphTestCase', '(', 'OratorTestCase', ')', ':', '___EOS___']", "index": 50 }, { "content": " def test_find_or_new_finds_model(self):\n relation = self._get_one_relation()\n model = flexmock()\n model.foo = 'bar'\n relation.get_query().should_receive('find').once().with_args('foo', ['*']).and_return(model)\n relation.get_related().should_receive('new_instance').never()\n model.should_receive('set_attribute').never()\n model.should_receive('save').never()\n\n self.assertEqual('bar', relation.find_or_new('foo').foo)", "metadata": "root.OrmMorphTestCase.test_find_or_new_finds_model", "header": "['class', 'OrmMorphTestCase', '(', 'OratorTestCase', ')', ':', '___EOS___']", "index": 61 }, { "content": " def test_find_or_new_returns_new_model_with_morph_keys_set(self):\n relation = self._get_one_relation()\n model = flexmock()\n model.foo = 'bar'\n relation.get_query().should_receive('find').once().with_args('foo', ['*']).and_return(None)\n relation.get_related().should_receive('new_instance').once().with_args().and_return(model)\n model.should_receive('set_attribute').once().with_args('morph_id', 1)\n model.should_receive('set_attribute').once().with_args('morph_type', relation.get_parent().__class__.__name__)\n model.should_receive('save').never()\n\n self.assertEqual('bar', relation.find_or_new('foo').foo)", "metadata": "root.OrmMorphTestCase.test_find_or_new_returns_new_model_with_morph_keys_set", "header": "['class', 'OrmMorphTestCase', '(', 'OratorTestCase', ')', ':', '___EOS___']", "index": 72 }, { "content": " def test_first_or_new_returns_first_model(self):\n relation = self._get_one_relation()\n model = flexmock()\n model.foo = 'bar'\n relation.get_query().should_receive('where').once().with_args({'foo': 'bar'}).and_return(relation.get_query())\n relation.get_query().should_receive('first').once().with_args().and_return(model)\n relation.get_related().should_receive('new_instance').never()\n model.should_receive('set_attribute').never()\n model.should_receive('set_attribute').never()\n model.should_receive('save').never()\n\n self.assertEqual('bar', relation.first_or_new({'foo': 'bar'}).foo)", "metadata": "root.OrmMorphTestCase.test_first_or_new_returns_first_model", "header": "['class', 'OrmMorphTestCase', '(', 'OratorTestCase', ')', ':', '___EOS___']", "index": 84 }, { "content": " def test_first_or_new_returns_new_model_with_morph_keys_set(self):\n relation = self._get_one_relation()\n model = flexmock()\n model.foo = 'bar'\n relation.get_query().should_receive('where').once().with_args({'foo': 'bar'}).and_return(relation.get_query())\n relation.get_query().should_receive('first').once().with_args().and_return(None)\n relation.get_related().should_receive('new_instance').once().with_args().and_return(model)\n model.should_receive('set_attribute').once().with_args('morph_id', 1)\n model.should_receive('set_attribute').once().with_args('morph_type', relation.get_parent().__class__.__name__)\n model.should_receive('save').never()\n\n self.assertEqual('bar', relation.first_or_new({'foo': 'bar'}).foo)", "metadata": "root.OrmMorphTestCase.test_first_or_new_returns_new_model_with_morph_keys_set", "header": "['class', 'OrmMorphTestCase', '(', 'OratorTestCase', ')', ':', '___EOS___']", "index": 97 }, { "content": " def test_first_or_create_returns_first_model(self):\n relation = self._get_one_relation()\n model = flexmock()\n model.foo = 'bar'\n relation.get_query().should_receive('where').once().with_args({'foo': 'bar'}).and_return(relation.get_query())\n relation.get_query().should_receive('first').once().with_args().and_return(model)\n relation.get_related().should_receive('new_instance').never()\n model.should_receive('set_attribute').never()\n model.should_receive('set_attribute').never()\n model.should_receive('save').never()\n\n self.assertEqual('bar', relation.first_or_create({'foo': 'bar'}).foo)", "metadata": "root.OrmMorphTestCase.test_first_or_create_returns_first_model", "header": "['class', 'OrmMorphTestCase', '(', 'OratorTestCase', ')', ':', '___EOS___']", "index": 110 }, { "content": " def test_first_or_create_creates_new_morph_model(self):\n relation = self._get_one_relation()\n model = flexmock()\n model.foo = 'bar'\n relation.get_query().should_receive('where').once().with_args({'foo': 'bar'}).and_return(relation.get_query())\n relation.get_query().should_receive('first').once().with_args().and_return(None)\n relation.get_related().should_receive('new_instance').once().with_args({'foo': 'bar'}).and_return(model)\n model.should_receive('set_attribute').once().with_args('morph_id', 1)\n model.should_receive('set_attribute').once().with_args('morph_type', relation.get_parent().__class__.__name__)\n model.should_receive('save').once().and_return()\n\n self.assertEqual('bar', relation.first_or_create({'foo': 'bar'}).foo)", "metadata": "root.OrmMorphTestCase.test_first_or_create_creates_new_morph_model", "header": "['class', 'OrmMorphTestCase', '(', 'OratorTestCase', ')', ':', '___EOS___']", "index": 123 }, { "content": " def test_update_or_create_finds_first_model_and_updates(self):\n relation = self._get_one_relation()\n model = flexmock()\n model.foo = 'bar'\n relation.get_query().should_receive('where').once().with_args({'foo': 'bar'}).and_return(relation.get_query())\n relation.get_query().should_receive('first').once().with_args().and_return(model)\n relation.get_related().should_receive('new_instance').never()\n model.should_receive('set_attribute').never()\n model.should_receive('set_attribute').never()\n model.should_receive('fill').once().with_args({'bar': 'baz'})\n model.should_receive('save').once().and_return(True)\n\n self.assertEqual('bar', relation.update_or_create({'foo': 'bar'}, {'bar': 'baz'}).foo)", "metadata": "root.OrmMorphTestCase.test_update_or_create_finds_first_model_and_updates", "header": "['class', 'OrmMorphTestCase', '(', 'OratorTestCase', ')', ':', '___EOS___']", "index": 136 }, { "content": " def test_update_or_create_finds_creates_new_morph_model(self):\n relation = self._get_one_relation()\n model = flexmock()\n model.foo = 'bar'\n relation.get_query().should_receive('where').once().with_args({'foo': 'bar'}).and_return(relation.get_query())\n relation.get_query().should_receive('first').once().with_args().and_return(None)\n relation.get_related().should_receive('new_instance').once().with_args().and_return(model)\n model.should_receive('set_attribute').once().with_args('morph_id', 1)\n model.should_receive('set_attribute').once().with_args('morph_type', relation.get_parent().__class__.__name__)\n model.should_receive('fill').once().with_args({'bar': 'baz'})\n model.should_receive('save').once().and_return(True)\n\n self.assertEqual('bar', relation.update_or_create({'foo': 'bar'}, {'bar': 'baz'}).foo)", "metadata": "root.OrmMorphTestCase.test_update_or_create_finds_creates_new_morph_model", "header": "['class', 'OrmMorphTestCase', '(', 'OratorTestCase', ')', ':', '___EOS___']", "index": 150 }, { "content": " def _get_many_relation(self):\n flexmock(Builder)\n query = flexmock(QueryBuilder(None, QueryGrammar(), None))\n builder = Builder(query)\n builder.should_receive('where').with_args('table.morph_id', '=', 1)\n related = flexmock(Model())\n builder.should_receive('get_model').and_return(related)\n parent = flexmock(Model())\n parent.should_receive('get_attribute').with_args('id').and_return(1)\n parent.should_receive('get_morph_name').and_return(parent.__class__.__name__)\n builder.should_receive('where').once().with_args('table.morph_type', parent.__class__.__name__)\n\n return MorphMany(builder, parent, 'table.morph_type', 'table.morph_id', 'id')", "metadata": "root.OrmMorphTestCase._get_many_relation", "header": "['class', 'OrmMorphTestCase', '(', 'OratorTestCase', ')', ':', '___EOS___']", "index": 164 }, { "content": " def _get_one_relation(self):\n flexmock(Builder)\n query = flexmock(QueryBuilder(None, QueryGrammar(), None))\n builder = Builder(query)\n builder.should_receive('where').with_args('table.morph_id', '=', 1)\n related = flexmock(Model())\n builder.should_receive('get_model').and_return(related)\n parent = flexmock(Model())\n parent.should_receive('get_attribute').with_args('id').and_return(1)\n parent.should_receive('get_morph_name').and_return(parent.__class__.__name__)\n builder.should_receive('where').once().with_args('table.morph_type', parent.__class__.__name__)\n\n return MorphOne(builder, parent, 'table.morph_type', 'table.morph_id', 'id')", "metadata": "root.OrmMorphTestCase._get_one_relation", "header": "['class', 'OrmMorphTestCase', '(', 'OratorTestCase', ')', ':', '___EOS___']", "index": 178 } ]
[ { "span": "import arrow", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 12 }, { "span": "from orator.query.expression import QueryExpression", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 51 }, { "span": "from orator.orm.collection import Collection", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 44 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "arrow_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "flex", "mock_", "import_", "flex", "mock_", ",_", "flex", "mock", "\\u", "teardown_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "..._", "import_", "Ora", "tor", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "ora", "tor_", "._", "query_", "._", "builder_", "import_", "Query", "Builder_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ora", "tor_", "._", "query_", "._", "grammar", "s_", "import_", "Query", "Grammar_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ora", "tor_", "._", "query_", "._", "expression_", "import_", "Query", "Expression_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ora", "tor_", "._", "orm_", "._", "builder_", "import_", "Builder_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ora", "tor_", "._", "orm_", "._", "model_", "import_", "Model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ora", "tor_", "._", "orm_", "._", "relations_", "import_", "Morph", "One_", ",_", "Morph", "Many", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ora", "tor_", "._", "orm_", "._", "collection_", "import_", "Collection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Or", "m", "Morph", "Test", "Case_", "(_", "Ora", "tor", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Or", "m", "Morph", "Test", "Case_", "(_", "Ora", "tor", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "flex", "mock", "\\u", "teardown_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Or", "m", "Morph", "Test", "Case_", "(_", "Ora", "tor", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "morph", "\\u", "one", "\\u", "sets", "\\u", "proper", "\\u", "constraints_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "get", "\\u", "one", "\\u", "relation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Or", "m", "Morph", "Test", "Case_", "(_", "Ora", "tor", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "morph", "\\u", "one", "\\u", "eage", "r", "\\u", "constraint", "s", "\\u", "are", "\\u", "proper", "ly", "\\u", "added_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "relation_", "=_", "self_", "._", "\\u", "get", "\\u", "one", "\\u", "relation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "query_", "(_", ")_", "._", "get", "\\u", "query_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "where", "\\u", "in", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "'", "table", ".", "morph", "\\u", "id", "'_", ",_", "[_", "1_", ",_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "query_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "where", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "'", "table", ".", "morph", "\\u", "type", "'_", ",_", "relation_", "._", "get", "\\u", "parent_", "(_", ")_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "model", "1_", "=_", "Model_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "1_", "._", "id_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "2_", "=_", "Model_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "2_", "._", "id_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "add", "\\u", "eage", "r", "\\u", "constraints_", "(_", "[_", "model", "1_", ",_", "model", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Or", "m", "Morph", "Test", "Case_", "(_", "Ora", "tor", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "morph", "\\u", "many", "\\u", "sets", "\\u", "proper", "\\u", "constraints_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "get", "\\u", "many", "\\u", "relation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Or", "m", "Morph", "Test", "Case_", "(_", "Ora", "tor", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "morph", "\\u", "many", "\\u", "eage", "r", "\\u", "constraint", "s", "\\u", "are", "\\u", "proper", "ly", "\\u", "added_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "relation_", "=_", "self_", "._", "\\u", "get", "\\u", "many", "\\u", "relation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "query_", "(_", ")_", "._", "get", "\\u", "query_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "where", "\\u", "in", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "'", "table", ".", "morph", "\\u", "id", "'_", ",_", "[_", "1_", ",_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "query_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "where", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "'", "table", ".", "morph", "\\u", "type", "'_", ",_", "relation_", "._", "get", "\\u", "parent_", "(_", ")_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "model", "1_", "=_", "Model_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "1_", "._", "id_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "2_", "=_", "Model_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "2_", "._", "id_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "add", "\\u", "eage", "r", "\\u", "constraints_", "(_", "[_", "model", "1_", ",_", "model", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Or", "m", "Morph", "Test", "Case_", "(_", "Ora", "tor", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "create_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "relation_", "=_", "self_", "._", "\\u", "get", "\\u", "one", "\\u", "relation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "created_", "=_", "flex", "mock_", "(_", "Model_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "created_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "set\\u", "attribute", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "'", "morph", "\\u", "id", "'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "created_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "set\\u", "attribute", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "'", "morph", "\\u", "type", "'_", ",_", "relation_", "._", "get", "\\u", "parent_", "(_", ")_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "related_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "new", "\\u", "instance", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "{_", "'", "name", "'_", ":_", "'", "john", "'_", "}_", ")_", "._", "and", "\\u", "return_", "(_", "created_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "created_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "save", "'_", ")_", "._", "once_", "(_", ")_", "._", "and", "\\u", "return_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "created_", ",_", "relation_", "._", "create_", "(_", "name_", "=_", "'", "john", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Or", "m", "Morph", "Test", "Case_", "(_", "Ora", "tor", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "find", "\\u", "or", "\\u", "new", "\\u", "find", "s", "\\u", "model_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "relation_", "=_", "self_", "._", "\\u", "get", "\\u", "one", "\\u", "relation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "flex", "mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "foo_", "=_", "'", "bar", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "query_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "find", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "'", "foo", "'_", ",_", "[_", "'*'_", "]_", ")_", "._", "and", "\\u", "return_", "(_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "related_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "new", "\\u", "instance", "'_", ")_", "._", "neve", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "set\\u", "attribute", "'_", ")_", "._", "neve", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "save", "'_", ")_", "._", "neve", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "bar", "'_", ",_", "relation_", "._", "find", "\\u", "or", "\\u", "new_", "(_", "'", "foo", "'_", ")_", "._", "foo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Or", "m", "Morph", "Test", "Case_", "(_", "Ora", "tor", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "find", "\\u", "or", "\\u", "new", "\\u", "return", "s", "\\u", "new", "\\u", "model", "\\u", "with", "\\u", "morph", "\\u", "keys", "\\u", "set_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "relation_", "=_", "self_", "._", "\\u", "get", "\\u", "one", "\\u", "relation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "flex", "mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "foo_", "=_", "'", "bar", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "query_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "find", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "'", "foo", "'_", ",_", "[_", "'*'_", "]_", ")_", "._", "and", "\\u", "return_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "related_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "new", "\\u", "instance", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", ")_", "._", "and", "\\u", "return_", "(_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "set\\u", "attribute", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "'", "morph", "\\u", "id", "'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "set\\u", "attribute", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "'", "morph", "\\u", "type", "'_", ",_", "relation_", "._", "get", "\\u", "parent_", "(_", ")_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "save", "'_", ")_", "._", "neve", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "bar", "'_", ",_", "relation_", "._", "find", "\\u", "or", "\\u", "new_", "(_", "'", "foo", "'_", ")_", "._", "foo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Or", "m", "Morph", "Test", "Case_", "(_", "Ora", "tor", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "first", "\\u", "or", "\\u", "new", "\\u", "return", "s", "\\u", "first", "\\u", "model_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "relation_", "=_", "self_", "._", "\\u", "get", "\\u", "one", "\\u", "relation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "flex", "mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "foo_", "=_", "'", "bar", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "query_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "where", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "{_", "'", "foo", "'_", ":_", "'", "bar", "'_", "}_", ")_", "._", "and", "\\u", "return_", "(_", "relation_", "._", "get", "\\u", "query_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "query_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "first", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", ")_", "._", "and", "\\u", "return_", "(_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "related_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "new", "\\u", "instance", "'_", ")_", "._", "neve", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "set\\u", "attribute", "'_", ")_", "._", "neve", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "set\\u", "attribute", "'_", ")_", "._", "neve", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "save", "'_", ")_", "._", "neve", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "bar", "'_", ",_", "relation_", "._", "first", "\\u", "or", "\\u", "new_", "(_", "{_", "'", "foo", "'_", ":_", "'", "bar", "'_", "}_", ")_", "._", "foo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Or", "m", "Morph", "Test", "Case_", "(_", "Ora", "tor", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "first", "\\u", "or", "\\u", "new", "\\u", "return", "s", "\\u", "new", "\\u", "model", "\\u", "with", "\\u", "morph", "\\u", "keys", "\\u", "set_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "relation_", "=_", "self_", "._", "\\u", "get", "\\u", "one", "\\u", "relation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "flex", "mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "foo_", "=_", "'", "bar", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "query_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "where", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "{_", "'", "foo", "'_", ":_", "'", "bar", "'_", "}_", ")_", "._", "and", "\\u", "return_", "(_", "relation_", "._", "get", "\\u", "query_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "query_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "first", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", ")_", "._", "and", "\\u", "return_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "related_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "new", "\\u", "instance", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", ")_", "._", "and", "\\u", "return_", "(_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "set\\u", "attribute", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "'", "morph", "\\u", "id", "'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "set\\u", "attribute", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "'", "morph", "\\u", "type", "'_", ",_", "relation_", "._", "get", "\\u", "parent_", "(_", ")_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "save", "'_", ")_", "._", "neve", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "bar", "'_", ",_", "relation_", "._", "first", "\\u", "or", "\\u", "new_", "(_", "{_", "'", "foo", "'_", ":_", "'", "bar", "'_", "}_", ")_", "._", "foo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Or", "m", "Morph", "Test", "Case_", "(_", "Ora", "tor", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "first", "\\u", "or", "\\u", "create", "\\u", "return", "s", "\\u", "first", "\\u", "model_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "relation_", "=_", "self_", "._", "\\u", "get", "\\u", "one", "\\u", "relation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "flex", "mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "foo_", "=_", "'", "bar", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "query_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "where", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "{_", "'", "foo", "'_", ":_", "'", "bar", "'_", "}_", ")_", "._", "and", "\\u", "return_", "(_", "relation_", "._", "get", "\\u", "query_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "query_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "first", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", ")_", "._", "and", "\\u", "return_", "(_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "related_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "new", "\\u", "instance", "'_", ")_", "._", "neve", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "set\\u", "attribute", "'_", ")_", "._", "neve", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "set\\u", "attribute", "'_", ")_", "._", "neve", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "save", "'_", ")_", "._", "neve", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "bar", "'_", ",_", "relation_", "._", "first", "\\u", "or", "\\u", "create_", "(_", "{_", "'", "foo", "'_", ":_", "'", "bar", "'_", "}_", ")_", "._", "foo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Or", "m", "Morph", "Test", "Case_", "(_", "Ora", "tor", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "first", "\\u", "or", "\\u", "create", "\\u", "create", "s", "\\u", "new", "\\u", "morph", "\\u", "model_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "relation_", "=_", "self_", "._", "\\u", "get", "\\u", "one", "\\u", "relation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "flex", "mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "foo_", "=_", "'", "bar", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "query_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "where", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "{_", "'", "foo", "'_", ":_", "'", "bar", "'_", "}_", ")_", "._", "and", "\\u", "return_", "(_", "relation_", "._", "get", "\\u", "query_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "query_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "first", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", ")_", "._", "and", "\\u", "return_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "related_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "new", "\\u", "instance", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "{_", "'", "foo", "'_", ":_", "'", "bar", "'_", "}_", ")_", "._", "and", "\\u", "return_", "(_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "set\\u", "attribute", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "'", "morph", "\\u", "id", "'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "set\\u", "attribute", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "'", "morph", "\\u", "type", "'_", ",_", "relation_", "._", "get", "\\u", "parent_", "(_", ")_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "save", "'_", ")_", "._", "once_", "(_", ")_", "._", "and", "\\u", "return_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "bar", "'_", ",_", "relation_", "._", "first", "\\u", "or", "\\u", "create_", "(_", "{_", "'", "foo", "'_", ":_", "'", "bar", "'_", "}_", ")_", "._", "foo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Or", "m", "Morph", "Test", "Case_", "(_", "Ora", "tor", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "update", "\\u", "or", "\\u", "create", "\\u", "find", "s", "\\u", "first", "\\u", "model", "\\u", "and", "\\u", "updates_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "relation_", "=_", "self_", "._", "\\u", "get", "\\u", "one", "\\u", "relation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "flex", "mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "foo_", "=_", "'", "bar", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "query_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "where", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "{_", "'", "foo", "'_", ":_", "'", "bar", "'_", "}_", ")_", "._", "and", "\\u", "return_", "(_", "relation_", "._", "get", "\\u", "query_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "query_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "first", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", ")_", "._", "and", "\\u", "return_", "(_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "related_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "new", "\\u", "instance", "'_", ")_", "._", "neve", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "set\\u", "attribute", "'_", ")_", "._", "neve", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "set\\u", "attribute", "'_", ")_", "._", "neve", "r_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "fill", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "{_", "'", "bar", "'_", ":_", "'", "ba", "z", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "save", "'_", ")_", "._", "once_", "(_", ")_", "._", "and", "\\u", "return_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "bar", "'_", ",_", "relation_", "._", "update", "\\u", "or", "\\u", "create_", "(_", "{_", "'", "foo", "'_", ":_", "'", "bar", "'_", "}_", ",_", "{_", "'", "bar", "'_", ":_", "'", "ba", "z", "'_", "}_", ")_", "._", "foo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Or", "m", "Morph", "Test", "Case_", "(_", "Ora", "tor", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "update", "\\u", "or", "\\u", "create", "\\u", "find", "s", "\\u", "create", "s", "\\u", "new", "\\u", "morph", "\\u", "model_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "relation_", "=_", "self_", "._", "\\u", "get", "\\u", "one", "\\u", "relation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "flex", "mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "foo_", "=_", "'", "bar", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "query_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "where", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "{_", "'", "foo", "'_", ":_", "'", "bar", "'_", "}_", ")_", "._", "and", "\\u", "return_", "(_", "relation_", "._", "get", "\\u", "query_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "query_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "first", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", ")_", "._", "and", "\\u", "return_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relation_", "._", "get", "\\u", "related_", "(_", ")_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "new", "\\u", "instance", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", ")_", "._", "and", "\\u", "return_", "(_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "set\\u", "attribute", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "'", "morph", "\\u", "id", "'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "set\\u", "attribute", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "'", "morph", "\\u", "type", "'_", ",_", "relation_", "._", "get", "\\u", "parent_", "(_", ")_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "fill", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "{_", "'", "bar", "'_", ":_", "'", "ba", "z", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "save", "'_", ")_", "._", "once_", "(_", ")_", "._", "and", "\\u", "return_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "bar", "'_", ",_", "relation_", "._", "update", "\\u", "or", "\\u", "create_", "(_", "{_", "'", "foo", "'_", ":_", "'", "bar", "'_", "}_", ",_", "{_", "'", "bar", "'_", ":_", "'", "ba", "z", "'_", "}_", ")_", "._", "foo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Or", "m", "Morph", "Test", "Case_", "(_", "Ora", "tor", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "many", "\\u", "relation_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "flex", "mock_", "(_", "Builder_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query_", "=_", "flex", "mock_", "(_", "Query", "Builder_", "(_", "None_", ",_", "Query", "Grammar_", "(_", ")_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "builder_", "=_", "Builder_", "(_", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "builder_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "where", "'_", ")_", "._", "with", "\\u", "args_", "(_", "'", "table", ".", "morph", "\\u", "id", "'_", ",_", "'='_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "related_", "=_", "flex", "mock_", "(_", "Model_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "builder_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "get", "\\u", "model", "'_", ")_", "._", "and", "\\u", "return_", "(_", "related_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parent_", "=_", "flex", "mock_", "(_", "Model_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parent_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "get", "\\u", "attribute", "'_", ")_", "._", "with", "\\u", "args_", "(_", "'", "id", "'_", ")_", "._", "and", "\\u", "return_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parent_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "get", "\\u", "morph", "\\u", "name", "'_", ")_", "._", "and", "\\u", "return_", "(_", "parent_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "builder_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "where", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "'", "table", ".", "morph", "\\u", "type", "'_", ",_", "parent_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "Morph", "Many", "_", "(_", "builder_", ",_", "parent_", ",_", "'", "table", ".", "morph", "\\u", "type", "'_", ",_", "'", "table", ".", "morph", "\\u", "id", "'_", ",_", "'", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Or", "m", "Morph", "Test", "Case_", "(_", "Ora", "tor", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "one", "\\u", "relation_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "flex", "mock_", "(_", "Builder_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query_", "=_", "flex", "mock_", "(_", "Query", "Builder_", "(_", "None_", ",_", "Query", "Grammar_", "(_", ")_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "builder_", "=_", "Builder_", "(_", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "builder_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "where", "'_", ")_", "._", "with", "\\u", "args_", "(_", "'", "table", ".", "morph", "\\u", "id", "'_", ",_", "'='_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "related_", "=_", "flex", "mock_", "(_", "Model_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "builder_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "get", "\\u", "model", "'_", ")_", "._", "and", "\\u", "return_", "(_", "related_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parent_", "=_", "flex", "mock_", "(_", "Model_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parent_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "get", "\\u", "attribute", "'_", ")_", "._", "with", "\\u", "args_", "(_", "'", "id", "'_", ")_", "._", "and", "\\u", "return_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parent_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "get", "\\u", "morph", "\\u", "name", "'_", ")_", "._", "and", "\\u", "return_", "(_", "parent_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "builder_", "._", "shou", "ld", "\\u", "receive_", "(_", "'", "where", "'_", ")_", "._", "once_", "(_", ")_", "._", "with", "\\u", "args_", "(_", "'", "table", ".", "morph", "\\u", "type", "'_", ",_", "parent_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "Morph", "One_", "(_", "builder_", ",_", "parent_", ",_", "'", "table", ".", "morph", "\\u", "type", "'_", ",_", "'", "table", ".", "morph", "\\u", "id", "'_", ",_", "'", "id", "'_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
WGBH/django-versatileimagefield/tests/tests.py
[ { "content": " def test_placeholder_image(self):\n \"\"\"Ensure placeholder images work as intended.\"\"\"\n self.jpg.optional_image.create_on_demand = True\n self.assertEqual(\n self.jpg.optional_image.url,\n '/media/__placeholder__/placeholder.png'\n )\n self.assertEqual(\n self.jpg.optional_image.crop['100x100'].url,\n '/media/__sized__/__placeholder__/'\n 'placeholder-crop-c0-5__0-5-100x100.png'\n )\n self.assertEqual(\n self.jpg.optional_image.thumbnail['100x100'].url,\n '/media/__sized__/__placeholder__/'\n 'placeholder-thumbnail-100x100.png'\n )\n self.assertEqual(\n self.jpg.optional_image.filters.invert.url,\n '/media/__placeholder__/__filtered__/placeholder__invert__.png'\n )\n self.assertEqual(\n self.jpg.optional_image_2.crop['100x100'].url,\n '/media/__sized__/__placeholder__/on-storage-placeholder/'\n 'placeholder-crop-c0-5__0-5-100x100.png'\n )\n self.assertEqual(\n self.jpg.optional_image_2.thumbnail['100x100'].url,\n '/media/__sized__/__placeholder__/on-storage-placeholder/'\n 'placeholder-thumbnail-100x100.png'\n )\n self.assertEqual(\n self.jpg.optional_image_2.filters.invert.url,\n '/media/__placeholder__/on-storage-placeholder/__filtered__/'\n 'placeholder__invert__.png'\n )\n self.assertFalse(\n self.jpg.optional_image.field.storage.size(\n self.jpg.optional_image.name\n ) is 0\n )\n self.jpg.optional_image.create_on_demand = False", "metadata": "root.VersatileImageFieldTestCase.test_placeholder_image", "header": "['class', 'VersatileImageFieldTestCase', '(', 'VersatileImageFieldBaseTestCase', ')', ':', '___EOS___']", "index": 229 }, { "content": " def test_unregister_methods(self):\n \"\"\"\n Ensuring versatileimagefield_registry unregister methods\n work as expected\n \"\"\"\n self.assertTrue(\n 'crop' in versatileimagefield_registry._sizedimage_registry\n )\n versatileimagefield_registry.unregister_sizer('crop')\n self.assertFalse(\n 'crop' in versatileimagefield_registry._sizedimage_registry\n )\n\n self.assertTrue(\n 'invert' in versatileimagefield_registry._filter_registry\n )\n versatileimagefield_registry.unregister_filter('invert')\n self.assertFalse(\n 'invert' in versatileimagefield_registry._filter_registry\n )", "metadata": "root.VersatileImageFieldTestCase.test_unregister_methods", "header": "['class', 'VersatileImageFieldTestCase', '(', 'VersatileImageFieldBaseTestCase', ')', ':', '___EOS___']", "index": 806 } ]
[ { "span": "self.assertFalse(\n self.jpg.optional_image.field.storage.size(\n self.jpg.optional_image.name\n ) is 0\n )", "start_line": 265, "start_column": 8, "end_line": 269, "end_column": 9 }, { "span": "self.assertTrue(\n 'crop' in versatileimagefield_registry._sizedimage_registry\n )", "start_line": 811, "start_column": 8, "end_line": 813, "end_column": 9 }, { "span": "self.assertFalse(\n 'crop' in versatileimagefield_registry._sizedimage_registry\n )", "start_line": 815, "start_column": 8, "end_line": 817, "end_column": 9 }, { "span": "self.assertTrue(\n 'invert' in versatileimagefield_registry._filter_registry\n )", "start_line": 819, "start_column": 8, "end_line": 821, "end_column": 9 }, { "span": "self.assertFalse(\n 'invert' in versatileimagefield_registry._filter_registry\n )", "start_line": 823, "start_column": 8, "end_line": 825, "end_column": 9 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Vers", "ati", "le", "Image", "Field", "Test", "Case_", "(_", "Vers", "ati", "le", "Image", "Field", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "placehold", "er", "\\u", "image_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Ensur", "e", " ", "placehold", "er", " ", "images", " ", "work", " ", "as", " ", "inten", "ded", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "jp", "g_", "._", "option", "al", "\\u", "image_", "._", "create", "\\u", "on", "\\u", "demand_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "jp", "g_", "._", "option", "al", "\\u", "image_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'/", "media", "/\\u", "\\u", "placehold", "er\\u\\u", "/", "placehold", "er", ".", "png", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "jp", "g_", "._", "option", "al", "\\u", "image_", "._", "crop_", "[_", "'", "100", "x1", "00", "'_", "]_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'/", "media", "/\\u", "\\u", "sized", "\\u\\u", "/\\u", "\\u", "placehold", "er\\u\\u", "/'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "placehold", "er", "-", "crop", "-", "c0", "-", "5", "\\u\\u", "0", "-", "5", "-1", "00", "x1", "00", ".", "png", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "jp", "g_", "._", "option", "al", "\\u", "image_", "._", "thumbnail_", "[_", "'", "100", "x1", "00", "'_", "]_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'/", "media", "/\\u", "\\u", "sized", "\\u\\u", "/\\u", "\\u", "placehold", "er\\u\\u", "/'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "placehold", "er", "-", "thumbnail", "-1", "00", "x1", "00", ".", "png", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "jp", "g_", "._", "option", "al", "\\u", "image_", "._", "filters_", "._", "invert_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'/", "media", "/\\u", "\\u", "placehold", "er\\u\\u", "/\\u", "\\u", "filter", "ed", "\\u\\u", "/", "placehold", "er\\u\\u", "invert", "\\u\\u", ".", "png", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "jp", "g_", "._", "option", "al", "\\u", "image", "\\u", "2_", "._", "crop_", "[_", "'", "100", "x1", "00", "'_", "]_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'/", "media", "/\\u", "\\u", "sized", "\\u\\u", "/\\u", "\\u", "placehold", "er\\u\\u", "/", "on", "-", "storage", "-", "placehold", "er", "/'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "placehold", "er", "-", "crop", "-", "c0", "-", "5", "\\u\\u", "0", "-", "5", "-1", "00", "x1", "00", ".", "png", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "jp", "g_", "._", "option", "al", "\\u", "image", "\\u", "2_", "._", "thumbnail_", "[_", "'", "100", "x1", "00", "'_", "]_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'/", "media", "/\\u", "\\u", "sized", "\\u\\u", "/\\u", "\\u", "placehold", "er\\u\\u", "/", "on", "-", "storage", "-", "placehold", "er", "/'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "placehold", "er", "-", "thumbnail", "-1", "00", "x1", "00", ".", "png", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "jp", "g_", "._", "option", "al", "\\u", "image", "\\u", "2_", "._", "filters_", "._", "invert_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'/", "media", "/\\u", "\\u", "placehold", "er\\u\\u", "/", "on", "-", "storage", "-", "placehold", "er", "/\\u", "\\u", "filter", "ed", "\\u\\u", "/'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "placehold", "er\\u\\u", "invert", "\\u\\u", ".", "png", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "jp", "g_", "._", "option", "al", "\\u", "image_", "._", "field_", "._", "storage_", "._", "size_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "jp", "g_", "._", "option", "al", "\\u", "image_", "._", "name_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "is_", "0_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "jp", "g_", "._", "option", "al", "\\u", "image_", "._", "create", "\\u", "on", "\\u", "demand_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Vers", "ati", "le", "Image", "Field", "Test", "Case_", "(_", "Vers", "ati", "le", "Image", "Field", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "unregister", "\\u", "methods_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Ensur", "ing", " ", "versa", "tile", "imagef", "iel", "d\\u", "registr", "y", " ", "unregister", " ", "method", "s", "\\", "10", ";", " ", " ", " ", " ", "work", " ", "as", " ", "expected", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "crop", "'_", "in_", "versa", "tile", "imagef", "iel", "d\\u", "registry_", "._", "\\u", "sized", "image", "\\u", "registry_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "versa", "tile", "imagef", "iel", "d\\u", "registry_", "._", "unregister", "\\u", "sizer_", "(_", "'", "crop", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "crop", "'_", "in_", "versa", "tile", "imagef", "iel", "d\\u", "registry_", "._", "\\u", "sized", "image", "\\u", "registry_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "invert", "'_", "in_", "versa", "tile", "imagef", "iel", "d\\u", "registry_", "._", "\\u", "filter", "\\u", "registry_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "versa", "tile", "imagef", "iel", "d\\u", "registry_", "._", "unregister", "\\u", "filter_", "(_", "'", "invert", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "invert", "'_", "in_", "versa", "tile", "imagef", "iel", "d\\u", "registry_", "._", "\\u", "filter", "\\u", "registry_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Testing equality to None
gkno/gkno_launcher/src/networkx/drawing/layout.py
[ { "content": "def shell_layout(G,nlist=None,dim=2,scale=1):\n \"\"\"Position nodes in concentric circles.\n\n Parameters\n ----------\n G : NetworkX graph\n\n nlist : list of lists\n List of node lists for each shell.\n\n dim : int\n Dimension of layout, currently only dim=2 is supported\n\n scale : float\n Scale factor for positions\n\n Returns\n -------\n dict :\n A dictionary of positions keyed by node\n\n Examples\n --------\n >>> G=nx.path_graph(4)\n >>> shells=[[0],[1,2,3]]\n >>> pos=nx.shell_layout(G,shells)\n\n Notes\n ------\n This algorithm currently only works in two dimensions and does not\n try to minimize edge crossings.\n\n \"\"\"\n try:\n import numpy as np\n except ImportError:\n raise ImportError(\"shell_layout() requires numpy: http://scipy.org/ \")\n if len(G)==0:\n return {}\n if len(G)==1:\n return {G.nodes()[0]:(1,)*dim}\n if nlist==None:\n nlist=[G.nodes()] # draw the whole graph in one shell\n\n if len(nlist[0])==1:\n radius=0.0 # single node at center\n else:\n radius=1.0 # else start at r=1\n\n npos={}\n for nodes in nlist:\n t=np.arange(0,2.0*np.pi,2.0*np.pi/len(nodes),dtype=np.float32)\n pos=np.transpose(np.array([radius*np.cos(t),radius*np.sin(t)]))\n npos.update(zip(nodes,pos))\n radius+=1.0\n\n # FIXME: rescale\n return npos", "metadata": "root.shell_layout", "header": "['module', '___EOS___']", "index": 101 }, { "content": "def _fruchterman_reingold(A, dim=2, k=None, pos=None, fixed=None, \n iterations=50):\n # Position nodes in adjacency matrix A using Fruchterman-Reingold\n # Entry point for NetworkX graph is fruchterman_reingold_layout()\n try:\n import numpy as np\n except ImportError:\n raise ImportError(\"_fruchterman_reingold() requires numpy: http://scipy.org/ \")\n\n try:\n nnodes,_=A.shape\n except AttributeError:\n raise nx.NetworkXError(\n \"fruchterman_reingold() takes an adjacency matrix as input\")\n\n A=np.asarray(A) # make sure we have an array instead of a matrix\n\n if pos==None:\n # random initial positions\n pos=np.asarray(np.random.random((nnodes,dim)),dtype=A.dtype)\n else:\n # make sure positions are of same type as matrix\n pos=pos.astype(A.dtype)\n\n # optimal distance between nodes\n if k is None:\n k=np.sqrt(1.0/nnodes)\n # the initial \"temperature\" is about .1 of domain area (=1x1)\n # this is the largest step allowed in the dynamics.\n t=0.1\n # simple cooling scheme.\n # linearly step down by dt on each iteration so last iteration is size dt.\n dt=t/float(iterations+1)\n delta = np.zeros((pos.shape[0],pos.shape[0],pos.shape[1]),dtype=A.dtype)\n # the inscrutable (but fast) version\n # this is still O(V^2)\n # could use multilevel methods to speed this up significantly\n for iteration in range(iterations):\n # matrix of difference between points\n for i in range(pos.shape[1]):\n delta[:,:,i]= pos[:,i,None]-pos[:,i]\n # distance between points\n distance=np.sqrt((delta**2).sum(axis=-1))\n # enforce minimum distance of 0.01\n distance=np.where(distance<0.01,0.01,distance)\n # displacement \"force\"\n displacement=np.transpose(np.transpose(delta)*\\\n (k*k/distance**2-A*distance/k))\\\n .sum(axis=1)\n # update positions\n length=np.sqrt((displacement**2).sum(axis=1))\n length=np.where(length<0.01,0.1,length)\n delta_pos=np.transpose(np.transpose(displacement)*t/length)\n if fixed is not None:\n # don't change positions of fixed nodes\n delta_pos[fixed]=0.0\n pos+=delta_pos\n # cool temperature\n t-=dt\n pos=_rescale_layout(pos)\n return pos", "metadata": "root._fruchterman_reingold", "header": "['module', '___EOS___']", "index": 251 }, { "content": "def _sparse_fruchterman_reingold(A, dim=2, k=None, pos=None, fixed=None, \n iterations=50):\n # Position nodes in adjacency matrix A using Fruchterman-Reingold \n # Entry point for NetworkX graph is fruchterman_reingold_layout()\n # Sparse version\n try:\n import numpy as np\n except ImportError:\n raise ImportError(\"_sparse_fruchterman_reingold() requires numpy: http://scipy.org/ \")\n try:\n nnodes,_=A.shape\n except AttributeError:\n raise nx.NetworkXError(\n \"fruchterman_reingold() takes an adjacency matrix as input\")\n try:\n from scipy.sparse import spdiags,coo_matrix\n except ImportError:\n raise ImportError(\"_sparse_fruchterman_reingold() scipy numpy: http://scipy.org/ \")\n # make sure we have a LIst of Lists representation\n try:\n A=A.tolil()\n except:\n A=(coo_matrix(A)).tolil()\n\n if pos==None:\n # random initial positions\n pos=np.asarray(np.random.random((nnodes,dim)),dtype=A.dtype)\n else:\n # make sure positions are of same type as matrix\n pos=pos.astype(A.dtype)\n\n # no fixed nodes\n if fixed==None:\n fixed=[]\n\n # optimal distance between nodes\n if k is None:\n k=np.sqrt(1.0/nnodes)\n # the initial \"temperature\" is about .1 of domain area (=1x1)\n # this is the largest step allowed in the dynamics.\n t=0.1\n # simple cooling scheme.\n # linearly step down by dt on each iteration so last iteration is size dt.\n dt=t/float(iterations+1)\n\n displacement=np.zeros((dim,nnodes))\n for iteration in range(iterations):\n displacement*=0\n # loop over rows\n for i in range(A.shape[0]):\n if i in fixed:\n continue\n # difference between this row's node position and all others\n delta=(pos[i]-pos).T\n # distance between points\n distance=np.sqrt((delta**2).sum(axis=0))\n # enforce minimum distance of 0.01\n distance=np.where(distance<0.01,0.01,distance)\n # the adjacency matrix row\n Ai=np.asarray(A.getrowview(i).toarray())\n # displacement \"force\"\n displacement[:,i]+=\\\n (delta*(k*k/distance**2-Ai*distance/k)).sum(axis=1)\n # update positions\n length=np.sqrt((displacement**2).sum(axis=0))\n length=np.where(length<0.01,0.1,length)\n pos+=(displacement*t/length).T\n # cool temperature\n t-=dt\n pos=_rescale_layout(pos)\n return pos", "metadata": "root._sparse_fruchterman_reingold", "header": "['module', '___EOS___']", "index": 314 } ]
[ { "span": "nlist==None:", "start_line": 142, "start_column": 7, "end_line": 142, "end_column": 18 }, { "span": "pos==None:", "start_line": 268, "start_column": 7, "end_line": 268, "end_column": 16 }, { "span": "pos==None:", "start_line": 338, "start_column": 7, "end_line": 338, "end_column": 16 }, { "span": "fixed==None:", "start_line": 346, "start_column": 7, "end_line": 346, "end_column": 18 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "shell", "\\u", "layout_", "(_", "G_", ",_", "nli", "st_", "=_", "None_", ",_", "dim_", "=_", "2_", ",_", "scale_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Position", " ", "nodes", " ", "in", " ", "conce", "ntri", "c", " ", "circles", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", " ", " ", " ", " ", "G", " ", ":", " ", "Network", "X", " ", "graph", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "nli", "st", " ", ":", " ", "list", " ", "of", " ", "lists", "\\", "10", ";", " ", " ", " ", "List", " ", "of", " ", "node", " ", "lists", " ", "for", " ", "each", " ", "shell", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "dim", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", "Dimen", "sion", " ", "of", " ", "layout", ",", " ", "currentl", "y", " ", "only", " ", "dim", "=", "2", " ", "is", " ", "support", "ed", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "scale", " ", ":", " ", "float", "\\", "10", ";", " ", " ", " ", " ", "Scale", " ", "factor", " ", "for", " ", "position", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", "\\", "10", ";", " ", " ", " ", " ", "-------", "\\", "10", ";", " ", " ", " ", " ", "dict", " ", ":", "\\", "10", ";", " ", " ", " ", "A", " ", "dictionar", "y", " ", "of", " ", "position", "s", " ", "keyed", " ", "by", " ", "node", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Exam", "ples", "\\", "10", ";", " ", " ", " ", " ", "--------", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "G", "=", "nx", ".", "path", "\\u", "graph", "(", "4", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "shells", "=[", "[", "0", "],[", "1", ",", "2", ",", "3", "]]", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "pos", "=", "nx", ".", "shell", "\\u", "layout", "(", "G", ",", "shells", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Not", "es", "\\", "10", ";", " ", " ", " ", " ", "------", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "algo", "rit", "hm", " ", "currentl", "y", " ", "only", " ", "works", " ", "in", " ", "two", " ", "dimension", "s", " ", "and", " ", "doe", "s", " ", "not", "\\", "10", ";", " ", " ", " ", " ", "try", " ", "to", " ", "minimize", " ", "edge", " ", "crossing", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Import", "Error_", "(_", "\"", "shell", "\\u", "layout", "()", " ", "require", "s", " ", "nump", "y", ":", " ", "http", "://", "sci", "py", ".", "org", "/", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "G_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "G_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "G_", "._", "nodes_", "(_", ")_", "[_", "0_", "]_", ":_", "(_", "1_", ",_", ")_", "*_", "dim_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "nli", "st_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nli", "st_", "=_", "[_", "G_", "._", "nodes_", "(_", ")_", "]_", "#", " ", "draw", " ", "the", " ", "whole", " ", "graph", " ", "in", " ", "one", " ", "shell_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "nli", "st_", "[_", "0_", "]_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "radius_", "=_", "0.0_", "#", " ", "single", " ", "node", " ", "at", " ", "center_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "radius_", "=_", "1.0_", "#", " ", "else", " ", "start", " ", "at", " ", "r", "=", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "npo", "s_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "nodes_", "in_", "nli", "st_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "np_", "._", "arange_", "(_", "0_", ",_", "2.0_", "*_", "np_", "._", "pi_", ",_", "2.0_", "*_", "np_", "._", "pi_", "/_", "len_", "(_", "nodes_", ")_", ",_", "dtype_", "=_", "np_", "._", "float32_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "=_", "np_", "._", "transpose_", "(_", "np_", "._", "array_", "(_", "[_", "radius_", "*_", "np_", "._", "cos_", "(_", "t_", ")_", ",_", "radius_", "*_", "np_", "._", "sin_", "(_", "t_", ")_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "npo", "s_", "._", "update_", "(_", "zip_", "(_", "nodes_", ",_", "pos_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "radius_", "+=_", "1.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "FIX", "ME", ":", " ", "rescale", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "npo", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "fru", "cht", "erm", "an", "\\u", "rein", "gold_", "(_", "A_", ",_", "dim_", "=_", "2_", ",_", "k_", "=_", "None_", ",_", "pos_", "=_", "None_", ",_", "fixed_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "iterations_", "=_", "50_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Position", " ", "nodes", " ", "in", " ", "adjacency", " ", "matrix", " ", "A", " ", "usi", "ng", " ", "Fru", "cht", "erm", "an", "-", "Rein", "gold_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Entr", "y", " ", "point", " ", "for", " ", "Network", "X", " ", "graph", " ", "is", " ", "fru", "cht", "erm", "an", "\\u", "rein", "gold", "\\u", "layout", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Import", "Error_", "(_", "\"\\u", "fru", "cht", "erm", "an", "\\u", "rein", "gold", "()", " ", "require", "s", " ", "nump", "y", ":", " ", "http", "://", "sci", "py", ".", "org", "/", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nno", "des_", ",_", "\\u_", "=_", "A_", "._", "shape_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "nx_", "._", "Network", "XE", "rror_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fru", "cht", "erm", "an", "\\u", "rein", "gold", "()", " ", "take", "s", " ", "an", " ", "adjacency", " ", "matrix", " ", "as", " ", "input", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "A_", "=_", "np_", "._", "asarray_", "(_", "A_", ")_", "#", " ", "make", " ", "sure", " ", "we", " ", "have", " ", "an", " ", "array", " ", "inst", "ead", " ", "of", " ", "a", " ", "matrix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "pos_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "random", " ", "initial", " ", "positions_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pos_", "=_", "np_", "._", "asarray_", "(_", "np_", "._", "random_", "._", "random_", "(_", "(_", "nno", "des_", ",_", "dim_", ")_", ")_", ",_", "dtype_", "=_", "A_", "._", "dtype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "position", "s", " ", "are", " ", "of", " ", "same", " ", "type", " ", "as", " ", "matrix_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pos_", "=_", "pos_", "._", "astype_", "(_", "A_", "._", "dtype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "optim", "al", " ", "distance", " ", "bet", "ween", " ", "nodes_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "k_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "k_", "=_", "np_", "._", "sqrt_", "(_", "1.0_", "/_", "nno", "des_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "the", " ", "initial", " ", "\"", "tempe", "ratur", "e", "\"", " ", " ", "is", " ", "abo", "ut", " ", ".1", " ", "of", " ", "domain", " ", "area", " ", "(", "=", "1x", "1", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "is", " ", "the", " ", "large", "st", " ", "step", " ", "allow", "ed", " ", "in", " ", "the", " ", "dynamics", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "t_", "=_", "0.1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "simple", " ", "cooling", " ", "sche", "me", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "linear", "ly", " ", "step", " ", "down", " ", "by", " ", "dt", " ", "on", " ", "each", " ", "iterati", "on", " ", "so", " ", "last", " ", "iterati", "on", " ", "is", " ", "size", " ", "dt", "._", "\\u\\u\\uNL\\u\\u\\u_", "dt_", "=_", "t_", "/_", "float_", "(_", "iterations_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delta_", "=_", "np_", "._", "zeros_", "(_", "(_", "pos_", "._", "shape_", "[_", "0_", "]_", ",_", "pos_", "._", "shape_", "[_", "0_", "]_", ",_", "pos_", "._", "shape_", "[_", "1_", "]_", ")_", ",_", "dtype_", "=_", "A_", "._", "dtype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "the", " ", "ins", "cru", "table", " ", "(", "but", " ", "fast", ")", " ", "version_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "is", " ", "still", " ", "O", "(", "V", "^", "2", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "coul", "d", " ", "use", " ", "multil", "evel", " ", "method", "s", " ", "to", " ", "speed", " ", "this", " ", "up", " ", "significant", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "iteration_", "in_", "range_", "(_", "iterations_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "matrix", " ", "of", " ", "difference", " ", "bet", "ween", " ", "points_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "range_", "(_", "pos_", "._", "shape_", "[_", "1_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "delta_", "[_", ":_", ",_", ":_", ",_", "i_", "]_", "=_", "pos_", "[_", ":_", ",_", "i_", ",_", "None_", "]_", "-_", "pos_", "[_", ":_", ",_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "distance", " ", "bet", "ween", " ", "points_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "distance_", "=_", "np_", "._", "sqrt_", "(_", "(_", "delta_", "**_", "2_", ")_", "._", "sum_", "(_", "axis_", "=_", "-_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "enforce", " ", "minim", "um", " ", "distance", " ", "of", " ", "0.01_", "\\u\\u\\uNL\\u\\u\\u_", "distance_", "=_", "np_", "._", "where_", "(_", "distance_", "<_", "0.01_", ",_", "0.01_", ",_", "distance_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "displacement", " ", "\"", "force", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "displacement", "_", "=_", "np_", "._", "transpose_", "(_", "np_", "._", "transpose_", "(_", "delta_", ")_", "*_", "(_", "k_", "*_", "k_", "/_", "distance_", "**_", "2_", "-_", "A_", "*_", "distance_", "/_", "k_", ")_", ")_", "._", "sum_", "(_", "axis_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "update", " ", "positions_", "\\u\\u\\uNL\\u\\u\\u_", "length_", "=_", "np_", "._", "sqrt_", "(_", "(_", "displacement", "_", "**_", "2_", ")_", "._", "sum_", "(_", "axis_", "=_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "length_", "=_", "np_", "._", "where_", "(_", "length_", "<_", "0.01_", ",_", "0.1_", ",_", "length_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delta", "\\u", "pos_", "=_", "np_", "._", "transpose_", "(_", "np_", "._", "transpose_", "(_", "displacement", "_", ")_", "*_", "t_", "/_", "length_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "fixed_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "don", "'", "t", " ", "change", " ", "position", "s", " ", "of", " ", "fixed", " ", "nodes_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "delta", "\\u", "pos_", "[_", "fixed_", "]_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pos_", "+=_", "delta", "\\u", "pos_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "cool", " ", "temperature_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "-=_", "dt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "=_", "\\u", "rescale", "\\u", "layout_", "(_", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "pos_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "spars", "e\\u", "fru", "cht", "erm", "an", "\\u", "rein", "gold_", "(_", "A_", ",_", "dim_", "=_", "2_", ",_", "k_", "=_", "None_", ",_", "pos_", "=_", "None_", ",_", "fixed_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "iterations_", "=_", "50_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Position", " ", "nodes", " ", "in", " ", "adjacency", " ", "matrix", " ", "A", " ", "usi", "ng", " ", "Fru", "cht", "erm", "an", "-", "Rein", "gold", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Entr", "y", " ", "point", " ", "for", " ", "Network", "X", " ", "graph", " ", "is", " ", "fru", "cht", "erm", "an", "\\u", "rein", "gold", "\\u", "layout", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Spar", "se", " ", "version_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Import", "Error_", "(_", "\"\\u", "spars", "e\\u", "fru", "cht", "erm", "an", "\\u", "rein", "gold", "()", " ", "require", "s", " ", "nump", "y", ":", " ", "http", "://", "sci", "py", ".", "org", "/", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nno", "des_", ",_", "\\u_", "=_", "A_", "._", "shape_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "nx_", "._", "Network", "XE", "rror_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fru", "cht", "erm", "an", "\\u", "rein", "gold", "()", " ", "take", "s", " ", "an", " ", "adjacency", " ", "matrix", " ", "as", " ", "input", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "scipy_", "._", "sparse_", "import_", "spd", "iag", "s_", ",_", "coo", "\\u", "matrix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Import", "Error_", "(_", "\"\\u", "spars", "e\\u", "fru", "cht", "erm", "an", "\\u", "rein", "gold", "()", " ", "sci", "py", " ", "nump", "y", ":", " ", "http", "://", "sci", "py", ".", "org", "/", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "we", " ", "have", " ", "a", " ", "LI", "st", " ", "of", " ", "List", "s", " ", "representation_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "A_", "=_", "A_", "._", "tol", "il_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "A_", "=_", "(_", "coo", "\\u", "matrix_", "(_", "A_", ")_", ")_", "._", "tol", "il_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "pos_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "random", " ", "initial", " ", "positions_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pos_", "=_", "np_", "._", "asarray_", "(_", "np_", "._", "random_", "._", "random_", "(_", "(_", "nno", "des_", ",_", "dim_", ")_", ")_", ",_", "dtype_", "=_", "A_", "._", "dtype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "position", "s", " ", "are", " ", "of", " ", "same", " ", "type", " ", "as", " ", "matrix_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pos_", "=_", "pos_", "._", "astype_", "(_", "A_", "._", "dtype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "no", " ", "fixed", " ", "nodes_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "fixed_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fixed_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "optim", "al", " ", "distance", " ", "bet", "ween", " ", "nodes_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "k_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "k_", "=_", "np_", "._", "sqrt_", "(_", "1.0_", "/_", "nno", "des_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "the", " ", "initial", " ", "\"", "tempe", "ratur", "e", "\"", " ", " ", "is", " ", "abo", "ut", " ", ".1", " ", "of", " ", "domain", " ", "area", " ", "(", "=", "1x", "1", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "is", " ", "the", " ", "large", "st", " ", "step", " ", "allow", "ed", " ", "in", " ", "the", " ", "dynamics", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "t_", "=_", "0.1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "simple", " ", "cooling", " ", "sche", "me", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "linear", "ly", " ", "step", " ", "down", " ", "by", " ", "dt", " ", "on", " ", "each", " ", "iterati", "on", " ", "so", " ", "last", " ", "iterati", "on", " ", "is", " ", "size", " ", "dt", "._", "\\u\\u\\uNL\\u\\u\\u_", "dt_", "=_", "t_", "/_", "float_", "(_", "iterations_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "displacement", "_", "=_", "np_", "._", "zeros_", "(_", "(_", "dim_", ",_", "nno", "des_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "iteration_", "in_", "range_", "(_", "iterations_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "displacement", "_", "*=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "loop", " ", "over", " ", "rows_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "A_", "._", "shape_", "[_", "0_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "i_", "in_", "fixed_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "difference", " ", "bet", "ween", " ", "this", " ", "row", "'", "s", " ", "node", " ", "position", " ", "and", " ", "all", " ", "others_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "delta_", "=_", "(_", "pos_", "[_", "i_", "]_", "-_", "pos_", ")_", "._", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "distance", " ", "bet", "ween", " ", "points_", "\\u\\u\\uNL\\u\\u\\u_", "distance_", "=_", "np_", "._", "sqrt_", "(_", "(_", "delta_", "**_", "2_", ")_", "._", "sum_", "(_", "axis_", "=_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "enforce", " ", "minim", "um", " ", "distance", " ", "of", " ", "0.01_", "\\u\\u\\uNL\\u\\u\\u_", "distance_", "=_", "np_", "._", "where_", "(_", "distance_", "<_", "0.01_", ",_", "0.01_", ",_", "distance_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "the", " ", "adjacency", " ", "matrix", " ", "row_", "\\u\\u\\uNL\\u\\u\\u_", "Ai", "_", "=_", "np_", "._", "asarray_", "(_", "A_", "._", "getr", "ow", "view_", "(_", "i_", ")_", "._", "toa", "rray_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "displacement", " ", "\"", "force", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "displacement", "_", "[_", ":_", ",_", "i_", "]_", "+=_", "(_", "delta_", "*_", "(_", "k_", "*_", "k_", "/_", "distance_", "**_", "2_", "-_", "Ai", "_", "*_", "distance_", "/_", "k_", ")_", ")_", "._", "sum_", "(_", "axis_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "update", " ", "positions_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "length_", "=_", "np_", "._", "sqrt_", "(_", "(_", "displacement", "_", "**_", "2_", ")_", "._", "sum_", "(_", "axis_", "=_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "length_", "=_", "np_", "._", "where_", "(_", "length_", "<_", "0.01_", ",_", "0.1_", ",_", "length_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "+=_", "(_", "displacement", "_", "*_", "t_", "/_", "length_", ")_", "._", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "cool", " ", "temperature_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "-=_", "dt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "=_", "\\u", "rescale", "\\u", "layout_", "(_", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "pos_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
packages/psutil/test/test_psutil.py
[ { "content": " def test_status_constants(self):\n # STATUS_* constants are supposed to be comparable also by\n # using their str representation\n self.assertTrue(psutil.STATUS_RUNNING == 0)\n self.assertTrue(psutil.STATUS_RUNNING == long(0))\n self.assertTrue(psutil.STATUS_RUNNING == 'running')\n self.assertFalse(psutil.STATUS_RUNNING == 1)\n self.assertFalse(psutil.STATUS_RUNNING == 'sleeping')\n self.assertFalse(psutil.STATUS_RUNNING != 0)\n self.assertFalse(psutil.STATUS_RUNNING != 'running')\n self.assertTrue(psutil.STATUS_RUNNING != 1)\n self.assertTrue(psutil.STATUS_RUNNING != 'sleeping')", "metadata": "root.TestCase.test_status_constants", "header": "['class', 'TestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1068 }, { "content": " def test_get_open_files(self):\n # current process\n p = psutil.Process(os.getpid())\n files = p.get_open_files()\n self.assertFalse(TESTFN in files)\n f = open(TESTFN, 'w')\n call_until(p.get_open_files, \"len(ret) != %i\" % len(files))\n filenames = [x.path for x in p.get_open_files()]\n self.assertIn(TESTFN, filenames)\n f.close()\n for file in filenames:\n assert os.path.isfile(file), file\n\n # another process\n cmdline = \"import time; f = open(r'%s', 'r'); time.sleep(100);\" % TESTFN\n sproc = get_test_subprocess([PYTHON, \"-c\", cmdline], wait=True)\n p = psutil.Process(sproc.pid)\n for x in range(100):\n filenames = [x.path for x in p.get_open_files()]\n if TESTFN in filenames:\n break\n time.sleep(.01)\n else:\n self.assertIn(TESTFN, filenames)\n for file in filenames:\n assert os.path.isfile(file), file", "metadata": "root.TestCase.test_get_open_files", "header": "['class', 'TestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1126 }, { "content": " def test_get_open_files2(self):\n # test fd and path fields\n fileobj = open(TESTFN, 'w')\n p = psutil.Process(os.getpid())\n for path, fd in p.get_open_files():\n if path == fileobj.name or fd == fileobj.fileno():\n break\n else:\n self.fail(\"no file found; files=%s\" % repr(p.get_open_files()))\n self.assertEqual(path, fileobj.name)\n if WINDOWS:\n self.assertEqual(fd, -1)\n else:\n self.assertEqual(fd, fileobj.fileno())\n # test positions\n ntuple = p.get_open_files()[0]\n self.assertEqual(ntuple[0], ntuple.path)\n self.assertEqual(ntuple[1], ntuple.fd)\n # test file is gone\n fileobj.close()\n self.assertTrue(fileobj.name not in p.get_open_files())", "metadata": "root.TestCase.test_get_open_files2", "header": "['class', 'TestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1153 }, { "content": " def test_parent_ppid(self):\n this_parent = os.getpid()\n sproc = get_test_subprocess()\n p = psutil.Process(sproc.pid)\n self.assertEqual(p.ppid, this_parent)\n self.assertEqual(p.parent.pid, this_parent)\n # no other process is supposed to have us as parent\n for p in psutil.process_iter():\n if p.pid == sproc.pid:\n continue\n self.assertTrue(p.ppid != this_parent)", "metadata": "root.TestCase.test_parent_ppid", "header": "['class', 'TestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1375 }, { "content": " def test_fetch_all(self):\n valid_procs = 0\n excluded_names = ['send_signal', 'suspend', 'resume', 'terminate',\n 'kill', 'wait', 'as_dict', 'get_cpu_percent', 'nice',\n 'parent', 'get_children', 'pid']\n attrs = []\n for name in dir(psutil.Process):\n if name.startswith(\"_\"):\n continue\n if name.startswith(\"set_\"):\n continue\n if name in excluded_names:\n continue\n attrs.append(name)\n\n for p in psutil.process_iter():\n for name in attrs:\n try:\n try:\n attr = getattr(p, name, None)\n if attr is not None and callable(attr):\n ret = attr()\n else:\n ret = attr\n valid_procs += 1\n except (psutil.NoSuchProcess, psutil.AccessDenied):\n err = sys.exc_info()[1]\n self.assertEqual(err.pid, p.pid)\n if err.name:\n # make sure exception's name attr is set\n # with the actual process name\n self.assertEqual(err.name, p.name)\n self.assertTrue(str(err))\n self.assertTrue(err.msg)\n else:\n if ret not in (0, 0.0, [], None, ''):\n assert ret, ret\n meth = getattr(self, name)\n meth(ret)\n except Exception:\n err = sys.exc_info()[1]\n trace = traceback.format_exc()\n self.fail('%s\\nproc=%s, method=%r, retvalue=%r'\n % (trace, p, name, ret))\n\n # we should always have a non-empty list, not including PID 0 etc.\n # special cases.\n self.assertTrue(valid_procs > 0)", "metadata": "root.TestFetchAllProcesses.test_fetch_all", "header": "['class', 'TestFetchAllProcesses', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '# Iterates over all running processes and performs some sanity', '___NL___', \"# checks against Process API's returned values.\", '___NL___', '___NL___', '# Python 2.4 compatibility', '___NL___', '___EOS___']", "index": 1607 }, { "content": " def ppid(self, ret):\n self.assertTrue(ret >= 0)", "metadata": "root.TestFetchAllProcesses.ppid", "header": "['class', 'TestFetchAllProcesses', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '# Iterates over all running processes and performs some sanity', '___NL___', \"# checks against Process API's returned values.\", '___NL___', '___NL___', '# Python 2.4 compatibility', '___NL___', '___EOS___']", "index": 1672 }, { "content": " def create_time(self, ret):\n self.assertTrue(ret > 0)\n if not WINDOWS:\n self.assertTrue(ret >= psutil.BOOT_TIME)\n # make sure returned value can be pretty printed\n # with strftime\n time.strftime(\"%Y %m %d %H:%M:%S\", time.localtime(ret))", "metadata": "root.TestFetchAllProcesses.create_time", "header": "['class', 'TestFetchAllProcesses', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '# Iterates over all running processes and performs some sanity', '___NL___', \"# checks against Process API's returned values.\", '___NL___', '___NL___', '# Python 2.4 compatibility', '___NL___', '___EOS___']", "index": 1679 }, { "content": " def uids(self, ret):\n for uid in ret:\n self.assertTrue(uid >= 0)\n self.assertIn(uid, self._uids)", "metadata": "root.TestFetchAllProcesses.uids", "header": "['class', 'TestFetchAllProcesses', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '# Iterates over all running processes and performs some sanity', '___NL___', \"# checks against Process API's returned values.\", '___NL___', '___NL___', '# Python 2.4 compatibility', '___NL___', '___EOS___']", "index": 1687 }, { "content": " def gids(self, ret):\n # note: testing all gids as above seems not to be reliable for\n # gid == 30 (nodoby); not sure why.\n for gid in ret:\n self.assertTrue(gid >= 0)\n #self.assertIn(uid, self.gids)", "metadata": "root.TestFetchAllProcesses.gids", "header": "['class', 'TestFetchAllProcesses', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '# Iterates over all running processes and performs some sanity', '___NL___', \"# checks against Process API's returned values.\", '___NL___', '___NL___', '# Python 2.4 compatibility', '___NL___', '___EOS___']", "index": 1692 }, { "content": " def status(self, ret):\n self.assertTrue(ret >= 0)\n self.assertTrue(str(ret) != '?')", "metadata": "root.TestFetchAllProcesses.status", "header": "['class', 'TestFetchAllProcesses', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '# Iterates over all running processes and performs some sanity', '___NL___', \"# checks against Process API's returned values.\", '___NL___', '___NL___', '# Python 2.4 compatibility', '___NL___', '___EOS___']", "index": 1704 }, { "content": " def get_io_counters(self, ret):\n for field in ret:\n if field != -1:\n self.assertTrue(field >= 0)", "metadata": "root.TestFetchAllProcesses.get_io_counters", "header": "['class', 'TestFetchAllProcesses', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '# Iterates over all running processes and performs some sanity', '___NL___', \"# checks against Process API's returned values.\", '___NL___', '___NL___', '# Python 2.4 compatibility', '___NL___', '___EOS___']", "index": 1708 }, { "content": " def get_ionice(self, ret):\n self.assertTrue(ret.ioclass >= 0)\n self.assertTrue(ret.value >= 0)", "metadata": "root.TestFetchAllProcesses.get_ionice", "header": "['class', 'TestFetchAllProcesses', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '# Iterates over all running processes and performs some sanity', '___NL___', \"# checks against Process API's returned values.\", '___NL___', '___NL___', '# Python 2.4 compatibility', '___NL___', '___EOS___']", "index": 1713 }, { "content": " def get_num_threads(self, ret):\n self.assertTrue(ret >= 1)", "metadata": "root.TestFetchAllProcesses.get_num_threads", "header": "['class', 'TestFetchAllProcesses', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '# Iterates over all running processes and performs some sanity', '___NL___', \"# checks against Process API's returned values.\", '___NL___', '___NL___', '# Python 2.4 compatibility', '___NL___', '___EOS___']", "index": 1717 }, { "content": " def get_threads(self, ret):\n for t in ret:\n self.assertTrue(t.id >= 0)\n self.assertTrue(t.user_time >= 0)\n self.assertTrue(t.system_time >= 0)", "metadata": "root.TestFetchAllProcesses.get_threads", "header": "['class', 'TestFetchAllProcesses', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '# Iterates over all running processes and performs some sanity', '___NL___', \"# checks against Process API's returned values.\", '___NL___', '___NL___', '# Python 2.4 compatibility', '___NL___', '___EOS___']", "index": 1720 }, { "content": " def get_cpu_times(self, ret):\n self.assertTrue(ret.user >= 0)\n self.assertTrue(ret.system >= 0)", "metadata": "root.TestFetchAllProcesses.get_cpu_times", "header": "['class', 'TestFetchAllProcesses', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '# Iterates over all running processes and performs some sanity', '___NL___', \"# checks against Process API's returned values.\", '___NL___', '___NL___', '# Python 2.4 compatibility', '___NL___', '___EOS___']", "index": 1726 }, { "content": " def get_memory_info(self, ret):\n self.assertTrue(ret.rss >= 0)\n self.assertTrue(ret.vms >= 0)", "metadata": "root.TestFetchAllProcesses.get_memory_info", "header": "['class', 'TestFetchAllProcesses', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '# Iterates over all running processes and performs some sanity', '___NL___', \"# checks against Process API's returned values.\", '___NL___', '___NL___', '# Python 2.4 compatibility', '___NL___', '___EOS___']", "index": 1730 }, { "content": " def get_ext_memory_info(self, ret):\n for name in ret._fields:\n self.assertTrue(getattr(ret, name) >= 0)\n if POSIX and ret.vms != 0:\n # VMS is always supposed to be the highest\n for name in ret._fields:\n if name != 'vms':\n value = getattr(ret, name)\n assert ret.vms > value, ret\n elif WINDOWS:\n assert ret.peak_wset >= ret.wset, ret\n assert ret.peak_paged_pool >= ret.paged_pool, ret\n assert ret.peak_nonpaged_pool >= ret.nonpaged_pool, ret\n assert ret.peak_pagefile >= ret.pagefile, ret", "metadata": "root.TestFetchAllProcesses.get_ext_memory_info", "header": "['class', 'TestFetchAllProcesses', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '# Iterates over all running processes and performs some sanity', '___NL___', \"# checks against Process API's returned values.\", '___NL___', '___NL___', '# Python 2.4 compatibility', '___NL___', '___EOS___']", "index": 1734 }, { "content": " def get_num_fds(self, ret):\n self.assertTrue(ret >= 0)", "metadata": "root.TestFetchAllProcesses.get_num_fds", "header": "['class', 'TestFetchAllProcesses', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '# Iterates over all running processes and performs some sanity', '___NL___', \"# checks against Process API's returned values.\", '___NL___', '___NL___', '# Python 2.4 compatibility', '___NL___', '___EOS___']", "index": 1758 }, { "content": " def get_num_ctx_switches(self, ret):\n self.assertTrue(ret.voluntary >= 0)\n self.assertTrue(ret.involuntary >= 0)", "metadata": "root.TestFetchAllProcesses.get_num_ctx_switches", "header": "['class', 'TestFetchAllProcesses', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '# Iterates over all running processes and performs some sanity', '___NL___', \"# checks against Process API's returned values.\", '___NL___', '___NL___', '# Python 2.4 compatibility', '___NL___', '___EOS___']", "index": 1857 } ]
[ { "span": "self.assertTrue(psutil.STATUS_RUNNING == 0)", "start_line": 1071, "start_column": 8, "end_line": 1071, "end_column": 51 }, { "span": "self.assertTrue(psutil.STATUS_RUNNING == long(0))", "start_line": 1072, "start_column": 8, "end_line": 1072, "end_column": 57 }, { "span": "self.assertTrue(psutil.STATUS_RUNNING == 'running')", "start_line": 1073, "start_column": 8, "end_line": 1073, "end_column": 59 }, { "span": "self.assertFalse(psutil.STATUS_RUNNING == 1)", "start_line": 1074, "start_column": 8, "end_line": 1074, "end_column": 52 }, { "span": "self.assertFalse(psutil.STATUS_RUNNING == 'sleeping')", "start_line": 1075, "start_column": 8, "end_line": 1075, "end_column": 61 }, { "span": "self.assertFalse(psutil.STATUS_RUNNING != 0)", "start_line": 1076, "start_column": 8, "end_line": 1076, "end_column": 52 }, { "span": "self.assertFalse(psutil.STATUS_RUNNING != 'running')", "start_line": 1077, "start_column": 8, "end_line": 1077, "end_column": 60 }, { "span": "self.assertTrue(psutil.STATUS_RUNNING != 1)", "start_line": 1078, "start_column": 8, "end_line": 1078, "end_column": 51 }, { "span": "self.assertTrue(psutil.STATUS_RUNNING != 'sleeping')", "start_line": 1079, "start_column": 8, "end_line": 1079, "end_column": 60 }, { "span": "self.assertFalse(TESTFN in files)", "start_line": 1130, "start_column": 8, "end_line": 1130, "end_column": 41 }, { "span": "self.assertTrue(fileobj.name not in p.get_open_files())", "start_line": 1173, "start_column": 8, "end_line": 1173, "end_column": 63 }, { "span": "self.assertTrue(p.ppid != this_parent)", "start_line": 1385, "start_column": 12, "end_line": 1385, "end_column": 50 }, { "span": "self.assertTrue(valid_procs > 0)", "start_line": 1654, "start_column": 8, "end_line": 1654, "end_column": 40 }, { "span": "self.assertTrue(ret >= 0)", "start_line": 1673, "start_column": 8, "end_line": 1673, "end_column": 33 }, { "span": "self.assertTrue(ret > 0)", "start_line": 1680, "start_column": 8, "end_line": 1680, "end_column": 32 }, { "span": "self.assertTrue(ret >= psutil.BOOT_TIME)", "start_line": 1682, "start_column": 12, "end_line": 1682, "end_column": 52 }, { "span": "self.assertTrue(uid >= 0)", "start_line": 1689, "start_column": 12, "end_line": 1689, "end_column": 37 }, { "span": "self.assertTrue(gid >= 0)", "start_line": 1696, "start_column": 12, "end_line": 1696, "end_column": 37 }, { "span": "self.assertTrue(ret >= 0)", "start_line": 1705, "start_column": 8, "end_line": 1705, "end_column": 33 }, { "span": "self.assertTrue(str(ret) != '?')", "start_line": 1706, "start_column": 8, "end_line": 1706, "end_column": 40 }, { "span": "self.assertTrue(field >= 0)", "start_line": 1711, "start_column": 16, "end_line": 1711, "end_column": 43 }, { "span": "self.assertTrue(ret.ioclass >= 0)", "start_line": 1714, "start_column": 8, "end_line": 1714, "end_column": 41 }, { "span": "self.assertTrue(ret.value >= 0)", "start_line": 1715, "start_column": 8, "end_line": 1715, "end_column": 39 }, { "span": "self.assertTrue(ret >= 1)", "start_line": 1718, "start_column": 8, "end_line": 1718, "end_column": 33 }, { "span": "self.assertTrue(t.id >= 0)", "start_line": 1722, "start_column": 12, "end_line": 1722, "end_column": 38 }, { "span": "self.assertTrue(t.user_time >= 0)", "start_line": 1723, "start_column": 12, "end_line": 1723, "end_column": 45 }, { "span": "self.assertTrue(t.system_time >= 0)", "start_line": 1724, "start_column": 12, "end_line": 1724, "end_column": 47 }, { "span": "self.assertTrue(ret.user >= 0)", "start_line": 1727, "start_column": 8, "end_line": 1727, "end_column": 38 }, { "span": "self.assertTrue(ret.system >= 0)", "start_line": 1728, "start_column": 8, "end_line": 1728, "end_column": 40 }, { "span": "self.assertTrue(ret.rss >= 0)", "start_line": 1731, "start_column": 8, "end_line": 1731, "end_column": 37 }, { "span": "self.assertTrue(ret.vms >= 0)", "start_line": 1732, "start_column": 8, "end_line": 1732, "end_column": 37 }, { "span": "self.assertTrue(getattr(ret, name) >= 0)", "start_line": 1736, "start_column": 12, "end_line": 1736, "end_column": 52 }, { "span": "self.assertTrue(ret >= 0)", "start_line": 1759, "start_column": 8, "end_line": 1759, "end_column": 33 }, { "span": "self.assertTrue(ret.voluntary >= 0)", "start_line": 1858, "start_column": 8, "end_line": 1858, "end_column": 43 }, { "span": "self.assertTrue(ret.involuntary >= 0)", "start_line": 1859, "start_column": 8, "end_line": 1859, "end_column": 45 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "status", "\\u", "constants_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "STATUS", "\\u*", " ", "constant", "s", " ", "are", " ", "supposed", " ", "to", " ", "be", " ", "compara", "ble", " ", "als", "o", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "usi", "ng", " ", "thei", "r", " ", "str", " ", "representation_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "psutil_", "._", "STATUS", "\\u", "RUNNING_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "psutil_", "._", "STATUS", "\\u", "RUNNING_", "==_", "long_", "(_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "psutil_", "._", "STATUS", "\\u", "RUNNING_", "==_", "'", "runn", "ing", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "psutil_", "._", "STATUS", "\\u", "RUNNING_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "psutil_", "._", "STATUS", "\\u", "RUNNING_", "==_", "'", "sleep", "ing", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "psutil_", "._", "STATUS", "\\u", "RUNNING_", "!=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "psutil_", "._", "STATUS", "\\u", "RUNNING_", "!=_", "'", "runn", "ing", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "psutil_", "._", "STATUS", "\\u", "RUNNING_", "!=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "psutil_", "._", "STATUS", "\\u", "RUNNING_", "!=_", "'", "sleep", "ing", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "open", "\\u", "files_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "current", " ", "process_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "psutil_", "._", "Process_", "(_", "os_", "._", "getpid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "files_", "=_", "p_", "._", "get", "\\u", "open", "\\u", "files_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "TESTFN_", "in_", "files_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "open_", "(_", "TESTFN_", ",_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "call", "\\u", "until_", "(_", "p_", "._", "get", "\\u", "open", "\\u", "files_", ",_", "\"", "len", "(", "ret", ")", " ", "!=", " ", "%", "i", "\"_", "%_", "len_", "(_", "files_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filenames_", "=_", "[_", "x_", "._", "path_", "for_", "x_", "in_", "p_", "._", "get", "\\u", "open", "\\u", "files_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "TESTFN_", ",_", "filenames_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "file_", "in_", "filenames_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "os_", "._", "path_", "._", "isfile_", "(_", "file_", ")_", ",_", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "anot", "her", " ", "process_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cmdline_", "=_", "\"", "import", " ", "time", ";", " ", "f", " ", "=", " ", "open", "(", "r", "'%", "s", "',", " ", "'", "r", "');", " ", "time", ".", "sleep", "(", "100", ");\"_", "%_", "TESTFN_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spro", "c_", "=_", "get", "\\u", "test\\u", "subprocess_", "(_", "[_", "PYTHON", "_", ",_", "\"-", "c", "\"_", ",_", "cmdline_", "]_", ",_", "wait_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "psutil_", "._", "Process_", "(_", "spro", "c_", "._", "pid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "range_", "(_", "100_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filenames_", "=_", "[_", "x_", "._", "path_", "for_", "x_", "in_", "p_", "._", "get", "\\u", "open", "\\u", "files_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "TESTFN_", "in_", "filenames_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "time_", "._", "sleep_", "(_", ".01_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "In_", "(_", "TESTFN_", ",_", "filenames_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "file_", "in_", "filenames_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "os_", "._", "path_", "._", "isfile_", "(_", "file_", ")_", ",_", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "open", "\\u", "files", "2_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "test", " ", "fd", " ", "and", " ", "path", " ", "fields_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fileobj_", "=_", "open_", "(_", "TESTFN_", ",_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "psutil_", "._", "Process_", "(_", "os_", "._", "getpid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "path_", ",_", "fd_", "in_", "p_", "._", "get", "\\u", "open", "\\u", "files_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "path_", "==_", "fileobj_", "._", "name_", "or_", "fd_", "==_", "fileobj_", "._", "fileno_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "no", " ", "file", " ", "found", ";", " ", "files", "=", "%", "s", "\"_", "%_", "repr_", "(_", "p_", "._", "get", "\\u", "open", "\\u", "files_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "path_", ",_", "fileobj_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "WINDOWS", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "fd_", ",_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "fd_", ",_", "fileobj_", "._", "fileno_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "test", " ", "positions_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ntu", "ple_", "=_", "p_", "._", "get", "\\u", "open", "\\u", "files_", "(_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "ntu", "ple_", "[_", "0_", "]_", ",_", "ntu", "ple_", "._", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "ntu", "ple_", "[_", "1_", "]_", ",_", "ntu", "ple_", "._", "fd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "test", " ", "file", " ", "is", " ", "gone", "_", "\\u\\u\\uNL\\u\\u\\u_", "fileobj_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "fileobj_", "._", "name_", "not_", "in_", "p_", "._", "get", "\\u", "open", "\\u", "files_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "parent", "\\u", "ppi", "d_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "this", "\\u", "parent_", "=_", "os_", "._", "getpid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spro", "c_", "=_", "get", "\\u", "test\\u", "subprocess_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "psutil_", "._", "Process_", "(_", "spro", "c_", "._", "pid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "p_", "._", "ppi", "d_", ",_", "this", "\\u", "parent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "p_", "._", "parent_", "._", "pid_", ",_", "this", "\\u", "parent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "no", " ", "other", " ", "process", " ", "is", " ", "supposed", " ", "to", " ", "have", " ", "us", " ", "as", " ", "parent_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "p_", "in_", "psutil_", "._", "process", "\\u", "iter_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "p_", "._", "pid_", "==_", "spro", "c_", "._", "pid_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "p_", "._", "ppi", "d_", "!=_", "this", "\\u", "parent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Fe", "tch", "All", "Processe", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Iterat", "es", " ", "over", " ", "all", " ", "runn", "ing", " ", "process", "es", " ", "and", " ", "perform", "s", " ", "some", " ", "sanity", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "checks", " ", "against", " ", "Process", " ", "API", "'", "s", " ", "return", "ed", " ", "values", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "2.4", " ", "compatibility", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "fetch", "\\u", "all_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "valid", "\\u", "procs_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exclu", "ded", "\\u", "names_", "=_", "[_", "'", "send", "\\u", "signal", "'_", ",_", "'", "suspend", "'_", ",_", "'", "resum", "e", "'_", ",_", "'", "terminate", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "kill", "'_", ",_", "'", "wait", "'_", ",_", "'", "as", "\\u", "dict", "'_", ",_", "'", "get", "\\u", "cpu", "\\u", "percent", "'_", ",_", "'", "nice", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "parent", "'_", ",_", "'", "get", "\\u", "child", "ren", "'_", ",_", "'", "pid", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "attrs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", "in_", "dir_", "(_", "psutil_", "._", "Process_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "name_", "._", "startswith_", "(_", "\"\\u\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "name_", "._", "startswith_", "(_", "\"", "set\\u", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "name_", "in_", "exclu", "ded", "\\u", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "attrs_", "._", "append_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "p_", "in_", "psutil_", "._", "process", "\\u", "iter_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "name_", "in_", "attrs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "attr_", "=_", "getattr_", "(_", "p_", ",_", "name_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "attr_", "is_", "not_", "None_", "and_", "callable_", "(_", "attr_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "ret_", "=_", "attr_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "ret_", "=_", "attr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "valid", "\\u", "procs_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "psutil_", "._", "No", "Suc", "h", "Process_", ",_", "psutil_", "._", "Access", "Denied_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "err_", "=_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "err_", "._", "pid_", ",_", "p_", "._", "pid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "err_", "._", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "exception", "'", "s", " ", "name", " ", "attr", " ", "is", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "with", " ", "the", " ", "actual", " ", "process", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "assert", "Equal_", "(_", "err_", "._", "name_", ",_", "p_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "str_", "(_", "err_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "err_", "._", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "ret_", "not_", "in_", "(_", "0_", ",_", "0.0_", ",_", "[_", "]_", ",_", "None_", ",_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "assert_", "ret_", ",_", "ret_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "meth_", "=_", "getattr_", "(_", "self_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "meth_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "err_", "=_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "trace_", "=_", "traceback_", "._", "format\\u", "exc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "(_", "'%", "s", "\\\\", "nproc", "=", "%", "s", ",", " ", "method", "=", "%", "r", ",", " ", "ret", "value", "=", "%", "r", "'_", "\\u\\u\\uNL\\u\\u\\u_", "%_", "(_", "trace_", ",_", "p_", ",_", "name_", ",_", "ret_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "shou", "ld", " ", "alw", "ay", "s", " ", "have", " ", "a", " ", "non", "-", "empty", " ", "list", ",", " ", "not", " ", "inclu", "ding", " ", "PID", " ", "0", " ", "etc", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "special", " ", "case", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "valid", "\\u", "procs_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Fe", "tch", "All", "Processe", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Iterat", "es", " ", "over", " ", "all", " ", "runn", "ing", " ", "process", "es", " ", "and", " ", "perform", "s", " ", "some", " ", "sanity", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "checks", " ", "against", " ", "Process", " ", "API", "'", "s", " ", "return", "ed", " ", "values", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "2.4", " ", "compatibility", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ppi", "d_", "(_", "self_", ",_", "ret_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "ret_", ">=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Fe", "tch", "All", "Processe", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Iterat", "es", " ", "over", " ", "all", " ", "runn", "ing", " ", "process", "es", " ", "and", " ", "perform", "s", " ", "some", " ", "sanity", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "checks", " ", "against", " ", "Process", " ", "API", "'", "s", " ", "return", "ed", " ", "values", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "2.4", " ", "compatibility", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "time_", "(_", "self_", ",_", "ret_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "ret_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "WINDOWS", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "ret_", ">=_", "psutil_", "._", "BOOT", "\\u", "TIME_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "return", "ed", " ", "value", " ", "can", " ", "be", " ", "pretty", " ", "printed", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "with", " ", "strftime_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "time_", "._", "strftime_", "(_", "\"%", "Y", " ", "%", "m", " ", "%", "d", " ", "%", "H", ":", "%", "M", ":", "%", "S", "\"_", ",_", "time_", "._", "localtime_", "(_", "ret_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Fe", "tch", "All", "Processe", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Iterat", "es", " ", "over", " ", "all", " ", "runn", "ing", " ", "process", "es", " ", "and", " ", "perform", "s", " ", "some", " ", "sanity", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "checks", " ", "against", " ", "Process", " ", "API", "'", "s", " ", "return", "ed", " ", "values", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "2.4", " ", "compatibility", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "uids_", "(_", "self_", ",_", "ret_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "uid_", "in_", "ret_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "uid_", ">=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "uid_", ",_", "self_", "._", "\\u", "uids_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Fe", "tch", "All", "Processe", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Iterat", "es", " ", "over", " ", "all", " ", "runn", "ing", " ", "process", "es", " ", "and", " ", "perform", "s", " ", "some", " ", "sanity", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "checks", " ", "against", " ", "Process", " ", "API", "'", "s", " ", "return", "ed", " ", "values", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "2.4", " ", "compatibility", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "gid", "s_", "(_", "self_", ",_", "ret_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "note", ":", " ", "testi", "ng", " ", "all", " ", "gid", "s", " ", "as", " ", "above", " ", "see", "ms", " ", "not", " ", "to", " ", "be", " ", "reliab", "le", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "gid", " ", "==", " ", "30", " ", "(", "nod", "ob", "y", ");", " ", "not", " ", "sure", " ", "wh", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "gid_", "in_", "ret_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "gid_", ">=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "self", ".", "assert", "In", "(", "uid", ",", " ", "self", ".", "gid", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Fe", "tch", "All", "Processe", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Iterat", "es", " ", "over", " ", "all", " ", "runn", "ing", " ", "process", "es", " ", "and", " ", "perform", "s", " ", "some", " ", "sanity", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "checks", " ", "against", " ", "Process", " ", "API", "'", "s", " ", "return", "ed", " ", "values", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "2.4", " ", "compatibility", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "status_", "(_", "self_", ",_", "ret_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "ret_", ">=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "str_", "(_", "ret_", ")_", "!=_", "'?'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Fe", "tch", "All", "Processe", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Iterat", "es", " ", "over", " ", "all", " ", "runn", "ing", " ", "process", "es", " ", "and", " ", "perform", "s", " ", "some", " ", "sanity", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "checks", " ", "against", " ", "Process", " ", "API", "'", "s", " ", "return", "ed", " ", "values", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "2.4", " ", "compatibility", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "io", "\\u", "counters_", "(_", "self_", ",_", "ret_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "field_", "in_", "ret_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "field_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "field_", ">=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Fe", "tch", "All", "Processe", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Iterat", "es", " ", "over", " ", "all", " ", "runn", "ing", " ", "process", "es", " ", "and", " ", "perform", "s", " ", "some", " ", "sanity", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "checks", " ", "against", " ", "Process", " ", "API", "'", "s", " ", "return", "ed", " ", "values", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "2.4", " ", "compatibility", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "ioni", "ce_", "(_", "self_", ",_", "ret_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "ret_", "._", "ioc", "lass_", ">=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", "._", "value_", ">=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Fe", "tch", "All", "Processe", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Iterat", "es", " ", "over", " ", "all", " ", "runn", "ing", " ", "process", "es", " ", "and", " ", "perform", "s", " ", "some", " ", "sanity", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "checks", " ", "against", " ", "Process", " ", "API", "'", "s", " ", "return", "ed", " ", "values", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "2.4", " ", "compatibility", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "num", "\\u", "threads_", "(_", "self_", ",_", "ret_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "ret_", ">=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Fe", "tch", "All", "Processe", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Iterat", "es", " ", "over", " ", "all", " ", "runn", "ing", " ", "process", "es", " ", "and", " ", "perform", "s", " ", "some", " ", "sanity", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "checks", " ", "against", " ", "Process", " ", "API", "'", "s", " ", "return", "ed", " ", "values", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "2.4", " ", "compatibility", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "threads_", "(_", "self_", ",_", "ret_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "t_", "in_", "ret_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "t_", "._", "id_", ">=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t_", "._", "user", "\\u", "time_", ">=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "t_", "._", "system", "\\u", "time_", ">=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Fe", "tch", "All", "Processe", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Iterat", "es", " ", "over", " ", "all", " ", "runn", "ing", " ", "process", "es", " ", "and", " ", "perform", "s", " ", "some", " ", "sanity", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "checks", " ", "against", " ", "Process", " ", "API", "'", "s", " ", "return", "ed", " ", "values", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "2.4", " ", "compatibility", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "cpu", "\\u", "times_", "(_", "self_", ",_", "ret_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "ret_", "._", "user_", ">=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", "._", "system_", ">=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Fe", "tch", "All", "Processe", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Iterat", "es", " ", "over", " ", "all", " ", "runn", "ing", " ", "process", "es", " ", "and", " ", "perform", "s", " ", "some", " ", "sanity", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "checks", " ", "against", " ", "Process", " ", "API", "'", "s", " ", "return", "ed", " ", "values", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "2.4", " ", "compatibility", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "memory", "\\u", "info_", "(_", "self_", ",_", "ret_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "ret_", "._", "rss_", ">=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", "._", "vms_", ">=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Fe", "tch", "All", "Processe", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Iterat", "es", " ", "over", " ", "all", " ", "runn", "ing", " ", "process", "es", " ", "and", " ", "perform", "s", " ", "some", " ", "sanity", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "checks", " ", "against", " ", "Process", " ", "API", "'", "s", " ", "return", "ed", " ", "values", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "2.4", " ", "compatibility", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "ext", "\\u", "memory", "\\u", "info_", "(_", "self_", ",_", "ret_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "name_", "in_", "ret_", "._", "\\u", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "getattr_", "(_", "ret_", ",_", "name_", ")_", ">=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "POSI", "X_", "and_", "ret_", "._", "vms_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "VM", "S", " ", "is", " ", "alw", "ay", "s", " ", "supposed", " ", "to", " ", "be", " ", "the", " ", "high", "est_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "name_", "in_", "ret_", "._", "\\u", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "name_", "!=_", "'", "vms", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "value_", "=_", "getattr_", "(_", "ret_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "ret_", "._", "vms_", ">_", "value_", ",_", "ret_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "WINDOWS", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "ret_", "._", "peak", "\\u", "ws", "et_", ">=_", "ret_", "._", "ws", "et_", ",_", "ret_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "ret_", "._", "peak", "\\u", "paged", "\\u", "pool_", ">=_", "ret_", "._", "paged", "\\u", "pool_", ",_", "ret_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "ret_", "._", "peak", "\\u", "nonp", "age", "d\\u", "pool_", ">=_", "ret_", "._", "nonp", "age", "d\\u", "pool_", ",_", "ret_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "ret_", "._", "peak", "\\u", "page", "file_", ">=_", "ret_", "._", "page", "file_", ",_", "ret_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Fe", "tch", "All", "Processe", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Iterat", "es", " ", "over", " ", "all", " ", "runn", "ing", " ", "process", "es", " ", "and", " ", "perform", "s", " ", "some", " ", "sanity", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "checks", " ", "against", " ", "Process", " ", "API", "'", "s", " ", "return", "ed", " ", "values", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "2.4", " ", "compatibility", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "num", "\\u", "fds_", "(_", "self_", ",_", "ret_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "ret_", ">=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Fe", "tch", "All", "Processe", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Iterat", "es", " ", "over", " ", "all", " ", "runn", "ing", " ", "process", "es", " ", "and", " ", "perform", "s", " ", "some", " ", "sanity", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "checks", " ", "against", " ", "Process", " ", "API", "'", "s", " ", "return", "ed", " ", "values", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "2.4", " ", "compatibility", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "num", "\\u", "ctx", "\\u", "switches_", "(_", "self_", ",_", "ret_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "ret_", "._", "volu", "nta", "ry_", ">=_", "0_", ")_", "\\u\\u\\uNEWLINE\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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused local variable
sassoftware/conary/conary_test/queryreptest.py
[ { "content": " def testGetTrovesLatestByLabel(self):\n # test out the no trove queries that now use getTrovesLatestByLabel\n trv1 = self.addComponent('foo:run', '/localhost@rpl:branch//rpl:linux/1.0-1-1')\n trv2 = self.addComponent('foo:run', '1.0-1-2')\n trv3 = self.addComponent('foo:run', '/localhost@rpl:branch//rpl:linux/1.0-1-3', 'ssl')\n repos = self.openRepository()\n tups = queryrep.getTrovesToDisplay(repos, [], [], [],\n VERSION_FILTER_LATEST,\n FLAVOR_FILTER_BEST,\n self.cfg.installLabelPath,\n self.cfg.flavor, affinityDb=None)\n assert(len(tups) == 1)\n assert(tups[0] == trv3.getNameVersionFlavor())\n tups = queryrep.getTrovesToDisplay(repos, [], [], [],\n VERSION_FILTER_LEAVES,\n FLAVOR_FILTER_BEST,\n self.cfg.installLabelPath,\n self.cfg.flavor, affinityDb=None)\n assert(len(tups) == 2)\n assert(set(tups) == set([trv3.getNameVersionFlavor(),\n trv2.getNameVersionFlavor()]))", "metadata": "root.RepQueryTest.testGetTrovesLatestByLabel", "header": "['class', 'RepQueryTest', '(', 'rephelp', '.', 'RepositoryHelper', ')', ':', '___EOS___']", "index": 274 }, { "content": " def testLatestIsOfWrongFlavor(self):\n # CNY-784 - if the latest version was of an incompatible flavor,\n # conary rq <no args> would display nothing for that trove\n v1 = self.addComponent('foo:foo', '1.0', 'is:x86').getVersion()\n v2 = self.addComponent('foo:foo', '1.1', 'is:x86_64').getVersion()\n targetFlavor = [ deps.parseFlavor('is:x86') ]\n repos = self.openRepository()\n tups = queryrep.getTrovesToDisplay(repos, [], [], [],\n VERSION_FILTER_LATEST, \n FLAVOR_FILTER_BEST,\n self.cfg.installLabelPath,\n targetFlavor, affinityDb=None)\n assert(set([x[1] for x in tups]) == set((v1,)))\n tups = queryrep.getTrovesToDisplay(repos, [], [], [],\n VERSION_FILTER_LATEST, \n FLAVOR_FILTER_AVAIL,\n self.cfg.installLabelPath,\n targetFlavor, affinityDb=None)\n assert(set([x[1] for x in tups]) == set((v1,)))", "metadata": "root.RepQueryTest.testLatestIsOfWrongFlavor", "header": "['class', 'RepQueryTest', '(', 'rephelp', '.', 'RepositoryHelper', ')', ':', '___EOS___']", "index": 298 }, { "content": " def testBuildLogDisplay(self):\n buildlog = 'This is test buildlog';\n bz2compressor = bz2.BZ2Compressor()\n bz2compressor.compress(buildlog)\n contents = bz2compressor.flush()\n \n self.addComponent('foo:runtime')\n self.addComponent('foo:debuginfo', [('/usr/bin/foo', rephelp.RegularFile(contents=contents, tags=['buildlog']))])\n self.addCollection('foo', [(':runtime', True), (':debuginfo', False)])\n repos = self.openRepository()\n\n output = self.captureOutput(queryrep.displayTroves, self.cfg, ['foo'], [], [], \n queryrep.VERSION_FILTER_LATEST, queryrep.FLAVOR_FILTER_BEST, showBuildLog = True)\n self.assertEqual(output[1], buildlog)", "metadata": "root.RepQueryTest.testBuildLogDisplay", "header": "['class', 'RepQueryTest', '(', 'rephelp', '.', 'RepositoryHelper', ')', ':', '___EOS___']", "index": 538 }, { "content": " def testShowFile(self):\n contents1 = 'This is test content';\n contents2 = 'This is another test content';\n \n self.addComponent('foo:runtime', [('/usr/bin/foofile', contents1), ('/usr/bin/barfile', contents2)])\n self.addCollection('foo', [':runtime'])\n repos = self.openRepository()\n\n output = self.captureOutput(queryrep.displayTroves, self.cfg, ['foo'], [], [], \n queryrep.VERSION_FILTER_LATEST, queryrep.FLAVOR_FILTER_BEST, filesToShow = ['/usr/bin/barfile'])\n self.assertEqual(output[1], contents2)", "metadata": "root.RepQueryTest.testShowFile", "header": "['class', 'RepQueryTest', '(', 'rephelp', '.', 'RepositoryHelper', ')', ':', '___EOS___']", "index": 553 }, { "content": " def testRdiff1(self):\n req1 = 'soname: ELF32/libfoo1(blah)'\n req2 = 'soname: ELF32/lib/foo2(blah)'\n req3 = 'soname: ELF32/lib/foo3(blah) trove:bar(1)'\n prov1 = \"trove:bar(1) trove:baz(1)\"\n prov2 = \"trove:baz(1) trove:bloop(1)\"\n prov3 = \"trove:bloop(2) trove:bar(1)\"\n buildReqs1 = [ ('py', '1', 'is: x'), ('by', '1', 'is: y'),\n ('ty', '1', 'is: z')]\n buildReqs2 = [ ('py', '1', 'is: x'), ('my', '1', 'is: y'),\n ('by', '2', 'is: z')]\n rf1 = rephelp.RegularFile(contents='1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n',\n perms = 0644, provides = prov1, requires = req1,\n mtime = 1136921017,)\n rf2 = rephelp.RegularFile(contents='1\\n2\\n4\\n5\\n6\\n7\\n8\\n9\\n',\n perms = 0755, provides = prov2, requires = req2,\n mtime = 1136921317, tags=['tag2', 'tag1', 'tag3'])\n rf3 = rephelp.RegularFile(contents='1\\n2\\n4\\n5\\n6\\n7\\n8\\n10\\n',\n perms = 0400, provides = prov3, requires = req3,\n mtime = 1136921017)\n # rf5 differs from rf1 just by tags\n rf5 = rephelp.RegularFile(contents='1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n',\n perms = 0644, provides = prov1, requires = req1,\n mtime = 1136921017, tags=['tag2', 'tag1', 'tag3'])\n self.addComponent('foo:run', '1', 'is:x86',\n [('/usr/bin/foo', rf1),\n ('/usr/bin/bar', rf2),\n ('/usr/bin/file1', rf1),\n ])\n self.addComponent('foo:supdoc', '1', 'is:x86',\n [('/usr/share/doc/foo1', rf1)])\n self.addCollection('foo', '1', \n [(x, '1', 'is:x86') for x in [':run', ':supdoc']],\n buildReqs=buildReqs1)\n\n self.addComponent('foo:run', '2', 'is:x86_64',\n [('/usr/bin/foo', rf2),\n ('/usr/bin/file1', rf5),\n ('/usr/bin/baz', rf3),])\n self.addComponent('foo:doc', '2', 'is:x86_64',\n [('/usr/share/doc/foo2', rf2)])\n self.addCollection('foo', '2', \n [(x, '2', 'is:x86_64') for x in [':run', ':doc']],\n buildReqs=buildReqs2)\n\n # Force search flavor to x86_64 to get consistent output on x86\n self.cfg.flavor = [deps.parseFlavor('is: x86 x86_64')]\n repos = self.openRepository()\n\n troveSpec = 'foo=1[is:x86]--2[is:x86_64]'\n\n ret, outs = self._rdiff(troveSpec)\n self.assertEqual(outs, expOutput1noargs)\n\n self.cfg.fullFlavors = True\n ret, outs = self._rdiff(troveSpec)\n self.assertEqual(outs, expOutput1fullFlavors)\n self.cfg.fullFlavors = False\n\n self.cfg.fullVersions = True\n ret, outs = self._rdiff(troveSpec)\n self.assertEqual(outs, expOutput1fullVersions)\n self.cfg.fullVersions = False\n\n ret, outs = self._rdiff(troveSpec, ls = True)\n self.assertEqual(outs, expOutput1withFiles)\n\n ret, outs = self._rdiff(troveSpec, fileVersions = True)\n self.assertEqual(outs, expOutput1withFileVersions)\n\n ret, outs = self._rdiff(troveSpec, lsl = True)\n self.assertEqual(outs, expOutput1withFilesStat)\n\n ret, outs = self._rdiff(troveSpec, tags = True)\n self.assertEqual(outs, expOutput1withFileTags)\n\n # Diffing against ourselves\n troveSpec = 'foo=1[is:x86]--1[is:x86]'\n ret, outs = self._rdiff(troveSpec, tags = True)\n self.assertEqual(outs, 'Identical troves\\n')", "metadata": "root.RepQueryTest.testRdiff1", "header": "['class', 'RepQueryTest', '(', 'rephelp', '.', 'RepositoryHelper', ')', ':', '___EOS___']", "index": 565 }, { "content": " def testRdiff5(self):\n # CNY-1605\n # Create two flavors of the same trove and add them to the same group\n\n flv1 = '~ssl'\n flv2 = '~!ssl'\n\n rf11 = rephelp.RegularFile(contents='1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n',\n flavor=flv1)\n rf12 = rephelp.RegularFile(contents='1\\n2\\n4\\n5\\n6\\n7\\n8\\n9\\n',\n flavor=flv2)\n rf21 = rephelp.RegularFile(contents='1\\n2\\n4\\n5\\n6\\n7\\n8\\n9\\n',\n flavor=flv1)\n rf22 = rephelp.RegularFile(contents='1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n',\n flavor=flv2)\n\n files = [ (rf11, rf12), (rf21, rf22) ]\n\n for v, fileobjs in zip([ '1', '2' ], files):\n file1 = fileobjs[0]\n file2 = fileobjs[1]\n\n t1 = self.addComponent('foo:run', v, fileContents=[('/bin/foo', file1)])\n p1 = self.addCollection('foo', v, [(':run', v, t1.getFlavor())])\n\n t2 = self.addComponent('foo:run', v, fileContents=[('/bin/foo', file2)])\n p2 = self.addCollection('foo', v, [(':run', v, t2.getFlavor())])\n\n self.addCollection('group-foo', v,\n [('foo', v, flv1), ('foo', v, flv2)])\n\n troveSpec = 'group-foo=1--2'\n\n self.cfg.fullFlavors = True\n ret, outs = self._rdiff(troveSpec)\n self.cfg.fullFlavors = False\n self.assertEqual(outs, expOutput5)", "metadata": "root.RepQueryTest.testRdiff5", "header": "['class', 'RepQueryTest', '(', 'rephelp', '.', 'RepositoryHelper', ')', ':', '___EOS___']", "index": 727 }, { "content": " def testRdiffMulti(self):\n # CNY-2544 - groups including troves from foreign repos\n r0 = self._openRepository(0, \"localhost\")\n r1 = self._openRepository(1, \"otherhost\")\n c = self.getRepositoryClient(\"user\", \"pass\")\n\n self.addComponent(\"other:runtime\", \"/otherhost@foo:bar/9\", repos = c)\n self.addComponent(\"other:lib\", \"/otherhost@foo:bar/9\", repos = c)\n trv = self.addCollection(\"other\", \"/otherhost@foo:bar/9\", [ \":runtime\", \":lib\"], repos = c)\n grpfuu = self.addCollection(\"group-fuu\", \"/localhost@foo:bar/1\", [ trv.getNameVersionFlavor() ], repos = c)\n grpfoo1 = self.addCollection(\"group-foo\", \"/localhost@foo:bar/1\", [ grpfuu.getNameVersionFlavor() ], repos = c)\n grpfoo2 = self.addCollection(\"group-foo\", \"/localhost@foo:bar/2\", [ trv.getNameVersionFlavor() ], repos = c)\n\n ret, outs = self._rdiff(\n 'group-foo=localhost@foo:bar/1--localhost@foo:bar/2')\n self.assertEqual(outs, expOutput7)", "metadata": "root.MultiRepQueryTest.testRdiffMulti", "header": "['class', 'MultiRepQueryTest', '(', 'rephelp', '.', 'RepositoryHelper', ')', ':', '___EOS___']", "index": 953 } ]
[ { "span": "trv1 ", "start_line": 276, "start_column": 8, "end_line": 276, "end_column": 12 }, { "span": "v2 ", "start_line": 302, "start_column": 8, "end_line": 302, "end_column": 10 }, { "span": "repos ", "start_line": 547, "start_column": 8, "end_line": 547, "end_column": 13 }, { "span": "repos ", "start_line": 559, "start_column": 8, "end_line": 559, "end_column": 13 }, { "span": "repos ", "start_line": 612, "start_column": 8, "end_line": 612, "end_column": 13 }, { "span": "p1 ", "start_line": 750, "start_column": 12, "end_line": 750, "end_column": 14 }, { "span": "p2 ", "start_line": 753, "start_column": 12, "end_line": 753, "end_column": 14 }, { "span": "r0 ", "start_line": 955, "start_column": 8, "end_line": 955, "end_column": 10 }, { "span": "r1 ", "start_line": 956, "start_column": 8, "end_line": 956, "end_column": 10 }, { "span": "grpfoo1 ", "start_line": 963, "start_column": 8, "end_line": 963, "end_column": 15 }, { "span": "grpfoo2 ", "start_line": 964, "start_column": 8, "end_line": 964, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Rep", "Query", "Test_", "(_", "rep", "help_", "._", "Repos", "itor", "y", "Helper_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Get", "Trove", "s", "Late", "st", "By", "Label_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "test", " ", "out", " ", "the", " ", "no", " ", "trove", " ", "querie", "s", " ", "tha", "t", " ", "now", " ", "use", " ", "get", "Trove", "s", "Late", "st", "By", "Label_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tr", "v1_", "=_", "self_", "._", "add", "Component_", "(_", "'", "foo", ":", "run", "'_", ",_", "'/", "local", "host", "@", "rpl", ":", "branch", "//", "rpl", ":", "linux", "/", "1.0", "-1", "-1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tr", "v2_", "=_", "self_", "._", "add", "Component_", "(_", "'", "foo", ":", "run", "'_", ",_", "'", "1.0", "-1", "-", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tr", "v3_", "=_", "self_", "._", "add", "Component_", "(_", "'", "foo", ":", "run", "'_", ",_", "'/", "local", "host", "@", "rpl", ":", "branch", "//", "rpl", ":", "linux", "/", "1.0", "-1", "-", "3", "'_", ",_", "'", "ssl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repos_", "=_", "self_", "._", "open", "Repository_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tup", "s_", "=_", "query", "rep_", "._", "get", "Trove", "s", "To", "Display_", "(_", "repos_", ",_", "[_", "]_", ",_", "[_", "]_", ",_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "VERSI", "ON", "\\u", "FILTER", "\\u", "LATE", "ST_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "FLA", "VOR", "\\u", "FILTER", "\\u", "BES", "T_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cfg_", "._", "install", "Label", "Path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cfg_", "._", "flavor_", ",_", "affinity", "Db_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "len_", "(_", "tup", "s_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "tup", "s_", "[_", "0_", "]_", "==_", "tr", "v3_", "._", "get", "Name", "Version", "Flavor_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tup", "s_", "=_", "query", "rep_", "._", "get", "Trove", "s", "To", "Display_", "(_", "repos_", ",_", "[_", "]_", ",_", "[_", "]_", ",_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "VERSI", "ON", "\\u", "FILTER", "\\u", "LEA", "VE", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "FLA", "VOR", "\\u", "FILTER", "\\u", "BES", "T_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cfg_", "._", "install", "Label", "Path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cfg_", "._", "flavor_", ",_", "affinity", "Db_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "len_", "(_", "tup", "s_", ")_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "set_", "(_", "tup", "s_", ")_", "==_", "set_", "(_", "[_", "tr", "v3_", "._", "get", "Name", "Version", "Flavor_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "tr", "v2_", "._", "get", "Name", "Version", "Flavor_", "(_", ")_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rep", "Query", "Test_", "(_", "rep", "help_", "._", "Repos", "itor", "y", "Helper_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Late", "st", "Is", "Of", "Wro", "ng", "Flavor_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "CN", "Y", "-", "784", " ", "-", " ", "if", " ", "the", " ", "late", "st", " ", "version", " ", "was", " ", "of", " ", "an", " ", "incomp", "atible", " ", "flavor", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "cona", "ry", " ", "rq", " ", "<", "no", " ", "args", ">", " ", "wou", "ld", " ", "display", " ", "not", "hing", " ", "for", " ", "tha", "t", " ", "trove_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v1_", "=_", "self_", "._", "add", "Component_", "(_", "'", "foo", ":", "foo", "'_", ",_", "'", "1.0", "'_", ",_", "'", "is", ":", "x8", "6", "'_", ")_", "._", "get", "Version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v2_", "=_", "self_", "._", "add", "Component_", "(_", "'", "foo", ":", "foo", "'_", ",_", "'", "1.1", "'_", ",_", "'", "is", ":", "x8", "6", "\\u", "64", "'_", ")_", "._", "get", "Version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target", "Flavor_", "=_", "[_", "deps_", "._", "parse", "Flavor_", "(_", "'", "is", ":", "x8", "6", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repos_", "=_", "self_", "._", "open", "Repository_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tup", "s_", "=_", "query", "rep_", "._", "get", "Trove", "s", "To", "Display_", "(_", "repos_", ",_", "[_", "]_", ",_", "[_", "]_", ",_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "VERSI", "ON", "\\u", "FILTER", "\\u", "LATE", "ST_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "FLA", "VOR", "\\u", "FILTER", "\\u", "BES", "T_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cfg_", "._", "install", "Label", "Path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "target", "Flavor_", ",_", "affinity", "Db_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "set_", "(_", "[_", "x_", "[_", "1_", "]_", "for_", "x_", "in_", "tup", "s_", "]_", ")_", "==_", "set_", "(_", "(_", "v1_", ",_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tup", "s_", "=_", "query", "rep_", "._", "get", "Trove", "s", "To", "Display_", "(_", "repos_", ",_", "[_", "]_", ",_", "[_", "]_", ",_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "VERSI", "ON", "\\u", "FILTER", "\\u", "LATE", "ST_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "FLA", "VOR", "\\u", "FILTER", "\\u", "AVA", "IL", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cfg_", "._", "install", "Label", "Path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "target", "Flavor_", ",_", "affinity", "Db_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "set_", "(_", "[_", "x_", "[_", "1_", "]_", "for_", "x_", "in_", "tup", "s_", "]_", ")_", "==_", "set_", "(_", "(_", "v1_", ",_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rep", "Query", "Test_", "(_", "rep", "help_", "._", "Repos", "itor", "y", "Helper_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Build", "Log", "Display_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "build", "log_", "=_", "'", "Thi", "s", " ", "is", " ", "test", " ", "build", "log", "'_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bz2", "compressor", "_", "=_", "bz2", "_", "._", "BZ", "2", "Compress", "or_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bz2", "compressor", "_", "._", "compress_", "(_", "build", "log_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "contents_", "=_", "bz2", "compressor", "_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "add", "Component_", "(_", "'", "foo", ":", "runt", "ime", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Component_", "(_", "'", "foo", ":", "debug", "info", "'_", ",_", "[_", "(_", "'/", "usr", "/", "bin", "/", "foo", "'_", ",_", "rep", "help_", "._", "Regula", "r", "File_", "(_", "contents_", "=_", "contents_", ",_", "tags_", "=_", "[_", "'", "build", "log", "'_", "]_", ")_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Collection_", "(_", "'", "foo", "'_", ",_", "[_", "(_", "':", "runt", "ime", "'_", ",_", "True_", ")_", ",_", "(_", "':", "debug", "info", "'_", ",_", "False_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repos_", "=_", "self_", "._", "open", "Repository_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "output_", "=_", "self_", "._", "captur", "e", "Output_", "(_", "query", "rep_", "._", "display", "Trove", "s_", ",_", "self_", "._", "cfg_", ",_", "[_", "'", "foo", "'_", "]_", ",_", "[_", "]_", ",_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "query", "rep_", "._", "VERSI", "ON", "\\u", "FILTER", "\\u", "LATE", "ST_", ",_", "query", "rep_", "._", "FLA", "VOR", "\\u", "FILTER", "\\u", "BES", "T_", ",_", "show", "Build", "Log_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "output_", "[_", "1_", "]_", ",_", "build", "log_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rep", "Query", "Test_", "(_", "rep", "help_", "._", "Repos", "itor", "y", "Helper_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Show", "File_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content", "s1_", "=_", "'", "Thi", "s", " ", "is", " ", "test", " ", "content", "'_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content", "s2_", "=_", "'", "Thi", "s", " ", "is", " ", "anot", "her", " ", "test", " ", "content", "'_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "add", "Component_", "(_", "'", "foo", ":", "runt", "ime", "'_", ",_", "[_", "(_", "'/", "usr", "/", "bin", "/", "foo", "file", "'_", ",_", "content", "s1_", ")_", ",_", "(_", "'/", "usr", "/", "bin", "/", "bar", "file", "'_", ",_", "content", "s2_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Collection_", "(_", "'", "foo", "'_", ",_", "[_", "':", "runt", "ime", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repos_", "=_", "self_", "._", "open", "Repository_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "output_", "=_", "self_", "._", "captur", "e", "Output_", "(_", "query", "rep_", "._", "display", "Trove", "s_", ",_", "self_", "._", "cfg_", ",_", "[_", "'", "foo", "'_", "]_", ",_", "[_", "]_", ",_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "query", "rep_", "._", "VERSI", "ON", "\\u", "FILTER", "\\u", "LATE", "ST_", ",_", "query", "rep_", "._", "FLA", "VOR", "\\u", "FILTER", "\\u", "BES", "T_", ",_", "files", "To", "Show_", "=_", "[_", "'/", "usr", "/", "bin", "/", "bar", "file", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "output_", "[_", "1_", "]_", ",_", "content", "s2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rep", "Query", "Test_", "(_", "rep", "help_", "._", "Repos", "itor", "y", "Helper_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Rd", "iff", "1_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "req", "1_", "=_", "'", "sona", "me", ":", " ", "ELF", "32", "/", "libf", "oo", "1", "(", "bla", "h", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "req", "2_", "=_", "'", "sona", "me", ":", " ", "ELF", "32", "/", "lib", "/", "foo", "2", "(", "bla", "h", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "req", "3_", "=_", "'", "sona", "me", ":", " ", "ELF", "32", "/", "lib", "/", "foo", "3", "(", "bla", "h", ")", " ", "trove", ":", "bar", "(", "1", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prov", "1_", "=_", "\"", "trove", ":", "bar", "(", "1", ")", " ", "trove", ":", "ba", "z", "(", "1", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prov", "2_", "=_", "\"", "trove", ":", "ba", "z", "(", "1", ")", " ", "trove", ":", "blo", "op", "(", "1", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prov", "3_", "=_", "\"", "trove", ":", "blo", "op", "(", "2", ")", " ", "trove", ":", "bar", "(", "1", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "build", "Re", "qs", "1_", "=_", "[_", "(_", "'", "py", "'_", ",_", "'", "1", "'_", ",_", "'", "is", ":", " ", "x", "'_", ")_", ",_", "(_", "'", "by", "'_", ",_", "'", "1", "'_", ",_", "'", "is", ":", " ", "y", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "ty", "'_", ",_", "'", "1", "'_", ",_", "'", "is", ":", " ", "z", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "build", "Re", "qs", "2_", "=_", "[_", "(_", "'", "py", "'_", ",_", "'", "1", "'_", ",_", "'", "is", ":", " ", "x", "'_", ")_", ",_", "(_", "'", "my", "'_", ",_", "'", "1", "'_", ",_", "'", "is", ":", " ", "y", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "by", "'_", ",_", "'", "2", "'_", ",_", "'", "is", ":", " ", "z", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rf", "1_", "=_", "rep", "help_", "._", "Regula", "r", "File_", "(_", "contents_", "=_", "'", "1", "\\\\", "n2", "\\\\", "n", "3", "\\\\", "n4", "\\\\", "n", "5", "\\\\", "n", "6", "\\\\", "n", "7", "\\\\", "n", "8", "\\\\", "n", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "perms_", "=_", "0_", "644", "_", ",_", "provides_", "=_", "prov", "1_", ",_", "requires_", "=_", "req", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mtime_", "=_", "113", "692", "101", "7_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rf", "2_", "=_", "rep", "help_", "._", "Regula", "r", "File_", "(_", "contents_", "=_", "'", "1", "\\\\", "n2", "\\\\", "n4", "\\\\", "n", "5", "\\\\", "n", "6", "\\\\", "n", "7", "\\\\", "n", "8", "\\\\", "n", "9", "\\\\", "n", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "perms_", "=_", "0_", "755", "_", ",_", "provides_", "=_", "prov", "2_", ",_", "requires_", "=_", "req", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mtime_", "=_", "113", "692", "131", "7_", ",_", "tags_", "=_", "[_", "'", "tag", "2", "'_", ",_", "'", "tag", "1", "'_", ",_", "'", "tag", "3", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rf", "3_", "=_", "rep", "help_", "._", "Regula", "r", "File_", "(_", "contents_", "=_", "'", "1", "\\\\", "n2", "\\\\", "n4", "\\\\", "n", "5", "\\\\", "n", "6", "\\\\", "n", "7", "\\\\", "n", "8", "\\\\", "n1", "0", "\\\\", "n", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "perms_", "=_", "0_", "400_", ",_", "provides_", "=_", "prov", "3_", ",_", "requires_", "=_", "req", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mtime_", "=_", "113", "692", "101", "7_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "rf", "5", " ", "differs", " ", "from", " ", "rf", "1", " ", "just", " ", "by", " ", "tags_", "\\u\\u\\uNL\\u\\u\\u_", "rf", "5_", "=_", "rep", "help_", "._", "Regula", "r", "File_", "(_", "contents_", "=_", "'", "1", "\\\\", "n2", "\\\\", "n", "3", "\\\\", "n4", "\\\\", "n", "5", "\\\\", "n", "6", "\\\\", "n", "7", "\\\\", "n", "8", "\\\\", "n", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "perms_", "=_", "0_", "644", "_", ",_", "provides_", "=_", "prov", "1_", ",_", "requires_", "=_", "req", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mtime_", "=_", "113", "692", "101", "7_", ",_", "tags_", "=_", "[_", "'", "tag", "2", "'_", ",_", "'", "tag", "1", "'_", ",_", "'", "tag", "3", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Component_", "(_", "'", "foo", ":", "run", "'_", ",_", "'", "1", "'_", ",_", "'", "is", ":", "x8", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "'/", "usr", "/", "bin", "/", "foo", "'_", ",_", "rf", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'/", "usr", "/", "bin", "/", "bar", "'_", ",_", "rf", "2_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'/", "usr", "/", "bin", "/", "file", "1", "'_", ",_", "rf", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Component_", "(_", "'", "foo", ":", "sup", "doc", "'_", ",_", "'", "1", "'_", ",_", "'", "is", ":", "x8", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "'/", "usr", "/", "share", "/", "doc", "/", "foo", "1", "'_", ",_", "rf", "1_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Collection_", "(_", "'", "foo", "'_", ",_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "x_", ",_", "'", "1", "'_", ",_", "'", "is", ":", "x8", "6", "'_", ")_", "for_", "x_", "in_", "[_", "':", "run", "'_", ",_", "':", "sup", "doc", "'_", "]_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "build", "Re", "qs_", "=_", "build", "Re", "qs", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "add", "Component_", "(_", "'", "foo", ":", "run", "'_", ",_", "'", "2", "'_", ",_", "'", "is", ":", "x8", "6", "\\u", "64", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "'/", "usr", "/", "bin", "/", "foo", "'_", ",_", "rf", "2_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'/", "usr", "/", "bin", "/", "file", "1", "'_", ",_", "rf", "5_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'/", "usr", "/", "bin", "/", "ba", "z", "'_", ",_", "rf", "3_", ")_", ",_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Component_", "(_", "'", "foo", ":", "doc", "'_", ",_", "'", "2", "'_", ",_", "'", "is", ":", "x8", "6", "\\u", "64", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "'/", "usr", "/", "share", "/", "doc", "/", "foo", "2", "'_", ",_", "rf", "2_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Collection_", "(_", "'", "foo", "'_", ",_", "'", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "x_", ",_", "'", "2", "'_", ",_", "'", "is", ":", "x8", "6", "\\u", "64", "'_", ")_", "for_", "x_", "in_", "[_", "':", "run", "'_", ",_", "':", "doc", "'_", "]_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "build", "Re", "qs_", "=_", "build", "Re", "qs", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Force", " ", "search", " ", "flavor", " ", "to", " ", "x8", "6", "\\u", "64", " ", "to", " ", "get", " ", "consistent", " ", "output", " ", "on", " ", "x8", "6_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cfg_", "._", "flavor_", "=_", "[_", "deps_", "._", "parse", "Flavor_", "(_", "'", "is", ":", " ", "x8", "6", " ", "x8", "6", "\\u", "64", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repos_", "=_", "self_", "._", "open", "Repository_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "trove", "Spec_", "=_", "'", "foo", "=", "1", "[", "is", ":", "x8", "6", "]-", "-", "2", "[", "is", ":", "x8", "6", "\\u", "64", "]'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ret_", ",_", "outs_", "=_", "self_", "._", "\\u", "rdi", "ff_", "(_", "trove", "Spec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "outs_", ",_", "exp", "Output", "1", "noar", "gs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cfg_", "._", "full", "Fla", "vor", "s_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", ",_", "outs_", "=_", "self_", "._", "\\u", "rdi", "ff_", "(_", "trove", "Spec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "outs_", ",_", "exp", "Output", "1f", "ull", "Fla", "vor", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg_", "._", "full", "Fla", "vor", "s_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cfg_", "._", "full", "Version", "s_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", ",_", "outs_", "=_", "self_", "._", "\\u", "rdi", "ff_", "(_", "trove", "Spec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "outs_", ",_", "exp", "Output", "1f", "ull", "Version", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg_", "._", "full", "Version", "s_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ret_", ",_", "outs_", "=_", "self_", "._", "\\u", "rdi", "ff_", "(_", "trove", "Spec_", ",_", "ls_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "outs_", ",_", "exp", "Output", "1", "with", "Files_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ret_", ",_", "outs_", "=_", "self_", "._", "\\u", "rdi", "ff_", "(_", "trove", "Spec_", ",_", "file", "Version", "s_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "outs_", ",_", "exp", "Output", "1", "with", "File", "Version", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ret_", ",_", "outs_", "=_", "self_", "._", "\\u", "rdi", "ff_", "(_", "trove", "Spec_", ",_", "ls", "l_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "outs_", ",_", "exp", "Output", "1", "with", "Files", "Stat_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ret_", ",_", "outs_", "=_", "self_", "._", "\\u", "rdi", "ff_", "(_", "trove", "Spec_", ",_", "tags_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "outs_", ",_", "exp", "Output", "1", "with", "File", "Tags_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Diff", "ing", " ", "against", " ", "ours", "elv", "es_", "\\u\\u\\uNL\\u\\u\\u_", "trove", "Spec_", "=_", "'", "foo", "=", "1", "[", "is", ":", "x8", "6", "]-", "-1", "[", "is", ":", "x8", "6", "]'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", ",_", "outs_", "=_", "self_", "._", "\\u", "rdi", "ff_", "(_", "trove", "Spec_", ",_", "tags_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "outs_", ",_", "'", "Identical", " ", "trove", "s", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rep", "Query", "Test_", "(_", "rep", "help_", "._", "Repos", "itor", "y", "Helper_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Rd", "iff", "5_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "CN", "Y", "-1", "605", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "two", " ", "flavor", "s", " ", "of", " ", "the", " ", "same", " ", "trove", " ", "and", " ", "add", " ", "them", " ", "to", " ", "the", " ", "same", " ", "group_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fl", "v1_", "=_", "'", "~", "ssl", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fl", "v2_", "=_", "'", "~", "!", "ssl", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rf", "11_", "=_", "rep", "help_", "._", "Regula", "r", "File_", "(_", "contents_", "=_", "'", "1", "\\\\", "n2", "\\\\", "n", "3", "\\\\", "n4", "\\\\", "n", "5", "\\\\", "n", "6", "\\\\", "n", "7", "\\\\", "n", "8", "\\\\", "n", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "flavor_", "=_", "fl", "v1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rf", "12_", "=_", "rep", "help_", "._", "Regula", "r", "File_", "(_", "contents_", "=_", "'", "1", "\\\\", "n2", "\\\\", "n4", "\\\\", "n", "5", "\\\\", "n", "6", "\\\\", "n", "7", "\\\\", "n", "8", "\\\\", "n", "9", "\\\\", "n", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "flavor_", "=_", "fl", "v2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rf", "21_", "=_", "rep", "help_", "._", "Regula", "r", "File_", "(_", "contents_", "=_", "'", "1", "\\\\", "n2", "\\\\", "n4", "\\\\", "n", "5", "\\\\", "n", "6", "\\\\", "n", "7", "\\\\", "n", "8", "\\\\", "n", "9", "\\\\", "n", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "flavor_", "=_", "fl", "v1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rf", "22_", "=_", "rep", "help_", "._", "Regula", "r", "File_", "(_", "contents_", "=_", "'", "1", "\\\\", "n2", "\\\\", "n", "3", "\\\\", "n4", "\\\\", "n", "5", "\\\\", "n", "6", "\\\\", "n", "7", "\\\\", "n", "8", "\\\\", "n", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "flavor_", "=_", "fl", "v2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "files_", "=_", "[_", "(_", "rf", "11_", ",_", "rf", "12_", ")_", ",_", "(_", "rf", "21_", ",_", "rf", "22_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "v_", ",_", "fileo", "bj", "s_", "in_", "zip_", "(_", "[_", "'", "1", "'_", ",_", "'", "2", "'_", "]_", ",_", "files_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "file1_", "=_", "fileo", "bj", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file2_", "=_", "fileo", "bj", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t1_", "=_", "self_", "._", "add", "Component_", "(_", "'", "foo", ":", "run", "'_", ",_", "v_", ",_", "file", "Contents_", "=_", "[_", "(_", "'/", "bin", "/", "foo", "'_", ",_", "file1_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p1_", "=_", "self_", "._", "add", "Collection_", "(_", "'", "foo", "'_", ",_", "v_", ",_", "[_", "(_", "':", "run", "'_", ",_", "v_", ",_", "t1_", "._", "get", "Flavor_", "(_", ")_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t2_", "=_", "self_", "._", "add", "Component_", "(_", "'", "foo", ":", "run", "'_", ",_", "v_", ",_", "file", "Contents_", "=_", "[_", "(_", "'/", "bin", "/", "foo", "'_", ",_", "file2_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p2_", "=_", "self_", "._", "add", "Collection_", "(_", "'", "foo", "'_", ",_", "v_", ",_", "[_", "(_", "':", "run", "'_", ",_", "v_", ",_", "t2_", "._", "get", "Flavor_", "(_", ")_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "add", "Collection_", "(_", "'", "group", "-", "foo", "'_", ",_", "v_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "'", "foo", "'_", ",_", "v_", ",_", "fl", "v1_", ")_", ",_", "(_", "'", "foo", "'_", ",_", "v_", ",_", "fl", "v2_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "trove", "Spec_", "=_", "'", "group", "-", "foo", "=", "1", "--", "2", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cfg_", "._", "full", "Fla", "vor", "s_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", ",_", "outs_", "=_", "self_", "._", "\\u", "rdi", "ff_", "(_", "trove", "Spec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg_", "._", "full", "Fla", "vor", "s_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "outs_", ",_", "exp", "Output", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Multi", "Rep", "Query", "Test_", "(_", "rep", "help_", "._", "Repos", "itor", "y", "Helper_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Rd", "iff", "Multi", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "CN", "Y", "-", "254", "4", " ", "-", " ", "group", "s", " ", "inclu", "ding", " ", "trove", "s", " ", "from", " ", "foreign", " ", "repos_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r0_", "=_", "self_", "._", "\\u", "open", "Repository_", "(_", "0_", ",_", "\"", "local", "host", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r1_", "=_", "self_", "._", "\\u", "open", "Repository_", "(_", "1_", ",_", "\"", "other", "host", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "self_", "._", "get", "Repos", "itor", "y", "Client_", "(_", "\"", "user", "\"_", ",_", "\"", "pass", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "add", "Component_", "(_", "\"", "other", ":", "runt", "ime", "\"_", ",_", "\"/", "other", "host", "@", "foo", ":", "bar", "/", "9", "\"_", ",_", "repos_", "=_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Component_", "(_", "\"", "other", ":", "lib", "\"_", ",_", "\"/", "other", "host", "@", "foo", ":", "bar", "/", "9", "\"_", ",_", "repos_", "=_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tr", "v_", "=_", "self_", "._", "add", "Collection_", "(_", "\"", "other", "\"_", ",_", "\"/", "other", "host", "@", "foo", ":", "bar", "/", "9", "\"_", ",_", "[_", "\":", "runt", "ime", "\"_", ",_", "\":", "lib", "\"_", "]_", ",_", "repos_", "=_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "grp", "fu", "u_", "=_", "self_", "._", "add", "Collection_", "(_", "\"", "group", "-", "fu", "u", "\"_", ",_", "\"/", "local", "host", "@", "foo", ":", "bar", "/", "1", "\"_", ",_", "[_", "tr", "v_", "._", "get", "Name", "Version", "Flavor_", "(_", ")_", "]_", ",_", "repos_", "=_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "grp", "foo", "1_", "=_", "self_", "._", "add", "Collection_", "(_", "\"", "group", "-", "foo", "\"_", ",_", "\"/", "local", "host", "@", "foo", ":", "bar", "/", "1", "\"_", ",_", "[_", "grp", "fu", "u_", "._", "get", "Name", "Version", "Flavor_", "(_", ")_", "]_", ",_", "repos_", "=_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "grp", "foo", "2_", "=_", "self_", "._", "add", "Collection_", "(_", "\"", "group", "-", "foo", "\"_", ",_", "\"/", "local", "host", "@", "foo", ":", "bar", "/", "2", "\"_", ",_", "[_", "tr", "v_", "._", "get", "Name", "Version", "Flavor_", "(_", ")_", "]_", ",_", "repos_", "=_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ret_", ",_", "outs_", "=_", "self_", "._", "\\u", "rdi", "ff_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "-", "foo", "=", "local", "host", "@", "foo", ":", "bar", "/", "1", "--", "local", "host", "@", "foo", ":", "bar", "/", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "outs_", ",_", "exp", "Output", "7_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 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able defined multiple times
kobotoolbox/kobocat/onadata/apps/main/tests/test_form_metadata.py
[ { "content": " def test_shows_mapbox_layer_after_submit(self):\n self.post_data = {}\n self.post_data['map_name'] = 'test_mapbox_layer'\n self.post_data['link'] = 'http://0.0.0.0:8080'\n response = self.client.post(self.edit_url, self.post_data)\n response = self.client.get(self.url)\n self.assertContains(response, 'test_mapbox_layer')\n self.xform.shared = True\n self.xform.save()\n response = self.anon.get(self.url)\n self.assertEqual(response.status_code, 200)\n self.assertContains(response, 'test_mapbox_layer')", "metadata": "root.TestFormMetadata.test_shows_mapbox_layer_after_submit", "header": "['class', 'TestFormMetadata', '(', 'TestBase', ')', ':', '___EOS___']", "index": 99 } ]
[ { "span": "response ", "start_line": 103, "start_column": 8, "end_line": 103, "end_column": 16 } ]
[ { "span": "response ", "start_line": 104, "start_column": 8, "end_line": 104, "end_column": 16 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Test", "Form", "Metadata_", "(_", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "show", "s", "\\u", "map", "box", "\\u", "layer", "\\u", "after", "\\u", "submit_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "post", "\\u", "data_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "post", "\\u", "data_", "[_", "'", "map", "\\u", "name", "'_", "]_", "=_", "'", "test\\u", "map", "box", "\\u", "layer", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "post", "\\u", "data_", "[_", "'", "link", "'_", "]_", "=_", "'", "http", "://", "0.", "0.", "0.", "0", ":", "808", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "client_", "._", "post_", "(_", "self_", "._", "edit", "\\u", "url_", ",_", "self_", "._", "post", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "self_", "._", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Contains_", "(_", "response_", ",_", "'", "test\\u", "map", "box", "\\u", "layer", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "xform_", "._", "shared_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "xform_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "anon", "_", "._", "get_", "(_", "self_", "._", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Contains_", "(_", "response_", ",_", "'", "test\\u", "map", "box", "\\u", "layer", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
nii-cloud/dodai-compute/nova/tests/api/openstack/__init__.py
[ { "content": " def exhaust(self, middleware, method, url, username, times):\n req = Request.blank(url, dict(REQUEST_METHOD=method),\n headers={'X-Auth-User': username})\n req.environ['nova.context'] = context.RequestContext(username,\n username)\n for i in range(times):\n resp = req.get_response(middleware)\n self.assertEqual(resp.status_int, 200)\n resp = req.get_response(middleware)\n self.assertEqual(resp.status_int, 413)\n self.assertTrue('Retry-After' in resp.headers)", "metadata": "root.RateLimitingMiddlewareTest.exhaust", "header": "['class', 'RateLimitingMiddlewareTest', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']", "index": 56 }, { "content": " def test_POST_servers_action_implies_POST_action(self):\n middleware = RateLimitingMiddleware(simple_wsgi)\n self.exhaust(middleware, 'POST', '/fake/servers/4', 'usr1', 10)\n self.exhaust(middleware, 'POST', '/fake/images/4', 'usr2', 10)\n self.assertTrue(set(middleware.limiter._levels) == \\\n set(['usr1:POST', 'usr1:POST servers', 'usr2:POST']))", "metadata": "root.RateLimitingMiddlewareTest.test_POST_servers_action_implies_POST_action", "header": "['class', 'RateLimitingMiddlewareTest', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']", "index": 73 } ]
[ { "span": "self.assertTrue('Retry-After' in resp.headers)", "start_line": 66, "start_column": 8, "end_line": 66, "end_column": 54 }, { "span": "self.assertTrue(set(middleware.limiter._levels) == \\\n set(['usr1:POST', 'usr1:POST servers', 'usr2:POST']))", "start_line": 77, "start_column": 8, "end_line": 78, "end_column": 77 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Rat", "e", "Limit", "ing", "Mid", "dle", "ware", "Test_", "(_", "test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "exhaust", "_", "(_", "self_", ",_", "middleware_", ",_", "method_", ",_", "url_", ",_", "username_", ",_", "times_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "req_", "=_", "Request_", "._", "blank_", "(_", "url_", ",_", "dict_", "(_", "REQUEST", "\\u", "METHOD_", "=_", "method_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "headers_", "=_", "{_", "'", "X", "-", "Auth", "-", "User", "'_", ":_", "username_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "req_", "._", "environ_", "[_", "'", "nova", ".", "context", "'_", "]_", "=_", "context_", "._", "Request", "Context_", "(_", "username_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "username_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "times_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "req_", "._", "get", "\\u", "response_", "(_", "middleware_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "int_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "resp_", "=_", "req_", "._", "get", "\\u", "response_", "(_", "middleware_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "int_", ",_", "413_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "Retr", "y", "-", "Af", "ter", "'_", "in_", "resp_", "._", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rat", "e", "Limit", "ing", "Mid", "dle", "ware", "Test_", "(_", "test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "POST", "\\u", "server", "s", "\\u", "action", "\\u", "implies", "\\u", "POST", "\\u", "action_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "middleware_", "=_", "Rat", "e", "Limit", "ing", "Middleware_", "(_", "simple", "\\u", "wsgi_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "exhaust", "_", "(_", "middleware_", ",_", "'", "POST", "'_", ",_", "'/", "fake", "/", "server", "s", "/", "4", "'_", ",_", "'", "usr", "1", "'_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "exhaust", "_", "(_", "middleware_", ",_", "'", "POST", "'_", ",_", "'/", "fake", "/", "images", "/", "4", "'_", ",_", "'", "usr", "2", "'_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "set_", "(_", "middleware_", "._", "limiter", "_", "._", "\\u", "levels_", ")_", "==_", "set_", "(_", "[_", "'", "usr", "1", ":", "POST", "'_", ",_", "'", "usr", "1", ":", "POST", " ", "server", "s", "'_", ",_", "'", "usr", "2", ":", "POST", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused import
Shopify/shopify_python_api/test/order_test.py
[ { "content": "import shopify\nfrom test.test_helper import TestCase\nfrom pyactiveresource.activeresource import ActiveResource\nfrom pyactiveresource.util import xml_to_dict\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class OrderTest(TestCase):\n\n\n\n", "metadata": "root.OrderTest", "header": "['module', '___EOS___']", "index": 5 }, { "content": " def test_should_be_loaded_correctly_from_order_xml(self):\n order_xml = \"\"\"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <order>\n <note-attributes type=\"array\">\n <note-attribute>\n <name>size</name>\n <value>large</value>\n </note-attribute>\n </note-attributes>\n </order>\"\"\"\n order = shopify.Order(xml_to_dict(order_xml)[\"order\"])\n\n self.assertEqual(1, len(order.note_attributes))\n\n note_attribute = order.note_attributes[0]\n self.assertEqual(\"size\", note_attribute.name)\n self.assertEqual(\"large\", note_attribute.value)", "metadata": "root.OrderTest.test_should_be_loaded_correctly_from_order_xml", "header": "['class', 'OrderTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 7 }, { "content": " def test_should_be_able_to_add_note_attributes_to_an_order(self):\n order = shopify.Order()\n order.note_attributes = []\n order.note_attributes.append(shopify.NoteAttribute({'name': \"color\", 'value': \"blue\"}))\n\n order_xml = xml_to_dict(order.to_xml())\n note_attributes = order_xml[\"order\"][\"note_attributes\"]\n self.assertTrue(isinstance(note_attributes, list))\n\n attribute = note_attributes[0]\n self.assertEqual(\"color\", attribute[\"name\"])\n self.assertEqual(\"blue\", attribute[\"value\"])", "metadata": "root.OrderTest.test_should_be_able_to_add_note_attributes_to_an_order", "header": "['class', 'OrderTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 25 }, { "content": " def test_get_order(self):\n self.fake('orders/450789469', method='GET', body=self.load_fixture('order'))\n order = shopify.Order.find(450789469)\n self.assertEqual('[email protected]', order.email)", "metadata": "root.OrderTest.test_get_order", "header": "['class', 'OrderTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 38 }, { "content": " def test_get_order_transaction(self):\n self.fake('orders/450789469', method='GET', body=self.load_fixture('order'))\n order = shopify.Order.find(450789469)\n self.fake('orders/450789469/transactions', method='GET', body=self.load_fixture('transaction'))\n transactions = order.transactions()\n self.assertEqual(\"409.94\", transactions[0].amount)", "metadata": "root.OrderTest.test_get_order_transaction", "header": "['class', 'OrderTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 43 } ]
[ { "span": "from pyactiveresource.activeresource import ActiveResource", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 58 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "shop", "ify_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "test_", "._", "test\\u", "helper_", "import_", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pya", "ctive", "resource_", "._", "active", "resource_", "import_", "Activ", "e", "Resource_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pya", "ctive", "resource_", "._", "util_", "import_", "xml", "\\u", "to", "\\u", "dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Order", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Order", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "shou", "ld", "\\u", "be", "\\u", "load", "ed", "\\u", "correct", "ly", "\\u", "from", "\\u", "order", "\\u", "xml_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "order", "\\u", "xml_", "=_", "\"\"\"", "<", "?", "xml", " ", "version", "=\"", "1.0", "\"", " ", "encoding", "=\"", "UT", "F", "-", "8", "\"?", ">", "\\", "10", ";", " ", " ", "<", "order", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "note", "-", "attribute", "s", " ", "type", "=\"", "array", "\">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "note", "-", "attribute", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "name", ">", "size", "</", "name", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "value", ">", "large", "</", "value", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "note", "-", "attribute", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "note", "-", "attribute", "s", ">", "\\", "10", ";", " ", " ", "</", "order", ">\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "order_", "=_", "shop", "ify_", "._", "Order_", "(_", "xml", "\\u", "to", "\\u", "dict_", "(_", "order", "\\u", "xml_", ")_", "[_", "\"", "order", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1_", ",_", "len_", "(_", "order_", "._", "note", "\\u", "attributes_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "note", "\\u", "attribute_", "=_", "order_", "._", "note", "\\u", "attributes_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\"", "size", "\"_", ",_", "note", "\\u", "attribute_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\"", "large", "\"_", ",_", "note", "\\u", "attribute_", "._", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Order", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "shou", "ld", "\\u", "be", "\\u", "able", "\\u", "to", "\\u", "add", "\\u", "note", "\\u", "attribute", "s", "\\u", "to", "\\u", "an", "\\u", "order_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "order_", "=_", "shop", "ify_", "._", "Order_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "order_", "._", "note", "\\u", "attributes_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "order_", "._", "note", "\\u", "attributes_", "._", "append_", "(_", "shop", "ify_", "._", "Not", "e", "Attribute_", "(_", "{_", "'", "name", "'_", ":_", "\"", "color", "\"_", ",_", "'", "value", "'_", ":_", "\"", "blue", "\"_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "order", "\\u", "xml_", "=_", "xml", "\\u", "to", "\\u", "dict_", "(_", "order_", "._", "to", "\\u", "xml_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "note", "\\u", "attributes_", "=_", "order", "\\u", "xml_", "[_", "\"", "order", "\"_", "]_", "[_", "\"", "note", "\\u", "attribute", "s", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "note", "\\u", "attributes_", ",_", "list_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "attribute_", "=_", "note", "\\u", "attributes_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\"", "color", "\"_", ",_", "attribute_", "[_", "\"", "name", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\"", "blue", "\"_", ",_", "attribute_", "[_", "\"", "value", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Order", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "order_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fake_", "(_", "'", "order", "s", "/", "450", "789", "469", "'_", ",_", "method_", "=_", "'", "GET", "'_", ",_", "body_", "=_", "self_", "._", "load", "\\u", "fixture_", "(_", "'", "order", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "order_", "=_", "shop", "ify_", "._", "Order_", "._", "find_", "(_", "450", "789", "469", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "bob", ".", "norm", "an", "@", "host", "mail", ".", "com", "'_", ",_", "order_", "._", "email_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Order", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "order", "\\u", "transaction_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fake_", "(_", "'", "order", "s", "/", "450", "789", "469", "'_", ",_", "method_", "=_", "'", "GET", "'_", ",_", "body_", "=_", "self_", "._", "load", "\\u", "fixture_", "(_", "'", "order", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "order_", "=_", "shop", "ify_", "._", "Order_", "._", "find_", "(_", "450", "789", "469", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fake_", "(_", "'", "order", "s", "/", "450", "789", "469", "/", "transaction", "s", "'_", ",_", "method_", "=_", "'", "GET", "'_", ",_", "body_", "=_", "self_", "._", "load", "\\u", "fixture_", "(_", "'", "transaction", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "transactions_", "=_", "order_", "._", "transactions_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\"", "409", ".9", "4", "\"_", ",_", "transactions_", "[_", "0_", "]_", "._", "amount_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Testing equality to None
open-cloud/xos/xos/core/views/hpc_config.py
[ { "content": "def HpcConfig(request):\n hpcSlice=None\n cmiSlice=None\n redirSlice=None\n demuxSlice=None\n\n node_slicename = request.GET.get(\"slicename\", None)\n if not node_slicename:\n return HttpResponseServerError(\"Error: no slicename passed in request\")\n\n # search for an HPC Service that owns the slicename that was passed\n # to us.\n hpc=None\n for candidate in HpcService.objects.all():\n if candidate.cmi_hostname == node_slicename:\n # A hack for standalone CMIs that aren't managed by XOS. Set\n # /etc/slicename to cmi_hostname that's configured in the\n # HPCService object.\n hpc = candidate\n\n for slice in get_service_slices(candidate):\n if slice.name == node_slicename:\n hpc = candidate\n\n if (not hpc):\n return HttpResponseServerError(\"Error: no HPC service\")\n\n for slice in get_service_slices(hpc):\n if \"cmi\" in slice.name:\n cmiSlice = slice\n elif (\"hpc\" in slice.name) or (\"vcoblitz\" in slice.name):\n hpcSlice = slice\n elif \"redir\" in slice.name:\n redirSlice = slice\n elif \"demux\" in slice.name:\n demuxSlice = slice\n\n if (hpc.cmi_hostname):\n cmi_hostname = hpc.cmi_hostname\n else:\n if not cmiSlice:\n return HttpResponseServerError(\"Error: no CMI slice\")\n\n if len(cmiSlice.instances.all())==0:\n return HttpResponseServerError(\"Error: CMI slice has no instances\")\n\n # for now, assuming using NAT\n cmi_hostname = cmiSlice.instances.all()[0].node.name\n\n if not hpcSlice:\n return HttpResponseServerError(\"Error: no HPC slice\")\n\n if (redirSlice==None) or (demuxSlice==None):\n # The HPC Service didn't have a dnsredir or a dnsdemux, so try looking\n # in the RequestRouterService for one.\n\n rr = RequestRouterService.objects.all()\n if not (rr):\n return HttpResponseServerError(\"Error: no RR service\")\n\n rr = rr[0]\n try:\n slices = rr.slices.all()\n except:\n # this field used to be improperly named, and makemigrations won't fix it\n slices = rr.service.all()\n for slice in slices:\n if \"redir\" in slice.name:\n redirSlice = slice\n elif \"demux\" in slice.name:\n demuxSlice = slice\n\n if not redirSlice:\n return HttpResponseServerError(\"Error: no dnsredir slice\")\n\n if not demuxSlice:\n return HttpResponseServerError(\"Error: no dnsdemux slice\")\n\n d = {}\n d[\"hpc_slicename\"] = hpcSlice.name\n d[\"redir_slicename\"] = redirSlice.name\n d[\"demux_slicename\"] = demuxSlice.name\n d[\"cmi_hostname\"] = cmi_hostname\n d[\"xos_hostname\"] = xos.settings.RESTAPI_HOSTNAME\n d[\"xos_port\"] = str(xos.settings.RESTAPI_PORT)\n\n if hpc.hpc_port80:\n d[\"hpc_port80\"] = \"True\"\n else:\n d[\"hpc_port80\"] = \"False\"\n\n return HttpResponse(\"\"\"# auto-generated by HpcConfig\nENABLE_PLC=False\nENABLE_PS=True\nBASE_HRN=\"princeton\"\nRELEVANT_SERVICE_NAMES=['vcoblitz', 'coredirect', 'codnsdemux', \"syndicate_comon_server\"]\nCOBLITZ_SLICE_NAME=BASE_HRN+\"_vcoblitz\"\nCOBLITZ_SLICE_ID=70\nCOBLITZ_PS_SLICE_NAME=\"{hpc_slicename}\"\nDNSREDIR_SLICE_NAME=BASE_HRN+\"_coredirect\"\nDNSREDIR_SLICE_ID=71\nDNSREDIR_PS_SLICE_NAME=\"{redir_slicename}\"\nDNSDEMUX_SLICE_NAME=BASE_HRN+\"_codnsdemux\"\nDNSDEMUX_SLICE_ID=69\nDNSDEMUX_PS_SLICE_NAME=\"{demux_slicename}\"\nCMI_URL=\"http://{cmi_hostname}/\"\nCMI_HTTP_PORT=\"8004\"\nCMI_HTTPS_PORT=\"8003\"\nPUPPET_MASTER_HOSTNAME=\"{cmi_hostname}\"\nPUPPET_MASTER_PORT=\"8140\"\nPS_HOSTNAME=\"{xos_hostname}\"\nPS_PORT=\"{xos_port}\"\nCOBLITZ_PORT_80={hpc_port80}\n\"\"\".format(**d))", "metadata": "root.HpcConfig", "header": "['module', '___EOS___']", "index": 16 } ]
[ { "span": "redirSlice==None)", "start_line": 68, "start_column": 8, "end_line": 68, "end_column": 24 }, { "span": "demuxSlice==None)", "start_line": 68, "start_column": 30, "end_line": 68, "end_column": 46 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Hp", "c", "Config_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hp", "c", "Slice_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmi", "Slice_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redir", "Slice_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dem", "ux", "Slice_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "node", "\\u", "slice", "name_", "=_", "request_", "._", "GET_", "._", "get_", "(_", "\"", "slice", "name", "\"_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "node", "\\u", "slice", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Respons", "e", "Server", "Error_", "(_", "\"", "Error", ":", " ", "no", " ", "slice", "name", " ", "pass", "ed", " ", "in", " ", "request", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "search", " ", "for", " ", "an", " ", "HP", "C", " ", "Service", " ", "tha", "t", " ", "owns", " ", "the", " ", "slice", "name", " ", "tha", "t", " ", "was", " ", "passed_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "us", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "hp", "c_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "candidate_", "in_", "Hp", "c", "Service_", "._", "objects_", "._", "all_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "candidate_", "._", "cmi", "\\u", "hostname_", "==_", "node", "\\u", "slice", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "A", " ", "hack", " ", "for", " ", "standalone", " ", "CM", "Is", " ", "tha", "t", " ", "are", "n", "'", "t", " ", "manage", "d", " ", "by", " ", "XO", "S", ".", " ", "Set_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "etc", "/", "slice", "name", " ", "to", " ", "cmi", "\\u", "host", "name", " ", "tha", "t", "'", "s", " ", "configur", "ed", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "HP", "CS", "ervice", " ", "object", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hp", "c_", "=_", "candidate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "slice_", "in_", "get", "\\u", "service", "\\u", "slices_", "(_", "candidate_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "slice_", "._", "name_", "==_", "node", "\\u", "slice", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hp", "c_", "=_", "candidate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "not_", "hp", "c_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Respons", "e", "Server", "Error_", "(_", "\"", "Error", ":", " ", "no", " ", "HP", "C", " ", "service", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "slice_", "in_", "get", "\\u", "service", "\\u", "slices_", "(_", "hp", "c_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "\"", "cmi", "\"_", "in_", "slice_", "._", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmi", "Slice_", "=_", "slice_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "\"", "hp", "c", "\"_", "in_", "slice_", "._", "name_", ")_", "or_", "(_", "\"", "vco", "blit", "z", "\"_", "in_", "slice_", "._", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hp", "c", "Slice_", "=_", "slice_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "\"", "redir", "\"_", "in_", "slice_", "._", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "redir", "Slice_", "=_", "slice_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "\"", "dem", "ux", "\"_", "in_", "slice_", "._", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dem", "ux", "Slice_", "=_", "slice_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "hp", "c_", "._", "cmi", "\\u", "hostname_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmi", "\\u", "hostname_", "=_", "hp", "c_", "._", "cmi", "\\u", "hostname_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "cmi", "Slice_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Respons", "e", "Server", "Error_", "(_", "\"", "Error", ":", " ", "no", " ", "CM", "I", " ", "slice", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "cmi", "Slice_", "._", "instances_", "._", "all_", "(_", ")_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Respons", "e", "Server", "Error_", "(_", "\"", "Error", ":", " ", "CM", "I", " ", "slice", " ", "has", " ", "no", " ", "instance", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "now", ",", " ", "ass", "umi", "ng", " ", "usi", "ng", " ", "NAT", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cmi", "\\u", "hostname_", "=_", "cmi", "Slice_", "._", "instances_", "._", "all_", "(_", ")_", "[_", "0_", "]_", "._", "node_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "hp", "c", "Slice_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Respons", "e", "Server", "Error_", "(_", "\"", "Error", ":", " ", "no", " ", "HP", "C", " ", "slice", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "redir", "Slice_", "==_", "None_", ")_", "or_", "(_", "dem", "ux", "Slice_", "==_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "HP", "C", " ", "Service", " ", "did", "n", "'", "t", " ", "have", " ", "a", " ", "dns", "redir", " ", "or", " ", "a", " ", "dns", "dem", "ux", ",", " ", "so", " ", "try", " ", "look", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "the", " ", "Request", "Route", "r", "Service", " ", "for", " ", "one", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rr_", "=_", "Request", "Route", "r", "Service_", "._", "objects_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "(_", "rr_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Respons", "e", "Server", "Error_", "(_", "\"", "Error", ":", " ", "no", " ", "RR", " ", "service", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rr_", "=_", "rr_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "slices_", "=_", "rr_", "._", "slices_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "this", " ", "field", " ", "used", " ", "to", " ", "be", " ", "impro", "perl", "y", " ", "named", ",", " ", "and", " ", "make", "migrati", "ons", " ", "won", "'", "t", " ", "fix", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "slices_", "=_", "rr_", "._", "service_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "slice_", "in_", "slices_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "\"", "redir", "\"_", "in_", "slice_", "._", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "redir", "Slice_", "=_", "slice_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "\"", "dem", "ux", "\"_", "in_", "slice_", "._", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dem", "ux", "Slice_", "=_", "slice_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "redir", "Slice_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Respons", "e", "Server", "Error_", "(_", "\"", "Error", ":", " ", "no", " ", "dns", "redir", " ", "slice", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "dem", "ux", "Slice_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Respons", "e", "Server", "Error_", "(_", "\"", "Error", ":", " ", "no", " ", "dns", "dem", "ux", " ", "slice", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "[_", "\"", "hp", "c\\u", "slice", "name", "\"_", "]_", "=_", "hp", "c", "Slice_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "[_", "\"", "redir", "\\u", "slice", "name", "\"_", "]_", "=_", "redir", "Slice_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "[_", "\"", "dem", "ux", "\\u", "slice", "name", "\"_", "]_", "=_", "dem", "ux", "Slice_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "[_", "\"", "cmi", "\\u", "host", "name", "\"_", "]_", "=_", "cmi", "\\u", "hostname_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "[_", "\"", "xo", "s", "\\u", "host", "name", "\"_", "]_", "=_", "xo", "s_", "._", "settings_", "._", "RESTA", "PI", "\\u", "HOSTNAME", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "[_", "\"", "xo", "s", "\\u", "port", "\"_", "]_", "=_", "str_", "(_", "xo", "s_", "._", "settings_", "._", "RESTA", "PI", "\\u", "PORT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hp", "c_", "._", "hp", "c\\u", "port", "80_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "[_", "\"", "hp", "c\\u", "port", "80", "\"_", "]_", "=_", "\"", "Tru", "e", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "[_", "\"", "hp", "c\\u", "port", "80", "\"_", "]_", "=_", "\"", "Fal", "se", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Http", "Response_", "(_", "\"\"\"#", " ", "auto", "-", "generat", "ed", " ", "by", " ", "Hp", "c", "Config", "\\", "10", ";", "ENABLE", "\\u", "PLC", "=", "Fal", "se", "\\", "10", ";", "ENABLE", "\\u", "PS", "=", "Tru", "e", "\\", "10", ";", "BASE", "\\u", "HR", "N", "=\"", "princ", "eto", "n", "\"", "\\", "10", ";", "REL", "EV", "ANT", "\\u", "SERV", "ICE", "\\u", "NAMES", "=[", "'", "vco", "blit", "z", "',", " ", "'", "core", "direct", "',", " ", "'", "cod", "ns", "dem", "ux", "',", " ", "\"", "syn", "dicat", "e\\u", "com", "on", "\\u", "server", "\"]", "\\", "10", ";", "CO", "BLI", "TZ", "\\u", "SLI", "CE", "\\u", "NAME", "=", "BASE", "\\u", "HR", "N", "+\"", "\\u", "vco", "blit", "z", "\"", "\\", "10", ";", "CO", "BLI", "TZ", "\\u", "SLI", "CE", "\\u", "ID", "=", "7", "0", "\\", "10", ";", "CO", "BLI", "TZ", "\\u", "PS", "\\u", "SLI", "CE", "\\u", "NAME", "=\"", "{", "hp", "c\\u", "slice", "name", "}\"", "\\", "10", ";", "DNS", "RED", "IR", "\\u", "SLI", "CE", "\\u", "NAME", "=", "BASE", "\\u", "HR", "N", "+\"", "\\u", "core", "direct", "\"", "\\", "10", ";", "DNS", "RED", "IR", "\\u", "SLI", "CE", "\\u", "ID", "=", "7", "1", "\\", "10", ";", "DNS", "RED", "IR", "\\u", "PS", "\\u", "SLI", "CE", "\\u", "NAME", "=\"", "{", "redir", "\\u", "slice", "name", "}\"", "\\", "10", ";", "DNS", "DEM", "UX", "\\u", "SLI", "CE", "\\u", "NAME", "=", "BASE", "\\u", "HR", "N", "+\"", "\\u", "cod", "ns", "dem", "ux", "\"", "\\", "10", ";", "DNS", "DEM", "UX", "\\u", "SLI", "CE", "\\u", "ID", "=", "6", "9", "\\", "10", ";", "DNS", "DEM", "UX", "\\u", "PS", "\\u", "SLI", "CE", "\\u", "NAME", "=\"", "{", "dem", "ux", "\\u", "slice", "name", "}\"", "\\", "10", ";", "CM", "I", "\\u", "URL", "=\"", "http", "://", "{", "cmi", "\\u", "host", "name", "}/", "\"", "\\", "10", ";", "CM", "I", "\\u", "HTTP", "\\u", "PORT", "=\"", "800", "4", "\"", "\\", "10", ";", "CM", "I", "\\u", "HTTP", "S", "\\u", "PORT", "=\"", "800", "3", "\"", "\\", "10", ";", "PU", "PPE", "T", "\\u", "MASTER", "\\u", "HOSTNAME", "=\"", "{", "cmi", "\\u", "host", "name", "}\"", "\\", "10", ";", "PU", "PPE", "T", "\\u", "MASTER", "\\u", "PORT", "=\"", "814", "0", "\"", "\\", "10", ";", "PS", "\\u", "HOSTNAME", "=\"", "{", "xo", "s", "\\u", "host", "name", "}\"", "\\", "10", ";", "PS", "\\u", "PORT", "=\"", "{", "xo", "s", "\\u", "port", "}\"", "\\", "10", ";", "CO", "BLI", "TZ", "\\u", "PORT", "\\u", "80", "={", "hp", "c\\u", "port", "80", "}", "\\", "10", ";\"\"\"_", "._", "format_", "(_", "**_", "d_", ")_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Signature mismatch in overriding method
dssg/ushine-learning/dssg/classifier.py
[ { "content": "class DssgBinaryClassifier(object):\n\n \"\"\" This is meant to be an abstract class\n \"\"\"\n\n\n\n\n\n pass", "metadata": "root.DssgBinaryClassifier", "header": "['module', '___EOS___']", "index": 28 }, { "content": " def __init__(self):\n pass", "metadata": "root.DssgBinaryClassifier.__init__", "header": "['class', 'DssgBinaryClassifier', '(', 'object', ')', ':', '___EOS___']", "index": 33 }, { "content": " def train(binaryLabeledMessageList):\n \"\"\" labels should be 'pos'/'neg'\n \"\"\"\n raise NotImplementedError(\"\")", "metadata": "root.DssgBinaryClassifier.train", "header": "['class', 'DssgBinaryClassifier', '(', 'object', ')', ':', '___EOS___']", "index": 36 }, { "content": " def predictScore(self, message):\n \"\"\" returns a score dictionary that looks like: {\"pos\":.2, \"neg\":-.2}\n \"\"\"\n raise NotImplementedError(\"\")", "metadata": "root.DssgBinaryClassifier.predictScore", "header": "['class', 'DssgBinaryClassifier', '(', 'object', ')', ':', '___EOS___']", "index": 41 }, { "content": " def predictProba(self, message):\n \"\"\" returns a score dictionary that looks like: {\"pos\":0.8, \"neg\":0.2}\n \"\"\"\n raise NotImplementedError(\"\")", "metadata": "root.DssgBinaryClassifier.predictProba", "header": "['class', 'DssgBinaryClassifier', '(', 'object', ')', ':', '___EOS___']", "index": 46 }, { "content": "class DssgBinaryClassifierMajorityVote(DssgBinaryClassifier):\n\n \"\"\"\n Majority vote classifier.\n \"\"\"\n\n\n\n\n\n\n pass", "metadata": "root.DssgBinaryClassifierMajorityVote", "header": "['module', '___EOS___']", "index": 54 }, { "content": " def __init__(self):\n self._posNegPrbDic = {}", "metadata": "root.DssgBinaryClassifierMajorityVote.__init__", "header": "['class', 'DssgBinaryClassifierMajorityVote', '(', 'DssgBinaryClassifier', ')', ':', '___EOS___']", "index": 60 }, { "content": " def train(self, binaryLabeledMessageList):\n nPos = countTruth(lambda x: x[1] == 'pos', binaryLabeledMessageList)\n nNeg = countTruth(lambda x: x[1] == 'neg', binaryLabeledMessageList)\n assert(nPos + nNeg == len(binaryLabeledMessageList))\n posNegPrbDic = {'pos': float(\n nPos) / (nPos + nNeg),\n 'neg': float(nNeg) / (nPos + nNeg)}\n\n self._posNegPrbDic = posNegPrbDic\n pass", "metadata": "root.DssgBinaryClassifierMajorityVote.train", "header": "['class', 'DssgBinaryClassifierMajorityVote', '(', 'DssgBinaryClassifier', ')', ':', '___EOS___']", "index": 63 }, { "content": " def predictScore(self, message):\n \"\"\"\n This turns probability into score in range [-.5, 5]\n \"\"\"\n scoreDic = {}\n scoreDic['pos'] = (self._posNegPrbDic['pos'] - .5)\n scoreDic['neg'] = (self._posNegPrbDic['neg'] - .5)\n return self._posNegPrbDic", "metadata": "root.DssgBinaryClassifierMajorityVote.predictScore", "header": "['class', 'DssgBinaryClassifierMajorityVote', '(', 'DssgBinaryClassifier', ')', ':', '___EOS___']", "index": 74 }, { "content": " def predictProba(self, message):\n \"\"\"\n This returns probability estimate for each class.\n \"\"\"\n return self._posNegPrbDic", "metadata": "root.DssgBinaryClassifierMajorityVote.predictProba", "header": "['class', 'DssgBinaryClassifierMajorityVote', '(', 'DssgBinaryClassifier', ')', ':', '___EOS___']", "index": 83 }, { "content": " def __repr__(self):\n return (\n self.__class__.__name__ + '(pos = %.3f, neg = %.3f)' % (\n self._posNegPrbDic['pos'], self._posNegPrbDic['neg'])\n )", "metadata": "root.DssgBinaryClassifierMajorityVote.__repr__", "header": "['class', 'DssgBinaryClassifierMajorityVote', '(', 'DssgBinaryClassifier', ')', ':', '___EOS___']", "index": 89 }, { "content": "class DssgBinaryClassifierSVC(DssgBinaryClassifier):\n\n \"\"\"\n Linear SVM binary classifier (based on LibLinear).\n \"\"\"\n\n\n\n\n\n\n pass", "metadata": "root.DssgBinaryClassifierSVC", "header": "['module', '___EOS___']", "index": 98 }, { "content": " def __init__(self, vectorizer, balance=False, C=1.0, tol=1e-3):\n self._vectorizer = vectorizer\n self._balance = balance\n self._C = C\n self._tol = tol\n\n self._classifier = None\n self._plattModel = None", "metadata": "root.DssgBinaryClassifierSVC.__init__", "header": "['class', 'DssgBinaryClassifierSVC', '(', 'DssgBinaryClassifier', ')', ':', '___EOS___']", "index": 104 }, { "content": " def train(self, messageList):\n #--- prepare variables\n vectorizer = self._vectorizer\n balance = self._balance\n C = self._C\n tol = self._tol\n\n #---\n msgList = map(lambda x: x[0], messageList)\n y = np.array(map(lambda x: 1 if x[1] == 'pos' else 0, messageList))\n X = vectorizer.fitTransform(msgList)\n\n class_weight = 'auto' if balance else None\n classifier = LinearSVC(\n C=C, loss='l2', penalty='l1', dual=False, tol=tol,\n random_state=0, class_weight=class_weight)\n\n classifier.fit(X, y)\n\n #- learn sigmoid\n yDeci = classifier.decision_function(X)\n yy = [1 if v == 1 else -1 for v in y]\n [A, B] = platt.SigmoidTrain(yDeci, yy)\n plattModel = [A, B]\n\n #- save to instance variable\n self._classifier = classifier\n self._plattModel = plattModel\n pass", "metadata": "root.DssgBinaryClassifierSVC.train", "header": "['class', 'DssgBinaryClassifierSVC', '(', 'DssgBinaryClassifier', ')', ':', '___EOS___']", "index": 113 }, { "content": " def predictScore(self, message):\n featVec = self._vectorizer.transform([message])\n df = self._classifier.decision_function(featVec)\n scoreDic = {}\n scoreDic['pos'] = df[0]\n scoreDic['neg'] = -df[0]\n return scoreDic", "metadata": "root.DssgBinaryClassifierSVC.predictScore", "header": "['class', 'DssgBinaryClassifierSVC', '(', 'DssgBinaryClassifier', ')', ':', '___EOS___']", "index": 143 }, { "content": " def predictProba(self, message):\n featVec = self._vectorizer.transform([message])\n df = self._classifier.decision_function(featVec)\n prb = platt.SigmoidPredict(df, self._plattModel)\n probaDic = {}\n probaDic['pos'] = prb\n probaDic['neg'] = 1 - prb\n return probaDic", "metadata": "root.DssgBinaryClassifierSVC.predictProba", "header": "['class', 'DssgBinaryClassifierSVC', '(', 'DssgBinaryClassifier', ')', ':', '___EOS___']", "index": 151 }, { "content": " def __repr__(self):\n return (\n self.__class__.__name__ + '(_vectorizer=%s, _classifier=%s, _balance=%s, _C=%f, _tol=%f)' % (\n self._vectorizer, self._classifier, self._balance, self._C, self._tol)\n )", "metadata": "root.DssgBinaryClassifierSVC.__repr__", "header": "['class', 'DssgBinaryClassifierSVC', '(', 'DssgBinaryClassifier', ')', ':', '___EOS___']", "index": 160 }, { "content": "class DssgBinaryClassifierLogisticRegression(DssgBinaryClassifier):\n\n \"\"\"\n Linear logistic regression binary classifier (based on LibLinear).\n \"\"\"\n\n\n\n\n\n\n pass", "metadata": "root.DssgBinaryClassifierLogisticRegression", "header": "['module', '___EOS___']", "index": 169 }, { "content": " def __init__(self, vectorizer, balance=False, C=1.0, tol=1e-3):\n self._vectorizer = vectorizer\n self._balance = balance\n self._C = C\n self._tol = tol\n\n self._classifier = None", "metadata": "root.DssgBinaryClassifierLogisticRegression.__init__", "header": "['class', 'DssgBinaryClassifierLogisticRegression', '(', 'DssgBinaryClassifier', ')', ':', '___EOS___']", "index": 175 }, { "content": " def train(self, messageList):\n #--- prepare variables\n vectorizer = self._vectorizer\n balance = self._balance\n C = self._C\n tol = self._tol\n\n msgList = map(lambda x: x[0], messageList)\n y = np.array(map(lambda x: 1 if x[1] == 'pos' else 0, messageList))\n X = vectorizer.fitTransform(msgList)\n\n class_weight = 'auto' if balance else None\n classifier = LogisticRegression(\n C=C,\n penalty=\"l2\",\n dual=False,\n tol=tol,\n random_state=0,\n class_weight=class_weight)\n\n classifier.fit(X, y)\n\n #- save to instance variable\n self._classifier = classifier\n pass", "metadata": "root.DssgBinaryClassifierLogisticRegression.train", "header": "['class', 'DssgBinaryClassifierLogisticRegression', '(', 'DssgBinaryClassifier', ')', ':', '___EOS___']", "index": 183 }, { "content": " def predictScore(self, message):\n featVec = self._vectorizer.transform([message])\n df = self._classifier.decision_function(featVec)\n scoreDic = {}\n scoreDic['pos'] = df[0]\n scoreDic['neg'] = -df[0]\n return scoreDic", "metadata": "root.DssgBinaryClassifierLogisticRegression.predictScore", "header": "['class', 'DssgBinaryClassifierLogisticRegression', '(', 'DssgBinaryClassifier', ')', ':', '___EOS___']", "index": 209 }, { "content": " def predictProba(self, message):\n featVec = self._vectorizer.transform([message])\n ret = self._classifier.predict_proba(featVec)\n probaDic = {}\n probaDic['pos'] = ret[0][1]\n probaDic['neg'] = ret[0][0]\n return probaDic", "metadata": "root.DssgBinaryClassifierLogisticRegression.predictProba", "header": "['class', 'DssgBinaryClassifierLogisticRegression', '(', 'DssgBinaryClassifier', ')', ':', '___EOS___']", "index": 217 }, { "content": " def __repr__(self):\n return (\n self.__class__.__name__ + '(_vectorizer=%s, _classifier=%s, _balance=%s, _C=%f, _tol=%f)' % (\n self._vectorizer, self._classifier, self._balance, self._C, self._tol)\n )", "metadata": "root.DssgBinaryClassifierLogisticRegression.__repr__", "header": "['class', 'DssgBinaryClassifierLogisticRegression', '(', 'DssgBinaryClassifier', ')', ':', '___EOS___']", "index": 225 }, { "content": "class DssgBinaryClassifierAdaptiveInterpolation(DssgBinaryClassifier):\n\n \"\"\"\n predicts by \"(1-alpha)*f_{global} * alpha*f_{local}\"\n It takes a trained global classifier, and untrained (initialized) local classifier,\n and then train local classifier and alpha.\n \"\"\"\n\n\n\n\n\n\n pass", "metadata": "root.DssgBinaryClassifierAdaptiveInterpolation", "header": "['module', '___EOS___']", "index": 234 }, { "content": " def __repr__(self):\n return (\n self.__class__.__name__ + '(_globalClassifier=%s, _localClassifier=%s, _alpha=%s)' % (\n self._globalClassifier, self._localClassifier, self._alpha)\n )", "metadata": "root.DssgBinaryClassifierAdaptiveInterpolation.__repr__", "header": "['class', 'DssgBinaryClassifierAdaptiveInterpolation', '(', 'DssgBinaryClassifier', ')', ':', '___EOS___']", "index": 242 }, { "content": " def __init__(self, globalClassifier, untrainedLocalClassifier):\n self._globalClassifier = globalClassifier\n self._localClassifier = untrainedLocalClassifier\n\n self._alpha = None\n self._trainLog = None\n self._plattModel = None", "metadata": "root.DssgBinaryClassifierAdaptiveInterpolation.__init__", "header": "['class', 'DssgBinaryClassifierAdaptiveInterpolation', '(', 'DssgBinaryClassifier', ')', ':', '___EOS___']", "index": 248 }, { "content": " def train(self, messageList):\n globalClassifier = self._globalClassifier\n localClassifier = self._localClassifier\n trainLog = \"\"\n nFolds = 5\n\n msgList = map(lambda x: x[0], messageList)\n y = np.array(map(lambda x: 1 if x[1] == 'pos' else 0, messageList))\n\n #--- obtain global decision function list\n globalDFList = []\n for msg in msgList:\n v = globalClassifier.predictScore(msg)\n globalDFList.append(v['pos'])\n\n tt = tic()\n #--- obtain local decision function list (by cross-prediction)\n if (sum(y) < 2):\n #--- if there are less than 2 positive data points, set alpha=0\n trainLog += \"There are less than 2 positive data points. setting maxAlpha=0\\n\"\n maxAlpha = 0\n else:\n #--- split into 5 and cross-predict decision function\n localDFList = [float('nan')] * len(messageList)\n folds = StratifiedKFold(y, nFolds)\n for trainIdx, testIdx in folds:\n train = [messageList[i] for i in trainIdx]\n test = [messageList[i] for i in testIdx]\n\n tmpClassifier = copy.deepcopy(localClassifier)\n tmpClassifier.train(train)\n\n curDFList = []\n for x in test:\n v = tmpClassifier.predictScore(x[0])\n curDFList.append(v['pos'])\n\n for i in range(len(test)):\n localDFList[testIdx[i]] = curDFList[i]\n assert(countTruth(lambda x: np.isnan(x), localDFList) == 0)\n\n #--- try many alpha's, and measure F1\n f1List = []\n alphaList = np.linspace(0.0, 1.0, 101)\n for alpha in alphaList:\n combinedDFList = [(1 - alpha) * globalDFList[i] + alpha * localDFList[i]\n for i in range(len(globalDFList))]\n predy = [1 if v >= 0.0 else 0 for v in combinedDFList]\n #- measure F1\n f1 = metrics.f1_score(y, predy)\n f1List.append(f1)\n\n #--- pick alpha that maximizes F1\n trainLog += \"Finding alpha maximizing F1...\\n\"\n maxF1 = np.max(f1List)\n maxIdx = np.where(np.array(f1List) == maxF1)\n maxIdx = maxIdx[0]\n assert(len(maxIdx) != 0)\n candidateMaxAlpha = [alphaList[i] for i in maxIdx]\n maxAlpha = np.median(candidateMaxAlpha)\n\n trainLog += \"max(f1List) = %.3f\\n\" % maxF1\n trainLog += \"argmax_alpha = \\n%s\\n\" % str(\n np.array([alphaList[i] for i in maxIdx]))\n trainLog += \"chosen alpha by median = %.3f\\n\" % maxAlpha\n\n #--- train local classifier using all data\n localClassifier.train(binaryLabeledMessageList)\n\n elapsed = toc(tt)\n trainLog += \"Time taken for training: %.3f (sec)\\n\" % elapsed\n\n self._localClassifier = localClassifier\n self._alpha = maxAlpha\n self._trainLog = trainLog\n\n #--- learn sigmoid\n yDeci = [self.predictScore(msg)['pos'] for msg in messageList]\n yy = [1 if v == 1 else -1 for v in y]\n [A, B] = platt.SigmoidTrain(yDeci, yy)\n plattModel = [A, B]\n\n self._plattModel = plattModel\n pass", "metadata": "root.DssgBinaryClassifierAdaptiveInterpolation.train", "header": "['class', 'DssgBinaryClassifierAdaptiveInterpolation', '(', 'DssgBinaryClassifier', ')', ':', '___EOS___']", "index": 256 }, { "content": " def predictScore(self, message):\n if (self._localClassifier is None):\n return self._globalClassifier.predictScore(message)\n else:\n #--- compute interpolated decision value\n globalDecisionFunction = self._globalClassifier.predictScore(\n message)['pos']\n localDecisionFunction = self._localClassifier.predictScore(\n message)['pos']\n df = (1 - self._alpha) * globalDecisionFunction + \\\n self._alpha * localDecisionFunction\n\n #--- return dictionary of score\n scoreDic = {}\n scoreDic['pos'] = df\n scoreDic['neg'] = -df\n return scoreDic", "metadata": "root.DssgBinaryClassifierAdaptiveInterpolation.predictScore", "header": "['class', 'DssgBinaryClassifierAdaptiveInterpolation', '(', 'DssgBinaryClassifier', ')', ':', '___EOS___']", "index": 341 }, { "content": " def predictProb(self, message):\n if (self._localClassifier is None):\n return self._globalClassifier.predictProba(message)\n else:\n #--- compute interpolated decision value\n globalDecisionFunction = self._globalClassifier.predictScore(\n message)['pos']\n localDecisionFunction = self._localClassifier.predictScore(\n message)['pos']\n df = (1 - self._alpha) * globalDecisionFunction + \\\n self._alpha * localDecisionFunction\n prb = platt.SigmoidPredict(df, self._plattModel)\n probaDic = {}\n probaDic['pos'] = prb\n probaDic['neg'] = 1 - prb\n return probaDic", "metadata": "root.DssgBinaryClassifierAdaptiveInterpolation.predictProb", "header": "['class', 'DssgBinaryClassifierAdaptiveInterpolation', '(', 'DssgBinaryClassifier', ')', ':', '___EOS___']", "index": 359 }, { "content": "class DssgBinaryClassifierAdaptiveSVC(DssgBinaryClassifier):\n\n \"\"\"\n predicts by a training SVM on feature vector like [f_{global}, f_{local}]\n \"\"\"\n\n\n\n\n\n\n pass", "metadata": "root.DssgBinaryClassifierAdaptiveSVC", "header": "['module', '___EOS___']", "index": 379 }, { "content": " def __repr__(self):\n return (\n self.__class__.__name__ + '(_globalClassifier=%s, _localClassifier=%s, _metaClassifier=%s, _alpha=%s)' % (\n self._globalClassifier, self._localClassifier, self._metaClassifier, self._alpha)\n )", "metadata": "root.DssgBinaryClassifierAdaptiveSVC.__repr__", "header": "['class', 'DssgBinaryClassifierAdaptiveSVC', '(', 'DssgBinaryClassifier', ')', ':', '___EOS___']", "index": 385 }, { "content": " def __init__(self, globalClassifier, untrainedLocalClassifier):\n self._globalClassifier = globalClassifier\n self._localClassifier = untrainedLocalClassifier\n\n self._metaClassifier = None\n self._trainLog = None\n self._plattModel = None", "metadata": "root.DssgBinaryClassifierAdaptiveSVC.__init__", "header": "['class', 'DssgBinaryClassifierAdaptiveSVC', '(', 'DssgBinaryClassifier', ')', ':', '___EOS___']", "index": 391 }, { "content": " def train(self, binaryLabeledMessageList):\n globalClassifier = self._globalClassifier\n localClassifier = self._localClassifier\n\n trainLog = \"\"\n nFolds = 5\n\n msgList = map(lambda x: x[0], binaryLabeledMessageList)\n y = np.array(\n map(lambda x: 1 if x[1] == 'pos' else 0,\n binaryLabeledMessageList))\n\n #--- obtain global decision function list\n globalDFList = []\n for msg in msgList:\n v = globalClassifier.predictScore(msg)\n globalDFList.append(v['pos'])\n\n tt = tic()\n #--- obtain local decision function list (by cross-prediction)\n metaClassifier = None\n if (sum(y) < 2):\n #--- if there are less than 2 positive data points, set alpha=0\n trainLog += \"There are less than 2 positive data points. using globalClassifier as the classifier\\n\"\n localClassifier = None\n else:\n #--- split into 5 and cross-predict decision function\n localDFList = [float('nan')] * len(binaryLabeledMessageList)\n folds = StratifiedKFold(y, nFolds)\n for trainIdx, testIdx in folds:\n train = [binaryLabeledMessageList[i] for i in trainIdx]\n test = [binaryLabeledMessageList[i] for i in testIdx]\n\n tmpClassifier = copy.deepcopy(localClassifier)\n tmpClassifier.train(train)\n\n curDFList = []\n for x in test:\n v = tmpClassifier.predictScore(x[0])\n curDFList.append(v['pos'])\n\n for i in range(len(test)):\n localDFList[testIdx[i]] = curDFList[i]\n assert(countTruth(lambda x: np.isnan(x), localDFList) == 0)\n\n #--- train SVC!!\n #- prepare X\n X = np.hstack(\n [np.matrix(globalDFList).T,\n np.matrix(localDFList).T])\n metaClassifier = LinearSVC(\n loss='l2', penalty='l1', dual=False, tol=1e-6,\n random_state=0)\n metaClassifier.fit(X, y)\n trainLog += \"Trained a meta classifier:\\n\"\n coef = metaClassifier.coef_[0]\n trainLog += \" coef for (global, local): (%.6f, %.6f)\\n\" % (\n coef[0], coef[1])\n trainLog += \" intercept: %.6f\\n\" % (metaClassifier.intercept_)\n\n #--- train local classifier using all data\n localClassifier.train(binaryLabeledMessageList)\n trainLog += \"Trained a meta classifier\"\n\n elapsed = toc(tt)\n trainLog += \"Time taken for training: %.3f (sec)\\n\" % elapsed\n\n self._metaClassifier = metaClassifier\n self._trainLog = trainLog\n\n #--- learn sigmoid\n yDeci = [self.predictScore(msg)['pos']\n for msg in binaryLabeledMessageList]\n yy = [1 if v == 1 else -1 for v in y]\n [A, B] = platt.SigmoidTrain(yDeci, yy)\n plattModel = [A, B]\n\n self._plattModel = plattModel\n pass", "metadata": "root.DssgBinaryClassifierAdaptiveSVC.train", "header": "['class', 'DssgBinaryClassifierAdaptiveSVC', '(', 'DssgBinaryClassifier', ')', ':', '___EOS___']", "index": 399 }, { "content": " def predictScore(self, message):\n #--- if localClassifier is None, dont use it!!\n if (self._localClassifier is None):\n return self._globalClassifier.predictScore(message)\n else:\n #--- compute feature vector\n globalDecisionFunction = self._globalClassifier.predictScore(\n message)['pos']\n localDecisionFunction = self._localClassifier.predictScore(\n message)['pos']\n testX = np.matrix([globalDecisionFunction, localDecisionFunction])\n df = self._metaClassifier.decision_function(testX)\n\n #--- return dictionary of score\n scoreDic = {}\n scoreDic['pos'] = df\n scoreDic['neg'] = -df\n return scoreDic", "metadata": "root.DssgBinaryClassifierAdaptiveSVC.predictScore", "header": "['class', 'DssgBinaryClassifierAdaptiveSVC', '(', 'DssgBinaryClassifier', ')', ':', '___EOS___']", "index": 479 }, { "content": " def predictProb(self, message):\n if (self._localClassifier is None):\n return self._globalClassifier.predictProba(message)\n else:\n #--- compute interpolated decision value\n globalDecisionFunction = self._globalClassifier.predictScore(\n message)['pos']\n localDecisionFunction = self._localClassifier.predictScore(\n message)['pos']\n testX = np.matrix([globalDecisionFunction, localDecisionFunction])\n df = self._metaClassifier.decision_function(testX)\n\n prb = platt.SigmoidPredict(df, self._plattModel)\n probaDic = {}\n probaDic['pos'] = prb\n probaDic['neg'] = 1 - prb\n return probaDic", "metadata": "root.DssgBinaryClassifierAdaptiveSVC.predictProb", "header": "['class', 'DssgBinaryClassifierAdaptiveSVC', '(', 'DssgBinaryClassifier', ')', ':', '___EOS___']", "index": 498 } ]
[ { "span": "def train(self, binaryLabeledMessageList):", "start_line": 63, "start_column": 4, "end_line": 63, "end_column": 46 }, { "span": "def train(self, messageList):", "start_line": 113, "start_column": 4, "end_line": 113, "end_column": 33 }, { "span": "def train(self, messageList):", "start_line": 183, "start_column": 4, "end_line": 183, "end_column": 33 }, { "span": "def train(self, messageList):", "start_line": 256, "start_column": 4, "end_line": 256, "end_column": 33 }, { "span": "def train(self, binaryLabeledMessageList):", "start_line": 399, "start_column": 4, "end_line": 399, "end_column": 46 } ]
[ { "span": "def train(binaryLabeledMessageList):", "start_line": 36, "start_column": 4, "end_line": 36, "end_column": 40 } ]
1
false
[ "[CLS]_", "Signature_", "mismatch_", "in_", "overrid", "ing_", "method_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Ds", "sg", "Bin", "ary", "Classifier_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Thi", "s", " ", "is", " ", "mean", "t", " ", "to", " ", "be", " ", "an", " ", "abstract", " ", "class", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classifier_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classifier_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "train_", "(_", "binar", "y", "Label", "ed", "Messag", "e", "List_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "labels", " ", "shou", "ld", " ", "be", " ", "'", "pos", "'/'", "neg", "'", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classifier_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "predi", "ct", "Score_", "(_", "self_", ",_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "return", "s", " ", "a", " ", "score", " ", "dictionar", "y", " ", "tha", "t", " ", "look", "s", " ", "like", ":", " ", "{", "\"", "pos", "\":", ".2", ",", " ", "\"", "neg", "\":", "-.", "2", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classifier_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "predi", "ct", "Prob", "a_", "(_", "self_", ",_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "return", "s", " ", "a", " ", "score", " ", "dictionar", "y", " ", "tha", "t", " ", "look", "s", " ", "like", ":", " ", "{", "\"", "pos", "\":", "0.", "8", ",", " ", "\"", "neg", "\":", "0.", "2", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "Maj", "ori", "ty", "Vote", "_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Maj", "ori", "ty", " ", "vote", " ", "classif", "ier", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "Maj", "ori", "ty", "Vote", "_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "pos", "Ne", "g", "Pr", "b", "Dic_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "Maj", "ori", "ty", "Vote", "_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "train_", "(_", "self_", ",_", "binar", "y", "Label", "ed", "Messag", "e", "List_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n", "Pos_", "=_", "count", "Tru", "th_", "(_", "lambda_", "x_", ":_", "x_", "[_", "1_", "]_", "==_", "'", "pos", "'_", ",_", "binar", "y", "Label", "ed", "Messag", "e", "List_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n", "Ne", "g_", "=_", "count", "Tru", "th_", "(_", "lambda_", "x_", ":_", "x_", "[_", "1_", "]_", "==_", "'", "neg", "'_", ",_", "binar", "y", "Label", "ed", "Messag", "e", "List_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "n", "Pos_", "+_", "n", "Ne", "g_", "==_", "len_", "(_", "binar", "y", "Label", "ed", "Messag", "e", "List_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos", "Ne", "g", "Pr", "b", "Dic_", "=_", "{_", "'", "pos", "'_", ":_", "float_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "n", "Pos_", ")_", "/_", "(_", "n", "Pos_", "+_", "n", "Ne", "g_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "neg", "'_", ":_", "float_", "(_", "n", "Ne", "g_", ")_", "/_", "(_", "n", "Pos_", "+_", "n", "Ne", "g_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "pos", "Ne", "g", "Pr", "b", "Dic_", "=_", "pos", "Ne", "g", "Pr", "b", "Dic_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "Maj", "ori", "ty", "Vote", "_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "predi", "ct", "Score_", "(_", "self_", ",_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "turns", " ", "probabilit", "y", " ", "int", "o", " ", "score", " ", "in", " ", "range", " ", "[-", ".5", ",", " ", "5", "]", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "score", "Dic_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "score", "Dic_", "[_", "'", "pos", "'_", "]_", "=_", "(_", "self_", "._", "\\u", "pos", "Ne", "g", "Pr", "b", "Dic_", "[_", "'", "pos", "'_", "]_", "-_", ".5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "score", "Dic_", "[_", "'", "neg", "'_", "]_", "=_", "(_", "self_", "._", "\\u", "pos", "Ne", "g", "Pr", "b", "Dic_", "[_", "'", "neg", "'_", "]_", "-_", ".5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "pos", "Ne", "g", "Pr", "b", "Dic_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "Maj", "ori", "ty", "Vote", "_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "predi", "ct", "Prob", "a_", "(_", "self_", ",_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "return", "s", " ", "probabilit", "y", " ", "estimate", " ", "for", " ", "each", " ", "class", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "pos", "Ne", "g", "Pr", "b", "Dic_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "Maj", "ori", "ty", "Vote", "_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "+_", "'(", "pos", " ", "=", " ", "%", ".3", "f", ",", " ", "neg", " ", "=", " ", "%", ".3", "f", ")'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "pos", "Ne", "g", "Pr", "b", "Dic_", "[_", "'", "pos", "'_", "]_", ",_", "self_", "._", "\\u", "pos", "Ne", "g", "Pr", "b", "Dic_", "[_", "'", "neg", "'_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "SVC_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Linea", "r", " ", "SV", "M", " ", "binar", "y", " ", "classif", "ier", " ", "(", "based", " ", "on", " ", "Lib", "Linea", "r", ").", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "SVC_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "vectorizer", "_", ",_", "balance_", "=_", "False_", ",_", "C_", "=_", "1.0_", ",_", "tol_", "=_", "1e-3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "vectorizer", "_", "=_", "vectorizer", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "balance_", "=_", "balance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "C_", "=_", "C_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "tol_", "=_", "tol_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "classifier_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "plat", "t", "Model_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "SVC_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "train_", "(_", "self_", ",_", "message", "List_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#-", "--", " ", "prepar", "e", " ", "variables_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vectorizer", "_", "=_", "self_", "._", "\\u", "vectorizer", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "balance_", "=_", "self_", "._", "\\u", "balance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "C_", "=_", "self_", "._", "\\u", "C_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tol_", "=_", "self_", "._", "\\u", "tol_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--", "_", "\\u\\u\\uNL\\u\\u\\u_", "msg", "List_", "=_", "map_", "(_", "lambda_", "x_", ":_", "x_", "[_", "0_", "]_", ",_", "message", "List_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "np_", "._", "array_", "(_", "map_", "(_", "lambda_", "x_", ":_", "1_", "if_", "x_", "[_", "1_", "]_", "==_", "'", "pos", "'_", "else_", "0_", ",_", "message", "List_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X_", "=_", "vectorizer", "_", "._", "fit", "Transform_", "(_", "msg", "List_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class", "\\u", "weight_", "=_", "'", "auto", "'_", "if_", "balance_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "classifier_", "=_", "Linea", "r", "SVC_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "C_", "=_", "C_", ",_", "loss_", "=_", "'", "l2", "'_", ",_", "penalty_", "=_", "'", "l1", "'_", ",_", "dual", "_", "=_", "False_", ",_", "tol_", "=_", "tol_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "random", "\\u", "state_", "=_", "0_", ",_", "class", "\\u", "weight_", "=_", "class", "\\u", "weight_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "classifier_", "._", "fit_", "(_", "X_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", " ", "learn", " ", "sigmoid_", "\\u\\u\\uNL\\u\\u\\u_", "y", "Deci", "_", "=_", "classifier_", "._", "decision", "\\u", "function_", "(_", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yy_", "=_", "[_", "1_", "if_", "v_", "==_", "1_", "else_", "-_", "1_", "for_", "v_", "in_", "y_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[_", "A_", ",_", "B_", "]_", "=_", "plat", "t_", "._", "Sigm", "oid", "Train_", "(_", "y", "Deci", "_", ",_", "yy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plat", "t", "Model_", "=_", "[_", "A_", ",_", "B_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", " ", "save", " ", "to", " ", "instance", " ", "variable_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "classifier_", "=_", "classifier_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "plat", "t", "Model_", "=_", "plat", "t", "Model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "SVC_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "predi", "ct", "Score_", "(_", "self_", ",_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "feat", "Vec_", "=_", "self_", "._", "\\u", "vectorizer", "_", "._", "transform_", "(_", "[_", "message_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "df_", "=_", "self_", "._", "\\u", "classifier_", "._", "decision", "\\u", "function_", "(_", "feat", "Vec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "score", "Dic_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "score", "Dic_", "[_", "'", "pos", "'_", "]_", "=_", "df_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "score", "Dic_", "[_", "'", "neg", "'_", "]_", "=_", "-_", "df_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "score", "Dic_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "SVC_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "predi", "ct", "Prob", "a_", "(_", "self_", ",_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "feat", "Vec_", "=_", "self_", "._", "\\u", "vectorizer", "_", "._", "transform_", "(_", "[_", "message_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "df_", "=_", "self_", "._", "\\u", "classifier_", "._", "decision", "\\u", "function_", "(_", "feat", "Vec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pr", "b_", "=_", "plat", "t_", "._", "Sigm", "oid", "Predic", "t_", "(_", "df_", ",_", "self_", "._", "\\u", "plat", "t", "Model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "proba", "Dic_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "proba", "Dic_", "[_", "'", "pos", "'_", "]_", "=_", "pr", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "proba", "Dic_", "[_", "'", "neg", "'_", "]_", "=_", "1_", "-_", "pr", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "proba", "Dic_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "SVC_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "+_", "'(", "\\u", "vectorizer", "=", "%", "s", ",", " ", "\\u", "classif", "ier", "=", "%", "s", ",", " ", "\\u", "balance", "=", "%", "s", ",", " ", "\\u", "C", "=", "%", "f", ",", " ", "\\u", "tol", "=", "%", "f", ")'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "vectorizer", "_", ",_", "self_", "._", "\\u", "classifier_", ",_", "self_", "._", "\\u", "balance_", ",_", "self_", "._", "\\u", "C_", ",_", "self_", "._", "\\u", "tol_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "Logi", "stic", "Regression_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Linea", "r", " ", "logistic", " ", "regress", "ion", " ", "binar", "y", " ", "classif", "ier", " ", "(", "based", " ", "on", " ", "Lib", "Linea", "r", ").", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "Logi", "stic", "Regression_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "vectorizer", "_", ",_", "balance_", "=_", "False_", ",_", "C_", "=_", "1.0_", ",_", "tol_", "=_", "1e-3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "vectorizer", "_", "=_", "vectorizer", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "balance_", "=_", "balance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "C_", "=_", "C_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "tol_", "=_", "tol_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "classifier_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "Logi", "stic", "Regression_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "train_", "(_", "self_", ",_", "message", "List_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#-", "--", " ", "prepar", "e", " ", "variables_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vectorizer", "_", "=_", "self_", "._", "\\u", "vectorizer", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "balance_", "=_", "self_", "._", "\\u", "balance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "C_", "=_", "self_", "._", "\\u", "C_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tol_", "=_", "self_", "._", "\\u", "tol_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "msg", "List_", "=_", "map_", "(_", "lambda_", "x_", ":_", "x_", "[_", "0_", "]_", ",_", "message", "List_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "np_", "._", "array_", "(_", "map_", "(_", "lambda_", "x_", ":_", "1_", "if_", "x_", "[_", "1_", "]_", "==_", "'", "pos", "'_", "else_", "0_", ",_", "message", "List_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X_", "=_", "vectorizer", "_", "._", "fit", "Transform_", "(_", "msg", "List_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class", "\\u", "weight_", "=_", "'", "auto", "'_", "if_", "balance_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "classifier_", "=_", "Logi", "stic", "Regression_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "C_", "=_", "C_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "penalty_", "=_", "\"", "l2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dual", "_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "tol_", "=_", "tol_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "random", "\\u", "state_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "class", "\\u", "weight_", "=_", "class", "\\u", "weight_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "classifier_", "._", "fit_", "(_", "X_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", " ", "save", " ", "to", " ", "instance", " ", "variable_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "classifier_", "=_", "classifier_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "Logi", "stic", "Regression_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "predi", "ct", "Score_", "(_", "self_", ",_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "feat", "Vec_", "=_", "self_", "._", "\\u", "vectorizer", "_", "._", "transform_", "(_", "[_", "message_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "df_", "=_", "self_", "._", "\\u", "classifier_", "._", "decision", "\\u", "function_", "(_", "feat", "Vec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "score", "Dic_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "score", "Dic_", "[_", "'", "pos", "'_", "]_", "=_", "df_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "score", "Dic_", "[_", "'", "neg", "'_", "]_", "=_", "-_", "df_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "score", "Dic_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "Logi", "stic", "Regression_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "predi", "ct", "Prob", "a_", "(_", "self_", ",_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "feat", "Vec_", "=_", "self_", "._", "\\u", "vectorizer", "_", "._", "transform_", "(_", "[_", "message_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "\\u", "classifier_", "._", "predi", "ct", "\\u", "proba_", "(_", "feat", "Vec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "proba", "Dic_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "proba", "Dic_", "[_", "'", "pos", "'_", "]_", "=_", "ret_", "[_", "0_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "proba", "Dic_", "[_", "'", "neg", "'_", "]_", "=_", "ret_", "[_", "0_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "proba", "Dic_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "Logi", "stic", "Regression_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "+_", "'(", "\\u", "vectorizer", "=", "%", "s", ",", " ", "\\u", "classif", "ier", "=", "%", "s", ",", " ", "\\u", "balance", "=", "%", "s", ",", " ", "\\u", "C", "=", "%", "f", ",", " ", "\\u", "tol", "=", "%", "f", ")'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "vectorizer", "_", ",_", "self_", "._", "\\u", "classifier_", ",_", "self_", "._", "\\u", "balance_", ",_", "self_", "._", "\\u", "C_", ",_", "self_", "._", "\\u", "tol_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "Adapti", "ve", "Interpolation", "_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "predi", "ct", "s", " ", "by", " ", "\"(", "1", "-", "alpha", ")*", "f", "\\u{", "global", "}", " ", "*", " ", "alpha", "*", "f", "\\u{", "local", "}\"", "\\", "10", ";", " ", " ", " ", " ", "It", " ", "take", "s", " ", "a", " ", "trained", " ", "global", " ", "classif", "ier", ",", " ", "and", " ", "untr", "aine", "d", " ", "(", "initialize", "d", ")", " ", "local", " ", "classif", "ier", ",", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "then", " ", "train", " ", "local", " ", "classif", "ier", " ", "and", " ", "alpha", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "Adapti", "ve", "Interpolation", "_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "+_", "'(", "\\u", "global", "Classif", "ier", "=", "%", "s", ",", " ", "\\u", "local", "Classif", "ier", "=", "%", "s", ",", " ", "\\u", "alpha", "=", "%", "s", ")'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "global", "Classifier_", ",_", "self_", "._", "\\u", "local", "Classifier_", ",_", "self_", "._", "\\u", "alpha_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "Adapti", "ve", "Interpolation", "_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "global", "Classifier_", ",_", "untr", "aine", "d", "Local", "Classifier_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "global", "Classifier_", "=_", "global", "Classifier_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "local", "Classifier_", "=_", "untr", "aine", "d", "Local", "Classifier_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "alpha_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "train", "Log_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "plat", "t", "Model_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "Adapti", "ve", "Interpolation", "_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "train_", "(_", "self_", ",_", "message", "List_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global", "Classifier_", "=_", "self_", "._", "\\u", "global", "Classifier_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "local", "Classifier_", "=_", "self_", "._", "\\u", "local", "Classifier_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "Log_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n", "Fold", "s_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "msg", "List_", "=_", "map_", "(_", "lambda_", "x_", ":_", "x_", "[_", "0_", "]_", ",_", "message", "List_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "np_", "._", "array_", "(_", "map_", "(_", "lambda_", "x_", ":_", "1_", "if_", "x_", "[_", "1_", "]_", "==_", "'", "pos", "'_", "else_", "0_", ",_", "message", "List_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--", " ", "obtain", " ", "global", " ", "decision", " ", "function", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "global", "DF", "List_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "msg_", "in_", "msg", "List_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "global", "Classifier_", "._", "predi", "ct", "Score_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "global", "DF", "List_", "._", "append_", "(_", "v_", "[_", "'", "pos", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tt_", "=_", "tic_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#-", "--", " ", "obtain", " ", "local", " ", "decision", " ", "function", " ", "list", " ", "(", "by", " ", "cross", "-", "predicti", "on", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "sum_", "(_", "y_", ")_", "<_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#-", "--", " ", "if", " ", "there", " ", "are", " ", "less", " ", "than", " ", "2", " ", "posit", "ive", " ", "data", " ", "points", ",", " ", "set", " ", "alpha", "=", "0_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "train", "Log_", "+=_", "\"", "There", " ", "are", " ", "less", " ", "than", " ", "2", " ", "posit", "ive", " ", "data", " ", "points", ".", " ", "setti", "ng", " ", "max", "Al", "pha", "=", "0", "\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "Alpha_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#-", "--", " ", "split", " ", "int", "o", " ", "5", " ", "and", " ", "cross", "-", "predi", "ct", " ", "decision", " ", "function_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "local", "DF", "List_", "=_", "[_", "float_", "(_", "'", "nan", "'_", ")_", "]_", "*_", "len_", "(_", "message", "List_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "folds_", "=_", "Strat", "ified", "KF", "old_", "(_", "y_", ",_", "n", "Fold", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "train", "Idx_", ",_", "test", "Idx_", "in_", "folds_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "train_", "=_", "[_", "message", "List_", "[_", "i_", "]_", "for_", "i_", "in_", "train", "Idx_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test_", "=_", "[_", "message", "List_", "[_", "i_", "]_", "for_", "i_", "in_", "test", "Idx_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tmp", "Classifier_", "=_", "copy_", "._", "deepcopy_", "(_", "local", "Classifier_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "Classifier_", "._", "train_", "(_", "train_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cur", "DF", "List_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "test_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "v_", "=_", "tmp", "Classifier_", "._", "predi", "ct", "Score_", "(_", "x_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur", "DF", "List_", "._", "append_", "(_", "v_", "[_", "'", "pos", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "test_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "local", "DF", "List_", "[_", "test", "Idx_", "[_", "i_", "]_", "]_", "=_", "cur", "DF", "List_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "(_", "count", "Tru", "th_", "(_", "lambda_", "x_", ":_", "np_", "._", "isnan_", "(_", "x_", ")_", ",_", "local", "DF", "List_", ")_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--", " ", "try", " ", "many", " ", "alpha", "'", "s", ",", " ", "and", " ", "measure", " ", "F1_", "\\u\\u\\uNL\\u\\u\\u_", "f1", "List_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "alpha", "List_", "=_", "np_", "._", "linspace_", "(_", "0.0_", ",_", "1.0_", ",_", "101_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "alpha_", "in_", "alpha", "List_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "combin", "ed", "DF", "List_", "=_", "[_", "(_", "1_", "-_", "alpha_", ")_", "*_", "global", "DF", "List_", "[_", "i_", "]_", "+_", "alpha_", "*_", "local", "DF", "List_", "[_", "i_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "global", "DF", "List_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pred", "y_", "=_", "[_", "1_", "if_", "v_", ">=_", "0.0_", "else_", "0_", "for_", "v_", "in_", "combin", "ed", "DF", "List_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#-", " ", "measure", " ", "F1_", "\\u\\u\\uNL\\u\\u\\u_", "f1_", "=_", "metrics_", "._", "f1", "\\u", "score_", "(_", "y_", ",_", "pred", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f1", "List_", "._", "append_", "(_", "f1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--", " ", "pick", " ", "alpha", " ", "tha", "t", " ", "maximize", "s", " ", "F1_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "train", "Log_", "+=_", "\"", "Finding", " ", "alpha", " ", "maxim", "izi", "ng", " ", "F1", "...", "\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "F1_", "=_", "np_", "._", "max_", "(_", "f1", "List_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "Idx_", "=_", "np_", "._", "where_", "(_", "np_", "._", "array_", "(_", "f1", "List_", ")_", "==_", "max", "F1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "Idx_", "=_", "max", "Idx_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "len_", "(_", "max", "Idx_", ")_", "!=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "candidate", "Max", "Alpha_", "=_", "[_", "alpha", "List_", "[_", "i_", "]_", "for_", "i_", "in_", "max", "Idx_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "Alpha_", "=_", "np_", "._", "median_", "(_", "candidate", "Max", "Alpha_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "train", "Log_", "+=_", "\"", "max", "(", "f1", "List", ")", " ", "=", " ", "%", ".3", "f", "\\\\", "n", "\"_", "%_", "max", "F1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "Log_", "+=_", "\"", "argm", "ax", "\\u", "alpha", " ", "=", " ", "\\\\", "n", "%", "s", "\\\\", "n", "\"_", "%_", "str_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "np_", "._", "array_", "(_", "[_", "alpha", "List_", "[_", "i_", "]_", "for_", "i_", "in_", "max", "Idx_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "Log_", "+=_", "\"", "chosen", " ", "alpha", " ", "by", " ", "median", " ", "=", " ", "%", ".3", "f", "\\\\", "n", "\"_", "%_", "max", "Alpha_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--", " ", "train", " ", "local", " ", "classif", "ier", " ", "usi", "ng", " ", "all", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "local", "Classifier_", "._", "train_", "(_", "binar", "y", "Label", "ed", "Messag", "e", "List_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elapsed_", "=_", "toc_", "(_", "tt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "Log_", "+=_", "\"", "Time", " ", "take", "n", " ", "for", " ", "train", "ing", ":", " ", "%", ".3", "f", " ", "(", "sec", ")\\\\", "n", "\"_", "%_", "elapsed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "local", "Classifier_", "=_", "local", "Classifier_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "alpha_", "=_", "max", "Alpha_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "train", "Log_", "=_", "train", "Log_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--", " ", "learn", " ", "sigmoid_", "\\u\\u\\uNL\\u\\u\\u_", "y", "Deci", "_", "=_", "[_", "self_", "._", "predi", "ct", "Score_", "(_", "msg_", ")_", "[_", "'", "pos", "'_", "]_", "for_", "msg_", "in_", "message", "List_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yy_", "=_", "[_", "1_", "if_", "v_", "==_", "1_", "else_", "-_", "1_", "for_", "v_", "in_", "y_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[_", "A_", ",_", "B_", "]_", "=_", "plat", "t_", "._", "Sigm", "oid", "Train_", "(_", "y", "Deci", "_", ",_", "yy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plat", "t", "Model_", "=_", "[_", "A_", ",_", "B_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "plat", "t", "Model_", "=_", "plat", "t", "Model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "Adapti", "ve", "Interpolation", "_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "predi", "ct", "Score_", "(_", "self_", ",_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "self_", "._", "\\u", "local", "Classifier_", "is_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "global", "Classifier_", "._", "predi", "ct", "Score_", "(_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#-", "--", " ", "compute", " ", "interpolated", " ", "decision", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global", "Deci", "sion", "Function_", "=_", "self_", "._", "\\u", "global", "Classifier_", "._", "predi", "ct", "Score_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "message_", ")_", "[_", "'", "pos", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "local", "Deci", "sion", "Function_", "=_", "self_", "._", "\\u", "local", "Classifier_", "._", "predi", "ct", "Score_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "message_", ")_", "[_", "'", "pos", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "df_", "=_", "(_", "1_", "-_", "self_", "._", "\\u", "alpha_", ")_", "*_", "global", "Deci", "sion", "Function_", "+_", "self_", "._", "\\u", "alpha_", "*_", "local", "Deci", "sion", "Function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--", " ", "return", " ", "dictionar", "y", " ", "of", " ", "score_", "\\u\\u\\uNL\\u\\u\\u_", "score", "Dic_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "score", "Dic_", "[_", "'", "pos", "'_", "]_", "=_", "df_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "score", "Dic_", "[_", "'", "neg", "'_", "]_", "=_", "-_", "df_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "score", "Dic_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "Adapti", "ve", "Interpolation", "_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "predi", "ct", "Prob_", "(_", "self_", ",_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "self_", "._", "\\u", "local", "Classifier_", "is_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "global", "Classifier_", "._", "predi", "ct", "Prob", "a_", "(_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#-", "--", " ", "compute", " ", "interpolated", " ", "decision", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global", "Deci", "sion", "Function_", "=_", "self_", "._", "\\u", "global", "Classifier_", "._", "predi", "ct", "Score_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "message_", ")_", "[_", "'", "pos", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "local", "Deci", "sion", "Function_", "=_", "self_", "._", "\\u", "local", "Classifier_", "._", "predi", "ct", "Score_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "message_", ")_", "[_", "'", "pos", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "df_", "=_", "(_", "1_", "-_", "self_", "._", "\\u", "alpha_", ")_", "*_", "global", "Deci", "sion", "Function_", "+_", "self_", "._", "\\u", "alpha_", "*_", "local", "Deci", "sion", "Function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pr", "b_", "=_", "plat", "t_", "._", "Sigm", "oid", "Predic", "t_", "(_", "df_", ",_", "self_", "._", "\\u", "plat", "t", "Model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "proba", "Dic_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "proba", "Dic_", "[_", "'", "pos", "'_", "]_", "=_", "pr", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "proba", "Dic_", "[_", "'", "neg", "'_", "]_", "=_", "1_", "-_", "pr", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "proba", "Dic_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "Adapti", "ve", "SVC_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "predi", "ct", "s", " ", "by", " ", "a", " ", "train", "ing", " ", "SV", "M", " ", "on", " ", "feature", " ", "vector", " ", "like", " ", "[", "f", "\\u{", "global", "},", " ", "f", "\\u{", "local", "}]", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "Adapti", "ve", "SVC_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "+_", "'(", "\\u", "global", "Classif", "ier", "=", "%", "s", ",", " ", "\\u", "local", "Classif", "ier", "=", "%", "s", ",", " ", "\\u", "meta", "Classif", "ier", "=", "%", "s", ",", " ", "\\u", "alpha", "=", "%", "s", ")'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "global", "Classifier_", ",_", "self_", "._", "\\u", "local", "Classifier_", ",_", "self_", "._", "\\u", "meta", "Classifier_", ",_", "self_", "._", "\\u", "alpha_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "Adapti", "ve", "SVC_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "global", "Classifier_", ",_", "untr", "aine", "d", "Local", "Classifier_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "global", "Classifier_", "=_", "global", "Classifier_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "local", "Classifier_", "=_", "untr", "aine", "d", "Local", "Classifier_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "meta", "Classifier_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "train", "Log_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "plat", "t", "Model_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "Adapti", "ve", "SVC_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "train_", "(_", "self_", ",_", "binar", "y", "Label", "ed", "Messag", "e", "List_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global", "Classifier_", "=_", "self_", "._", "\\u", "global", "Classifier_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "local", "Classifier_", "=_", "self_", "._", "\\u", "local", "Classifier_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "train", "Log_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n", "Fold", "s_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "msg", "List_", "=_", "map_", "(_", "lambda_", "x_", ":_", "x_", "[_", "0_", "]_", ",_", "binar", "y", "Label", "ed", "Messag", "e", "List_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "np_", "._", "array_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "map_", "(_", "lambda_", "x_", ":_", "1_", "if_", "x_", "[_", "1_", "]_", "==_", "'", "pos", "'_", "else_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "binar", "y", "Label", "ed", "Messag", "e", "List_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--", " ", "obtain", " ", "global", " ", "decision", " ", "function", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "global", "DF", "List_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "msg_", "in_", "msg", "List_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "global", "Classifier_", "._", "predi", "ct", "Score_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "global", "DF", "List_", "._", "append_", "(_", "v_", "[_", "'", "pos", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tt_", "=_", "tic_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#-", "--", " ", "obtain", " ", "local", " ", "decision", " ", "function", " ", "list", " ", "(", "by", " ", "cross", "-", "predicti", "on", ")_", "\\u\\u\\uNL\\u\\u\\u_", "meta", "Classifier_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "sum_", "(_", "y_", ")_", "<_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#-", "--", " ", "if", " ", "there", " ", "are", " ", "less", " ", "than", " ", "2", " ", "posit", "ive", " ", "data", " ", "points", ",", " ", "set", " ", "alpha", "=", "0_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "train", "Log_", "+=_", "\"", "There", " ", "are", " ", "less", " ", "than", " ", "2", " ", "posit", "ive", " ", "data", " ", "points", ".", " ", "usi", "ng", " ", "global", "Classif", "ier", " ", "as", " ", "the", " ", "classif", "ier", "\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "local", "Classifier_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#-", "--", " ", "split", " ", "int", "o", " ", "5", " ", "and", " ", "cross", "-", "predi", "ct", " ", "decision", " ", "function_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "local", "DF", "List_", "=_", "[_", "float_", "(_", "'", "nan", "'_", ")_", "]_", "*_", "len_", "(_", "binar", "y", "Label", "ed", "Messag", "e", "List_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "folds_", "=_", "Strat", "ified", "KF", "old_", "(_", "y_", ",_", "n", "Fold", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "train", "Idx_", ",_", "test", "Idx_", "in_", "folds_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "train_", "=_", "[_", "binar", "y", "Label", "ed", "Messag", "e", "List_", "[_", "i_", "]_", "for_", "i_", "in_", "train", "Idx_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test_", "=_", "[_", "binar", "y", "Label", "ed", "Messag", "e", "List_", "[_", "i_", "]_", "for_", "i_", "in_", "test", "Idx_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tmp", "Classifier_", "=_", "copy_", "._", "deepcopy_", "(_", "local", "Classifier_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "Classifier_", "._", "train_", "(_", "train_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cur", "DF", "List_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "test_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "v_", "=_", "tmp", "Classifier_", "._", "predi", "ct", "Score_", "(_", "x_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur", "DF", "List_", "._", "append_", "(_", "v_", "[_", "'", "pos", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "test_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "local", "DF", "List_", "[_", "test", "Idx_", "[_", "i_", "]_", "]_", "=_", "cur", "DF", "List_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "(_", "count", "Tru", "th_", "(_", "lambda_", "x_", ":_", "np_", "._", "isnan_", "(_", "x_", ")_", ",_", "local", "DF", "List_", ")_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--", " ", "train", " ", "SVC", "!!", "_", "\\u\\u\\uNL\\u\\u\\u_", "#-", " ", "prepar", "e", " ", "X_", "\\u\\u\\uNL\\u\\u\\u_", "X_", "=_", "np_", "._", "hstack_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "np_", "._", "matrix_", "(_", "global", "DF", "List_", ")_", "._", "T_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "np_", "._", "matrix_", "(_", "local", "DF", "List_", ")_", "._", "T_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "meta", "Classifier_", "=_", "Linea", "r", "SVC_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "loss_", "=_", "'", "l2", "'_", ",_", "penalty_", "=_", "'", "l1", "'_", ",_", "dual", "_", "=_", "False_", ",_", "tol_", "=_", "1e-6_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "random", "\\u", "state_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "meta", "Classifier_", "._", "fit_", "(_", "X_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "Log_", "+=_", "\"", "Train", "ed", " ", "a", " ", "meta", " ", "classif", "ier", ":\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "coef_", "=_", "meta", "Classifier_", "._", "coef\\u", "_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "Log_", "+=_", "\"", " ", " ", "coef", " ", "for", " ", "(", "global", ",", " ", "local", "):", " ", "(%", ".6", "f", ",", " ", "%", ".6", "f", ")\\\\", "n", "\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "coef_", "[_", "0_", "]_", ",_", "coef_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "Log_", "+=_", "\"", " ", " ", "intercept", ":", " ", "%", ".6", "f", "\\\\", "n", "\"_", "%_", "(_", "meta", "Classifier_", "._", "intercept", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--", " ", "train", " ", "local", " ", "classif", "ier", " ", "usi", "ng", " ", "all", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "local", "Classifier_", "._", "train_", "(_", "binar", "y", "Label", "ed", "Messag", "e", "List_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "Log_", "+=_", "\"", "Train", "ed", " ", "a", " ", "meta", " ", "classif", "ier", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elapsed_", "=_", "toc_", "(_", "tt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "Log_", "+=_", "\"", "Time", " ", "take", "n", " ", "for", " ", "train", "ing", ":", " ", "%", ".3", "f", " ", "(", "sec", ")\\\\", "n", "\"_", "%_", "elapsed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "meta", "Classifier_", "=_", "meta", "Classifier_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "train", "Log_", "=_", "train", "Log_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--", " ", "learn", " ", "sigmoid_", "\\u\\u\\uNL\\u\\u\\u_", "y", "Deci", "_", "=_", "[_", "self_", "._", "predi", "ct", "Score_", "(_", "msg_", ")_", "[_", "'", "pos", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "msg_", "in_", "binar", "y", "Label", "ed", "Messag", "e", "List_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yy_", "=_", "[_", "1_", "if_", "v_", "==_", "1_", "else_", "-_", "1_", "for_", "v_", "in_", "y_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[_", "A_", ",_", "B_", "]_", "=_", "plat", "t_", "._", "Sigm", "oid", "Train_", "(_", "y", "Deci", "_", ",_", "yy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plat", "t", "Model_", "=_", "[_", "A_", ",_", "B_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "plat", "t", "Model_", "=_", "plat", "t", "Model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "Adapti", "ve", "SVC_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "predi", "ct", "Score_", "(_", "self_", ",_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#-", "--", " ", "if", " ", "local", "Classif", "ier", " ", "is", " ", "Non", "e", ",", " ", "don", "t", " ", "use", " ", "it", "!!", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "self_", "._", "\\u", "local", "Classifier_", "is_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "global", "Classifier_", "._", "predi", "ct", "Score_", "(_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#-", "--", " ", "compute", " ", "feature", " ", "vector_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global", "Deci", "sion", "Function_", "=_", "self_", "._", "\\u", "global", "Classifier_", "._", "predi", "ct", "Score_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "message_", ")_", "[_", "'", "pos", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "local", "Deci", "sion", "Function_", "=_", "self_", "._", "\\u", "local", "Classifier_", "._", "predi", "ct", "Score_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "message_", ")_", "[_", "'", "pos", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test", "X_", "=_", "np_", "._", "matrix_", "(_", "[_", "global", "Deci", "sion", "Function_", ",_", "local", "Deci", "sion", "Function_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "df_", "=_", "self_", "._", "\\u", "meta", "Classifier_", "._", "decision", "\\u", "function_", "(_", "test", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--", " ", "return", " ", "dictionar", "y", " ", "of", " ", "score_", "\\u\\u\\uNL\\u\\u\\u_", "score", "Dic_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "score", "Dic_", "[_", "'", "pos", "'_", "]_", "=_", "df_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "score", "Dic_", "[_", "'", "neg", "'_", "]_", "=_", "-_", "df_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "score", "Dic_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ds", "sg", "Bin", "ary", "Classif", "ier", "Adapti", "ve", "SVC_", "(_", "Ds", "sg", "Bin", "ary", "Classifier_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "predi", "ct", "Prob_", "(_", "self_", ",_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "self_", "._", "\\u", "local", "Classifier_", "is_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "global", "Classifier_", "._", "predi", "ct", "Prob", "a_", "(_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#-", "--", " ", "compute", " ", "interpolated", " ", "decision", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global", "Deci", "sion", "Function_", "=_", "self_", "._", "\\u", "global", "Classifier_", "._", "predi", "ct", "Score_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "message_", ")_", "[_", "'", "pos", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "local", "Deci", "sion", "Function_", "=_", "self_", "._", "\\u", "local", "Classifier_", "._", "predi", "ct", "Score_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "message_", ")_", "[_", "'", "pos", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test", "X_", "=_", "np_", "._", "matrix_", "(_", "[_", "global", "Deci", "sion", "Function_", ",_", "local", "Deci", "sion", "Function_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "df_", "=_", "self_", "._", "\\u", "meta", "Classifier_", "._", "decision", "\\u", "function_", "(_", "test", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pr", "b_", "=_", "plat", "t_", "._", "Sigm", "oid", "Predic", "t_", "(_", "df_", ",_", "self_", "._", "\\u", "plat", "t", "Model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
hycis/Pynet/hps/deprecated/AE.py
[ { "content": "\nfrom jobman import DD, expand, flatten\n\nimport pynet.layer as layer\nfrom pynet.model import *\nfrom pynet.layer import *\nfrom pynet.datasets.mnist import Mnist, Mnist_Blocks\nimport pynet.datasets.spec as spec\nimport pynet.datasets.mnist as mnist\nimport pynet.datasets.transfactor as tf\nimport pynet.datasets.mapping as mapping\nimport pynet.learning_method as learning_methods\nfrom pynet.learning_rule import LearningRule\nfrom pynet.log import Log\nfrom pynet.train_object import TrainObject\nfrom pynet.cost import Cost\nimport pynet.datasets.preprocessor as preproc\nimport pynet.datasets.dataset_noise as noisy\nimport pynet.layer_noise as layer_noise\nimport cPickle\nimport os\n\nimport theano\nfrom theano.sandbox.cuda.var import CudaNdarraySharedVariable\nfloatX = theano.config.floatX\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class AE:\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.AE", "header": "['module', '___EOS___']", "index": 26 }, { "content": " def __init__(self, state):\n self.state = state", "metadata": "root.AE.__init__", "header": "['class', 'AE', ':', '___EOS___']", "index": 28 }, { "content": " def run(self):\n log = self.build_log()\n dataset = self.build_dataset()\n\n learning_rule = self.build_learning_rule()\n model = self.build_model(dataset)\n train_obj = TrainObject(log = log,\n dataset = dataset,\n learning_rule = learning_rule,\n model = model)\n train_obj.run()", "metadata": "root.AE.run", "header": "['class', 'AE', ':', '___EOS___']", "index": 31 }, { "content": " def build_log(self, save_to_database=None, id=None):\n log = Log(experiment_name = id is not None and '%s_%s'%(self.state.log.experiment_name,id) \\\n or self.state.log.experiment_name,\n description = self.state.log.description,\n save_outputs = self.state.log.save_outputs,\n save_learning_rule = self.state.log.save_learning_rule,\n save_model = self.state.log.save_model,\n save_epoch_error = self.state.log.save_epoch_error,\n save_to_database = save_to_database)\n return log", "metadata": "root.AE.build_log", "header": "['class', 'AE', ':', '___EOS___']", "index": 44 }, { "content": " def build_dataset(self):\n dataset = None\n\n preprocessor = None if self.state.dataset.preprocessor.type is None else \\\n getattr(preproc, self.state.dataset.preprocessor.type)()\n\n # if self.state.dataset.noise.type == 'BlackOut' or self.state.dataset.noise.type == 'MaskOut':\n # noise = None if self.state.dataset.noise.type is None else \\\n # getattr(noisy, self.state.dataset.noise.type)(ratio=self.state.dataset.noise.ratio)\n # else:\n # noise = getattr(noisy, self.state.dataset.noise.type)()\n noise = None if self.state.dataset.dataset_noise.type is None else \\\n getattr(noisy, self.state.dataset.dataset_noise.type)()\n\n if self.state.dataset.preprocessor.type == 'Scale':\n preprocessor.max = self.state.dataset.preprocessor.global_max\n preprocessor.min = self.state.dataset.preprocessor.global_min\n preprocessor.buffer = self.state.dataset.preprocessor.buffer\n preprocessor.scale_range = self.state.dataset.preprocessor.scale_range\n\n if self.state.dataset.type == 'Mnist':\n dataset = Mnist(train_valid_test_ratio = self.state.dataset.train_valid_test_ratio,\n preprocessor = preprocessor,\n noise = noise,\n batch_size = self.state.dataset.batch_size,\n num_batches = self.state.dataset.num_batches,\n iter_class = self.state.dataset.iter_class,\n rng = self.state.dataset.rng)\n train = dataset.get_train()\n dataset.set_train(train.X, train.X)\n valid = dataset.get_valid()\n dataset.set_valid(valid.X, valid.X)\n test = dataset.get_test()\n dataset.set_test(test.X, test.X)\n\n elif self.state.dataset.type[:12] == 'Mnist_Blocks':\n dataset = getattr(mnist, self.state.dataset.type)(\n feature_size = self.state.dataset.feature_size,\n target_size = self.state.dataset.feature_size,\n train_valid_test_ratio = self.state.dataset.train_valid_test_ratio,\n preprocessor = preprocessor,\n noise = noise,\n batch_size = self.state.dataset.batch_size,\n num_batches = self.state.dataset.num_batches,\n iter_class = self.state.dataset.iter_class,\n rng = self.state.dataset.rng)\n\n elif self.state.dataset.type[:4] == 'P276':\n dataset = getattr(spec, self.state.dataset.type)(\n train_valid_test_ratio = self.state.dataset.train_valid_test_ratio,\n preprocessor = preprocessor,\n noise = noise,\n batch_size = self.state.dataset.batch_size,\n num_batches = self.state.dataset.num_batches,\n iter_class = self.state.dataset.iter_class,\n rng = self.state.dataset.rng)\n train = dataset.get_train()\n dataset.set_train(train.X, train.X)\n valid = dataset.get_valid()\n dataset.set_valid(valid.X, valid.X)\n test = dataset.get_test()\n dataset.set_test(test.X, test.X)\n\n elif self.state.dataset.type[:5] == 'Laura':\n dataset = getattr(spec, self.state.dataset.type)(\n feature_size = self.state.dataset.feature_size,\n target_size = self.state.dataset.feature_size,\n train_valid_test_ratio = self.state.dataset.train_valid_test_ratio,\n preprocessor = preprocessor,\n noise = noise,\n batch_size = self.state.dataset.batch_size,\n num_batches = self.state.dataset.num_batches,\n iter_class = self.state.dataset.iter_class,\n rng = self.state.dataset.rng)\n\n elif self.state.dataset.type[:18] == 'TransFactor_Blocks':\n dataset = getattr(tf, self.state.dataset.type)(\n feature_size = self.state.dataset.feature_size,\n target_size = self.state.dataset.feature_size,\n train_valid_test_ratio = self.state.dataset.train_valid_test_ratio,\n preprocessor = preprocessor,\n noise = noise,\n batch_size = self.state.dataset.batch_size,\n num_batches = self.state.dataset.num_batches,\n iter_class = self.state.dataset.iter_class,\n rng = self.state.dataset.rng)\n\n elif self.state.dataset.type[:11] == 'TransFactor':\n dataset = getattr(tf, self.state.dataset.type)(\n # feature_size = self.state.dataset.feature_size,\n # target_size = self.state.dataset.feature_size,\n train_valid_test_ratio = self.state.dataset.train_valid_test_ratio,\n preprocessor = preprocessor,\n noise = noise,\n batch_size = self.state.dataset.batch_size,\n num_batches = self.state.dataset.num_batches,\n iter_class = self.state.dataset.iter_class,\n rng = self.state.dataset.rng)\n train = dataset.get_train()\n dataset.set_train(train.X, train.X)\n valid = dataset.get_valid()\n dataset.set_valid(valid.X, valid.X)\n test = dataset.get_test()\n dataset.set_test(test.X, test.X)\n\n\n\n return dataset", "metadata": "root.AE.build_dataset", "header": "['class', 'AE', ':', '___EOS___']", "index": 56 }, { "content": " def build_learning_method(self):\n\n if self.state.learning_method.type == 'SGD':\n learn_method = getattr(learning_methods,\n self.state.learning_method.type)(\n learning_rate = self.state.learning_method.learning_rate,\n momentum = self.state.learning_method.momentum)\n\n elif self.state.learning_method.type == 'AdaGrad':\n learn_method = getattr(learning_methods,\n self.state.learning_method.type)(\n learning_rate = self.state.learning_method.learning_rate,\n momentum = self.state.learning_method.momentum)\n\n elif self.state.learning_method.type == 'AdaDelta':\n learn_method = getattr(learning_methods,\n self.state.learning_method.type)(\n rho = self.state.learning_method.rho,\n eps = self.state.learning_method.eps)\n\n else:\n raise TypeError(\"not SGD, AdaGrad or AdaDelta\")\n\n\n return learn_method", "metadata": "root.AE.build_learning_method", "header": "['class', 'AE', ':', '___EOS___']", "index": 166 }, { "content": " def build_learning_rule(self):\n learning_rule = LearningRule(max_col_norm = self.state.learning_rule.max_col_norm,\n L1_lambda = self.state.learning_rule.L1_lambda,\n L2_lambda = self.state.learning_rule.L2_lambda,\n training_cost = Cost(type = self.state.learning_rule.cost),\n stopping_criteria = {'max_epoch' : self.state.learning_rule.stopping_criteria.max_epoch,\n 'epoch_look_back' : self.state.learning_rule.stopping_criteria.epoch_look_back,\n 'cost' : Cost(type=self.state.learning_rule.stopping_criteria.cost),\n 'percent_decrease' : self.state.learning_rule.stopping_criteria.percent_decrease})\n return learning_rule", "metadata": "root.AE.build_learning_rule", "header": "['class', 'AE', ':', '___EOS___']", "index": 193 }, { "content": " def build_one_hid_model(self, input_dim):\n model = AutoEncoder(input_dim=input_dim, rand_seed=self.state.model.rand_seed)\n\n h1_noise = None if self.state.hidden1.layer_noise.type is None else \\\n getattr(layer_noise, self.state.hidden1.layer_noise.type)()\n\n if self.state.hidden1.layer_noise.type in ['BlackOut', 'MaskOut', 'BatchOut']:\n h1_noise.ratio = self.state.hidden1.layer_noise.ratio\n\n\n elif self.state.hidden1.layer_noise.type == 'Gaussian':\n h1_noise.std = self.state.hidden1.layer_noise.std\n h1_noise.mean = self.state.hidden1.layer_noise.mean\n\n hidden1 = getattr(layer, self.state.hidden1.type)(dim=self.state.hidden1.dim,\n name=self.state.hidden1.name,\n dropout_below=self.state.hidden1.dropout_below,\n noise=h1_noise)\n # blackout_below=self.state.hidden1.blackout_below)\n model.add_encode_layer(hidden1)\n h1_mirror = getattr(layer, self.state.h1_mirror.type)(dim=input_dim,\n name=self.state.h1_mirror.name,\n W=hidden1.W.T,\n dropout_below=self.state.h1_mirror.dropout_below)\n # blackout_below=self.state.h1_mirror.blackout_below)\n model.add_decode_layer(h1_mirror)\n return model", "metadata": "root.AE.build_one_hid_model", "header": "['class', 'AE', ':', '___EOS___']", "index": 205 }, { "content": " def build_one_hid_model_no_transpose(self, input_dim):\n model = AutoEncoder(input_dim = input_dim, rand_seed=self.state.model.rand_seed)\n hidden1 = getattr(layer, self.state.hidden1.type)(dim=self.state.hidden1.dim,\n name=self.state.hidden1.name,\n dropout_below=self.state.hidden1.dropout_below,\n noise=None if self.state.hidden1.layer_noise is None else \\\n getattr(layer_noise, self.state.hidden1.layer_noise)())\n # blackout_below=self.state.hidden1.blackout_below)\n model.add_encode_layer(hidden1)\n h1_mirror = getattr(layer, self.state.h1_mirror.type)(dim=input_dim,\n name=self.state.h1_mirror.name,\n dropout_below=self.state.h1_mirror.dropout_below)\n # blackout_below=self.state.h1_mirror.blackout_below)\n model.add_decode_layer(h1_mirror)\n return model", "metadata": "root.AE.build_one_hid_model_no_transpose", "header": "['class', 'AE', ':', '___EOS___']", "index": 233 }, { "content": " def build_two_hid_model(self, input_dim):\n model = AutoEncoder(input_dim=input_dim, rand_seed=self.state.model.rand_seed)\n hidden1 = getattr(layer, self.state.hidden1.type)(dim=self.state.hidden1.dim,\n name=self.state.hidden1.name,\n dropout_below=self.state.hidden1.dropout_below,\n noise=None if self.state.hidden1.layer_noise is None else \\\n getattr(layer_noise, self.state.hidden1.layer_noise)())\n # blackout_below=self.state.hidden1.blackout_below)\n model.add_encode_layer(hidden1)\n\n hidden2 = getattr(layer, self.state.hidden2.type)(dim=self.state.hidden2.dim,\n name=self.state.hidden2.name,\n dropout_below=self.state.hidden2.dropout_below,\n noise=None if self.state.hidden2.layer_noise is None else \\\n getattr(layer_noise, self.state.hidden2.layer_noise)())\n # blackout_below=self.state.hidden2.blackout_below)\n model.add_encode_layer(hidden2)\n\n hidden2_mirror = getattr(layer, self.state.h2_mirror.type)(dim=self.state.hidden1.dim,\n name=self.state.h2_mirror.name,\n dropout_below=self.state.h2_mirror.dropout_below,\n # blackout_below=self.state.h2_mirror.blackout_below,\n W = hidden2.W.T)\n model.add_decode_layer(hidden2_mirror)\n\n hidden1_mirror = getattr(layer, self.state.h1_mirror.type)(dim=input_dim,\n name=self.state.h1_mirror.name,\n dropout_below=self.state.h1_mirror.dropout_below,\n # blackout_below=self.state.h1_mirror.blackout_below,\n W = hidden1.W.T)\n model.add_decode_layer(hidden1_mirror)\n return model", "metadata": "root.AE.build_two_hid_model", "header": "['class', 'AE', ':', '___EOS___']", "index": 249 }, { "content": " def build_database(self, dataset, learning_rule, learning_method, model):\n save_to_database = {'name' : self.state.log.save_to_database_name,\n 'records' : {'Dataset' : dataset.__class__.__name__,\n 'max_col_norm' : learning_rule.max_col_norm,\n 'Weight_Init_Seed' : model.rand_seed,\n 'Dropout_Below' : str([layer.dropout_below for layer in model.layers]),\n 'Learning_Method' : learning_method.__class__.__name__,\n 'Batch_Size' : dataset.batch_size,\n 'Dataset_Noise' : dataset.noise.__class__.__name__,\n 'Dataset_Dir' : dataset.data_dir,\n 'Feature_Size' : dataset.feature_size(),\n 'nblocks' : dataset.nblocks(),\n 'Layer_Types' : str([layer.__class__.__name__ for layer in model.layers]),\n 'Layer_Dim' : str([layer.dim for layer in model.layers]),\n 'Preprocessor' : dataset.preprocessor.__class__.__name__,\n 'Training_Cost' : learning_rule.cost.type,\n 'Stopping_Cost' : learning_rule.stopping_criteria['cost'].type}\n }\n\n if learning_method.__class__.__name__ == \"SGD\":\n save_to_database[\"records\"][\"Learning_rate\"] = learning_method.learning_rate\n save_to_database[\"records\"][\"Momentum\"] = learning_method.momentum\n elif learning_method.__class__.__name__ == \"AdaGrad\":\n save_to_database[\"records\"][\"Learning_rate\"] = learning_method.learning_rate\n save_to_database[\"records\"][\"Momentum\"] = learning_method.momentum\n elif learning_method.__class__.__name__ == \"AdaDelta\":\n save_to_database[\"records\"][\"rho\"] = learning_method.rho\n save_to_database[\"records\"][\"eps\"] = learning_method.eps\n else:\n raise TypeError(\"not SGD, AdaGrad or AdaDelta\")\n\n layer_noise = []\n layer_noise_params = []\n for layer in model.layers:\n layer_noise.append(layer.noise.__class__.__name__)\n if layer.noise.__class__.__name__ in ['BlackOut', 'MaskOut', 'BatchOut']:\n layer_noise_params.append(layer.noise.ratio)\n\n elif layer.noise.__class__.__name__ is 'Gaussian':\n layer_noise_params.append((layer.noise.mean, layer.noise.std))\n\n else:\n layer_noise_params.append(None)\n\n save_to_database[\"records\"][\"Layer_Noise\"] = str(layer_noise)\n save_to_database[\"records\"][\"Layer_Noise_Params\"] = str(layer_noise_params)\n\n return save_to_database", "metadata": "root.AE.build_database", "header": "['class', 'AE', ':', '___EOS___']", "index": 283 }, { "content": "class AE_Testing(AE):\n\n\n", "metadata": "root.AE_Testing", "header": "['module', '___EOS___']", "index": 332 }, { "content": " def __init__(self, state):\n self.state = state", "metadata": "root.AE_Testing.__init__", "header": "['class', 'AE_Testing', '(', 'AE', ')', ':', '___EOS___']", "index": 334 }, { "content": " def run(self):\n\n dataset = self.build_dataset()\n learning_rule = self.build_learning_rule()\n learn_method = self.build_learning_method()\n\n model = self.build_one_hid_model(dataset.feature_size())\n\n if self.state.log.save_to_database_name:\n database = self.build_database(dataset, learning_rule, learn_method, model)\n log = self.build_log(database)\n\n train_obj = TrainObject(log = log,\n dataset = dataset,\n learning_rule = learning_rule,\n learning_method = learn_method,\n model = model)\n train_obj.run()\n\n # fine tuning\n log.info(\"fine tuning\")\n train_obj.model.layers[0].dropout_below = None\n train_obj.setup()\n train_obj.run()", "metadata": "root.AE_Testing.run", "header": "['class', 'AE_Testing', '(', 'AE', ')', ':', '___EOS___']", "index": 338 }, { "content": "class Laura_Mapping(AE):\n", "metadata": "root.Laura_Mapping", "header": "['module', '___EOS___']", "index": 363 }, { "content": " def __init__(self, state):\n self.state = state", "metadata": "root.Laura_Mapping.__init__", "header": "['class', 'Laura_Mapping', '(', 'AE', ')', ':', '___EOS___']", "index": 364 }, { "content": " def run(self):\n preprocessor = None if self.state.dataset.preprocessor is None else \\\n getattr(preproc, self.state.dataset.preprocessor)()\n dataset = getattr(mapping, self.state.dataset.type)(feature_size = self.state.dataset.feature_size,\n target_size = self.state.dataset.target_size,\n train_valid_test_ratio = self.state.dataset.train_valid_test_ratio,\n preprocessor = preprocessor,\n batch_size = self.state.dataset.batch_size,\n num_batches = self.state.dataset.num_batches,\n iter_class = self.state.dataset.iter_class,\n rng = self.state.dataset.rng)\n model = MLP(input_dim = self.state.dataset.feature_size, rand_seed=self.state.model.rand_seed)\n hidden1 = getattr(layer, self.state.hidden1.type)(dim=self.state.hidden1.dim,\n name=self.state.hidden1.name,\n dropout_below=self.state.hidden1.dropout_below)\n model.add_layer(hidden1)\n\n hidden2 = getattr(layer, self.state.hidden2.type)(dim=self.state.hidden2.dim,\n name=self.state.hidden2.name,\n dropout_below=self.state.hidden2.dropout_below)\n model.add_layer(hidden2)\n\n output = getattr(layer, self.state.output.type)(dim=self.state.output.dim,\n name=self.state.output.name,\n dropout_below=self.state.output.dropout_below)\n model.add_layer(output)\n\n learning_rule = self.build_learning_rule()\n learn_method = self.build_learning_method()\n database = self.build_database(dataset, learning_rule, learn_method, model)\n log = self.build_log(database)\n\n train_obj = TrainObject(log = log,\n dataset = dataset,\n learning_rule = learning_rule,\n learning_method = learn_method,\n model = model)\n\n train_obj.run()", "metadata": "root.Laura_Mapping.run", "header": "['class', 'Laura_Mapping', '(', 'AE', ')', ':', '___EOS___']", "index": 367 }, { "content": "class Laura(AE):\n\n\n", "metadata": "root.Laura", "header": "['module', '___EOS___']", "index": 408 }, { "content": " def __init__(self, state):\n self.state = state", "metadata": "root.Laura.__init__", "header": "['class', 'Laura', '(', 'AE', ')', ':', '___EOS___']", "index": 410 }, { "content": " def run(self):\n\n dataset = self.build_dataset()\n learning_rule = self.build_learning_rule()\n learn_method = self.build_learning_method()\n\n # import pdb\n # pdb.set_trace()\n\n if self.state.num_layers == 1:\n model = self.build_one_hid_model(dataset.feature_size())\n elif self.state.num_layers == 2:\n model = self.build_two_hid_model(dataset.feature_size())\n else:\n raise ValueError()\n\n database = self.build_database(dataset, learning_rule, learn_method, model)\n log = self.build_log(database)\n\n dataset.log = log\n\n train_obj = TrainObject(log = log,\n dataset = dataset,\n learning_rule = learning_rule,\n learning_method = learn_method,\n model = model)\n\n train_obj.run()\n\n log.info(\"Fine Tuning\")\n\n for layer in train_obj.model.layers:\n layer.dropout_below = None\n layer.noise = None\n\n train_obj.setup()\n train_obj.run()", "metadata": "root.Laura.run", "header": "['class', 'Laura', '(', 'AE', ')', ':', '___EOS___']", "index": 414 }, { "content": "class Laura_Continue(AE):\n\n\n\n", "metadata": "root.Laura_Continue", "header": "['module', '___EOS___']", "index": 452 }, { "content": " def __init__(self, state):\n self.state = state", "metadata": "root.Laura_Continue.__init__", "header": "['class', 'Laura_Continue', '(', 'AE', ')', ':', '___EOS___']", "index": 454 }, { "content": " def build_model(self):\n with open(os.environ['PYNET_SAVE_PATH'] + '/log/'\n + self.state.hidden1.model + '/model.pkl') as f1:\n model = cPickle.load(f1)\n return model", "metadata": "root.Laura_Continue.build_model", "header": "['class', 'Laura_Continue', '(', 'AE', ')', ':', '___EOS___']", "index": 458 }, { "content": " def run(self):\n\n dataset = self.build_dataset()\n learning_rule = self.build_learning_rule()\n learn_method = self.build_learning_method()\n\n model = self.build_model()\n\n if self.state.fine_tuning_only:\n for layer in model.layers:\n layer.dropout_below = None\n layer.noise = None\n print \"Fine Tuning Only\"\n\n if self.state.log.save_to_database_name:\n database = self.build_database(dataset, learning_rule, learn_method, model)\n database['records']['model'] = self.state.hidden1.model\n log = self.build_log(database)\n\n train_obj = TrainObject(log = log,\n dataset = dataset,\n learning_rule = learning_rule,\n learning_method = learn_method,\n model = model)\n\n train_obj.run()\n\n if not self.state.fine_tuning_only:\n log.info(\"..Fine Tuning after Noisy Training\")\n for layer in train_obj.model.layers:\n layer.dropout_below = None\n layer.noise = None\n train_obj.setup()\n train_obj.run()", "metadata": "root.Laura_Continue.run", "header": "['class', 'Laura_Continue', '(', 'AE', ')', ':', '___EOS___']", "index": 464 }, { "content": "class Laura_Two_Layers(AE):\n\n\n\n", "metadata": "root.Laura_Two_Layers", "header": "['module', '___EOS___']", "index": 501 }, { "content": " def __init__(self, state):\n self.state = state", "metadata": "root.Laura_Two_Layers.__init__", "header": "['class', 'Laura_Two_Layers', '(', 'AE', ')', ':', '___EOS___']", "index": 503 }, { "content": " def build_model(self, input_dim):\n with open(os.environ['PYNET_SAVE_PATH'] + '/log/'\n + self.state.hidden1.model + '/model.pkl') as f1:\n model1 = cPickle.load(f1)\n\n with open(os.environ['PYNET_SAVE_PATH'] + '/log/'\n + self.state.hidden2.model + '/model.pkl') as f2:\n model2 = cPickle.load(f2)\n\n model = AutoEncoder(input_dim=input_dim)\n while len(model1.encode_layers) > 0:\n model.add_encode_layer(model1.pop_encode_layer())\n while len(model2.encode_layers) > 0:\n model.add_encode_layer(model2.pop_encode_layer())\n while len(model2.decode_layers) > 0:\n model.add_decode_layer(model2.pop_decode_layer())\n while len(model1.decode_layers) > 0:\n model.add_decode_layer(model1.pop_decode_layer())\n return model", "metadata": "root.Laura_Two_Layers.build_model", "header": "['class', 'Laura_Two_Layers', '(', 'AE', ')', ':', '___EOS___']", "index": 507 }, { "content": " def run(self):\n\n dataset = self.build_dataset()\n learning_rule = self.build_learning_rule()\n learn_method = self.build_learning_method()\n\n model = self.build_model(dataset.feature_size())\n model.layers[0].dropout_below = self.state.hidden1.dropout_below\n\n if self.state.log.save_to_database_name:\n database = self.build_database(dataset, learning_rule, learn_method, model)\n database['records']['h1_model'] = self.state.hidden1.model\n database['records']['h2_model'] = self.state.hidden2.model\n log = self.build_log(database)\n\n log.info(\"Fine Tuning\")\n for layer in model.layers:\n layer.dropout_below = None\n layer.noise = None\n\n train_obj = TrainObject(log = log,\n dataset = dataset,\n learning_rule = learning_rule,\n learning_method = learn_method,\n model = model)\n\n train_obj.run()", "metadata": "root.Laura_Two_Layers.run", "header": "['class', 'Laura_Two_Layers', '(', 'AE', ')', ':', '___EOS___']", "index": 527 }, { "content": "class Laura_Three_Layers(AE):\n\n\n", "metadata": "root.Laura_Three_Layers", "header": "['module', '___EOS___']", "index": 555 }, { "content": " def __init__(self, state):\n self.state = state", "metadata": "root.Laura_Three_Layers.__init__", "header": "['class', 'Laura_Three_Layers', '(', 'AE', ')', ':', '___EOS___']", "index": 556 }, { "content": " def build_model(self, input_dim):\n with open(os.environ['PYNET_SAVE_PATH'] + '/log/'\n + self.state.hidden1.model + '/model.pkl') as f1:\n model1 = cPickle.load(f1)\n\n with open(os.environ['PYNET_SAVE_PATH'] + '/log/'\n + self.state.hidden2.model + '/model.pkl') as f2:\n model2 = cPickle.load(f2)\n\n with open(os.environ['PYNET_SAVE_PATH'] + '/log/'\n + self.state.hidden3.model + '/model.pkl') as f3:\n model3 = cPickle.load(f3)\n\n model = AutoEncoder(input_dim=input_dim)\n\n model.add_encode_layer(model1.pop_encode_layer())\n model.add_encode_layer(model2.pop_encode_layer())\n model.add_encode_layer(model3.pop_encode_layer())\n model.add_decode_layer(model3.pop_decode_layer())\n model.add_decode_layer(model2.pop_decode_layer())\n model.add_decode_layer(model1.pop_decode_layer())\n\n return model", "metadata": "root.Laura_Three_Layers.build_model", "header": "['class', 'Laura_Three_Layers', '(', 'AE', ')', ':', '___EOS___']", "index": 560 }, { "content": " def run(self):\n\n dataset = self.build_dataset()\n learning_rule = self.build_learning_rule()\n learn_method = self.build_learning_method()\n\n model = self.build_model(dataset.feature_size())\n\n model.layers[0].dropout_below = self.state.hidden1.dropout_below\n model.layers[1].dropout_below = self.state.hidden2.dropout_below\n model.layers[2].dropout_below = self.state.hidden3.dropout_below\n\n if self.state.log.save_to_database_name:\n database = self.build_database(dataset, learning_rule, learn_method, model)\n database['records']['h1_model'] = self.state.hidden1.model\n database['records']['h2_model'] = self.state.hidden2.model\n database['records']['h3_model'] = self.state.hidden3.model\n log = self.build_log(database)\n\n log.info(\"Fine Tuning\")\n for layer in model.layers:\n layer.dropout_below = None\n layer.noise = None\n\n train_obj = TrainObject(log = log,\n dataset = dataset,\n learning_rule = learning_rule,\n learning_method = learn_method,\n model = model)\n train_obj.run()", "metadata": "root.Laura_Three_Layers.run", "header": "['class', 'Laura_Three_Layers', '(', 'AE', ')', ':', '___EOS___']", "index": 584 }, { "content": "class Laura_Two_Layers_No_Transpose(AE):\n\n\n", "metadata": "root.Laura_Two_Layers_No_Transpose", "header": "['module', '___EOS___']", "index": 616 }, { "content": " def __init__(self, state):\n self.state = state", "metadata": "root.Laura_Two_Layers_No_Transpose.__init__", "header": "['class', 'Laura_Two_Layers_No_Transpose', '(', 'AE', ')', ':', '___EOS___']", "index": 618 }, { "content": " def run(self):\n\n dataset = self.build_dataset()\n learning_rule = self.build_learning_rule()\n learn_method = self.build_learning_method()\n\n if self.state.num_layers == 1:\n model = self.build_one_hid_model_no_transpose(dataset.feature_size())\n else:\n raise ValueError()\n\n if self.state.log.save_to_database_name:\n database = self.build_database(dataset, learning_rule, learn_method, model)\n log = self.build_log(database)\n\n train_obj = TrainObject(log = log,\n dataset = dataset,\n learning_rule = learning_rule,\n learning_method = learn_method,\n model = model)\n\n train_obj.run()\n\n # fine tuning\n log.info(\"fine tuning\")\n train_obj.model.layers[0].dropout_below = None\n train_obj.setup()\n train_obj.run()", "metadata": "root.Laura_Two_Layers_No_Transpose.run", "header": "['class', 'Laura_Two_Layers_No_Transpose', '(', 'AE', ')', ':', '___EOS___']", "index": 622 } ]
[ { "span": "from jobman import DD, expand, flatten", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 38 }, { "span": "from pynet.datasets.mnist import Mnist, Mnist_Blocks", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 52 }, { "span": "from theano.sandbox.cuda.var import CudaNdarraySharedVariable", "start_line": 23, "start_column": 0, "end_line": 23, "end_column": 61 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "job", "man_", "import_", "DD", "_", ",_", "expand_", ",_", "flatten_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "pyn", "et_", "._", "layer_", "as_", "layer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyn", "et_", "._", "model_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyn", "et_", "._", "layer_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyn", "et_", "._", "datasets_", "._", "mnist_", "import_", "Mn", "ist_", ",_", "Mn", "ist", "\\u", "Blocks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pyn", "et_", "._", "datasets_", "._", "spec_", "as_", "spec_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pyn", "et_", "._", "datasets_", "._", "mnist_", "as_", "mnist_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pyn", "et_", "._", "datasets_", "._", "transf", "actor_", "as_", "tf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pyn", "et_", "._", "datasets_", "._", "mapping_", "as_", "mapping_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pyn", "et_", "._", "learn", "ing", "\\u", "method_", "as_", "learn", "ing", "\\u", "methods_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyn", "et_", "._", "learn", "ing", "\\u", "rule_", "import_", "Learn", "ing", "Rule_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyn", "et_", "._", "log_", "import_", "Log_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyn", "et_", "._", "train", "\\u", "object_", "import_", "Train", "Object_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyn", "et_", "._", "cost_", "import_", "Cost_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pyn", "et_", "._", "datasets_", "._", "preprocessor_", "as_", "preproc", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pyn", "et_", "._", "datasets_", "._", "dataset", "\\u", "noise_", "as_", "noisy", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pyn", "et_", "._", "layer", "\\u", "noise_", "as_", "layer", "\\u", "noise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "c", "Pickle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "theano_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "theano_", "._", "sandbox_", "._", "cuda_", "._", "var_", "import_", "Cu", "da", "Nd", "array", "Share", "d", "Variable_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "float", "X_", "=_", "theano_", "._", "config_", "._", "float", "X_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "AE", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "AE", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "state_", "=_", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "AE", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "=_", "self_", "._", "build", "\\u", "log_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dataset_", "=_", "self_", "._", "build", "\\u", "dataset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "learn", "ing", "\\u", "rule_", "=_", "self_", "._", "build", "\\u", "learn", "ing", "\\u", "rule_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "self_", "._", "build", "\\u", "model_", "(_", "dataset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "\\u", "obj_", "=_", "Train", "Object_", "(_", "log_", "=_", "log_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dataset_", "=_", "dataset_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "learn", "ing", "\\u", "rule_", "=_", "learn", "ing", "\\u", "rule_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "=_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "\\u", "obj_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "AE", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "\\u", "log_", "(_", "self_", ",_", "save", "\\u", "to", "\\u", "database_", "=_", "None_", ",_", "id_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "=_", "Log_", "(_", "experiment", "\\u", "name_", "=_", "id_", "is_", "not_", "None_", "and_", "'%", "s", "\\u", "%", "s", "'_", "%_", "(_", "self_", "._", "state_", "._", "log_", "._", "experiment", "\\u", "name_", ",_", "id_", ")_", "or_", "self_", "._", "state_", "._", "log_", "._", "experiment", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "self_", "._", "state_", "._", "log_", "._", "description_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "save", "\\u", "outputs_", "=_", "self_", "._", "state_", "._", "log_", "._", "save", "\\u", "outputs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "save", "\\u", "learn", "ing", "\\u", "rule_", "=_", "self_", "._", "state_", "._", "log_", "._", "save", "\\u", "learn", "ing", "\\u", "rule_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "save", "\\u", "model_", "=_", "self_", "._", "state_", "._", "log_", "._", "save", "\\u", "model_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "save", "\\u", "epoch", "\\u", "error_", "=_", "self_", "._", "state_", "._", "log_", "._", "save", "\\u", "epoch", "\\u", "error_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "save", "\\u", "to", "\\u", "database_", "=_", "save", "\\u", "to", "\\u", "database_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "log_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "AE", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "\\u", "dataset_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dataset_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "preprocessor_", "=_", "None_", "if_", "self_", "._", "state_", "._", "dataset_", "._", "preprocessor_", "._", "type_", "is_", "None_", "else_", "getattr_", "(_", "preproc", "_", ",_", "self_", "._", "state_", "._", "dataset_", "._", "preprocessor_", "._", "type_", ")_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "self", ".", "state", ".", "dataset", ".", "noise", ".", "type", " ", "==", " ", "'", "Black", "Out", "'", " ", "or", " ", "self", ".", "state", ".", "dataset", ".", "noise", ".", "type", " ", "==", " ", "'", "Mask", "Out", "':", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "noise", " ", "=", " ", "Non", "e", " ", "if", " ", "self", ".", "state", ".", "dataset", ".", "noise", ".", "type", " ", "is", " ", "Non", "e", " ", "else", " ", "\\\\_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "getattr", "(", "noisy", ",", " ", "self", ".", "state", ".", "dataset", ".", "noise", ".", "type", ")(", "ratio", "=", "self", ".", "state", ".", "dataset", ".", "noise", ".", "ratio", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "noise", " ", "=", " ", "getattr", "(", "noisy", ",", " ", "self", ".", "state", ".", "dataset", ".", "noise", ".", "type", ")()", "_", "\\u\\u\\uNL\\u\\u\\u_", "noise_", "=_", "None_", "if_", "self_", "._", "state_", "._", "dataset_", "._", "dataset", "\\u", "noise_", "._", "type_", "is_", "None_", "else_", "getattr_", "(_", "noisy", "_", ",_", "self_", "._", "state_", "._", "dataset_", "._", "dataset", "\\u", "noise_", "._", "type_", ")_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "state_", "._", "dataset_", "._", "preprocessor_", "._", "type_", "==_", "'", "Scale", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "preprocessor_", "._", "max_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "preprocessor_", "._", "global", "\\u", "max_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "preprocessor_", "._", "min_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "preprocessor_", "._", "global", "\\u", "min_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "preprocessor_", "._", "buffer_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "preprocessor_", "._", "buffer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "preprocessor_", "._", "scale", "\\u", "range_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "preprocessor_", "._", "scale", "\\u", "range_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "state_", "._", "dataset_", "._", "type_", "==_", "'", "Mn", "ist", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dataset_", "=_", "Mn", "ist_", "(_", "train", "\\u", "valid", "\\u", "test\\u", "ratio_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "train", "\\u", "valid", "\\u", "test\\u", "ratio_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "preprocessor_", "=_", "preprocessor_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "noise_", "=_", "noise_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "batch", "\\u", "size_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "batch", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "batches_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "num", "\\u", "batches_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "iter", "\\u", "class_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "iter", "\\u", "class_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rng_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "rng_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train_", "=_", "dataset_", "._", "get", "\\u", "train_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dataset_", "._", "set\\u", "train_", "(_", "train_", "._", "X_", ",_", "train_", "._", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "valid_", "=_", "dataset_", "._", "get", "\\u", "valid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dataset_", "._", "set\\u", "valid_", "(_", "valid_", "._", "X_", ",_", "valid_", "._", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test_", "=_", "dataset_", "._", "get", "\\u", "test_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dataset_", "._", "set\\u", "test_", "(_", "test_", "._", "X_", ",_", "test_", "._", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "state_", "._", "dataset_", "._", "type_", "[_", ":_", "12_", "]_", "==_", "'", "Mn", "ist", "\\u", "Block", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dataset_", "=_", "getattr_", "(_", "mnist_", ",_", "self_", "._", "state_", "._", "dataset_", "._", "type_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "feature", "\\u", "size_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "feature", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "target", "\\u", "size_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "feature", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "train", "\\u", "valid", "\\u", "test\\u", "ratio_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "train", "\\u", "valid", "\\u", "test\\u", "ratio_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "preprocessor_", "=_", "preprocessor_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "noise_", "=_", "noise_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "batch", "\\u", "size_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "batch", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "batches_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "num", "\\u", "batches_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "iter", "\\u", "class_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "iter", "\\u", "class_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rng_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "rng_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "state_", "._", "dataset_", "._", "type_", "[_", ":_", "4_", "]_", "==_", "'", "P2", "7", "6", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dataset_", "=_", "getattr_", "(_", "spec_", ",_", "self_", "._", "state_", "._", "dataset_", "._", "type_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "train", "\\u", "valid", "\\u", "test\\u", "ratio_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "train", "\\u", "valid", "\\u", "test\\u", "ratio_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "preprocessor_", "=_", "preprocessor_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "noise_", "=_", "noise_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "batch", "\\u", "size_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "batch", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "batches_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "num", "\\u", "batches_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "iter", "\\u", "class_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "iter", "\\u", "class_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rng_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "rng_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train_", "=_", "dataset_", "._", "get", "\\u", "train_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dataset_", "._", "set\\u", "train_", "(_", "train_", "._", "X_", ",_", "train_", "._", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "valid_", "=_", "dataset_", "._", "get", "\\u", "valid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dataset_", "._", "set\\u", "valid_", "(_", "valid_", "._", "X_", ",_", "valid_", "._", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test_", "=_", "dataset_", "._", "get", "\\u", "test_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dataset_", "._", "set\\u", "test_", "(_", "test_", "._", "X_", ",_", "test_", "._", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "state_", "._", "dataset_", "._", "type_", "[_", ":_", "5_", "]_", "==_", "'", "Lau", "ra", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dataset_", "=_", "getattr_", "(_", "spec_", ",_", "self_", "._", "state_", "._", "dataset_", "._", "type_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "feature", "\\u", "size_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "feature", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "target", "\\u", "size_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "feature", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "train", "\\u", "valid", "\\u", "test\\u", "ratio_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "train", "\\u", "valid", "\\u", "test\\u", "ratio_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "preprocessor_", "=_", "preprocessor_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "noise_", "=_", "noise_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "batch", "\\u", "size_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "batch", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "batches_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "num", "\\u", "batches_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "iter", "\\u", "class_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "iter", "\\u", "class_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rng_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "rng_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "state_", "._", "dataset_", "._", "type_", "[_", ":_", "18_", "]_", "==_", "'", "Trans", "Factor", "\\u", "Block", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dataset_", "=_", "getattr_", "(_", "tf_", ",_", "self_", "._", "state_", "._", "dataset_", "._", "type_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "feature", "\\u", "size_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "feature", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "target", "\\u", "size_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "feature", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "train", "\\u", "valid", "\\u", "test\\u", "ratio_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "train", "\\u", "valid", "\\u", "test\\u", "ratio_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "preprocessor_", "=_", "preprocessor_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "noise_", "=_", "noise_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "batch", "\\u", "size_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "batch", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "batches_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "num", "\\u", "batches_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "iter", "\\u", "class_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "iter", "\\u", "class_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rng_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "rng_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "state_", "._", "dataset_", "._", "type_", "[_", ":_", "11_", "]_", "==_", "'", "Trans", "Factor", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dataset_", "=_", "getattr_", "(_", "tf_", ",_", "self_", "._", "state_", "._", "dataset_", "._", "type_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "feature", "\\u", "size", " ", "=", " ", "self", ".", "state", ".", "dataset", ".", "feature", "\\u", "size", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "target", "\\u", "size", " ", "=", " ", "self", ".", "state", ".", "dataset", ".", "feature", "\\u", "size", ",_", "\\u\\u\\uNL\\u\\u\\u_", "train", "\\u", "valid", "\\u", "test\\u", "ratio_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "train", "\\u", "valid", "\\u", "test\\u", "ratio_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "preprocessor_", "=_", "preprocessor_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "noise_", "=_", "noise_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "batch", "\\u", "size_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "batch", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "batches_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "num", "\\u", "batches_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "iter", "\\u", "class_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "iter", "\\u", "class_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rng_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "rng_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train_", "=_", "dataset_", "._", "get", "\\u", "train_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dataset_", "._", "set\\u", "train_", "(_", "train_", "._", "X_", ",_", "train_", "._", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "valid_", "=_", "dataset_", "._", "get", "\\u", "valid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dataset_", "._", "set\\u", "valid_", "(_", "valid_", "._", "X_", ",_", "valid_", "._", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test_", "=_", "dataset_", "._", "get", "\\u", "test_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dataset_", "._", "set\\u", "test_", "(_", "test_", "._", "X_", ",_", "test_", "._", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "dataset_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "AE", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "\\u", "learn", "ing", "\\u", "method_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "state_", "._", "learn", "ing", "\\u", "method_", "._", "type_", "==_", "'", "SGD", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "learn", "\\u", "method_", "=_", "getattr_", "(_", "learn", "ing", "\\u", "methods_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "state_", "._", "learn", "ing", "\\u", "method_", "._", "type_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "learn", "ing", "\\u", "rate_", "=_", "self_", "._", "state_", "._", "learn", "ing", "\\u", "method_", "._", "learn", "ing", "\\u", "rate_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "momentum_", "=_", "self_", "._", "state_", "._", "learn", "ing", "\\u", "method_", "._", "momentum_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "state_", "._", "learn", "ing", "\\u", "method_", "._", "type_", "==_", "'", "Ada", "Grad", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "learn", "\\u", "method_", "=_", "getattr_", "(_", "learn", "ing", "\\u", "methods_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "state_", "._", "learn", "ing", "\\u", "method_", "._", "type_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "learn", "ing", "\\u", "rate_", "=_", "self_", "._", "state_", "._", "learn", "ing", "\\u", "method_", "._", "learn", "ing", "\\u", "rate_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "momentum_", "=_", "self_", "._", "state_", "._", "learn", "ing", "\\u", "method_", "._", "momentum_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "state_", "._", "learn", "ing", "\\u", "method_", "._", "type_", "==_", "'", "Ada", "Del", "ta", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "learn", "\\u", "method_", "=_", "getattr_", "(_", "learn", "ing", "\\u", "methods_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "state_", "._", "learn", "ing", "\\u", "method_", "._", "type_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "rho_", "=_", "self_", "._", "state_", "._", "learn", "ing", "\\u", "method_", "._", "rho_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "eps_", "=_", "self_", "._", "state_", "._", "learn", "ing", "\\u", "method_", "._", "eps_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "\"", "not", " ", "SGD", ",", " ", "Ada", "Grad", " ", "or", " ", "Ada", "Del", "ta", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "learn", "\\u", "method_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "AE", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "\\u", "learn", "ing", "\\u", "rule_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "learn", "ing", "\\u", "rule_", "=_", "Learn", "ing", "Rule_", "(_", "max", "\\u", "col", "\\u", "norm_", "=_", "self_", "._", "state_", "._", "learn", "ing", "\\u", "rule_", "._", "max", "\\u", "col", "\\u", "norm_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "L1", "\\u", "lambda_", "=_", "self_", "._", "state_", "._", "learn", "ing", "\\u", "rule_", "._", "L1", "\\u", "lambda_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "L", "2", "\\u", "lambda_", "=_", "self_", "._", "state_", "._", "learn", "ing", "\\u", "rule_", "._", "L", "2", "\\u", "lambda_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "train", "ing", "\\u", "cost_", "=_", "Cost_", "(_", "type_", "=_", "self_", "._", "state_", "._", "learn", "ing", "\\u", "rule_", "._", "cost_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stopping", "\\u", "criteria_", "=_", "{_", "'", "max", "\\u", "epoch", "'_", ":_", "self_", "._", "state_", "._", "learn", "ing", "\\u", "rule_", "._", "stopping", "\\u", "criteria_", "._", "max", "\\u", "epoch_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "epoch", "\\u", "look", "\\u", "back", "'_", ":_", "self_", "._", "state_", "._", "learn", "ing", "\\u", "rule_", "._", "stopping", "\\u", "criteria_", "._", "epoch", "\\u", "look", "\\u", "back_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cost", "'_", ":_", "Cost_", "(_", "type_", "=_", "self_", "._", "state_", "._", "learn", "ing", "\\u", "rule_", "._", "stopping", "\\u", "criteria_", "._", "cost_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "percent", "\\u", "decrease", "'_", ":_", "self_", "._", "state_", "._", "learn", "ing", "\\u", "rule_", "._", "stopping", "\\u", "criteria_", "._", "percent", "\\u", "decrease", "_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "learn", "ing", "\\u", "rule_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "AE", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "\\u", "one", "\\u", "hid", "\\u", "model_", "(_", "self_", ",_", "input", "\\u", "dim_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "Auto", "Encoder_", "(_", "input", "\\u", "dim_", "=_", "input", "\\u", "dim_", ",_", "rand", "\\u", "seed_", "=_", "self_", "._", "state_", "._", "model_", "._", "rand", "\\u", "seed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "h1", "\\u", "noise_", "=_", "None_", "if_", "self_", "._", "state_", "._", "hidden", "1_", "._", "layer", "\\u", "noise_", "._", "type_", "is_", "None_", "else_", "getattr_", "(_", "layer", "\\u", "noise_", ",_", "self_", "._", "state_", "._", "hidden", "1_", "._", "layer", "\\u", "noise_", "._", "type_", ")_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "state_", "._", "hidden", "1_", "._", "layer", "\\u", "noise_", "._", "type_", "in_", "[_", "'", "Black", "Out", "'_", ",_", "'", "Mask", "Out", "'_", ",_", "'", "Bat", "ch", "Out", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h1", "\\u", "noise_", "._", "ratio_", "=_", "self_", "._", "state_", "._", "hidden", "1_", "._", "layer", "\\u", "noise_", "._", "ratio_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "state_", "._", "hidden", "1_", "._", "layer", "\\u", "noise_", "._", "type_", "==_", "'", "Gaussian", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h1", "\\u", "noise_", "._", "std_", "=_", "self_", "._", "state_", "._", "hidden", "1_", "._", "layer", "\\u", "noise_", "._", "std_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h1", "\\u", "noise_", "._", "mean_", "=_", "self_", "._", "state_", "._", "hidden", "1_", "._", "layer", "\\u", "noise_", "._", "mean_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "hidden", "1_", "=_", "getattr_", "(_", "layer_", ",_", "self_", "._", "state_", "._", "hidden", "1_", "._", "type_", ")_", "(_", "dim_", "=_", "self_", "._", "state_", "._", "hidden", "1_", "._", "dim_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "self_", "._", "state_", "._", "hidden", "1_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "drop", "out", "\\u", "below_", "=_", "self_", "._", "state_", "._", "hidden", "1_", "._", "drop", "out", "\\u", "below_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "noise_", "=_", "h1", "\\u", "noise_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "black", "out", "\\u", "belo", "w", "=", "self", ".", "state", ".", "hidden", "1", ".", "black", "out", "\\u", "belo", "w", ")_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "._", "add", "\\u", "encode", "\\u", "layer_", "(_", "hidden", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h1", "\\u", "mirror_", "=_", "getattr_", "(_", "layer_", ",_", "self_", "._", "state_", "._", "h1", "\\u", "mirror_", "._", "type_", ")_", "(_", "dim_", "=_", "input", "\\u", "dim_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "self_", "._", "state_", "._", "h1", "\\u", "mirror_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "W_", "=_", "hidden", "1_", "._", "W_", "._", "T_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "drop", "out", "\\u", "below_", "=_", "self_", "._", "state_", "._", "h1", "\\u", "mirror_", "._", "drop", "out", "\\u", "below_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "black", "out", "\\u", "belo", "w", "=", "self", ".", "state", ".", "h1", "\\u", "mirror", ".", "black", "out", "\\u", "belo", "w", ")_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "._", "add", "\\u", "decode", "\\u", "layer_", "(_", "h1", "\\u", "mirror_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "AE", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "\\u", "one", "\\u", "hid", "\\u", "model", "\\u", "no", "\\u", "transpose_", "(_", "self_", ",_", "input", "\\u", "dim_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "Auto", "Encoder_", "(_", "input", "\\u", "dim_", "=_", "input", "\\u", "dim_", ",_", "rand", "\\u", "seed_", "=_", "self_", "._", "state_", "._", "model_", "._", "rand", "\\u", "seed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hidden", "1_", "=_", "getattr_", "(_", "layer_", ",_", "self_", "._", "state_", "._", "hidden", "1_", "._", "type_", ")_", "(_", "dim_", "=_", "self_", "._", "state_", "._", "hidden", "1_", "._", "dim_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "self_", "._", "state_", "._", "hidden", "1_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "drop", "out", "\\u", "below_", "=_", "self_", "._", "state_", "._", "hidden", "1_", "._", "drop", "out", "\\u", "below_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "noise_", "=_", "None_", "if_", "self_", "._", "state_", "._", "hidden", "1_", "._", "layer", "\\u", "noise_", "is_", "None_", "else_", "getattr_", "(_", "layer", "\\u", "noise_", ",_", "self_", "._", "state_", "._", "hidden", "1_", "._", "layer", "\\u", "noise_", ")_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "black", "out", "\\u", "belo", "w", "=", "self", ".", "state", ".", "hidden", "1", ".", "black", "out", "\\u", "belo", "w", ")_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "._", "add", "\\u", "encode", "\\u", "layer_", "(_", "hidden", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h1", "\\u", "mirror_", "=_", "getattr_", "(_", "layer_", ",_", "self_", "._", "state_", "._", "h1", "\\u", "mirror_", "._", "type_", ")_", "(_", "dim_", "=_", "input", "\\u", "dim_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "self_", "._", "state_", "._", "h1", "\\u", "mirror_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "drop", "out", "\\u", "below_", "=_", "self_", "._", "state_", "._", "h1", "\\u", "mirror_", "._", "drop", "out", "\\u", "below_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "black", "out", "\\u", "belo", "w", "=", "self", ".", "state", ".", "h1", "\\u", "mirror", ".", "black", "out", "\\u", "belo", "w", ")_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "._", "add", "\\u", "decode", "\\u", "layer_", "(_", "h1", "\\u", "mirror_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "AE", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "\\u", "two", "\\u", "hid", "\\u", "model_", "(_", "self_", ",_", "input", "\\u", "dim_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "Auto", "Encoder_", "(_", "input", "\\u", "dim_", "=_", "input", "\\u", "dim_", ",_", "rand", "\\u", "seed_", "=_", "self_", "._", "state_", "._", "model_", "._", "rand", "\\u", "seed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hidden", "1_", "=_", "getattr_", "(_", "layer_", ",_", "self_", "._", "state_", "._", "hidden", "1_", "._", "type_", ")_", "(_", "dim_", "=_", "self_", "._", "state_", "._", "hidden", "1_", "._", "dim_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "self_", "._", "state_", "._", "hidden", "1_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "drop", "out", "\\u", "below_", "=_", "self_", "._", "state_", "._", "hidden", "1_", "._", "drop", "out", "\\u", "below_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "noise_", "=_", "None_", "if_", "self_", "._", "state_", "._", "hidden", "1_", "._", "layer", "\\u", "noise_", "is_", "None_", "else_", "getattr_", "(_", "layer", "\\u", "noise_", ",_", "self_", "._", "state_", "._", "hidden", "1_", "._", "layer", "\\u", "noise_", ")_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "black", "out", "\\u", "belo", "w", "=", "self", ".", "state", ".", "hidden", "1", ".", "black", "out", "\\u", "belo", "w", ")_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "._", "add", "\\u", "encode", "\\u", "layer_", "(_", "hidden", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "hidden", "2_", "=_", "getattr_", "(_", "layer_", ",_", "self_", "._", "state_", "._", "hidden", "2_", "._", "type_", ")_", "(_", "dim_", "=_", "self_", "._", "state_", "._", "hidden", "2_", "._", "dim_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "self_", "._", "state_", "._", "hidden", "2_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "drop", "out", "\\u", "below_", "=_", "self_", "._", "state_", "._", "hidden", "2_", "._", "drop", "out", "\\u", "below_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "noise_", "=_", "None_", "if_", "self_", "._", "state_", "._", "hidden", "2_", "._", "layer", "\\u", "noise_", "is_", "None_", "else_", "getattr_", "(_", "layer", "\\u", "noise_", ",_", "self_", "._", "state_", "._", "hidden", "2_", "._", "layer", "\\u", "noise_", ")_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "black", "out", "\\u", "belo", "w", "=", "self", ".", "state", ".", "hidden", "2", ".", "black", "out", "\\u", "belo", "w", ")_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "._", "add", "\\u", "encode", "\\u", "layer_", "(_", "hidden", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "hidden", "2", "\\u", "mirror_", "=_", "getattr_", "(_", "layer_", ",_", "self_", "._", "state_", "._", "h2", "\\u", "mirror_", "._", "type_", ")_", "(_", "dim_", "=_", "self_", "._", "state_", "._", "hidden", "1_", "._", "dim_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "self_", "._", "state_", "._", "h2", "\\u", "mirror_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "drop", "out", "\\u", "below_", "=_", "self_", "._", "state_", "._", "h2", "\\u", "mirror_", "._", "drop", "out", "\\u", "below_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "black", "out", "\\u", "belo", "w", "=", "self", ".", "state", ".", "h2", "\\u", "mirror", ".", "black", "out", "\\u", "belo", "w", ",_", "\\u\\u\\uNL\\u\\u\\u_", "W_", "=_", "hidden", "2_", "._", "W_", "._", "T_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "add", "\\u", "decode", "\\u", "layer_", "(_", "hidden", "2", "\\u", "mirror_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "hidden", "1", "\\u", "mirror_", "=_", "getattr_", "(_", "layer_", ",_", "self_", "._", "state_", "._", "h1", "\\u", "mirror_", "._", "type_", ")_", "(_", "dim_", "=_", "input", "\\u", "dim_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "self_", "._", "state_", "._", "h1", "\\u", "mirror_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "drop", "out", "\\u", "below_", "=_", "self_", "._", "state_", "._", "h1", "\\u", "mirror_", "._", "drop", "out", "\\u", "below_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "black", "out", "\\u", "belo", "w", "=", "self", ".", "state", ".", "h1", "\\u", "mirror", ".", "black", "out", "\\u", "belo", "w", ",_", "\\u\\u\\uNL\\u\\u\\u_", "W_", "=_", "hidden", "1_", "._", "W_", "._", "T_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "add", "\\u", "decode", "\\u", "layer_", "(_", "hidden", "1", "\\u", "mirror_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "AE", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "\\u", "database_", "(_", "self_", ",_", "dataset_", ",_", "learn", "ing", "\\u", "rule_", ",_", "learn", "ing", "\\u", "method_", ",_", "model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "save", "\\u", "to", "\\u", "database_", "=_", "{_", "'", "name", "'_", ":_", "self_", "._", "state_", "._", "log_", "._", "save", "\\u", "to", "\\u", "databa", "se", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "record", "s", "'_", ":_", "{_", "'", "Datas", "et", "'_", ":_", "dataset_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "max", "\\u", "col", "\\u", "norm", "'_", ":_", "learn", "ing", "\\u", "rule_", "._", "max", "\\u", "col", "\\u", "norm_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Weig", "ht", "\\u", "Ini", "t", "\\u", "See", "d", "'_", ":_", "model_", "._", "rand", "\\u", "seed_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Drop", "out", "\\u", "Below", "'_", ":_", "str_", "(_", "[_", "layer_", "._", "drop", "out", "\\u", "below_", "for_", "layer_", "in_", "model_", "._", "layers_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Learn", "ing", "\\u", "Meth", "od", "'_", ":_", "learn", "ing", "\\u", "method_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Bat", "ch", "\\u", "Size", "'_", ":_", "dataset_", "._", "batch", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Datas", "et", "\\u", "No", "ise", "'_", ":_", "dataset_", "._", "noise_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Datas", "et", "\\u", "Dir", "'_", ":_", "dataset_", "._", "data\\u", "dir_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Feature", "\\u", "Size", "'_", ":_", "dataset_", "._", "feature", "\\u", "size_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "nbl", "ock", "s", "'_", ":_", "dataset_", "._", "nbl", "ock", "s_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Layer", "\\u", "Type", "s", "'_", ":_", "str_", "(_", "[_", "layer_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "for_", "layer_", "in_", "model_", "._", "layers_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Layer", "\\u", "Dim", "'_", ":_", "str_", "(_", "[_", "layer_", "._", "dim_", "for_", "layer_", "in_", "model_", "._", "layers_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Preprocessor", "'_", ":_", "dataset_", "._", "preprocessor_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Train", "ing", "\\u", "Cost", "'_", ":_", "learn", "ing", "\\u", "rule_", "._", "cost_", "._", "type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Stopp", "ing", "\\u", "Cost", "'_", ":_", "learn", "ing", "\\u", "rule_", "._", "stopping", "\\u", "criteria_", "[_", "'", "cost", "'_", "]_", "._", "type_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "learn", "ing", "\\u", "method_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "==_", "\"", "SGD", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "save", "\\u", "to", "\\u", "database_", "[_", "\"", "record", "s", "\"_", "]_", "[_", "\"", "Learn", "ing", "\\u", "rate", "\"_", "]_", "=_", "learn", "ing", "\\u", "method_", "._", "learn", "ing", "\\u", "rate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "save", "\\u", "to", "\\u", "database_", "[_", "\"", "record", "s", "\"_", "]_", "[_", "\"", "Moment", "um", "\"_", "]_", "=_", "learn", "ing", "\\u", "method_", "._", "momentum_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "learn", "ing", "\\u", "method_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "==_", "\"", "Ada", "Grad", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "save", "\\u", "to", "\\u", "database_", "[_", "\"", "record", "s", "\"_", "]_", "[_", "\"", "Learn", "ing", "\\u", "rate", "\"_", "]_", "=_", "learn", "ing", "\\u", "method_", "._", "learn", "ing", "\\u", "rate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "save", "\\u", "to", "\\u", "database_", "[_", "\"", "record", "s", "\"_", "]_", "[_", "\"", "Moment", "um", "\"_", "]_", "=_", "learn", "ing", "\\u", "method_", "._", "momentum_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "learn", "ing", "\\u", "method_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "==_", "\"", "Ada", "Del", "ta", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "save", "\\u", "to", "\\u", "database_", "[_", "\"", "record", "s", "\"_", "]_", "[_", "\"", "rho", "\"_", "]_", "=_", "learn", "ing", "\\u", "method_", "._", "rho_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "save", "\\u", "to", "\\u", "database_", "[_", "\"", "record", "s", "\"_", "]_", "[_", "\"", "eps", "\"_", "]_", "=_", "learn", "ing", "\\u", "method_", "._", "eps_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "\"", "not", " ", "SGD", ",", " ", "Ada", "Grad", " ", "or", " ", "Ada", "Del", "ta", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "layer", "\\u", "noise_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "layer", "\\u", "noise", "\\u", "params_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "layer_", "in_", "model_", "._", "layers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "layer", "\\u", "noise_", "._", "append_", "(_", "layer_", "._", "noise_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "layer_", "._", "noise_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "in_", "[_", "'", "Black", "Out", "'_", ",_", "'", "Mask", "Out", "'_", ",_", "'", "Bat", "ch", "Out", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "layer", "\\u", "noise", "\\u", "params_", "._", "append_", "(_", "layer_", "._", "noise_", "._", "ratio_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "layer_", "._", "noise_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "is_", "'", "Gaussian", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "layer", "\\u", "noise", "\\u", "params_", "._", "append_", "(_", "(_", "layer_", "._", "noise_", "._", "mean_", ",_", "layer_", "._", "noise_", "._", "std_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "layer", "\\u", "noise", "\\u", "params_", "._", "append_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "save", "\\u", "to", "\\u", "database_", "[_", "\"", "record", "s", "\"_", "]_", "[_", "\"", "Layer", "\\u", "No", "ise", "\"_", "]_", "=_", "str_", "(_", "layer", "\\u", "noise_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "save", "\\u", "to", "\\u", "database_", "[_", "\"", "record", "s", "\"_", "]_", "[_", "\"", "Layer", "\\u", "No", "ise", "\\u", "Param", "s", "\"_", "]_", "=_", "str_", "(_", "layer", "\\u", "noise", "\\u", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "save", "\\u", "to", "\\u", "database_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "AE", "\\u", "Test", "ing_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "AE", "\\u", "Test", "ing_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "state_", "=_", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "AE", "\\u", "Test", "ing_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dataset_", "=_", "self_", "._", "build", "\\u", "dataset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "learn", "ing", "\\u", "rule_", "=_", "self_", "._", "build", "\\u", "learn", "ing", "\\u", "rule_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "learn", "\\u", "method_", "=_", "self_", "._", "build", "\\u", "learn", "ing", "\\u", "method_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "=_", "self_", "._", "build", "\\u", "one", "\\u", "hid", "\\u", "model_", "(_", "dataset_", "._", "feature", "\\u", "size_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "state_", "._", "log_", "._", "save", "\\u", "to", "\\u", "databa", "se", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "database_", "=_", "self_", "._", "build", "\\u", "database_", "(_", "dataset_", ",_", "learn", "ing", "\\u", "rule_", ",_", "learn", "\\u", "method_", ",_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "=_", "self_", "._", "build", "\\u", "log_", "(_", "database_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "train", "\\u", "obj_", "=_", "Train", "Object_", "(_", "log_", "=_", "log_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dataset_", "=_", "dataset_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "learn", "ing", "\\u", "rule_", "=_", "learn", "ing", "\\u", "rule_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "learn", "ing", "\\u", "method_", "=_", "learn", "\\u", "method_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "=_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "\\u", "obj_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fine", " ", "tuning", "_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "._", "info_", "(_", "\"", "fine", " ", "tuning", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "\\u", "obj_", "._", "model_", "._", "layers_", "[_", "0_", "]_", "._", "drop", "out", "\\u", "below_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "\\u", "obj_", "._", "setup_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "\\u", "obj_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Lau", "ra", "\\u", "Mapping_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Lau", "ra", "\\u", "Mapping_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "state_", "=_", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Lau", "ra", "\\u", "Mapping_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "preprocessor_", "=_", "None_", "if_", "self_", "._", "state_", "._", "dataset_", "._", "preprocessor_", "is_", "None_", "else_", "getattr_", "(_", "preproc", "_", ",_", "self_", "._", "state_", "._", "dataset_", "._", "preprocessor_", ")_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dataset_", "=_", "getattr_", "(_", "mapping_", ",_", "self_", "._", "state_", "._", "dataset_", "._", "type_", ")_", "(_", "feature", "\\u", "size_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "feature", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "target", "\\u", "size_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "target", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "train", "\\u", "valid", "\\u", "test\\u", "ratio_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "train", "\\u", "valid", "\\u", "test\\u", "ratio_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "preprocessor_", "=_", "preprocessor_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "batch", "\\u", "size_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "batch", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "batches_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "num", "\\u", "batches_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "iter", "\\u", "class_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "iter", "\\u", "class_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rng_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "rng_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "MLP", "_", "(_", "input", "\\u", "dim_", "=_", "self_", "._", "state_", "._", "dataset_", "._", "feature", "\\u", "size_", ",_", "rand", "\\u", "seed_", "=_", "self_", "._", "state_", "._", "model_", "._", "rand", "\\u", "seed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hidden", "1_", "=_", "getattr_", "(_", "layer_", ",_", "self_", "._", "state_", "._", "hidden", "1_", "._", "type_", ")_", "(_", "dim_", "=_", "self_", "._", "state_", "._", "hidden", "1_", "._", "dim_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "self_", "._", "state_", "._", "hidden", "1_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "drop", "out", "\\u", "below_", "=_", "self_", "._", "state_", "._", "hidden", "1_", "._", "drop", "out", "\\u", "below_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "add", "\\u", "layer_", "(_", "hidden", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "hidden", "2_", "=_", "getattr_", "(_", "layer_", ",_", "self_", "._", "state_", "._", "hidden", "2_", "._", "type_", ")_", "(_", "dim_", "=_", "self_", "._", "state_", "._", "hidden", "2_", "._", "dim_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "self_", "._", "state_", "._", "hidden", "2_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "drop", "out", "\\u", "below_", "=_", "self_", "._", "state_", "._", "hidden", "2_", "._", "drop", "out", "\\u", "below_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "add", "\\u", "layer_", "(_", "hidden", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "output_", "=_", "getattr_", "(_", "layer_", ",_", "self_", "._", "state_", "._", "output_", "._", "type_", ")_", "(_", "dim_", "=_", "self_", "._", "state_", "._", "output_", "._", "dim_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "self_", "._", "state_", "._", "output_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "drop", "out", "\\u", "below_", "=_", "self_", "._", "state_", "._", "output_", "._", "drop", "out", "\\u", "below_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "add", "\\u", "layer_", "(_", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "learn", "ing", "\\u", "rule_", "=_", "self_", "._", "build", "\\u", "learn", "ing", "\\u", "rule_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "learn", "\\u", "method_", "=_", "self_", "._", "build", "\\u", "learn", "ing", "\\u", "method_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "database_", "=_", "self_", "._", "build", "\\u", "database_", "(_", "dataset_", ",_", "learn", "ing", "\\u", "rule_", ",_", "learn", "\\u", "method_", ",_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "=_", "self_", "._", "build", "\\u", "log_", "(_", "database_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "train", "\\u", "obj_", "=_", "Train", "Object_", "(_", "log_", "=_", "log_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dataset_", "=_", "dataset_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "learn", "ing", "\\u", "rule_", "=_", "learn", "ing", "\\u", "rule_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "learn", "ing", "\\u", "method_", "=_", "learn", "\\u", "method_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "=_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "train", "\\u", "obj_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Lau", "ra_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Lau", "ra_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "state_", "=_", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Lau", "ra_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dataset_", "=_", "self_", "._", "build", "\\u", "dataset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "learn", "ing", "\\u", "rule_", "=_", "self_", "._", "build", "\\u", "learn", "ing", "\\u", "rule_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "learn", "\\u", "method_", "=_", "self_", "._", "build", "\\u", "learn", "ing", "\\u", "method_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "import", " ", "pdb_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pdb", ".", "set\\u", "trace", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "state_", "._", "num", "\\u", "layers_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "self_", "._", "build", "\\u", "one", "\\u", "hid", "\\u", "model_", "(_", "dataset_", "._", "feature", "\\u", "size_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "state_", "._", "num", "\\u", "layers_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "self_", "._", "build", "\\u", "two", "\\u", "hid", "\\u", "model_", "(_", "dataset_", "._", "feature", "\\u", "size_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "database_", "=_", "self_", "._", "build", "\\u", "database_", "(_", "dataset_", ",_", "learn", "ing", "\\u", "rule_", ",_", "learn", "\\u", "method_", ",_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "=_", "self_", "._", "build", "\\u", "log_", "(_", "database_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dataset_", "._", "log_", "=_", "log_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "train", "\\u", "obj_", "=_", "Train", "Object_", "(_", "log_", "=_", "log_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dataset_", "=_", "dataset_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "learn", "ing", "\\u", "rule_", "=_", "learn", "ing", "\\u", "rule_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "learn", "ing", "\\u", "method_", "=_", "learn", "\\u", "method_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "=_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "train", "\\u", "obj_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "._", "info_", "(_", "\"", "Fin", "e", " ", "Tuni", "ng", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "layer_", "in_", "train", "\\u", "obj_", "._", "model_", "._", "layers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "layer_", "._", "drop", "out", "\\u", "below_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "layer_", "._", "noise_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "train", "\\u", "obj_", "._", "setup_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "\\u", "obj_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Lau", "ra", "\\u", "Continu", "e_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Lau", "ra", "\\u", "Continu", "e_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "state_", "=_", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Lau", "ra", "\\u", "Continu", "e_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "\\u", "model_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "os_", "._", "environ_", "[_", "'", "PY", "NET", "\\u", "SAVE", "\\u", "PATH", "'_", "]_", "+_", "'/", "log", "/'_", "\\u\\u\\uNL\\u\\u\\u_", "+_", "self_", "._", "state_", "._", "hidden", "1_", "._", "model_", "+_", "'/", "model", ".", "pkl", "'_", ")_", "as_", "f1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "c", "Pickle_", "._", "load_", "(_", "f1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Lau", "ra", "\\u", "Continu", "e_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dataset_", "=_", "self_", "._", "build", "\\u", "dataset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "learn", "ing", "\\u", "rule_", "=_", "self_", "._", "build", "\\u", "learn", "ing", "\\u", "rule_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "learn", "\\u", "method_", "=_", "self_", "._", "build", "\\u", "learn", "ing", "\\u", "method_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "=_", "self_", "._", "build", "\\u", "model_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "state_", "._", "fine", "\\u", "tuning", "\\u", "only_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "layer_", "in_", "model_", "._", "layers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "layer_", "._", "drop", "out", "\\u", "below_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "layer_", "._", "noise_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"", "Fin", "e", " ", "Tuni", "ng", " ", "On", "ly", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "state_", "._", "log_", "._", "save", "\\u", "to", "\\u", "databa", "se", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "database_", "=_", "self_", "._", "build", "\\u", "database_", "(_", "dataset_", ",_", "learn", "ing", "\\u", "rule_", ",_", "learn", "\\u", "method_", ",_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "database_", "[_", "'", "record", "s", "'_", "]_", "[_", "'", "model", "'_", "]_", "=_", "self_", "._", "state_", "._", "hidden", "1_", "._", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "=_", "self_", "._", "build", "\\u", "log_", "(_", "database_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "train", "\\u", "obj_", "=_", "Train", "Object_", "(_", "log_", "=_", "log_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dataset_", "=_", "dataset_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "learn", "ing", "\\u", "rule_", "=_", "learn", "ing", "\\u", "rule_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "learn", "ing", "\\u", "method_", "=_", "learn", "\\u", "method_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "=_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "train", "\\u", "obj_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "self_", "._", "state_", "._", "fine", "\\u", "tuning", "\\u", "only_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "\"..", "Fin", "e", " ", "Tuni", "ng", " ", "after", " ", "No", "isy", " ", "Train", "ing", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "layer_", "in_", "train", "\\u", "obj_", "._", "model_", "._", "layers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "layer_", "._", "drop", "out", "\\u", "below_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "layer_", "._", "noise_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "train", "\\u", "obj_", "._", "setup_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "\\u", "obj_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Lau", "ra", "\\u", "Tw", "o", "\\u", "Layers_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Lau", "ra", "\\u", "Tw", "o", "\\u", "Layers_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "state_", "=_", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Lau", "ra", "\\u", "Tw", "o", "\\u", "Layers_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "\\u", "model_", "(_", "self_", ",_", "input", "\\u", "dim_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "os_", "._", "environ_", "[_", "'", "PY", "NET", "\\u", "SAVE", "\\u", "PATH", "'_", "]_", "+_", "'/", "log", "/'_", "\\u\\u\\uNL\\u\\u\\u_", "+_", "self_", "._", "state_", "._", "hidden", "1_", "._", "model_", "+_", "'/", "model", ".", "pkl", "'_", ")_", "as_", "f1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model", "1_", "=_", "c", "Pickle_", "._", "load_", "(_", "f1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "open_", "(_", "os_", "._", "environ_", "[_", "'", "PY", "NET", "\\u", "SAVE", "\\u", "PATH", "'_", "]_", "+_", "'/", "log", "/'_", "\\u\\u\\uNL\\u\\u\\u_", "+_", "self_", "._", "state_", "._", "hidden", "2_", "._", "model_", "+_", "'/", "model", ".", "pkl", "'_", ")_", "as_", "f2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model", "2_", "=_", "c", "Pickle_", "._", "load_", "(_", "f2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "model_", "=_", "Auto", "Encoder_", "(_", "input", "\\u", "dim_", "=_", "input", "\\u", "dim_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "len_", "(_", "model", "1_", "._", "encode", "\\u", "layers_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "._", "add", "\\u", "encode", "\\u", "layer_", "(_", "model", "1_", "._", "pop", "\\u", "encode", "\\u", "layer_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "len_", "(_", "model", "2_", "._", "encode", "\\u", "layers_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "._", "add", "\\u", "encode", "\\u", "layer_", "(_", "model", "2_", "._", "pop", "\\u", "encode", "\\u", "layer_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "len_", "(_", "model", "2_", "._", "decode", "\\u", "layers_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "._", "add", "\\u", "decode", "\\u", "layer_", "(_", "model", "2_", "._", "pop", "\\u", "decode", "\\u", "layer_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "len_", "(_", "model", "1_", "._", "decode", "\\u", "layers_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "._", "add", "\\u", "decode", "\\u", "layer_", "(_", "model", "1_", "._", "pop", "\\u", "decode", "\\u", "layer_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Lau", "ra", "\\u", "Tw", "o", "\\u", "Layers_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dataset_", "=_", "self_", "._", "build", "\\u", "dataset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "learn", "ing", "\\u", "rule_", "=_", "self_", "._", "build", "\\u", "learn", "ing", "\\u", "rule_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "learn", "\\u", "method_", "=_", "self_", "._", "build", "\\u", "learn", "ing", "\\u", "method_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "=_", "self_", "._", "build", "\\u", "model_", "(_", "dataset_", "._", "feature", "\\u", "size_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "layers_", "[_", "0_", "]_", "._", "drop", "out", "\\u", "below_", "=_", "self_", "._", "state_", "._", "hidden", "1_", "._", "drop", "out", "\\u", "below_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "state_", "._", "log_", "._", "save", "\\u", "to", "\\u", "databa", "se", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "database_", "=_", "self_", "._", "build", "\\u", "database_", "(_", "dataset_", ",_", "learn", "ing", "\\u", "rule_", ",_", "learn", "\\u", "method_", ",_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "database_", "[_", "'", "record", "s", "'_", "]_", "[_", "'", "h1", "\\u", "model", "'_", "]_", "=_", "self_", "._", "state_", "._", "hidden", "1_", "._", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "database_", "[_", "'", "record", "s", "'_", "]_", "[_", "'", "h2", "\\u", "model", "'_", "]_", "=_", "self_", "._", "state_", "._", "hidden", "2_", "._", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "=_", "self_", "._", "build", "\\u", "log_", "(_", "database_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "._", "info_", "(_", "\"", "Fin", "e", " ", "Tuni", "ng", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "layer_", "in_", "model_", "._", "layers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "layer_", "._", "drop", "out", "\\u", "below_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "layer_", "._", "noise_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "train", "\\u", "obj_", "=_", "Train", "Object_", "(_", "log_", "=_", "log_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dataset_", "=_", "dataset_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "learn", "ing", "\\u", "rule_", "=_", "learn", "ing", "\\u", "rule_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "learn", "ing", "\\u", "method_", "=_", "learn", "\\u", "method_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "=_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "train", "\\u", "obj_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Lau", "ra", "\\u", "Thre", "e\\u", "Layers_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Lau", "ra", "\\u", "Thre", "e\\u", "Layers_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "state_", "=_", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Lau", "ra", "\\u", "Thre", "e\\u", "Layers_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "\\u", "model_", "(_", "self_", ",_", "input", "\\u", "dim_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "os_", "._", "environ_", "[_", "'", "PY", "NET", "\\u", "SAVE", "\\u", "PATH", "'_", "]_", "+_", "'/", "log", "/'_", "\\u\\u\\uNL\\u\\u\\u_", "+_", "self_", "._", "state_", "._", "hidden", "1_", "._", "model_", "+_", "'/", "model", ".", "pkl", "'_", ")_", "as_", "f1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model", "1_", "=_", "c", "Pickle_", "._", "load_", "(_", "f1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "open_", "(_", "os_", "._", "environ_", "[_", "'", "PY", "NET", "\\u", "SAVE", "\\u", "PATH", "'_", "]_", "+_", "'/", "log", "/'_", "\\u\\u\\uNL\\u\\u\\u_", "+_", "self_", "._", "state_", "._", "hidden", "2_", "._", "model_", "+_", "'/", "model", ".", "pkl", "'_", ")_", "as_", "f2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model", "2_", "=_", "c", "Pickle_", "._", "load_", "(_", "f2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "open_", "(_", "os_", "._", "environ_", "[_", "'", "PY", "NET", "\\u", "SAVE", "\\u", "PATH", "'_", "]_", "+_", "'/", "log", "/'_", "\\u\\u\\uNL\\u\\u\\u_", "+_", "self_", "._", "state_", "._", "hidden", "3_", "._", "model_", "+_", "'/", "model", ".", "pkl", "'_", ")_", "as_", "f3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model", "3_", "=_", "c", "Pickle_", "._", "load_", "(_", "f3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "model_", "=_", "Auto", "Encoder_", "(_", "input", "\\u", "dim_", "=_", "input", "\\u", "dim_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "._", "add", "\\u", "encode", "\\u", "layer_", "(_", "model", "1_", "._", "pop", "\\u", "encode", "\\u", "layer_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "add", "\\u", "encode", "\\u", "layer_", "(_", "model", "2_", "._", "pop", "\\u", "encode", "\\u", "layer_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "add", "\\u", "encode", "\\u", "layer_", "(_", "model", "3_", "._", "pop", "\\u", "encode", "\\u", "layer_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "add", "\\u", "decode", "\\u", "layer_", "(_", "model", "3_", "._", "pop", "\\u", "decode", "\\u", "layer_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "add", "\\u", "decode", "\\u", "layer_", "(_", "model", "2_", "._", "pop", "\\u", "decode", "\\u", "layer_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "add", "\\u", "decode", "\\u", "layer_", "(_", "model", "1_", "._", "pop", "\\u", "decode", "\\u", "layer_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Lau", "ra", "\\u", "Thre", "e\\u", "Layers_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dataset_", "=_", "self_", "._", "build", "\\u", "dataset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "learn", "ing", "\\u", "rule_", "=_", "self_", "._", "build", "\\u", "learn", "ing", "\\u", "rule_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "learn", "\\u", "method_", "=_", "self_", "._", "build", "\\u", "learn", "ing", "\\u", "method_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "=_", "self_", "._", "build", "\\u", "model_", "(_", "dataset_", "._", "feature", "\\u", "size_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "._", "layers_", "[_", "0_", "]_", "._", "drop", "out", "\\u", "below_", "=_", "self_", "._", "state_", "._", "hidden", "1_", "._", "drop", "out", "\\u", "below_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "layers_", "[_", "1_", "]_", "._", "drop", "out", "\\u", "below_", "=_", "self_", "._", "state_", "._", "hidden", "2_", "._", "drop", "out", "\\u", "below_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "layers_", "[_", "2_", "]_", "._", "drop", "out", "\\u", "below_", "=_", "self_", "._", "state_", "._", "hidden", "3_", "._", "drop", "out", "\\u", "below_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "state_", "._", "log_", "._", "save", "\\u", "to", "\\u", "databa", "se", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "database_", "=_", "self_", "._", "build", "\\u", "database_", "(_", "dataset_", ",_", "learn", "ing", "\\u", "rule_", ",_", "learn", "\\u", "method_", ",_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "database_", "[_", "'", "record", "s", "'_", "]_", "[_", "'", "h1", "\\u", "model", "'_", "]_", "=_", "self_", "._", "state_", "._", "hidden", "1_", "._", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "database_", "[_", "'", "record", "s", "'_", "]_", "[_", "'", "h2", "\\u", "model", "'_", "]_", "=_", "self_", "._", "state_", "._", "hidden", "2_", "._", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "database_", "[_", "'", "record", "s", "'_", "]_", "[_", "'", "h", "3", "\\u", "model", "'_", "]_", "=_", "self_", "._", "state_", "._", "hidden", "3_", "._", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "=_", "self_", "._", "build", "\\u", "log_", "(_", "database_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "._", "info_", "(_", "\"", "Fin", "e", " ", "Tuni", "ng", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "layer_", "in_", "model_", "._", "layers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "layer_", "._", "drop", "out", "\\u", "below_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "layer_", "._", "noise_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "train", "\\u", "obj_", "=_", "Train", "Object_", "(_", "log_", "=_", "log_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dataset_", "=_", "dataset_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "learn", "ing", "\\u", "rule_", "=_", "learn", "ing", "\\u", "rule_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "learn", "ing", "\\u", "method_", "=_", "learn", "\\u", "method_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "=_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "\\u", "obj_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Lau", "ra", "\\u", "Tw", "o", "\\u", "Layer", "s", "\\u", "No", "\\u", "Transpose", "_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Lau", "ra", "\\u", "Tw", "o", "\\u", "Layer", "s", "\\u", "No", "\\u", "Transpose", "_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "state_", "=_", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Lau", "ra", "\\u", "Tw", "o", "\\u", "Layer", "s", "\\u", "No", "\\u", "Transpose", "_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dataset_", "=_", "self_", "._", "build", "\\u", "dataset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "learn", "ing", "\\u", "rule_", "=_", "self_", "._", "build", "\\u", "learn", "ing", "\\u", "rule_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "learn", "\\u", "method_", "=_", "self_", "._", "build", "\\u", "learn", "ing", "\\u", "method_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "state_", "._", "num", "\\u", "layers_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "self_", "._", "build", "\\u", "one", "\\u", "hid", "\\u", "model", "\\u", "no", "\\u", "transpose_", "(_", "dataset_", "._", "feature", "\\u", "size_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "state_", "._", "log_", "._", "save", "\\u", "to", "\\u", "databa", "se", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "database_", "=_", "self_", "._", "build", "\\u", "database_", "(_", "dataset_", ",_", "learn", "ing", "\\u", "rule_", ",_", "learn", "\\u", "method_", ",_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "=_", "self_", "._", "build", "\\u", "log_", "(_", "database_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "train", "\\u", "obj_", "=_", "Train", "Object_", "(_", "log_", "=_", "log_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dataset_", "=_", "dataset_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "learn", "ing", "\\u", "rule_", "=_", "learn", "ing", "\\u", "rule_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "learn", "ing", "\\u", "method_", "=_", "learn", "\\u", "method_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "=_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "train", "\\u", "obj_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fine", " ", "tuning", "_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "._", "info_", "(_", "\"", "fine", " ", "tuning", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "\\u", "obj_", "._", "model_", "._", "layers_", "[_", "0_", "]_", "._", "drop", "out", "\\u", "below_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "\\u", "obj_", "._", "setup_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "\\u", "obj_", "._", "run_", "(_", ")_" ]
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 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
cloudera/hue/desktop/core/ext-py/South-1.0.2/south/management/commands/datamigration.py
[ { "content": "\"\"\"\nData migration creation command\n\"\"\"\n\nfrom __future__ import print_function\n\nimport sys\nimport os\nimport re\nfrom optparse import make_option\n\ntry:\n set\nexcept NameError:\n from sets import Set as set\n\nfrom django.core.management.base import BaseCommand\nfrom django.core.management.color import no_style\nfrom django.db import models\nfrom django.conf import settings\n\nfrom south.migration import Migrations\nfrom south.exceptions import NoMigrations\nfrom south.creator import freezer\n\n\n\nMIGRATION_TEMPLATE = \"\"\"# -*- coding: utf-8 -*-\nfrom south.utils import datetime_utils as datetime\nfrom south.db import db\nfrom south.v2 import DataMigration\nfrom django.db import models\n\nclass Migration(DataMigration):\n\n def forwards(self, orm):\n \"Write your forwards methods here.\"\n # Note: Don't use \"from appname.models import ModelName\". \n # Use orm.ModelName to refer to models in this application,\n # and orm['appname.ModelName'] for models in other applications.\n\n def backwards(self, orm):\n \"Write your backwards methods here.\"\n\n models = %(frozen_models)s\n\n %(complete_apps)s\n symmetrical = True\n\"\"\"\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Command(BaseCommand):\n option_list = BaseCommand.option_list + (\n make_option('--freeze', action='append', dest='freeze_list', type='string',\n help='Freeze the specified app(s). Provide an app name with each; use the option multiple times for multiple apps'),\n make_option('--stdout', action='store_true', dest='stdout', default=False,\n help='Print the migration to stdout instead of writing it to a file.'),\n )\n help = \"Creates a new template data migration for the given app\"\n usage_str = \"Usage: ./manage.py datamigration appname migrationname [--stdout] [--freeze appname]\"\n \n \n \n", "metadata": "root.Command", "header": "['module', '___EOS___']", "index": 25 }, { "content": " def handle(self, app=None, name=\"\", freeze_list=None, stdout=False, verbosity=1, **options):\n\n verbosity = int(verbosity)\n \n # Any supposed lists that are None become empty lists\n freeze_list = freeze_list or []\n\n # --stdout means name = -\n if stdout:\n name = \"-\"\n\t\n # Only allow valid names\n if re.search('[^_\\w]', name) and name != \"-\":\n self.error(\"Migration names should contain only alphanumeric characters and underscores.\")\n \n # If not name, there's an error\n if not name:\n self.error(\"You must provide a name for this migration.\\n\" + self.usage_str)\n \n if not app:\n self.error(\"You must provide an app to create a migration for.\\n\" + self.usage_str)\n\n # Ensure that verbosity is not a string (Python 3)\n try:\n verbosity = int(verbosity)\n except ValueError:\n self.error(\"Verbosity must be an number.\\n\" + self.usage_str)\n \n # Get the Migrations for this app (creating the migrations dir if needed)\n migrations = Migrations(app, force_creation=True, verbose_creation=verbosity > 0)\n \n # See what filename is next in line. We assume they use numbers.\n new_filename = migrations.next_filename(name)\n \n # Work out which apps to freeze\n apps_to_freeze = self.calc_frozen_apps(migrations, freeze_list)\n \n # So, what's in this file, then?\n file_contents = self.get_migration_template() % {\n \"frozen_models\": freezer.freeze_apps_to_string(apps_to_freeze),\n \"complete_apps\": apps_to_freeze and \"complete_apps = [%s]\" % (\", \".join(map(repr, apps_to_freeze))) or \"\"\n }\n \n # - is a special name which means 'print to stdout'\n if name == \"-\":\n print(file_contents)\n # Write the migration file if the name isn't -\n else:\n fp = open(os.path.join(migrations.migrations_dir(), new_filename), \"w\")\n fp.write(file_contents)\n fp.close()\n print(\"Created %s.\" % new_filename, file=sys.stderr)", "metadata": "root.Command.handle", "header": "['class', 'Command', '(', 'BaseCommand', ')', ':', '___EOS___']", "index": 35 }, { "content": " def calc_frozen_apps(self, migrations, freeze_list):\n \"\"\"\n Works out, from the current app, settings, and the command line options,\n which apps should be frozen.\n \"\"\"\n apps_to_freeze = []\n for to_freeze in freeze_list:\n if \".\" in to_freeze:\n self.error(\"You cannot freeze %r; you must provide an app label, like 'auth' or 'books'.\" % to_freeze)\n # Make sure it's a real app\n if not models.get_app(to_freeze):\n self.error(\"You cannot freeze %r; it's not an installed app.\" % to_freeze)\n # OK, it's fine\n apps_to_freeze.append(to_freeze)\n if getattr(settings, 'SOUTH_AUTO_FREEZE_APP', True):\n apps_to_freeze.append(migrations.app_label())\n return apps_to_freeze", "metadata": "root.Command.calc_frozen_apps", "header": "['class', 'Command', '(', 'BaseCommand', ')', ':', '___EOS___']", "index": 88 }, { "content": " def error(self, message, code=1):\n \"\"\"\n Prints the error, and exits with the given code.\n \"\"\"\n print(message, file=sys.stderr)\n sys.exit(code)", "metadata": "root.Command.error", "header": "['class', 'Command', '(', 'BaseCommand', ')', ':', '___EOS___']", "index": 106 }, { "content": " def get_migration_template(self):\n return MIGRATION_TEMPLATE", "metadata": "root.Command.get_migration_template", "header": "['class', 'Command', '(', 'BaseCommand', ')', ':', '___EOS___']", "index": 113 } ]
[ { "span": "from django.core.management.color import no_style", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 49 }, { "span": "from south.exceptions import NoMigrations", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 41 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Data", " ", "migrati", "on", " ", "creati", "on", " ", "command", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "print", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "optparse_", "import_", "make", "\\u", "option_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "set_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Name", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "sets_", "import_", "Set_", "as_", "set_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "management_", "._", "base_", "import_", "Base", "Command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "management_", "._", "color_", "import_", "no", "\\u", "style_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "south_", "._", "migration_", "import_", "Migrat", "ions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "south_", "._", "exceptions_", "import_", "No", "Migrat", "ions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "south_", "._", "creator_", "import_", "freez", "er_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "MIGRAT", "ION", "\\u", "TEMPLATE_", "=_", "\"\"\"#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "\\", "10", ";", "from", " ", "south", ".", "util", "s", " ", "import", " ", "datetime", "\\u", "util", "s", " ", "as", " ", "datetime", "\\", "10", ";", "from", " ", "south", ".", "db", " ", "import", " ", "db", "\\", "10", ";", "from", " ", "south", ".", "v2", " ", "import", " ", "Data", "Migrat", "ion", "\\", "10", ";", "from", " ", "django", ".", "db", " ", "import", " ", "model", "s", "\\", "10", ";", "\\", "10", ";", "class", " ", "Migrat", "ion", "(", "Data", "Migrat", "ion", "):", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "def", " ", "forward", "s", "(", "self", ",", " ", "orm", "):", "\\", "10", ";", " ", " ", " ", " ", "\"", "Write", " ", "your", " ", "forward", "s", " ", "method", "s", " ", "here", ".\"", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "Not", "e", ":", " ", "Don", "'", "t", " ", "use", " ", "\"", "from", " ", "app", "name", ".", "model", "s", " ", "import", " ", "Model", "Name", "\".", " ", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "Us", "e", " ", "orm", ".", "Model", "Name", " ", "to", " ", "refer", " ", "to", " ", "model", "s", " ", "in", " ", "this", " ", "applica", "tion", ",", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "and", " ", "orm", "['", "app", "name", ".", "Model", "Name", "']", " ", "for", " ", "model", "s", " ", "in", " ", "other", " ", "applica", "tion", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "def", " ", "back", "ward", "s", "(", "self", ",", " ", "orm", "):", "\\", "10", ";", " ", " ", " ", " ", "\"", "Write", " ", "your", " ", "back", "ward", "s", " ", "method", "s", " ", "here", ".\"", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "model", "s", " ", "=", " ", "%", "(", "frozen", "\\u", "model", "s", ")", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "complete", "\\u", "apps", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "symmetric", "al", " ", "=", " ", "Tru", "e", "\\", "10", ";\"\"\"_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Command_", "(_", "Base", "Command_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "option", "\\u", "list_", "=_", "Base", "Command_", "._", "option", "\\u", "list_", "+_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "make", "\\u", "option_", "(_", "'--", "freez", "e", "'_", ",_", "action_", "=_", "'", "append", "'_", ",_", "dest_", "=_", "'", "freez", "e\\u", "list", "'_", ",_", "type_", "=_", "'", "string", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Freez", "e", " ", "the", " ", "specified", " ", "app", "(", "s", ").", " ", "Prov", "ide", " ", "an", " ", "app", " ", "name", " ", "with", " ", "each", ";", " ", "use", " ", "the", " ", "option", " ", "multiple", " ", "times", " ", "for", " ", "multiple", " ", "apps", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "make", "\\u", "option_", "(_", "'--", "stdout", "'_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "dest_", "=_", "'", "stdout", "'_", ",_", "default_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Print", " ", "the", " ", "migrati", "on", " ", "to", " ", "stdout", " ", "inst", "ead", " ", "of", " ", "writ", "ing", " ", "it", " ", "to", " ", "a", " ", "file", ".'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "help_", "=_", "\"", "Creat", "es", " ", "a", " ", "new", " ", "template", " ", "data", " ", "migrati", "on", " ", "for", " ", "the", " ", "give", "n", " ", "app", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "usage", "\\u", "str_", "=_", "\"", "Us", "age", ":", " ", "./", "manage", ".", "py", " ", "datam", "igra", "tion", " ", "app", "name", " ", "migrati", "onn", "ame", " ", "[-", "-", "stdout", "]", " ", "[-", "-", "freez", "e", " ", "app", "name", "]\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Command_", "(_", "Base", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "handle_", "(_", "self_", ",_", "app_", "=_", "None_", ",_", "name_", "=_", "\"\"_", ",_", "freez", "e\\u", "list_", "=_", "None_", ",_", "stdout_", "=_", "False_", ",_", "verbosity_", "=_", "1_", ",_", "**_", "options_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "verbosity_", "=_", "int_", "(_", "verbosity_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Any", " ", "supposed", " ", "lists", " ", "tha", "t", " ", "are", " ", "Non", "e", " ", "bec", "ome", " ", "empty", " ", "lists_", "\\u\\u\\uNL\\u\\u\\u_", "freez", "e\\u", "list_", "=_", "freez", "e\\u", "list_", "or_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", "stdout", " ", "means", " ", "name", " ", "=", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "stdout_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "\"-\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "On", "ly", " ", "allow", " ", "valid", " ", "names_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "re_", "._", "search_", "(_", "'[", "^", "\\u\\\\", "w", "]'_", ",_", "name_", ")_", "and_", "name_", "!=_", "\"-\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "(_", "\"", "Migrat", "ion", " ", "names", " ", "shou", "ld", " ", "contain", " ", "only", " ", "alphanumeric", " ", "character", "s", " ", "and", " ", "underscore", "s", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "not", " ", "name", ",", " ", "there", "'", "s", " ", "an", " ", "error_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "(_", "\"", "You", " ", "must", " ", "provide", " ", "a", " ", "name", " ", "for", " ", "this", " ", "migrati", "on", ".\\\\", "n", "\"_", "+_", "self_", "._", "usage", "\\u", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "app_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "(_", "\"", "You", " ", "must", " ", "provide", " ", "an", " ", "app", " ", "to", " ", "create", " ", "a", " ", "migrati", "on", " ", "for", ".\\\\", "n", "\"_", "+_", "self_", "._", "usage", "\\u", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ensur", "e", " ", "tha", "t", " ", "verbo", "sity", " ", "is", " ", "not", " ", "a", " ", "string", " ", "(", "Pyth", "on", " ", "3", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "verbosity_", "=_", "int_", "(_", "verbosity_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "(_", "\"", "Verbos", "it", "y", " ", "must", " ", "be", " ", "an", " ", "number", ".\\\\", "n", "\"_", "+_", "self_", "._", "usage", "\\u", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "the", " ", "Migrat", "ion", "s", " ", "for", " ", "this", " ", "app", " ", "(", "creati", "ng", " ", "the", " ", "migrati", "ons", " ", "dir", " ", "if", " ", "need", "ed", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "migrations_", "=_", "Migrat", "ions_", "(_", "app_", ",_", "force", "\\u", "creation_", "=_", "True_", ",_", "verbo", "se", "\\u", "creation_", "=_", "verbosity_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "See", " ", "what", " ", "filename", " ", "is", " ", "next", " ", "in", " ", "line", ".", " ", "We", " ", "assume", " ", "the", "y", " ", "use", " ", "numbers", "._", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "filename_", "=_", "migrations_", "._", "next", "\\u", "filename_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Work", " ", "out", " ", "whi", "ch", " ", "apps", " ", "to", " ", "freeze_", "\\u\\u\\uNL\\u\\u\\u_", "apps", "\\u", "to", "\\u", "freeze_", "=_", "self_", "._", "calc", "\\u", "frozen", "\\u", "apps_", "(_", "migrations_", ",_", "freez", "e\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "So", ",", " ", "what", "'", "s", " ", "in", " ", "this", " ", "file", ",", " ", "then", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "file", "\\u", "contents_", "=_", "self_", "._", "get", "\\u", "migrati", "on", "\\u", "template_", "(_", ")_", "%_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "frozen", "\\u", "model", "s", "\"_", ":_", "freez", "er_", "._", "freez", "e\\u", "apps", "\\u", "to", "\\u", "string_", "(_", "apps", "\\u", "to", "\\u", "freeze_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "complete", "\\u", "apps", "\"_", ":_", "apps", "\\u", "to", "\\u", "freeze_", "and_", "\"", "complete", "\\u", "apps", " ", "=", " ", "[", "%", "s", "]\"_", "%_", "(_", "\",", " ", "\"_", "._", "join_", "(_", "map_", "(_", "repr_", ",_", "apps", "\\u", "to", "\\u", "freeze_", ")_", ")_", ")_", "or_", "\"\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "is", " ", "a", " ", "special", " ", "name", " ", "whi", "ch", " ", "means", " ", "'", "print", " ", "to", " ", "stdout", "'_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "name_", "==_", "\"-\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "file", "\\u", "contents_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Write", " ", "the", " ", "migrati", "on", " ", "file", " ", "if", " ", "the", " ", "name", " ", "isn", "'", "t", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fp_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "migrations_", "._", "migrati", "ons", "\\u", "dir_", "(_", ")_", ",_", "new", "\\u", "filename_", ")_", ",_", "\"", "w", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fp_", "._", "write_", "(_", "file", "\\u", "contents_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fp_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "Creat", "ed", " ", "%", "s", ".\"_", "%_", "new", "\\u", "filename_", ",_", "file_", "=_", "sys_", "._", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command_", "(_", "Base", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "calc", "\\u", "frozen", "\\u", "apps_", "(_", "self_", ",_", "migrations_", ",_", "freez", "e\\u", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Works", " ", "out", ",", " ", "from", " ", "the", " ", "current", " ", "app", ",", " ", "settings", ",", " ", "and", " ", "the", " ", "command", " ", "line", " ", "options", ",", "\\", "10", ";", " ", " ", " ", " ", "whi", "ch", " ", "apps", " ", "shou", "ld", " ", "be", " ", "frozen", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "apps", "\\u", "to", "\\u", "freeze_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "to", "\\u", "freeze_", "in_", "freez", "e\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "\".\"_", "in_", "to", "\\u", "freeze_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "(_", "\"", "You", " ", "cann", "ot", " ", "freez", "e", " ", "%", "r", ";", " ", "you", " ", "must", " ", "provide", " ", "an", " ", "app", " ", "label", ",", " ", "like", " ", "'", "auth", "'", " ", "or", " ", "'", "books", "'.\"_", "%_", "to", "\\u", "freeze_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "it", "'", "s", " ", "a", " ", "real", " ", "app_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "models_", "._", "get", "\\u", "app_", "(_", "to", "\\u", "freeze_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error_", "(_", "\"", "You", " ", "cann", "ot", " ", "freez", "e", " ", "%", "r", ";", " ", "it", "'", "s", " ", "not", " ", "an", " ", "install", "ed", " ", "app", ".\"_", "%_", "to", "\\u", "freeze_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "OK", ",", " ", "it", "'", "s", " ", "fine", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "apps", "\\u", "to", "\\u", "freeze_", "._", "append_", "(_", "to", "\\u", "freeze_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "getattr_", "(_", "settings_", ",_", "'", "SOUT", "H", "\\u", "AUTO", "\\u", "FREE", "ZE", "\\u", "APP", "'_", ",_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "apps", "\\u", "to", "\\u", "freeze_", "._", "append_", "(_", "migrations_", "._", "app", "\\u", "label_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "apps", "\\u", "to", "\\u", "freeze_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command_", "(_", "Base", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "error_", "(_", "self_", ",_", "message_", ",_", "code_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Print", "s", " ", "the", " ", "error", ",", " ", "and", " ", "exits", " ", "with", " ", "the", " ", "give", "n", " ", "code", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "message_", ",_", "file_", "=_", "sys_", "._", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command_", "(_", "Base", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "migrati", "on", "\\u", "template_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "MIGRAT", "ION", "\\u", "TEMPLATE_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
posborne/mlcollection/mlcollection/lib/reinforcement/simple_rl.py
[ { "content": "'''\nCreated on Mar 23, 2010\n@author: Zachary Varberg\n'''\n\nfrom numpy import *\nimport scipy as Sci\nimport scipy.linalg\nimport copy\nfrom matplotlib import pyplot \n\nimport abstract_rl\nimport lib.matplotlib_util as mpl_util\n\n\nif __name__==\"__main__\":\n rl = Simple_RL(.1,.95)\n rl.run(1000)\n print rl.Q_mat", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Simple_RL(abstract_rl.AbstractReinforcementLearner):\n \n \n \n \n \n ", "metadata": "root.Simple_RL", "header": "['module', '___EOS___']", "index": 14 }, { "content": " def __init__(self, alpha, gamma, num_states=(15,15)):\n self.num_states = num_states[0]*num_states[1]\n self.dimensions = num_states\n self.alpha = alpha\n self.gamma = gamma\n self.curr_state = self.get_start_state()\n self.num_actions = 4\n self.Q_mat = zeros((self.num_states, self.num_actions))\n self.trans_mat = {0:-15, 1:1, 2:15, 3:-1}", "metadata": "root.Simple_RL.__init__", "header": "['class', 'Simple_RL', '(', 'abstract_rl', '.', 'AbstractReinforcementLearner', ')', ':', '___EOS___']", "index": 16 }, { "content": " def get_start_state(self):\n return random.randint(0,self.num_states)", "metadata": "root.Simple_RL.get_start_state", "header": "['class', 'Simple_RL', '(', 'abstract_rl', '.', 'AbstractReinforcementLearner', ')', ':', '___EOS___']", "index": 26 }, { "content": " def get_reward(self, prev_state, action):\n if self.prev_state + self.trans_mat[action] == (self.num_states*3/4):\n return 10\n return -1 ", "metadata": "root.Simple_RL.get_reward", "header": "['class', 'Simple_RL', '(', 'abstract_rl', '.', 'AbstractReinforcementLearner', ')', ':', '___EOS___']", "index": 29 }, { "content": " def select_action(self, state):\n best_action = nonzero(self.Q_mat[state]==max(self.Q_mat[state]))[0]\n return best_action[random.randint(0,len(best_action))] if random.random() < .9 else random.randint(0,self.num_actions)", "metadata": "root.Simple_RL.select_action", "header": "['class', 'Simple_RL', '(', 'abstract_rl', '.', 'AbstractReinforcementLearner', ')', ':', '___EOS___']", "index": 34 }, { "content": " def execute_action(self, state, action):\n move = self.trans_mat[action]\n self.prev_state = state\n r = self.get_reward(self.prev_state, action)\n self.curr_state = min(max(self.curr_state + move, 0),self.num_states-1)\n if self.prev_state % self.dimensions[0] == 0 and self.curr_state % self.dimensions[0] == 14:\n self.curr_state -= 1\n if self.prev_state % self.dimensions[0] == 14 and self.curr_state % self.dimensions[0] == 0:\n self.curr_state += 1\n self.Q_mat[self.prev_state,action] = (\n self.Q_mat[self.prev_state,action]*(1-self.alpha) +\n (r + self.gamma*max(self.Q_mat[self.curr_state]))*self.alpha)\n if r == 10:\n return True\n return False", "metadata": "root.Simple_RL.execute_action", "header": "['class', 'Simple_RL', '(', 'abstract_rl', '.', 'AbstractReinforcementLearner', ')', ':', '___EOS___']", "index": 38 }, { "content": " def display(self):\n fig1 = pyplot.figure(1)\n mpl_util.plot_running_average(self.tot_reward,100)\n fig1.suptitle(\"Rewards\")\n fig2 = pyplot.figure(2)\n mpl_util.plot_running_average(self.tot_steps,100)\n fig2.suptitle(\"Steps\")\n pyplot.show()", "metadata": "root.Simple_RL.display", "header": "['class', 'Simple_RL', '(', 'abstract_rl', '.', 'AbstractReinforcementLearner', ')', ':', '___EOS___']", "index": 54 } ]
[ { "span": "import scipy as Sci", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 19 }, { "span": "import scipy.linalg", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 19 }, { "span": "import copy", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 11 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "'''", "\\", "10", ";", "Creat", "ed", " ", "on", " ", "Mar", " ", "23", ",", " ", "2010", "\\", "10", ";", "@", "author", ":", " ", "Za", "char", "y", " ", "Var", "ber", "g", "\\", "10", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "numpy_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "scipy_", "as_", "Sci", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "scipy_", "._", "linalg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "matplotlib_", "import_", "pyplot_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "abstract", "\\u", "rl_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "lib_", "._", "mat", "plotlib", "\\u", "util_", "as_", "mpl", "\\u", "util_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rl_", "=_", "Simple", "\\u", "RL", "_", "(_", ".1_", ",_", ".95", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rl_", "._", "run_", "(_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "rl_", "._", "Q", "\\u", "mat_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Simple", "\\u", "RL", "_", "(_", "abstract", "\\u", "rl_", "._", "Abstract", "Rein", "force", "ment", "Learner", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Simple", "\\u", "RL", "_", "(_", "abstract", "\\u", "rl_", "._", "Abstract", "Rein", "force", "ment", "Learner", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "alpha_", ",_", "gamma_", ",_", "num", "\\u", "states_", "=_", "(_", "15_", ",_", "15_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "num", "\\u", "states_", "=_", "num", "\\u", "states_", "[_", "0_", "]_", "*_", "num", "\\u", "states_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "dimensions_", "=_", "num", "\\u", "states_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "alpha_", "=_", "alpha_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "gamma_", "=_", "gamma_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "curr", "\\u", "state_", "=_", "self_", "._", "get", "\\u", "start", "\\u", "state_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "num", "\\u", "actions_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Q", "\\u", "mat_", "=_", "zeros_", "(_", "(_", "self_", "._", "num", "\\u", "states_", ",_", "self_", "._", "num", "\\u", "actions_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "trans", "\\u", "mat_", "=_", "{_", "0_", ":_", "-_", "15_", ",_", "1_", ":_", "1_", ",_", "2_", ":_", "15_", ",_", "3_", ":_", "-_", "1_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "\\u", "RL", "_", "(_", "abstract", "\\u", "rl_", "._", "Abstract", "Rein", "force", "ment", "Learner", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "start", "\\u", "state_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "random_", "._", "randint_", "(_", "0_", ",_", "self_", "._", "num", "\\u", "states_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "\\u", "RL", "_", "(_", "abstract", "\\u", "rl_", "._", "Abstract", "Rein", "force", "ment", "Learner", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "reward_", "(_", "self_", ",_", "prev", "\\u", "state_", ",_", "action_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "prev", "\\u", "state_", "+_", "self_", "._", "trans", "\\u", "mat_", "[_", "action_", "]_", "==_", "(_", "self_", "._", "num", "\\u", "states_", "*_", "3_", "/_", "4_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "\\u", "RL", "_", "(_", "abstract", "\\u", "rl_", "._", "Abstract", "Rein", "force", "ment", "Learner", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "select", "\\u", "action_", "(_", "self_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "best", "\\u", "action_", "=_", "nonzero_", "(_", "self_", "._", "Q", "\\u", "mat_", "[_", "state_", "]_", "==_", "max_", "(_", "self_", "._", "Q", "\\u", "mat_", "[_", "state_", "]_", ")_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "best", "\\u", "action_", "[_", "random_", "._", "randint_", "(_", "0_", ",_", "len_", "(_", "best", "\\u", "action_", ")_", ")_", "]_", "if_", "random_", "._", "random_", "(_", ")_", "<_", ".9_", "else_", "random_", "._", "randint_", "(_", "0_", ",_", "self_", "._", "num", "\\u", "actions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "\\u", "RL", "_", "(_", "abstract", "\\u", "rl_", "._", "Abstract", "Rein", "force", "ment", "Learner", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "execute", "\\u", "action_", "(_", "self_", ",_", "state_", ",_", "action_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "move_", "=_", "self_", "._", "trans", "\\u", "mat_", "[_", "action_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "prev", "\\u", "state_", "=_", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "self_", "._", "get", "\\u", "reward_", "(_", "self_", "._", "prev", "\\u", "state_", ",_", "action_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "curr", "\\u", "state_", "=_", "min_", "(_", "max_", "(_", "self_", "._", "curr", "\\u", "state_", "+_", "move_", ",_", "0_", ")_", ",_", "self_", "._", "num", "\\u", "states_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "prev", "\\u", "state_", "%_", "self_", "._", "dimensions_", "[_", "0_", "]_", "==_", "0_", "and_", "self_", "._", "curr", "\\u", "state_", "%_", "self_", "._", "dimensions_", "[_", "0_", "]_", "==_", "14_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "curr", "\\u", "state_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "prev", "\\u", "state_", "%_", "self_", "._", "dimensions_", "[_", "0_", "]_", "==_", "14_", "and_", "self_", "._", "curr", "\\u", "state_", "%_", "self_", "._", "dimensions_", "[_", "0_", "]_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "curr", "\\u", "state_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "Q", "\\u", "mat_", "[_", "self_", "._", "prev", "\\u", "state_", ",_", "action_", "]_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "Q", "\\u", "mat_", "[_", "self_", "._", "prev", "\\u", "state_", ",_", "action_", "]_", "*_", "(_", "1_", "-_", "self_", "._", "alpha_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "r_", "+_", "self_", "._", "gamma_", "*_", "max_", "(_", "self_", "._", "Q", "\\u", "mat_", "[_", "self_", "._", "curr", "\\u", "state_", "]_", ")_", ")_", "*_", "self_", "._", "alpha_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "r_", "==_", "10_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "\\u", "RL", "_", "(_", "abstract", "\\u", "rl_", "._", "Abstract", "Rein", "force", "ment", "Learner", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "display_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fig", "1_", "=_", "pyplot_", "._", "figure_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mpl", "\\u", "util_", "._", "plot", "\\u", "runn", "ing", "\\u", "average_", "(_", "self_", "._", "tot", "\\u", "reward_", ",_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fig", "1_", "._", "suptitle_", "(_", "\"", "Reward", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fig", "2_", "=_", "pyplot_", "._", "figure_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mpl", "\\u", "util_", "._", "plot", "\\u", "runn", "ing", "\\u", "average_", "(_", "self_", "._", "tot", "\\u", "steps_", ",_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fig", "2_", "._", "suptitle_", "(_", "\"", "Step", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pyplot_", "._", "show_", "(_", ")_", "\\u\\u\\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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
sunlightlabs/clearspending/animation/views.py
[ { "content": "import settings\nfrom django.http import HttpResponse, HttpResponseRedirect\nfrom django.shortcuts import render_to_response, get_object_or_404\nfrom django.template import RequestContext\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def main(request):\n\n return render_to_response('animation/map.html', {}, context_instance=RequestContext(request))", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 6 } ]
[ { "span": "import settings", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 15 }, { "span": "from django.http import HttpResponse, HttpResponseRedirect", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 58 }, { "span": "from django.shortcuts import render_to_response, get_object_or_404", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 66 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "http_", "import_", "Http", "Response_", ",_", "Http", "Respons", "e", "Redirect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "shortcuts_", "import_", "render", "\\u", "to", "\\u", "response_", ",_", "get", "\\u", "object\\u", "or", "\\u", "404_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "import_", "Request", "Context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "main_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "render", "\\u", "to", "\\u", "response_", "(_", "'", "animati", "on", "/", "map", ".", "html", "'_", ",_", "{_", "}_", ",_", "context", "\\u", "instance_", "=_", "Request", "Context_", "(_", "request_", ")_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
circus-tent/circus/circus/tests/test_process.py
[ { "content": " def test_base(self):\n cmd = PYTHON\n args = \"-c 'import time; time.sleep(10)'\"\n process = Process('test', 1, cmd, args=args, shell=False,\n use_fds=USE_FDS)\n try:\n info = process.info()\n self.assertEqual(process.pid, info['pid'])\n # Make sure the process lived a measurable amount of time\n # (precision error on Windows)\n time.sleep(0.01)\n age = process.age()\n self.assertTrue(age > 0.)\n self.assertFalse(process.is_child(0))\n finally:\n process.stop()", "metadata": "root.TestProcess.test_base", "header": "['class', 'TestProcess', '(', 'TestCircus', ')', ':', '___EOS___']", "index": 54 }, { "content": " def test_comparison(self):\n cmd = PYTHON\n args = ['import time; time.sleep(2)', ]\n p1 = Process('test', 1, cmd, args=args, use_fds=USE_FDS)\n # Make sure the two processes are launched with a measurable\n # difference. (precsion error on Windows)\n time.sleep(0.01)\n p2 = Process('test', 2, cmd, args=args, use_fds=USE_FDS)\n\n self.assertTrue(p1 < p2)\n self.assertFalse(p1 == p2)\n self.assertTrue(p1 == p1)\n\n p1.stop()\n p2.stop()", "metadata": "root.TestProcess.test_comparison", "header": "['class', 'TestProcess', '(', 'TestCircus', ')', ':', '___EOS___']", "index": 104 }, { "content": " @skipIf(DEBUG, 'Py_DEBUG=1')\n @skipIf(_nose_no_s(), 'Nose runs without -s')\n @skipIf(IS_WINDOWS, \"Streams not supported\")\n def test_streams(self):\n script_file = self.get_tmpfile(VERBOSE)\n output_file = self.get_tmpfile()\n\n cmd = PYTHON\n args = [script_file, output_file]\n\n # 1. streams sent to /dev/null\n process = Process('test', 1, cmd, args=args,\n close_child_stdout=True, close_child_stderr=True)\n try:\n poll_for(output_file, 'END')\n\n # the pipes should be empty\n self.assertEqual(process.stdout.read(), b'')\n self.assertEqual(process.stderr.read(), b'')\n finally:\n process.stop()\n\n # 2. streams sent to /dev/null, no PIPEs\n output_file = self.get_tmpfile()\n args[1] = output_file\n\n process = Process('test', 1, cmd, args=args,\n close_child_stdout=True, close_child_stderr=True,\n pipe_stdout=False, pipe_stderr=False)\n\n try:\n poll_for(output_file, 'END')\n # the pipes should be unexistant\n self.assertTrue(process.stdout is None)\n self.assertTrue(process.stderr is None)\n finally:\n process.stop()\n\n # 3. streams & pipes open\n output_file = self.get_tmpfile()\n args[1] = output_file\n process = Process('test', '1', cmd, args=args)\n\n try:\n poll_for(output_file, 'END')\n\n # the pipes should be unexistant\n self.assertEqual(len(process.stdout.read()), 2890)\n self.assertEqual(len(process.stderr.read()), 2890)\n finally:\n process.stop()", "metadata": "root.TestProcess.test_streams", "header": "['class', 'TestProcess', '(', 'TestCircus', ')', ':', '___EOS___']", "index": 142 } ]
[ { "span": "self.assertTrue(age > 0.)", "start_line": 66, "start_column": 12, "end_line": 66, "end_column": 37 }, { "span": "self.assertTrue(p1 < p2)", "start_line": 113, "start_column": 8, "end_line": 113, "end_column": 32 }, { "span": "self.assertFalse(p1 == p2)", "start_line": 114, "start_column": 8, "end_line": 114, "end_column": 34 }, { "span": "self.assertTrue(p1 == p1)", "start_line": 115, "start_column": 8, "end_line": 115, "end_column": 33 }, { "span": "self.assertTrue(process.stdout is None)", "start_line": 175, "start_column": 12, "end_line": 175, "end_column": 51 }, { "span": "self.assertTrue(process.stderr is None)", "start_line": 176, "start_column": 12, "end_line": 176, "end_column": 51 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Process_", "(_", "Test", "Circ", "us_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "base_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "PYTHON", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "\"-", "c", " ", "'", "import", " ", "time", ";", " ", "time", ".", "sleep", "(", "10", ")'", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "=_", "Process_", "(_", "'", "test", "'_", ",_", "1_", ",_", "cmd_", ",_", "args_", "=_", "args_", ",_", "shell_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "\\u", "fds_", "=_", "USE", "\\u", "FD", "S_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "info_", "=_", "process_", "._", "info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "process_", "._", "pid_", ",_", "info_", "[_", "'", "pid", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "the", " ", "process", " ", "live", "d", " ", "a", " ", "meas", "ura", "ble", " ", "amo", "unt", " ", "of", " ", "time_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "preci", "sion", " ", "error", " ", "on", " ", "Window", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "time_", "._", "sleep_", "(_", "0.01_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "age_", "=_", "process_", "._", "age_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "age_", ">_", "0._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "process_", "._", "is", "\\u", "child_", "(_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "process_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Process_", "(_", "Test", "Circ", "us_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "comparison_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "PYTHON", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "[_", "'", "import", " ", "time", ";", " ", "time", ".", "sleep", "(", "2", ")'_", ",_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p1_", "=_", "Process_", "(_", "'", "test", "'_", ",_", "1_", ",_", "cmd_", ",_", "args_", "=_", "args_", ",_", "use", "\\u", "fds_", "=_", "USE", "\\u", "FD", "S_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "the", " ", "two", " ", "process", "es", " ", "are", " ", "launched", " ", "with", " ", "a", " ", "meas", "ura", "ble_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "difference", ".", " ", "(", "prec", "sion", " ", "error", " ", "on", " ", "Window", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "time_", "._", "sleep_", "(_", "0.01_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p2_", "=_", "Process_", "(_", "'", "test", "'_", ",_", "2_", ",_", "cmd_", ",_", "args_", "=_", "args_", ",_", "use", "\\u", "fds_", "=_", "USE", "\\u", "FD", "S_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "p1_", "<_", "p2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "p1_", "==_", "p2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "p1_", "==_", "p1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p1_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p2_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Process_", "(_", "Test", "Circ", "us_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "skip", "If_", "(_", "DEBUG_", ",_", "'", "Py", "\\u", "DEBU", "G", "=", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "skip", "If_", "(_", "\\u", "nose", "\\u", "no", "\\u", "s_", "(_", ")_", ",_", "'", "No", "se", " ", "runs", " ", "with", "out", " ", "-", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "skip", "If_", "(_", "IS", "\\u", "WINDOWS", "_", ",_", "\"", "Stream", "s", " ", "not", " ", "support", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "streams_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "script", "\\u", "file_", "=_", "self_", "._", "get", "\\u", "tmpfile_", "(_", "VERBOSE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "\\u", "file_", "=_", "self_", "._", "get", "\\u", "tmpfile_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cmd_", "=_", "PYTHON", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "[_", "script", "\\u", "file_", ",_", "output", "\\u", "file_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "1", ".", " ", "stream", "s", " ", "sent", " ", "to", " ", "/", "dev", "/", "null_", "\\u\\u\\uNL\\u\\u\\u_", "process_", "=_", "Process_", "(_", "'", "test", "'_", ",_", "1_", ",_", "cmd_", ",_", "args_", "=_", "args_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "close", "\\u", "child", "\\u", "stdout_", "=_", "True_", ",_", "close", "\\u", "child", "\\u", "stderr_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "poll", "\\u", "for_", "(_", "output", "\\u", "file_", ",_", "'", "END", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "pipe", "s", " ", "shou", "ld", " ", "be", " ", "empty_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "process_", "._", "stdout_", "._", "read_", "(_", ")_", ",_", "b", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "process_", "._", "stderr_", "._", "read_", "(_", ")_", ",_", "b", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "process_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "2", ".", " ", "stream", "s", " ", "sent", " ", "to", " ", "/", "dev", "/", "null", ",", " ", "no", " ", "PIPE", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "output", "\\u", "file_", "=_", "self_", "._", "get", "\\u", "tmpfile_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "[_", "1_", "]_", "=_", "output", "\\u", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "process_", "=_", "Process_", "(_", "'", "test", "'_", ",_", "1_", ",_", "cmd_", ",_", "args_", "=_", "args_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "close", "\\u", "child", "\\u", "stdout_", "=_", "True_", ",_", "close", "\\u", "child", "\\u", "stderr_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pipe", "\\u", "stdout_", "=_", "False_", ",_", "pipe", "\\u", "stderr_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "poll", "\\u", "for_", "(_", "output", "\\u", "file_", ",_", "'", "END", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "the", " ", "pipe", "s", " ", "shou", "ld", " ", "be", " ", "une", "xist", "ant_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "process_", "._", "stdout_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "process_", "._", "stderr_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "process_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "3", ".", " ", "stream", "s", " ", "&", " ", "pipe", "s", " ", "open_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "output", "\\u", "file_", "=_", "self_", "._", "get", "\\u", "tmpfile_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "[_", "1_", "]_", "=_", "output", "\\u", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "=_", "Process_", "(_", "'", "test", "'_", ",_", "'", "1", "'_", ",_", "cmd_", ",_", "args_", "=_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "poll", "\\u", "for_", "(_", "output", "\\u", "file_", ",_", "'", "END", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "pipe", "s", " ", "shou", "ld", " ", "be", " ", "une", "xist", "ant_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "process_", "._", "stdout_", "._", "read_", "(_", ")_", ")_", ",_", "289", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "process_", "._", "stderr_", "._", "read_", "(_", ")_", ")_", ",_", "289", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "process_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
lsaffre/lino/lino/utils/html2text.py
[ { "content": "#!/usr/bin/env python\n\"\"\"html2text: Turn HTML into equivalent Markdown-structured text.\n\nThis is an almost unmodified copy of Aaron Swartz's \n`html2text <http://www.aaronsw.com/2002/html2text/>`.\n\nLino uses this in :mod:`lino_xl.lib.outbox`\nfor attaching a text version of a generated email.\n\nModifications:\n\n- set `UNICODE_SNOB` to 1\n\n\"\"\"\nfrom __future__ import division\nfrom future import standard_library\nstandard_library.install_aliases()\nfrom builtins import chr\nfrom builtins import str\nfrom builtins import range\nfrom builtins import object\nfrom past.utils import old_div\n__version__ = \"3.1\"\n__author__ = \"Aaron Swartz ([email protected])\"\n__copyright__ = \"(C) 2004-2008 Aaron Swartz. GNU GPL 3.\"\n__contributors__ = [\"Martin 'Joey' Schulze\",\n \"Ricardo Reyes\", \"Kevin Jay North\"]\n\n# TODO:\n# Support decoded entities with unifiable.\n\ntry:\n True\nexcept NameError:\n setattr(__builtins__, 'True', 1)\n setattr(__builtins__, 'False', 0)\n\n\n\n# try:\n# import html.entities\n# import urllib.parse\n# import html.parser\n# except ImportError: # Python3\nimport html.entities as htmlentitydefs\nimport urllib.parse as urlparse\nfrom html.parser import HTMLParser\ntry: # Python3\n import urllib.request as urllib\nexcept:\n import urllib.request, urllib.parse, urllib.error\nimport optparse\nimport re\nimport sys\nimport codecs\nimport types\n\ntry:\n from textwrap import wrap\nexcept:\n pass\n\n# Use Unicode characters instead of their ascii psuedo-replacements\nUNICODE_SNOB = 1\n\n# Put the links after each paragraph instead of at the end.\nLINKS_EACH_PARAGRAPH = 0\n\n# Wrap long lines at position. 0 for no wrapping. (Requires Python 2.3.)\nBODY_WIDTH = 78\n\n# Don't show internal links (href=\"#local-anchor\") -- corresponding link targets\n# won't be visible in the plain text file anyway.\nSKIP_INTERNAL_LINKS = True\n\n# Use inline, rather than reference, formatting for images and links\nINLINE_LINKS = True\n\n# Number of pixels Google indents nested lists\nGOOGLE_LIST_INDENT = 36\n\nIGNORE_ANCHORS = False\nIGNORE_IMAGES = False\n\n# Entity Nonsense ###\n\n\n\nunifiable = {'rsquo': \"'\", 'lsquo': \"'\", 'rdquo': '\"', 'ldquo': '\"',\n 'copy': '(C)', 'mdash': '--', 'nbsp': ' ', 'rarr': '->', 'larr': '<-', 'middot': '*',\n 'ndash': '-', 'oelig': 'oe', 'aelig': 'ae',\n 'agrave': 'a', 'aacute': 'a', 'acirc': 'a', 'atilde': 'a', 'auml': 'a', 'aring': 'a',\n 'egrave': 'e', 'eacute': 'e', 'ecirc': 'e', 'euml': 'e',\n 'igrave': 'i', 'iacute': 'i', 'icirc': 'i', 'iuml': 'i',\n 'ograve': 'o', 'oacute': 'o', 'ocirc': 'o', 'otilde': 'o', 'ouml': 'o',\n 'ugrave': 'u', 'uacute': 'u', 'ucirc': 'u', 'uuml': 'u',\n 'lrm': '', 'rlm': ''}\n\nunifiable_n = {}\n\nfor k in list(unifiable.keys()):\n unifiable_n[name2cp(k)] = unifiable[k]\n\n\n\n\n\n\n\nr_unescape = re.compile(r\"&(#?[xX]?(?:[0-9a-fA-F]+|\\w{1,8}));\")\n\n\n\n# End Entity Nonsense ###\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\noptions = Storage()\noptions.google_doc = False\noptions.ul_item_mark = '*'\n\nif __name__ == \"__main__\":\n baseurl = ''\n\n p = optparse.OptionParser('%prog [(filename|url) [encoding]]',\n version='%prog ' + __version__)\n p.add_option(\"-g\", \"--google-doc\", action=\"store_true\", dest=\"google_doc\",\n default=False, help=\"convert an html-exported Google Document\")\n p.add_option(\n \"-d\", \"--dash-unordered-list\", action=\"store_true\", dest=\"ul_style_dash\",\n default=False, help=\"use a dash rather than a star for unordered list items\")\n p.add_option(\n \"-b\", \"--body-width\", dest=\"body_width\", action=\"store\", type=\"int\",\n default=78, help=\"number of characters per output line, 0 for no wrap\")\n p.add_option(\n \"-i\", \"--google-list-indent\", dest=\"list_indent\", action=\"store\", type=\"int\",\n default=GOOGLE_LIST_INDENT, help=\"number of pixels Google indents nested lists\")\n p.add_option(\n \"-s\", \"--hide-strikethrough\", action=\"store_true\", dest=\"hide_strikethrough\",\n default=False, help=\"hide strike-through text. only relevent when -g is specified as well\")\n (options, args) = p.parse_args()\n\n # handle options\n if options.ul_style_dash:\n options.ul_item_mark = '-'\n else:\n options.ul_item_mark = '*'\n\n BODY_WIDTH = options.body_width\n GOOGLE_LIST_INDENT = options.list_indent\n\n # process input\n if len(args) > 0:\n file_ = args[0]\n encoding = None\n if len(args) == 2:\n encoding = args[1]\n if len(args) > 2:\n p.error('Too many arguments')\n\n if file_.startswith('http://') or file_.startswith('https://'):\n baseurl = file_\n j = urllib.request.urlopen(baseurl)\n text = j.read()\n if encoding is None:\n try:\n from feedparser import _getCharacterEncoding as enc\n except ImportError:\n enc = lambda x, y: ('utf-8', 1)\n encoding = enc(j.headers, text)[0]\n if encoding == 'us-ascii':\n encoding = 'utf-8'\n data = text.decode(encoding)\n\n else:\n data = open(file_, 'rb').read()\n if encoding is None:\n try:\n from chardet import detect\n except ImportError:\n detect = lambda x: {'encoding': 'utf-8'}\n encoding = detect(data)['encoding']\n data = data.decode(encoding)\n else:\n data = sys.stdin.read()\n wrapwrite(html2text(data, baseurl))\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "except:", "start_line": 54, "start_column": 0, "end_line": 54, "end_column": 7 }, { "span": "except:", "start_line": 64, "start_column": 0, "end_line": 64, "end_column": 7 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "html", "2te", "xt", ":", " ", "Turn", " ", "HTM", "L", " ", "int", "o", " ", "equivalent", " ", "Markdown", "-", "structure", "d", " ", "text", ".", "\\", "10", ";", "\\", "10", ";", "Thi", "s", " ", "is", " ", "an", " ", "alm", "ost", " ", "unmo", "difi", "ed", " ", "copy", " ", "of", " ", "Aa", "ron", " ", "Swa", "rt", "z", "'", "s", " ", "\\", "10", ";", "`", "html", "2te", "xt", " ", "<", "http", "://", "www", ".", "aar", "ons", "w", ".", "com", "/", "2002", "/", "html", "2te", "xt", "/>", "`.", "\\", "10", ";", "\\", "10", ";", "Lin", "o", " ", "use", "s", " ", "this", " ", "in", " ", ":", "mod", ":`", "lino", "\\u", "xl", ".", "lib", ".", "outbox", "`", "\\", "10", ";", "for", " ", "attach", "ing", " ", "a", " ", "text", " ", "version", " ", "of", " ", "a", " ", "generat", "ed", " ", "email", ".", "\\", "10", ";", "\\", "10", ";", "Modifica", "tion", "s", ":", "\\", "10", ";", "\\", "10", ";", "-", " ", "set", " ", "`", "UNICODE", "\\u", "SN", "OB", "`", " ", "to", " ", "1", "\\", "10", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "division_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "future_", "import_", "standard", "\\u", "library_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "standard", "\\u", "library_", "._", "install", "\\u", "aliases_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "builtins_", "import_", "chr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "builtins_", "import_", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "builtins_", "import_", "range_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "builtins_", "import_", "object_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "past_", "._", "utils_", "import_", "old", "\\u", "div_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "version\\u\\u_", "=_", "\"", "3.1", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "author\\u\\u_", "=_", "\"", "Aa", "ron", " ", "Swa", "rt", "z", " ", "(", "me", "@", "aar", "ons", "w", ".", "com", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "copyright\\u\\u_", "=_", "\"(", "C", ")", " ", "2004", "-", "2008", " ", "Aa", "ron", " ", "Swa", "rt", "z", ".", " ", "GN", "U", " ", "GP", "L", " ", "3", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "contributor", "s\\u\\u_", "=_", "[_", "\"", "Mart", "in", " ", "'", "Jo", "ey", "'", " ", "Sch", "ul", "ze", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ric", "ard", "o", " ", "Re", "ye", "s", "\"_", ",_", "\"", "Ke", "vin", " ", "Ja", "y", " ", "North", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "Supp", "ort", " ", "decode", "d", " ", "entit", "ies", " ", "with", " ", "uni", "fia", "ble", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Name", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "setattr_", "(_", "\\u\\u", "bui", "lti", "ns", "\\u\\u_", ",_", "'", "Tru", "e", "'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "setattr_", "(_", "\\u\\u", "bui", "lti", "ns", "\\u\\u_", ",_", "'", "Fal", "se", "'_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "import", " ", "html", ".", "entities_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "import", " ", "url", "lib", ".", "parse_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "import", " ", "html", ".", "parser_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "except", " ", "Import", "Error", ":", " ", " ", "#", " ", "Pyth", "on", "3_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "html_", "._", "entities_", "as_", "html", "entity", "defs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib_", "._", "parse_", "as_", "urlparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "html_", "._", "parser_", "import_", "HTM", "LP", "arser", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "#", " ", "Pyth", "on", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "urllib_", "._", "request_", "as_", "urllib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "urllib_", "._", "request_", ",_", "urllib_", "._", "parse_", ",_", "urllib_", "._", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "optparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "codecs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "types_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "textwrap_", "import_", "wrap_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "e", " ", "Unic", "ode", " ", "character", "s", " ", "inst", "ead", " ", "of", " ", "thei", "r", " ", "ascii", " ", "psu", "edo", "-", "replacements_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "UNICODE", "\\u", "SN", "OB", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Put", " ", "the", " ", "link", "s", " ", "after", " ", "each", " ", "paragraph", " ", "inst", "ead", " ", "of", " ", "at", " ", "the", " ", "end", "._", "\\u\\u\\uNL\\u\\u\\u_", "LINKS", "\\u", "EAC", "H", "\\u", "PARA", "GRAPH", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Wra", "p", " ", "long", " ", "lines", " ", "at", " ", "position", ".", " ", "0", " ", "for", " ", "no", " ", "wrapp", "ing", ".", " ", "(", "Requ", "ires", " ", "Pyth", "on", " ", "2.3", ".)", "_", "\\u\\u\\uNL\\u\\u\\u_", "BODY", "\\u", "WIDTH_", "=_", "78_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Don", "'", "t", " ", "show", " ", "internal", " ", "link", "s", " ", "(", "href", "=\"", "#", "local", "-", "anchor", "\")", " ", "--", " ", "correspond", "ing", " ", "link", " ", "targets_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "won", "'", "t", " ", "be", " ", "visi", "ble", " ", "in", " ", "the", " ", "plain", " ", "text", " ", "file", " ", "anyway", "._", "\\u\\u\\uNL\\u\\u\\u_", "SKIP", "\\u", "INTERN", "AL", "\\u", "LINKS", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "e", " ", "inline", ",", " ", "rat", "her", " ", "than", " ", "reference", ",", " ", "format", "ting", " ", "for", " ", "images", " ", "and", " ", "links_", "\\u\\u\\uNL\\u\\u\\u_", "IN", "LINE", "\\u", "LINKS", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Number", " ", "of", " ", "pixel", "s", " ", "Goo", "gle", " ", "indent", "s", " ", "nest", "ed", " ", "lists_", "\\u\\u\\uNL\\u\\u\\u_", "GO", "OG", "LE", "\\u", "LIST", "\\u", "INDENT", "_", "=_", "36_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "IGNORE", "\\u", "ANC", "HOR", "S_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "IGNORE", "\\u", "IMAGES", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Entit", "y", " ", "Non", "sense", " ", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "uni", "fia", "ble_", "=_", "{_", "'", "rs", "quo", "'_", ":_", "\"'\"_", ",_", "'", "ls", "quo", "'_", ":_", "\"'\"_", ",_", "'", "rd", "quo", "'_", ":_", "'\"'_", ",_", "'", "ld", "quo", "'_", ":_", "'\"'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "copy", "'_", ":_", "'(", "C", ")'_", ",_", "'", "mda", "sh", "'_", ":_", "'--'_", ",_", "'", "nb", "sp", "'_", ":_", "'", " ", "'_", ",_", "'", "rar", "r", "'_", ":_", "'->", "'_", ",_", "'", "lar", "r", "'_", ":_", "'<", "-'_", ",_", "'", "mid", "dot", "'_", ":_", "'*'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "nda", "sh", "'_", ":_", "'-'_", ",_", "'", "oe", "lig", "'_", ":_", "'", "oe", "'_", ",_", "'", "ael", "ig", "'_", ":_", "'", "ae", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "agr", "ave", "'_", ":_", "'", "a", "'_", ",_", "'", "aac", "ute", "'_", ":_", "'", "a", "'_", ",_", "'", "aci", "rc", "'_", ":_", "'", "a", "'_", ",_", "'", "ati", "lde", "'_", ":_", "'", "a", "'_", ",_", "'", "au", "ml", "'_", ":_", "'", "a", "'_", ",_", "'", "ari", "ng", "'_", ":_", "'", "a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "egr", "ave", "'_", ":_", "'", "e", "'_", ",_", "'", "eac", "ute", "'_", ":_", "'", "e", "'_", ",_", "'", "eci", "rc", "'_", ":_", "'", "e", "'_", ",_", "'", "eum", "l", "'_", ":_", "'", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "igra", "ve", "'_", ":_", "'", "i", "'_", ",_", "'", "iac", "ute", "'_", ":_", "'", "i", "'_", ",_", "'", "ici", "rc", "'_", ":_", "'", "i", "'_", ",_", "'", "ium", "l", "'_", ":_", "'", "i", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ogr", "ave", "'_", ":_", "'", "o", "'_", ",_", "'", "oa", "cute", "'_", ":_", "'", "o", "'_", ",_", "'", "oci", "rc", "'_", ":_", "'", "o", "'_", ",_", "'", "oti", "lde", "'_", ":_", "'", "o", "'_", ",_", "'", "ou", "ml", "'_", ":_", "'", "o", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ug", "rave", "'_", ":_", "'", "u", "'_", ",_", "'", "uac", "ute", "'_", ":_", "'", "u", "'_", ",_", "'", "uci", "rc", "'_", ":_", "'", "u", "'_", ",_", "'", "uu", "ml", "'_", ":_", "'", "u", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lr", "m", "'_", ":_", "''_", ",_", "'", "rl", "m", "'_", ":_", "''_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "uni", "fia", "ble", "\\u", "n_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "k_", "in_", "list_", "(_", "uni", "fia", "ble_", "._", "keys_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "uni", "fia", "ble", "\\u", "n_", "[_", "name2", "cp_", "(_", "k_", ")_", "]_", "=_", "uni", "fia", "ble_", "[_", "k_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "r", "\\u", "unescape_", "=_", "re_", "._", "compile_", "(_", "r", "\"&", "(", "#", "?", "[", "x", "X", "]?", "(?:[", "0", "-", "9", "a", "-", "f", "A", "-", "F", "]+", "|\\\\", "w", "{", "1", ",", "8", "}))", ";\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "End", " ", "Entit", "y", " ", "Non", "sense", " ", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\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\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "options_", "=_", "Storage_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "options_", "._", "google", "\\u", "doc_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "options_", "._", "ul", "\\u", "item", "\\u", "mark_", "=_", "'*'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "baseurl_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "=_", "optparse_", "._", "Optio", "n", "Parser_", "(_", "'%", "prog", " ", "[(", "filename", "|", "url", ")", " ", "[", "encoding", "]]'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "'%", "prog", " ", "'_", "+_", "\\u\\u", "version\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "add", "\\u", "option_", "(_", "\"-", "g", "\"_", ",_", "\"--", "google", "-", "doc", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "google", "\\u", "doc", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "False_", ",_", "help_", "=_", "\"", "convert", " ", "an", " ", "html", "-", "exported", " ", "Goo", "gle", " ", "Document", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "add", "\\u", "option_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"-", "d", "\"_", ",_", "\"--", "dash", "-", "unordered", "-", "list", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "ul", "\\u", "style", "\\u", "dash", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "False_", ",_", "help_", "=_", "\"", "use", " ", "a", " ", "dash", " ", "rat", "her", " ", "than", " ", "a", " ", "star", " ", "for", " ", "unordered", " ", "list", " ", "items", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "add", "\\u", "option_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"-", "b", "\"_", ",_", "\"--", "body", "-", "widt", "h", "\"_", ",_", "dest_", "=_", "\"", "body", "\\u", "widt", "h", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "type_", "=_", "\"", "int", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "78_", ",_", "help_", "=_", "\"", "number", " ", "of", " ", "character", "s", " ", "per", " ", "output", " ", "line", ",", " ", "0", " ", "for", " ", "no", " ", "wrap", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "add", "\\u", "option_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"-", "i", "\"_", ",_", "\"--", "google", "-", "list", "-", "indent", "\"_", ",_", "dest_", "=_", "\"", "list", "\\u", "indent", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "type_", "=_", "\"", "int", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "GO", "OG", "LE", "\\u", "LIST", "\\u", "INDENT", "_", ",_", "help_", "=_", "\"", "number", " ", "of", " ", "pixel", "s", " ", "Goo", "gle", " ", "indent", "s", " ", "nest", "ed", " ", "lists", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "add", "\\u", "option_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"-", "s", "\"_", ",_", "\"--", "hide", "-", "strike", "through", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "hide", "\\u", "strike", "through", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "False_", ",_", "help_", "=_", "\"", "hide", " ", "strike", "-", "through", " ", "text", ".", " ", "only", " ", "rele", "vent", " ", "whe", "n", " ", "-", "g", " ", "is", " ", "specified", " ", "as", " ", "well", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "options_", ",_", "args_", ")_", "=_", "p_", "._", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "handle", " ", "options_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "options_", "._", "ul", "\\u", "style", "\\u", "dash_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "ul", "\\u", "item", "\\u", "mark_", "=_", "'-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "ul", "\\u", "item", "\\u", "mark_", "=_", "'*'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "BODY", "\\u", "WIDTH_", "=_", "options_", "._", "body", "\\u", "width_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GO", "OG", "LE", "\\u", "LIST", "\\u", "INDENT", "_", "=_", "options_", "._", "list", "\\u", "indent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "process", " ", "input_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "args_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "file\\u_", "=_", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoding_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "args_", ")_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "encoding_", "=_", "args_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "args_", ")_", ">_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "._", "error_", "(_", "'", "Too", " ", "many", " ", "argu", "ment", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "file\\u_", "._", "startswith_", "(_", "'", "http", "://'_", ")_", "or_", "file\\u_", "._", "startswith_", "(_", "'", "https", "://'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "baseurl_", "=_", "file\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "j_", "=_", "urllib_", "._", "request_", "._", "urlopen_", "(_", "baseurl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "j_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "encoding_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "from_", "feed", "parser_", "import_", "\\u", "get", "Char", "acte", "r", "Encoding_", "as_", "enc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "enc_", "=_", "lambda_", "x_", ",_", "y_", ":_", "(_", "'", "utf", "-", "8", "'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "encoding_", "=_", "enc_", "(_", "j_", "._", "headers_", ",_", "text_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "encoding_", "==_", "'", "us", "-", "ascii", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "encoding_", "=_", "'", "utf", "-", "8", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "=_", "text_", "._", "decode_", "(_", "encoding_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "open_", "(_", "file\\u_", ",_", "'", "rb", "'_", ")_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "encoding_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "from_", "char", "det_", "import_", "detect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "detect_", "=_", "lambda_", "x_", ":_", "{_", "'", "encoding", "'_", ":_", "'", "utf", "-", "8", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "encoding_", "=_", "detect_", "(_", "data_", ")_", "[_", "'", "encoding", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "=_", "data_", "._", "decode_", "(_", "encoding_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "sys_", "._", "stdin_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "wrap", "write_", "(_", "html", "2te", "xt_", "(_", "data_", ",_", "baseurl_", ")_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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.py
[ { "content": " def testModelFiltering(self):\n users = ({\n 'email': '[email protected]',\n 'login': 'goodlogin',\n 'firstName': 'First',\n 'lastName': 'Last',\n 'password': 'goodpassword'\n }, {\n 'email': '[email protected]',\n 'login': 'regularuser',\n 'firstName': 'First',\n 'lastName': 'Last',\n 'password': 'goodpassword'\n })\n adminUser, regUser = [\n self.model('user').createUser(**user) for user in users]\n\n fields = {\n 'hidden': 1,\n 'read': 1,\n 'write': 1,\n 'write2': 1,\n 'admin': 1,\n 'sa': 1\n }\n # Test filter behavior on access controlled model\n fakeAc = self.model('fake_ac').save(fields)\n fakeAc = self.model('fake_ac').setUserAccess(\n fakeAc, regUser, level=AccessType.READ)\n\n filtered = self.model('fake_ac').filter(fakeAc, adminUser)\n self.assertTrue('sa' in filtered)\n self.assertTrue('write' in filtered)\n self.assertFalse('hidden' in filtered)\n\n self.model('fake_ac').exposeFields(\n level=AccessType.READ, fields='hidden')\n\n filtered = self.model('fake_ac').filter(fakeAc, regUser)\n self.assertTrue('hidden' in filtered)\n self.assertTrue('read' in filtered)\n self.assertFalse('write' in filtered)\n self.assertFalse('admin' in filtered)\n self.assertFalse('sa' in filtered)\n\n self.model('fake_ac').hideFields(level=AccessType.READ, fields='read')\n\n fakeAc = self.model('fake_ac').setUserAccess(\n fakeAc, regUser, level=AccessType.ADMIN)\n\n filtered = self.model('fake_ac').filter(fakeAc, regUser)\n self.assertTrue('hidden' in filtered)\n self.assertTrue('write' in filtered)\n self.assertTrue('admin' in filtered)\n self.assertFalse('read' in filtered)\n self.assertFalse('sa' in filtered)\n\n # Test Model implementation\n fake = self.model('fake').save(fields)\n filtered = self.model('fake').filter(fake, regUser)\n self.assertEqual(filtered, {'read': 1, '_modelType': 'fake'})\n\n filtered = self.model('fake').filter(fake, adminUser)\n self.assertEqual(filtered, {\n 'read': 1,\n 'sa': 1,\n '_modelType': 'fake'\n })", "metadata": "root.ModelTestCase.testModelFiltering", "header": "['class', 'ModelTestCase', '(', 'base', '.', 'TestCase', ')', ':', '___EOS___']", "index": 66 } ]
[ { "span": "self.assertTrue('sa' in filtered)", "start_line": 97, "start_column": 8, "end_line": 97, "end_column": 41 }, { "span": "self.assertTrue('write' in filtered)", "start_line": 98, "start_column": 8, "end_line": 98, "end_column": 44 }, { "span": "self.assertFalse('hidden' in filtered)", "start_line": 99, "start_column": 8, "end_line": 99, "end_column": 46 }, { "span": "self.assertTrue('hidden' in filtered)", "start_line": 105, "start_column": 8, "end_line": 105, "end_column": 45 }, { "span": "self.assertTrue('read' in filtered)", "start_line": 106, "start_column": 8, "end_line": 106, "end_column": 43 }, { "span": "self.assertFalse('write' in filtered)", "start_line": 107, "start_column": 8, "end_line": 107, "end_column": 45 }, { "span": "self.assertFalse('admin' in filtered)", "start_line": 108, "start_column": 8, "end_line": 108, "end_column": 45 }, { "span": "self.assertFalse('sa' in filtered)", "start_line": 109, "start_column": 8, "end_line": 109, "end_column": 42 }, { "span": "self.assertTrue('hidden' in filtered)", "start_line": 117, "start_column": 8, "end_line": 117, "end_column": 45 }, { "span": "self.assertTrue('write' in filtered)", "start_line": 118, "start_column": 8, "end_line": 118, "end_column": 44 }, { "span": "self.assertTrue('admin' in filtered)", "start_line": 119, "start_column": 8, "end_line": 119, "end_column": 44 }, { "span": "self.assertFalse('read' in filtered)", "start_line": 120, "start_column": 8, "end_line": 120, "end_column": 44 }, { "span": "self.assertFalse('sa' in filtered)", "start_line": 121, "start_column": 8, "end_line": 121, "end_column": 42 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Model", "Test", "Case_", "(_", "base_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Model", "Filtering", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "users_", "=_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "'", "good", "@", "email", ".", "com", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "login", "'_", ":_", "'", "good", "login", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "first", "Name", "'_", ":_", "'", "Fi", "rst", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "Name", "'_", ":_", "'", "Las", "t", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "password", "'_", ":_", "'", "good", "password", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "'", "regular", "user", "@", "email", ".", "com", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "login", "'_", ":_", "'", "regular", "user", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "first", "Name", "'_", ":_", "'", "Fi", "rst", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "Name", "'_", ":_", "'", "Las", "t", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "password", "'_", ":_", "'", "good", "password", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "admin", "User_", ",_", "reg", "User_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "model_", "(_", "'", "user", "'_", ")_", "._", "create", "User_", "(_", "**_", "user_", ")_", "for_", "user_", "in_", "users_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fields_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "hidden", "'_", ":_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "read", "'_", ":_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "write", "'_", ":_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "write", "2", "'_", ":_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "admin", "'_", ":_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sa", "'_", ":_", "1_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Test", " ", "filter", " ", "behavior", " ", "on", " ", "access", " ", "controlle", "d", " ", "model_", "\\u\\u\\uNL\\u\\u\\u_", "fake", "Ac_", "=_", "self_", "._", "model_", "(_", "'", "fake", "\\u", "ac", "'_", ")_", "._", "save_", "(_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake", "Ac_", "=_", "self_", "._", "model_", "(_", "'", "fake", "\\u", "ac", "'_", ")_", "._", "set", "User", "Access_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "fake", "Ac_", ",_", "reg", "User_", ",_", "level_", "=_", "Access", "Type_", "._", "READ_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "filtered_", "=_", "self_", "._", "model_", "(_", "'", "fake", "\\u", "ac", "'_", ")_", "._", "filter_", "(_", "fake", "Ac_", ",_", "admin", "User_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "sa", "'_", "in_", "filtered_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "write", "'_", "in_", "filtered_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "hidden", "'_", "in_", "filtered_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "model_", "(_", "'", "fake", "\\u", "ac", "'_", ")_", "._", "expos", "e", "Fields_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "level_", "=_", "Access", "Type_", "._", "READ_", ",_", "fields_", "=_", "'", "hidden", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "filtered_", "=_", "self_", "._", "model_", "(_", "'", "fake", "\\u", "ac", "'_", ")_", "._", "filter_", "(_", "fake", "Ac_", ",_", "reg", "User_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "hidden", "'_", "in_", "filtered_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "read", "'_", "in_", "filtered_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "write", "'_", "in_", "filtered_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "admin", "'_", "in_", "filtered_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "sa", "'_", "in_", "filtered_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "model_", "(_", "'", "fake", "\\u", "ac", "'_", ")_", "._", "hide", "Fields_", "(_", "level_", "=_", "Access", "Type_", "._", "READ_", ",_", "fields_", "=_", "'", "read", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fake", "Ac_", "=_", "self_", "._", "model_", "(_", "'", "fake", "\\u", "ac", "'_", ")_", "._", "set", "User", "Access_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "fake", "Ac_", ",_", "reg", "User_", ",_", "level_", "=_", "Access", "Type_", "._", "ADMIN_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "filtered_", "=_", "self_", "._", "model_", "(_", "'", "fake", "\\u", "ac", "'_", ")_", "._", "filter_", "(_", "fake", "Ac_", ",_", "reg", "User_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "hidden", "'_", "in_", "filtered_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "write", "'_", "in_", "filtered_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "admin", "'_", "in_", "filtered_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "read", "'_", "in_", "filtered_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "sa", "'_", "in_", "filtered_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "Model", " ", "implementation_", "\\u\\u\\uNL\\u\\u\\u_", "fake_", "=_", "self_", "._", "model_", "(_", "'", "fake", "'_", ")_", "._", "save_", "(_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filtered_", "=_", "self_", "._", "model_", "(_", "'", "fake", "'_", ")_", "._", "filter_", "(_", "fake_", ",_", "reg", "User_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "filtered_", ",_", "{_", "'", "read", "'_", ":_", "1_", ",_", "'\\u", "model", "Type", "'_", ":_", "'", "fake", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "filtered_", "=_", "self_", "._", "model_", "(_", "'", "fake", "'_", ")_", "._", "filter_", "(_", "fake_", ",_", "admin", "User_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "filtered_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "read", "'_", ":_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sa", "'_", ":_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "model", "Type", "'_", ":_", "'",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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
MLWave/kepler-mapper/km.py
[ { "content": " def fit_transform(self, X, projection=\"sum\", scaler=preprocessing.MinMaxScaler()):\n # Creates the projection/lens from X. \n #\n # Input: X. Input features as a numpy array.\n # Output: projected_X. original data transformed to a projection (lens).\n # \n # parameters\n # ----------\n # projection: Projection parameter is either a string, \n # a scikit class with fit_transform, like manifold.TSNE(), \n # or a list of dimension indices.\n # scaler: if None, do no scaling, else apply scaling to the projection\n # Default: Min-Max scaling\n \n self.scaler = scaler\n self.projection = str(projection)\n \n # Detect if projection is a class (for scikit-learn)\n if str(type(projection))[1:6] == \"class\": #TODO: de-ugly-fy\n reducer = projection\n if self.verbose > 0:\n try: \n projection.set_params(**{\"verbose\":self.verbose})\n except:\n pass\n print(\"\\n..Projecting data using: \\n\\t%s\\n\"%str(projection))\n X = reducer.fit_transform(X)\n \n # Detect if projection is a string (for standard functions)\n if isinstance(projection, str):\n if self.verbose > 0:\n print(\"\\n..Projecting data using: %s\"%(projection))\n # Stats lenses\n if projection == \"sum\": # sum of row\n X = np.sum(X, axis=1).reshape((X.shape[0],1))\n if projection == \"mean\": # mean of row\n X = np.mean(X, axis=1).reshape((X.shape[0],1))\n if projection == \"median\": # mean of row\n X = np.median(X, axis=1).reshape((X.shape[0],1))\n if projection == \"max\": # max of row\n X = np.max(X, axis=1).reshape((X.shape[0],1))\n if projection == \"min\": # min of row\n X = np.min(X, axis=1).reshape((X.shape[0],1))\n if projection == \"std\": # std of row\n X = np.std(X, axis=1).reshape((X.shape[0],1))\n \n if projection == \"dist_mean\": # Distance of x to mean of X\n X_mean = np.mean(X, axis=0) \n X = np.sum(np.sqrt((X - X_mean)**2), axis=1).reshape((X.shape[0],1))\n\n # Detect if projection is a list (with dimension indices)\n if isinstance(projection, list):\n if self.verbose > 0:\n print(\"\\n..Projecting data using: %s\"%(str(projection)))\n X = X[:,np.array(projection)]\n \n # Scaling\n if scaler is not None:\n if self.verbose > 0:\n print(\"\\n..Scaling with: %s\\n\"%str(scaler))\n X = scaler.fit_transform(X)\n \n return X", "metadata": "root.KeplerMapper.fit_transform", "header": "['class', 'KeplerMapper', '(', 'object', ')', ':', '___NEWLINE___', '# With this class you can build topological networks from (high-dimensional) data.', '___NL___', '#', '___NL___', '# 1) \\tFit a projection/lens/function to a dataset and transform it. ', '___NL___', '# \\tFor instance \"mean_of_row(x) for x in X\"', '___NL___', '# 2) \\tMap this projection with overlapping intervals/hypercubes. ', '___NL___', '# \\t\\tCluster the points inside the interval ', '___NL___', '# \\t\\t(Note: we cluster on the inverse image/original data to lessen projection loss).', '___NL___', '# \\t\\tIf two clusters/nodes have the same members (due to the overlap), then: ', '___NL___', '# \\t\\tconnect these with an edge.', '___NL___', '# 3) \\tVisualize the network using HTML and D3.js.', '___NL___', '# ', '___NL___', '# functions', '___NL___', '# ---------', '___NL___', '# fit_transform: Create a projection (lens) from a dataset', '___NL___', '# map: \\tApply Mapper algorithm on this projection and build a simplicial complex', '___NL___', '# visualize: \\tTurns the complex dictionary into a HTML/D3.js visualization', '___NL___', '___EOS___']", "index": 37 } ]
[ { "span": "except:", "start_line": 60, "start_column": 8, "end_line": 60, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Ke", "ple", "r", "Mapper_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "With", " ", "this", " ", "class", " ", "you", " ", "can", " ", "build", " ", "topologi", "cal", " ", "network", "s", " ", "from", " ", "(", "high", "-", "dimension", "al", ")", " ", "data", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "1", ")", " \t", "Fit", " ", "a", " ", "projecti", "on", "/", "lens", "/", "function", " ", "to", " ", "a", " ", "dataset", " ", "and", " ", "transform", " ", "it", ".", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\t", "For", " ", "instance", " ", "\"", "mean", "\\u", "of", "\\u", "row", "(", "x", ")", " ", "for", " ", "x", " ", "in", " ", "X", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "2", ")", " \t", "Map", " ", "this", " ", "projecti", "on", " ", "with", " ", "overlapping", " ", "interval", "s", "/", "hyper", "cubes", ".", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " \t", "\t", "Cluster", " ", "the", " ", "points", " ", "insi", "de", " ", "the", " ", "interval", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " \t", "\t", "(", "Not", "e", ":", " ", "we", " ", "cluster", " ", "on", " ", "the", " ", "inv", "erse", " ", "image", "/", "original", " ", "data", " ", "to", " ", "less", "en", " ", "projecti", "on", " ", "loss", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " \t", "\t", "If", " ", "two", " ", "cluster", "s", "/", "nodes", " ", "have", " ", "the", " ", "same", " ", "member", "s", " ", "(", "due", " ", "to", " ", "the", " ", "overl", "ap", "),", " ", "then", ":", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " \t", "\t", "connect", " ", "these", " ", "with", " ", "an", " ", "edge", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "3", ")", " ", " ", "\t", "Visuali", "ze", " ", "the", " ", "network", " ", "usi", "ng", " ", "HTM", "L", " ", "and", " ", "D3", ".", "js", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "functions_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "---------", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fit", "\\u", "transform", ":", " ", " ", " ", "Creat", "e", " ", "a", " ", "projecti", "on", " ", "(", "lens", ")", " ", "from", " ", "a", " ", "dataset_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "map", ":", " ", " ", " \t", "Apply", " ", "Map", "per", " ", "algo", "rit", "hm", " ", "on", " ", "this", " ", "projecti", "on", " ", "and", " ", "build", " ", "a", " ", "simpli", "cia", "l", " ", "complex_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "visualize", ":", " ", " \t", "Turn", "s", " ", "the", " ", "complex", " ", "dictionar", "y", " ", "int", "o", " ", "a", " ", "HTM", "L", "/", "D3", ".", "js", " ", "visualization", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fit", "\\u", "transform_", "(_", "self_", ",_", "X_", ",_", "projection_", "=_", "\"", "sum", "\"_", ",_", "scaler_", "=_", "preprocessing_", "._", "Min", "Max", "Scaler", "_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Creat", "es", " ", "the", " ", "projecti", "on", "/", "lens", " ", "from", " ", "X", ".", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Inp", "ut", ":", " ", " ", "X", ".", " ", "Inp", "ut", " ", "features", " ", "as", " ", "a", " ", "nump", "y", " ", "array", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Output", ":", " ", "projected", "\\u", "X", ".", " ", "original", " ", "data", " ", "transforme", "d", " ", "to", " ", "a", " ", "projecti", "on", " ", "(", "lens", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "parameters_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "----------", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "projecti", "on", ":", " ", " ", " ", "Projection", " ", "parameter", " ", "is", " ", "eit", "her", " ", "a", " ", "string", ",", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "a", " ", "scikit", " ", "class", " ", "with", " ", "fit", "\\u", "transform", ",", " ", "like", " ", "mani", "fold", ".", "TS", "NE", "()", ",", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "or", " ", "a", " ", "list", " ", "of", " ", "dimension", " ", "indice", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "scale", "r", ":", " ", " ", " ", "if", " ", "Non", "e", ",", " ", "do", " ", "no", " ", "scal", "ing", ",", " ", "else", " ", "appl", "y", " ", "scal", "ing", " ", "to", " ", "the", " ", "projection_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "Default", ":", " ", "Min", "-", "Max", " ", "scaling_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "scaler_", "=_", "scaler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "projection_", "=_", "str_", "(_", "projection_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Detect", " ", "if", " ", "projecti", "on", " ", "is", " ", "a", " ", "class", " ", "(", "for", " ", "scikit", "-", "learn", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "str_", "(_", "type_", "(_", "projection_", ")_", ")_", "[_", "1_", ":_", "6_", "]_", "==_", "\"", "class", "\"_", ":_", "#", "TOD", "O", ":", " ", "de", "-", "ug", "ly", "-", "fy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "reducer", "_", "=_", "projection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "verbose_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "projection_", "._", "set\\u", "params_", "(_", "**_", "{_", "\"", "verbo", "se", "\"_", ":_", "self_", "._", "verbose_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "\"\\\\", "n", "..", "Project", "ing", " ", "data", " ", "usi", "ng", ":", " ", "\\\\", "n", "\\\\", "t", "%", "s", "\\\\", "n", "\"_", "%_", "str_", "(_", "projection_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "X_", "=_", "reducer", "_", "._", "fit", "\\u", "transform_", "(_", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Detect", " ", "if", " ", "projecti", "on", " ", "is", " ", "a", " ", "string", " ", "(", "for", " ", "standard", " ", "function", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "projection_", ",_", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "verbose_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"\\\\", "n", "..", "Project", "ing", " ", "data", " ", "usi", "ng", ":", " ", "%", "s", "\"_", "%_", "(_", "projection_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Stat", "s", " ", "lens", "es_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "projection_", "==_", "\"", "sum", "\"_", ":_", "#", " ", "sum", " ", "of", " ", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "X_", "=_", "np_", "._", "sum_", "(_", "X_", ",_", "axis_", "=_", "1_", ")_", "._", "reshape_", "(_", "(_", "X_", "._", "shape_", "[_", "0_", "]_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "projection_", "==_", "\"", "mean", "\"_", ":_", "#", " ", "mean", " ", "of", " ", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "X_", "=_", "np_", "._", "mean_", "(_", "X_", ",_", "axis_", "=_", "1_", ")_", "._", "reshape_", "(_", "(_", "X_", "._", "shape_", "[_", "0_", "]_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "projection_", "==_", "\"", "median", "\"_", ":_", "#", " ", "mean", " ", "of", " ", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "X_", "=_", "np_", "._", "median_", "(_", "X_", ",_", "axis_", "=_", "1_", ")_", "._", "reshape_", "(_", "(_", "X_", "._", "shape_", "[_", "0_", "]_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "projection_", "==_", "\"", "max", "\"_", ":_", "#", " ", "max", " ", "of", " ", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "X_", "=_", "np_", "._", "max_", "(_", "X_", ",_", "axis_", "=_", "1_", ")_", "._", "reshape_", "(_", "(_", "X_", "._", "shape_", "[_", "0_", "]_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "projection_", "==_", "\"", "min", "\"_", ":_", "#", " ", "min", " ", "of", " ", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "X_", "=_", "np_", "._", "min_", "(_", "X_", ",_", "axis_", "=_", "1_", ")_", "._", "reshape_", "(_", "(_", "X_", "._", "shape_", "[_", "0_", "]_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "projection_", "==_", "\"", "std", "\"_", ":_", "#", " ", "std", " ", "of", " ", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "X_", "=_", "np_", "._", "std_", "(_", "X_", ",_", "axis_", "=_", "1_", ")_", "._", "reshape_", "(_", "(_", "X_", "._", "shape_", "[_", "0_", "]_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "projection_", "==_", "\"", "dist", "\\u", "mean", "\"_", ":_", "#", " ", "Distan", "ce", " ", "of", " ", "x", " ", "to", " ", "mean", " ", "of", " ", "X_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "X", "\\u", "mean_", "=_", "np_", "._", "mean_", "(_", "X_", ",_", "axis_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X_", "=_", "np_", "._", "sum_", "(_", "np_", "._", "sqrt_", "(_", "(_", "X_", "-_", "X", "\\u", "mean_", ")_", "**_", "2_", ")_", ",_", "axis_", "=_", "1_", ")_", "._", "reshape_", "(_", "(_", "X_", "._", "shape_", "[_", "0_", "]_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Detect", " ", "if", " ", "projecti", "on", " ", "is", " ", "a", " ", "list", " ", "(", "with", " ", "dimension", " ", "indice", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "projection_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "verbose_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"\\\\", "n", "..", "Project", "ing", " ", "data", " ", "usi", "ng", ":", " ", "%", "s", "\"_", "%_", "(_", "str_", "(_", "projection_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "X_", "=_", "X_", "[_", ":_", ",_", "np_", "._", "array_", "(_", "projection_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sca", "ling_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "scaler_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "verbose_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"\\\\", "n", "..", "Sca", "ling", " ", "with", ":", " ", "%", "s", "\\\\", "n", "\"_", "%_", "str_", "(_", "sca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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
cocagne/paxos/test/test_external.py
[ { "content": "import sys\nimport os.path\nimport heapq\n\nimport unittest\n\nthis_dir = os.path.dirname(os.path.abspath(__file__))\nsys.path.append( os.path.dirname(this_dir) )\n\nfrom paxos import external\n\nimport test_practical\nfrom test_practical import PID\n\n\n \n\n\n \n \n\n\n \n\n\n\n\n\n\n\n\n\nif __name__ == '__main__':\n unittest.main()\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class ExternalMessenger (test_practical.PracticalMessenger):\n\n procs = 0\n tleader = None\n\n \n\n \n\n \n\n ", "metadata": "root.ExternalMessenger", "header": "['module', '___EOS___']", "index": 15 }, { "content": " def send_leadership_proclamation(self, pnum):\n self.procs += 1", "metadata": "root.ExternalMessenger.send_leadership_proclamation", "header": "['class', 'ExternalMessenger', '(', 'test_practical', '.', 'PracticalMessenger', ')', ':', '___EOS___']", "index": 21 }, { "content": " def on_leadership_acquired(self):\n super(ExternalMessenger,self).on_leadership_acquired()\n self.tleader = 'gained'", "metadata": "root.ExternalMessenger.on_leadership_acquired", "header": "['class', 'ExternalMessenger', '(', 'test_practical', '.', 'PracticalMessenger', ')', ':', '___EOS___']", "index": 25 }, { "content": " def on_leadership_lost(self):\n self.tleader = 'lost'", "metadata": "root.ExternalMessenger.on_leadership_lost", "header": "['class', 'ExternalMessenger', '(', 'test_practical', '.', 'PracticalMessenger', ')', ':', '___EOS___']", "index": 30 }, { "content": " def on_leadership_change(self, old_uid, new_uid):\n pass", "metadata": "root.ExternalMessenger.on_leadership_change", "header": "['class', 'ExternalMessenger', '(', 'test_practical', '.', 'PracticalMessenger', ')', ':', '___EOS___']", "index": 34 }, { "content": "class ExternalTests (object):\n\n node_factory = None\n \n\n \n\n\n \n\n\n\n \n\n\n\n\n\n\n \n \n\n\n", "metadata": "root.ExternalTests", "header": "['module', '___EOS___']", "index": 41 }, { "content": " def create_node(self):\n self.l = self.node_factory(self, 'A', 3)", "metadata": "root.ExternalTests.create_node", "header": "['class', 'ExternalTests', '(', 'object', ')', ':', '___EOS___']", "index": 45 }, { "content": " def test_initial_leader(self):\n self.l = self.node_factory(self, 'A', 3, 'A')\n self.assertTrue(self.l.leader)\n self.assertEquals( self.procs, 0 )", "metadata": "root.ExternalTests.test_initial_leader", "header": "['class', 'ExternalTests', '(', 'object', ')', ':', '___EOS___']", "index": 50 }, { "content": " def test_gain_leader(self):\n self.l.set_proposal('foo')\n self.l.prepare()\n \n self.am('prepare', PID(1,'A'))\n\n self.l.recv_promise('A', PID(1,'A'), None, None)\n self.l.recv_promise('B', PID(1,'A'), None, None)\n \n self.an()\n \n self.l.recv_promise('C', PID(1,'A'), None, None)\n \n self.am('accept', PID(1,'A'), 'foo')\n\n self.assertEquals( self.tleader, 'gained' )\n self.assertEquals( self.l.leader_uid, 'A' )", "metadata": "root.ExternalTests.test_gain_leader", "header": "['class', 'ExternalTests', '(', 'object', ')', ':', '___EOS___']", "index": 56 }, { "content": " def test_gain_leader_nack(self):\n self.l.set_proposal('foo')\n \n self.l.prepare()\n\n self.am('prepare', PID(1,'A'))\n\n self.l.recv_promise('A', PID(1,'A'), None, None)\n\n self.l.recv_prepare_nack('B', PID(1,'A'), PID(2,'C'))\n\n self.l.prepare()\n\n self.am('prepare', PID(3,'A'))", "metadata": "root.ExternalTests.test_gain_leader_nack", "header": "['class', 'ExternalTests', '(', 'object', ')', ':', '___EOS___']", "index": 76 }, { "content": " def test_lose_leader(self):\n self.test_gain_leader()\n\n self.assertEquals( self.l.leader_proposal_id, PID(1,'A') )\n \n self.l.recv_leadership_proclamation( 'B', PID(5,'B') )\n\n self.assertEquals( self.l.leader_proposal_id, PID(5,'B') )\n self.assertEquals( self.tleader, 'lost' )", "metadata": "root.ExternalTests.test_lose_leader", "header": "['class', 'ExternalTests', '(', 'object', ')', ':', '___EOS___']", "index": 93 }, { "content": " def test_lose_leader_via_nacks(self):\n self.test_gain_leader()\n\n self.assertEquals( self.l.leader_proposal_id, PID(1,'A') )\n \n self.l.recv_accept_nack( 'B', PID(1,'A'), PID(2,'B') )\n self.l.recv_accept_nack( 'C', PID(1,'A'), PID(2,'B') )\n\n self.assertEquals( self.tleader, 'gained' )\n self.assertEquals( self.l.leader_proposal_id, PID(1,'A') )\n\n self.l.recv_accept_nack( 'D', PID(1,'A'), PID(2,'B') )\n\n self.assertEquals( self.l.leader_proposal_id, None )\n self.assertEquals( self.tleader, 'lost' )", "metadata": "root.ExternalTests.test_lose_leader_via_nacks", "header": "['class', 'ExternalTests', '(', 'object', ')', ':', '___EOS___']", "index": 104 }, { "content": " def test_regain_leader(self):\n self.test_lose_leader()\n \n self.l.prepare()\n\n self.am('prepare', PID(6,'A'))\n\n self.l.recv_promise('B', PID(6,'A'), None, None)\n self.l.recv_promise('C', PID(6,'A'), None, None)\n self.an()\n self.l.recv_promise('D', PID(6,'A'), None, None)\n self.am('accept', PID(6,'A'), 'foo')\n\n self.assertEquals( self.tleader, 'gained' )", "metadata": "root.ExternalTests.test_regain_leader", "header": "['class', 'ExternalTests', '(', 'object', ')', ':', '___EOS___']", "index": 121 }, { "content": " def test_ignore_old_leader_proclamation(self):\n self.test_lose_leader()\n\n self.l.recv_leadership_proclamation( 'A', PID(1,'A') )\n\n self.assertEquals( self.l.leader_proposal_id, PID(5,'B') )", "metadata": "root.ExternalTests.test_ignore_old_leader_proclamation", "header": "['class', 'ExternalTests', '(', 'object', ')', ':', '___EOS___']", "index": 138 }, { "content": " def test_proposal_id_increment(self):\n self.l.set_proposal('foo')\n\n self.l.prepare()\n\n self.am('prepare', PID(1,'A'))\n\n self.l.recv_promise('A', PID(1,'A'), None, None)\n self.l.recv_promise('B', PID(1,'A'), None, None)\n self.an()\n \n self.l.prepare()\n self.am('prepare', PID(2,'A'))\n\n self.l.recv_promise('A', PID(2,'A'), None, None)\n self.l.recv_promise('B', PID(2,'A'), None, None)\n self.l.recv_promise('C', PID(2,'A'), None, None)\n \n self.am('accept', PID(2,'A'), 'foo')\n\n self.assertEquals( self.tleader, 'gained' )", "metadata": "root.ExternalTests.test_proposal_id_increment", "header": "['class', 'ExternalTests', '(', 'object', ')', ':', '___EOS___']", "index": 146 }, { "content": "class ExternalTester(ExternalTests, ExternalMessenger, unittest.TestCase):\n node_factory = external.ExternalNode\n", "metadata": "root.ExternalTester", "header": "['module', '___EOS___']", "index": 169 }, { "content": " def setUp(self):\n super(ExternalTester,self).setUp()\n self.create_node()", "metadata": "root.ExternalTester.setUp", "header": "['class', 'ExternalTester', '(', 'ExternalTests', ',', 'ExternalMessenger', ',', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 172 }, { "content": "class TNode(test_practical.AutoSaveMixin, external.ExternalNode):\n pass", "metadata": "root.TNode", "header": "['module', '___EOS___']", "index": 178 }, { "content": "class ExternalProposerTester(test_practical.PracticalProposerTests,\n ExternalMessenger,\n unittest.TestCase):\n proposer_factory = TNode\n", "metadata": "root.ExternalProposerTester", "header": "['module', '___EOS___']", "index": 181 }, { "content": " def setUp(self):\n super(ExternalProposerTester,self).setUp()", "metadata": "root.ExternalProposerTester.setUp", "header": "['class', 'ExternalProposerTester', '(', 'test_practical', '.', 'PracticalProposerTests', ',', '___NL___', 'ExternalMessenger', ',', '___NL___', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 186 }, { "content": "class ExternalAcceptorTester(test_practical.PracticalAcceptorTests,\n ExternalMessenger,\n unittest.TestCase):\n acceptor_factory = TNode\n", "metadata": "root.ExternalAcceptorTester", "header": "['module', '___EOS___']", "index": 190 }, { "content": " def setUp(self):\n super(ExternalAcceptorTester,self).setUp()", "metadata": "root.ExternalAcceptorTester.setUp", "header": "['class', 'ExternalAcceptorTester', '(', 'test_practical', '.', 'PracticalAcceptorTests', ',', '___NL___', 'ExternalMessenger', ',', '___NL___', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 195 }, { "content": "class ExternalLearnerTester(test_practical.PracticalLearnerTests,\n ExternalMessenger,\n unittest.TestCase):\n learner_factory = TNode\n", "metadata": "root.ExternalLearnerTester", "header": "['module', '___EOS___']", "index": 199 }, { "content": " def setUp(self):\n super(ExternalLearnerTester,self).setUp()", "metadata": "root.ExternalLearnerTester.setUp", "header": "['class', 'ExternalLearnerTester', '(', 'test_practical', '.', 'PracticalLearnerTests', ',', '___NL___', 'ExternalMessenger', ',', '___NL___', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 204 } ]
[ { "span": "import heapq", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 12 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "._", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "heapq_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "this", "\\u", "dir_", "=_", "os_", "._", "path_", "._", "dirname_", "(_", "os_", "._", "path_", "._", "abspath_", "(_", "\\u\\u", "file\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "append_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "this", "\\u", "dir_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "pa", "xo", "s_", "import_", "external_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "test\\u", "practic", "al_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "test\\u", "practic", "al_", "import_", "PID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unittest_", "._", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Exter", "nal", "Mess", "enger", "_", "(_", "test\\u", "practic", "al_", "._", "Pra", "ctic", "al", "Mess", "enger", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "procs_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tle", "ader_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Exter", "nal", "Mess", "enger", "_", "(_", "test\\u", "practic", "al_", "._", "Pra", "ctic", "al", "Mess", "enger", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "send", "\\u", "leader", "ship", "\\u", "proc", "lam", "ation_", "(_", "self_", ",_", "pn", "um_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "procs_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exter", "nal", "Mess", "enger", "_", "(_", "test\\u", "practic", "al_", "._", "Pra", "ctic", "al", "Mess", "enger", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "\\u", "leader", "ship", "\\u", "acquired", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Exter", "nal", "Mess", "enger", "_", ",_", "self_", ")_", "._", "on", "\\u", "leader", "ship", "\\u", "acquired", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "tle", "ader_", "=_", "'", "gain", "ed", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exter", "nal", "Mess", "enger", "_", "(_", "test\\u", "practic", "al_", "._", "Pra", "ctic", "al", "Mess", "enger", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "\\u", "leader", "ship", "\\u", "lost_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "tle", "ader_", "=_", "'", "lost", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exter", "nal", "Mess", "enger", "_", "(_", "test\\u", "practic", "al_", "._", "Pra", "ctic", "al", "Mess", "enger", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "\\u", "leader", "ship", "\\u", "change_", "(_", "self_", ",_", "old", "\\u", "uid_", ",_", "new", "\\u", "uid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Exter", "nal", "Tests_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node", "\\u", "factory_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Exter", "nal", "Tests_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "create", "\\u", "node_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "l_", "=_", "self_", "._", "node", "\\u", "factory_", "(_", "self_", ",_", "'", "A", "'_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exter", "nal", "Tests_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "initial", "\\u", "leader_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "l_", "=_", "self_", "._", "node", "\\u", "factory_", "(_", "self_", ",_", "'", "A", "'_", ",_", "3_", ",_", "'", "A", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "l_", "._", "leader_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "procs_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exter", "nal", "Tests_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "gain", "\\u", "leader_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "l_", "._", "set\\u", "proposal_", "(_", "'", "foo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "l_", "._", "prepare_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "am_", "(_", "'", "prepar", "e", "'_", ",_", "PID_", "(_", "1_", ",_", "'", "A", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "l_", "._", "recv", "\\u", "promise", "_", "(_", "'", "A", "'_", ",_", "PID_", "(_", "1_", ",_", "'", "A", "'_", ")_", ",_", "None_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "l_", "._", "recv", "\\u", "promise", "_", "(_", "'", "B", "'_", ",_", "PID_", "(_", "1_", ",_", "'", "A", "'_", ")_", ",_", "None_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "an_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "l_", "._", "recv", "\\u", "promise", "_", "(_", "'", "C", "'_", ",_", "PID_", "(_", "1_", ",_", "'", "A", "'_", ")_", ",_", "None_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "am_", "(_", "'", "accept", "'_", ",_", "PID_", "(_", "1_", ",_", "'", "A", "'_", ")_", ",_", "'", "foo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "tle", "ader_", ",_", "'", "gain", "ed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "l_", "._", "leader", "\\u", "uid_", ",_", "'", "A", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exter", "nal", "Tests_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "gain", "\\u", "leader", "\\u", "nac", "k_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "l_", "._", "set\\u", "proposal_", "(_", "'", "foo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "l_", "._", "prepare_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "am_", "(_", "'", "prepar", "e", "'_", ",_", "PID_", "(_", "1_", ",_", "'", "A", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "l_", "._", "recv", "\\u", "promise", "_", "(_", "'", "A", "'_", ",_", "PID_", "(_", "1_", ",_", "'", "A", "'_", ")_", ",_", "None_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "l_", "._", "recv", "\\u", "prepar", "e\\u", "nac", "k_", "(_", "'", "B", "'_", ",_", "PID_", "(_", "1_", ",_", "'", "A", "'_", ")_", ",_", "PID_", "(_", "2_", ",_", "'", "C", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "l_", "._", "prepare_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "am_", "(_", "'", "prepar", "e", "'_", ",_", "PID_", "(_", "3_", ",_", "'", "A", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exter", "nal", "Tests_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "lose", "\\u", "leader_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "test\\u", "gain", "\\u", "leader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "l_", "._", "leader", "\\u", "propos", "al", "\\u", "id_", ",_", "PID_", "(_", "1_", ",_", "'", "A", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "l_", "._", "recv", "\\u", "leader", "ship", "\\u", "proc", "lam", "ation_", "(_", "'", "B", "'_", ",_", "PID_", "(_", "5_", ",_", "'", "B", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "l_", "._", "leader", "\\u", "propos", "al", "\\u", "id_", ",_", "PID_", "(_", "5_", ",_", "'", "B", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "tle", "ader_", ",_", "'", "lost", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exter", "nal", "Tests_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "lose", "\\u", "leader", "\\u", "via", "\\u", "nac", "ks_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "test\\u", "gain", "\\u", "leader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "l_", "._", "leader", "\\u", "propos", "al", "\\u", "id_", ",_", "PID_", "(_", "1_", ",_", "'", "A", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "l_", "._", "recv", "\\u", "accept", "\\u", "nac", "k_", "(_", "'", "B", "'_", ",_", "PID_", "(_", "1_", ",_", "'", "A", "'_", ")_", ",_", "PID_", "(_", "2_", ",_", "'", "B", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "l_", "._", "recv", "\\u", "accept", "\\u", "nac", "k_", "(_", "'", "C", "'_", ",_", "PID_", "(_", "1_", ",_", "'", "A", "'_", ")_", ",_", "PID_", "(_", "2_", ",_", "'", "B", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "tle", "ader_", ",_", "'", "gain", "ed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "l_", "._", "leader", "\\u", "propos", "al", "\\u", "id_", ",_", "PID_", "(_", "1_", ",_", "'", "A", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "l_", "._", "recv", "\\u", "accept", "\\u", "nac", "k_", "(_", "'", "D", "'_", ",_", "PID_", "(_", "1_", ",_", "'", "A", "'_", ")_", ",_", "PID_", "(_", "2_", ",_", "'", "B", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "l_", "._", "leader", "\\u", "propos", "al", "\\u", "id_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "tle", "ader_", ",_", "'", "lost", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exter", "nal", "Tests_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "rega", "in", "\\u", "leader_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "test\\u", "lose", "\\u", "leader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "l_", "._", "prepare_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "am_", "(_", "'", "prepar", "e", "'_", ",_", "PID_", "(_", "6_", ",_", "'", "A", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "l_", "._", "recv", "\\u", "promise", "_", "(_", "'", "B", "'_", ",_", "PID_", "(_", "6_", ",_", "'", "A", "'_", ")_", ",_", "None_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "l_", "._", "recv", "\\u", "promise", "_", "(_", "'", "C", "'_", ",_", "PID_", "(_", "6_", ",_", "'", "A", "'_", ")_", ",_", "None_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "an_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "l_", "._", "recv", "\\u", "promise", "_", "(_", "'", "D", "'_", ",_", "PID_", "(_", "6_", ",_", "'", "A", "'_", ")_", ",_", "None_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "am_", "(_", "'", "accept", "'_", ",_", "PID_", "(_", "6_", ",_", "'", "A", "'_", ")_", ",_", "'", "foo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "tle", "ader_", ",_", "'", "gain", "ed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exter", "nal", "Tests_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "ignore", "\\u", "old", "\\u", "leader", "\\u", "proc", "lam", "ation_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "test\\u", "lose", "\\u", "leader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "l_", "._", "recv", "\\u", "leader", "ship", "\\u", "proc", "lam", "ation_", "(_", "'", "A", "'_", ",_", "PID_", "(_", "1_", ",_", "'", "A", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "l_", "._", "leader", "\\u", "propos", "al", "\\u", "id_", ",_", "PID_", "(_", "5_", ",_", "'", "B", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exter", "nal", "Tests_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "propos", "al", "\\u", "id", "\\u", "increment_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "l_", "._", "set\\u", "proposal_", "(_", "'", "foo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "l_", "._", "prepare_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "am_", "(_", "'", "prepar", "e", "'_", ",_", "PID_", "(_", "1_", ",_", "'", "A", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "l_", "._", "recv", "\\u", "promise", "_", "(_", "'", "A", "'_", ",_", "PID_", "(_", "1_", ",_", "'", "A", "'_", ")_", ",_", "None_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "l_", "._", "recv", "\\u", "promise", "_", "(_", "'", "B", "'_", ",_", "PID_", "(_", "1_", ",_", "'", "A", "'_", ")_", ",_", "None_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "an_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "l_", "._", "prepare_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "am_", "(_", "'", "prepar", "e", "'_", ",_", "PID_", "(_", "2_", ",_", "'", "A", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "l_", "._", "recv", "\\u", "promise", "_", "(_", "'", "A", "'_", ",_", "PID_", "(_", "2_", ",_", "'", "A", "'_", ")_", ",_", "None_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "l_", "._", "recv", "\\u", "promise", "_", "(_", "'", "B", "'_", ",_", "PID_", "(_", "2_", ",_", "'", "A", "'_", ")_", ",_", "None_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "l_", "._", "recv", "\\u", "promise", "_", "(_", "'", "C", "'_", ",_", "PID_", "(_", "2_", ",_", "'", "A", "'_", ")_", ",_", "None_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "am_", "(_", "'", "accept", "'_", ",_", "PID_", "(_", "2_", ",_", "'", "A", "'_", ")_", ",_", "'", "foo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "tle", "ader_", ",_", "'", "gain", "ed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Exter", "nal", "Tester_", "(_", "Exter", "nal", "Tests_", ",_", "Exter", "nal", "Mess", "enger", "_", ",_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node", "\\u", "factory_", "=_", "external_", "._", "Exter", "nal", "Node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Exter", "nal", "Tester_", "(_", "Exter", "nal", "Tests_", ",_", "Exter", "nal", "Mess", "enger", "_", ",_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Exter", "nal", "Tester_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "create", "\\u", "node_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "TN", "ode_", "(_", "test\\u", "practic", "al_", "._", "Auto", "Save", "Mixin_", ",_", "external_", "._", "Exter", "nal", "Node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Exter", "nal", "Propos", "er", "Tester_", "(_", "test\\u", "practic", "al_", "._", "Pra", "ctic", "al", "Propos", "er", "Tests_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Exter", "nal", "Mess", "enger", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "propos", "er", "\\u", "factory_", "=_", "TN", "ode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Exter", "nal", "Propos", "er", "Tester_", "(_", "test\\u", "practic", "al_", "._", "Pra", "ctic", "al", "Propos", "er", "Tests_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Exter", "nal", "Mess", "enger", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Exter", "nal", "Propos", "er", "Tester_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Exter", "nal", "Accept", "or", "Tester_", "(_", "test\\u", "practic", "al_", "._", "Pra", "ctic", "al", "Accept", "or", "Tests_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Exter", "nal", "Mess", "enger", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "accept", "or", "\\u", "factory_", "=_", "TN", "ode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Exter", "nal", "Accept", "or", "Tester_", "(_", "test\\u", "practic", "al_", "._", "Pra", "ctic", "al", "Accept", "or", "Tests_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Exter", "nal", "Mess", "enger", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Exter", "nal", "Accept", "or", "Tester_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Exter", "nal", "Learner", "Tester_", "(_", "test\\u", "practic", "al_", "._", "Pra", "ctic", "al", "Learner", "Tests_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Exter", "nal", "Mess", "enger", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "learner", "\\u", "factory_", "=_", "TN", "ode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Exter", "nal", "Learner", "Tester_", "(_", "test\\u", "practic", "al_", "._", "Pra", "ctic", "al", "Learner", "Tests_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Exter", "nal", "Mess", "enger", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Exter", "nal", "Learner", "Tester_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
wrongwaycn/ssdb-py/ssdb/_compat.py
[ { "content": "#coding=utf-8\n\nimport sys\n\nif sys.version_info[0] < 3:\n #python2.x\n from urlparse import urlparse\n from itertools import imap, izip\n from string import letters as ascii_letters\n from Queue import Queue\n try:\n from cStringIO import StringIO as BytesIO\n except ImportError:\n from StringIO import StringIO as BytesIO\n\n iteritems = lambda x: x.iteritems()\n iterkeys = lambda x: x.iterkeys()\n itervalues = lambda x: x.itervalues()\n nativestr = lambda x: x if isinstance(x, str) else x.encode('utf-8', 'replace')\n u = lambda x: x.decode()\n b = lambda x: x\n byte_to_chr = lambda x: x\n next = lambda x: x.next() \n unichr = unichr\n xrange = xrange\n basestring = basestring\n unicode = unicode\n bytes = str\n long = long \nelse:\n #python3.x\n from urllib.parse import urlparse\n from string import ascii_letters\n from queue import Queue\n from io import BytesIO \n\n iteritems = lambda x: iter(x.items())\n iterkeys = lambda x: iter(x.keys())\n itervalues = lambda x: iter(x.values())\n byte_to_chr = lambda x: chr(x)\n nativestr = lambda x: x if isinstance(x, str) else x.decode('utf-8', 'replace')\n u = lambda x: x\n b = lambda x: x.encode('iso-8859-1') if not isinstance(x, bytes) else x\n next = next\n unichr = chr\n imap = map\n izip = zip\n xrange = range\n basestring = str\n unicode = str\n bytes = bytes\n long = int\n\ntry:\n from collections import OrderedDict\nexcept ImportError:\n from ssdb.utils import SortedDict as OrderedDict\n\ntry:\n # Python 3\n from queue import LifoQueue, Empty, Full\nexcept ImportError:\n from Queue import Empty, Full\n try:\n # Python 2.6 - 2.7\n from Queue import LifoQueue\n except ImportError:\n # Python 2.5\n from Queue import Queue\n # From the Python 2.7 lib. Python 2.5 already extracted the core\n # methods to aid implementating different queue organisations.\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": " class LifoQueue(Queue):\n \"Override queue methods to implement a last-in first-out queue.\"\n\n\n\n ", "metadata": "root.LifoQueue", "header": "['module', '___EOS___']", "index": 72 }, { "content": " def _init(self, maxsize):\n self.maxsize = maxsize\n self.queue = []", "metadata": "root.LifoQueue._init", "header": "['class', 'LifoQueue', '(', 'Queue', ')', ':', '___EOS___']", "index": 75 }, { "content": " def _qsize(self, len=len):\n return len(self.queue)", "metadata": "root.LifoQueue._qsize", "header": "['class', 'LifoQueue', '(', 'Queue', ')', ':', '___EOS___']", "index": 79 }, { "content": " def _put(self, item):\n self.queue.append(item)", "metadata": "root.LifoQueue._put", "header": "['class', 'LifoQueue', '(', 'Queue', ')', ':', '___EOS___']", "index": 82 }, { "content": " def _get(self):\n return self.queue.pop()", "metadata": "root.LifoQueue._get", "header": "['class', 'LifoQueue', '(', 'Queue', ')', ':', '___EOS___']", "index": 85 } ]
[ { "span": "from urllib.parse import urlparse", "start_line": 31, "start_column": 4, "end_line": 31, "end_column": 37 }, { "span": "from string import ascii_letters", "start_line": 32, "start_column": 4, "end_line": 32, "end_column": 36 }, { "span": "from io import BytesIO ", "start_line": 34, "start_column": 4, "end_line": 34, "end_column": 26 }, { "span": "from collections import OrderedDict", "start_line": 54, "start_column": 4, "end_line": 54, "end_column": 39 }, { "span": "from ssdb.utils import SortedDict as OrderedDict", "start_line": 56, "start_column": 4, "end_line": 56, "end_column": 52 }, { "span": "from queue import LifoQueue, Empty, Full", "start_line": 60, "start_column": 4, "end_line": 60, "end_column": 44 }, { "span": "from Queue import Empty, Full", "start_line": 62, "start_column": 4, "end_line": 62, "end_column": 33 }, { "span": "from Queue import LifoQueue", "start_line": 65, "start_column": 8, "end_line": 65, "end_column": 35 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", "codi", "ng", "=", "utf", "-", "8_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "sys_", "._", "version", "\\u", "info_", "[_", "0_", "]_", "<_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "python", "2", ".", "x_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "urlparse_", "import_", "urlparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "itertools_", "import_", "imap_", ",_", "izip_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "string_", "import_", "letters_", "as_", "ascii", "\\u", "letters_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Queue_", "import_", "Queue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "c", "String", "IO_", "import_", "String", "IO_", "as_", "Byte", "s", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "String", "IO_", "import_", "String", "IO_", "as_", "Byte", "s", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iteritems_", "=_", "lambda_", "x_", ":_", "x_", "._", "iteritems_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iterkeys_", "=_", "lambda_", "x_", ":_", "x_", "._", "iterkeys_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "itervalues_", "=_", "lambda_", "x_", ":_", "x_", "._", "itervalues_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nativ", "estr", "_", "=_", "lambda_", "x_", ":_", "x_", "if_", "isinstance_", "(_", "x_", ",_", "str_", ")_", "else_", "x_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ",_", "'", "replace", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "=_", "lambda_", "x_", ":_", "x_", "._", "decode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "lambda_", "x_", ":_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "byte", "\\u", "to", "\\u", "chr_", "=_", "lambda_", "x_", ":_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "next_", "=_", "lambda_", "x_", ":_", "x_", "._", "next_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unichr_", "=_", "unichr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xrange_", "=_", "xrange_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "basestring_", "=_", "basestring_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unicode_", "=_", "unicode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bytes_", "=_", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "long_", "=_", "long_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "python", "3", ".", "x_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "urllib_", "._", "parse_", "import_", "urlparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "string_", "import_", "ascii", "\\u", "letters_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "queue_", "import_", "Queue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "io_", "import_", "Byte", "s", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "iteritems_", "=_", "lambda_", "x_", ":_", "iter_", "(_", "x_", "._", "items_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iterkeys_", "=_", "lambda_", "x_", ":_", "iter_", "(_", "x_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "itervalues_", "=_", "lambda_", "x_", ":_", "iter_", "(_", "x_", "._", "values_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "byte", "\\u", "to", "\\u", "chr_", "=_", "lambda_", "x_", ":_", "chr_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nativ", "estr", "_", "=_", "lambda_", "x_", ":_", "x_", "if_", "isinstance_", "(_", "x_", ",_", "str_", ")_", "else_", "x_", "._", "decode_", "(_", "'", "utf", "-", "8", "'_", ",_", "'", "replace", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "=_", "lambda_", "x_", ":_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "lambda_", "x_", ":_", "x_", "._", "encode_", "(_", "'", "iso", "-", "8859", "-1", "'_", ")_", "if_", "not_", "isinstance_", "(_", "x_", ",_", "bytes_", ")_", "else_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "next_", "=_", "next_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unichr_", "=_", "chr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "imap_", "=_", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "izip_", "=_", "zip_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xrange_", "=_", "range_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "basestring_", "=_", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unicode_", "=_", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bytes_", "=_", "bytes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "long_", "=_", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "collections_", "import_", "Order", "ed", "Dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "ssd", "b_", "._", "utils_", "import_", "Sorte", "d", "Dict_", "as_", "Order", "ed", "Dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "3_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "queue_", "import_", "Lif", "o", "Queue_", ",_", "Empty_", ",_", "Full_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "Queue_", "import_", "Empty_", ",_", "Full_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "2.6", " ", "-", " ", "2.7", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "Queue_", "import_", "Lif", "o", "Queue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "2.5_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "Queue_", "import_", "Queue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fro", "m", " ", "the", " ", "Pyth", "on", " ", "2.7", " ", "lib", ".", " ", "Pyth", "on", " ", "2.5", " ", "alr", "ead", "y", " ", "extracted", " ", "the", " ", "core_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "method", "s", " ", "to", " ", "aid", " ", "implement", "ati", "ng", " ", "different", " ", "queue", " ", "organisation", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Lif", "o", "Queue_", "(_", "Queue_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Override", " ", "queue", " ", "method", "s", " ", "to", " ", "implement", " ", "a", " ", "last", "-", "in", " ", "first", "-", "out", " ", "queue", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Lif", "o", "Queue_", "(_", "Queue_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "init_", "(_", "self_", ",_", "maxsize_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "maxsize_", "=_", "maxsize_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "queue_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Lif", "o", "Queue_", "(_", "Queue_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "qsize_", "(_", "self_", ",_", "len_", "=_", "len_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "len_", "(_", "self_", "._", "queue_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Lif", "o", "Queue_", "(_", "Queue_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "put_", "(_", "self_", ",_", "item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "queue_", "._", "append_", "(_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Lif", "o", "Queue_", "(_", "Queue_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
appcelerator-archive/poc-nodejs-desktop/Resources/nodejs/builds/linux/node/lib/node/wafadmin/pproc.py
[ { "content": "# borrowed from python 2.5.2c1\n# Copyright (c) 2003-2005 by Peter Astrand <[email protected]>\n# Licensed to PSF under a Contributor Agreement.\n\nimport sys\nmswindows = (sys.platform == \"win32\")\n\nimport os\nimport types\nimport traceback\nimport gc\n\n\nif mswindows:\n import threading\n import msvcrt\n if 0:\n import pywintypes\n from win32api import GetStdHandle, STD_INPUT_HANDLE, \\\n STD_OUTPUT_HANDLE, STD_ERROR_HANDLE\n from win32api import GetCurrentProcess, DuplicateHandle, \\\n GetModuleFileName, GetVersion\n from win32con import DUPLICATE_SAME_ACCESS, SW_HIDE\n from win32pipe import CreatePipe\n from win32process import CreateProcess, STARTUPINFO, \\\n GetExitCodeProcess, STARTF_USESTDHANDLES, \\\n STARTF_USESHOWWINDOW, CREATE_NEW_CONSOLE\n from win32event import WaitForSingleObject, INFINITE, WAIT_OBJECT_0\n else:\n from _subprocess import *\nelse:\n import select\n import errno\n import fcntl\n import pickle\n\n__all__ = [\"Popen\", \"PIPE\", \"STDOUT\", \"call\", \"check_call\", \"CalledProcessError\"]\n\ntry:\n MAXFD = os.sysconf(\"SC_OPEN_MAX\")\nexcept:\n MAXFD = 256\n\ntry:\n False\nexcept NameError:\n False = 0\n True = 1\n\n_active = []\n\n\nPIPE = -1\nSTDOUT = -2\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class CalledProcessError(Exception):", "metadata": "root.CalledProcessError", "header": "['module', '___EOS___']", "index": 12 }, { "content": " def __init__(self, returncode, cmd):\n self.returncode = returncode\n self.cmd = cmd", "metadata": "root.CalledProcessError.__init__", "header": "['class', 'CalledProcessError', '(', 'Exception', ')', ':', '___EOS___']", "index": 13 }, { "content": " def __str__(self):\n return \"Command '%s' returned non-zero exit status %d\" % (self.cmd, self.returncode)", "metadata": "root.CalledProcessError.__str__", "header": "['class', 'CalledProcessError', '(', 'Exception', ')', ':', '___EOS___']", "index": 16 }, { "content": " class STARTUPINFO:\n dwFlags = 0\n hStdInput = None\n hStdOutput = None\n hStdError = None\n wShowWindow = 0", "metadata": "root.STARTUPINFO", "header": "['module', '___EOS___']", "index": 36 }, { "content": " class pywintypes:\n error = IOError", "metadata": "root.pywintypes", "header": "['module', '___EOS___']", "index": 42 }, { "content": "def _cleanup():\n for inst in _active[:]:\n if inst.poll(_deadstate=sys.maxint) >= 0:\n try:\n _active.remove(inst)\n except ValueError:\n pass", "metadata": "root._cleanup", "header": "['module', '___EOS___']", "index": 65 }, { "content": "def call(*popenargs, **kwargs):\n return Popen(*popenargs, **kwargs).wait()", "metadata": "root.call", "header": "['module', '___EOS___']", "index": 77 }, { "content": "def check_call(*popenargs, **kwargs):\n retcode = call(*popenargs, **kwargs)\n cmd = kwargs.get(\"args\")\n if cmd is None:\n cmd = popenargs[0]\n if retcode:\n raise CalledProcessError(retcode, cmd)\n return retcode", "metadata": "root.check_call", "header": "['module', '___EOS___']", "index": 80 }, { "content": "def list2cmdline(seq):\n result = []\n needquote = False\n for arg in seq:\n bs_buf = []\n\n if result:\n result.append(' ')\n\n needquote = (\" \" in arg) or (\"\\t\" in arg) or arg == \"\"\n if needquote:\n result.append('\"')\n\n for c in arg:\n if c == '\\\\':\n bs_buf.append(c)\n elif c == '\"':\n result.append('\\\\' * len(bs_buf)*2)\n bs_buf = []\n result.append('\\\\\"')\n else:\n if bs_buf:\n result.extend(bs_buf)\n bs_buf = []\n result.append(c)\n\n if bs_buf:\n result.extend(bs_buf)\n\n if needquote:\n result.extend(bs_buf)\n result.append('\"')\n\n return ''.join(result)", "metadata": "root.list2cmdline", "header": "['module', '___EOS___']", "index": 90 }, { "content": "class Popen(object):\n\n\n\n\n\n\n\n\n if mswindows:\n\n\n\n\n\n\n\n\n\n else:\n\n\n\n\n\n\n", "metadata": "root.Popen", "header": "['module', '___EOS___']", "index": 125 }, { "content": " def __init__(self, args, bufsize=0, executable=None,\n stdin=None, stdout=None, stderr=None,\n preexec_fn=None, close_fds=False, shell=False,\n cwd=None, env=None, universal_newlines=False,\n startupinfo=None, creationflags=0):\n _cleanup()\n\n self._child_created = False\n if not isinstance(bufsize, (int, long)):\n raise TypeError(\"bufsize must be an integer\")\n\n if mswindows:\n if preexec_fn is not None:\n raise ValueError(\"preexec_fn is not supported on Windows platforms\")\n if close_fds:\n raise ValueError(\"close_fds is not supported on Windows platforms\")\n else:\n if startupinfo is not None:\n raise ValueError(\"startupinfo is only supported on Windows platforms\")\n if creationflags != 0:\n raise ValueError(\"creationflags is only supported on Windows platforms\")\n\n self.stdin = None\n self.stdout = None\n self.stderr = None\n self.pid = None\n self.returncode = None\n self.universal_newlines = universal_newlines\n\n (p2cread, p2cwrite,\n c2pread, c2pwrite,\n errread, errwrite) = self._get_handles(stdin, stdout, stderr)\n\n self._execute_child(args, executable, preexec_fn, close_fds,\n cwd, env, universal_newlines,\n startupinfo, creationflags, shell,\n p2cread, p2cwrite,\n c2pread, c2pwrite,\n errread, errwrite)\n\n if mswindows:\n if stdin is None and p2cwrite is not None:\n os.close(p2cwrite)\n p2cwrite = None\n if stdout is None and c2pread is not None:\n os.close(c2pread)\n c2pread = None\n if stderr is None and errread is not None:\n os.close(errread)\n errread = None\n\n if p2cwrite:\n self.stdin = os.fdopen(p2cwrite, 'wb', bufsize)\n if c2pread:\n if universal_newlines:\n self.stdout = os.fdopen(c2pread, 'rU', bufsize)\n else:\n self.stdout = os.fdopen(c2pread, 'rb', bufsize)\n if errread:\n if universal_newlines:\n self.stderr = os.fdopen(errread, 'rU', bufsize)\n else:\n self.stderr = os.fdopen(errread, 'rb', bufsize)", "metadata": "root.Popen.__init__", "header": "['class', 'Popen', '(', 'object', ')', ':', '___EOS___']", "index": 126 }, { "content": " def _translate_newlines(self, data):\n data = data.replace(\"\\r\\n\", \"\\n\")\n data = data.replace(\"\\r\", \"\\n\")\n return data", "metadata": "root.Popen._translate_newlines", "header": "['class', 'Popen', '(', 'object', ')', ':', '___EOS___']", "index": 191 }, { "content": " def __del__(self, sys=sys):\n if not self._child_created:\n return\n self.poll(_deadstate=sys.maxint)\n if self.returncode is None and _active is not None:\n _active.append(self)", "metadata": "root.Popen.__del__", "header": "['class', 'Popen', '(', 'object', ')', ':', '___EOS___']", "index": 197 }, { "content": " def communicate(self, input=None):\n if [self.stdin, self.stdout, self.stderr].count(None) >= 2:\n stdout = None\n stderr = None\n if self.stdin:\n if input:\n self.stdin.write(input)\n self.stdin.close()\n elif self.stdout:\n stdout = self.stdout.read()\n elif self.stderr:\n stderr = self.stderr.read()\n self.wait()\n return (stdout, stderr)\n\n return self._communicate(input)", "metadata": "root.Popen.communicate", "header": "['class', 'Popen', '(', 'object', ')', ':', '___EOS___']", "index": 205 }, { "content": " def _get_handles(self, stdin, stdout, stderr):\n if stdin is None and stdout is None and stderr is None:\n return (None, None, None, None, None, None)\n\n p2cread, p2cwrite = None, None\n c2pread, c2pwrite = None, None\n errread, errwrite = None, None\n\n if stdin is None:\n p2cread = GetStdHandle(STD_INPUT_HANDLE)\n if p2cread is not None:\n pass\n elif stdin is None or stdin == PIPE:\n p2cread, p2cwrite = CreatePipe(None, 0)\n p2cwrite = p2cwrite.Detach()\n p2cwrite = msvcrt.open_osfhandle(p2cwrite, 0)\n elif isinstance(stdin, int):\n p2cread = msvcrt.get_osfhandle(stdin)\n else:\n p2cread = msvcrt.get_osfhandle(stdin.fileno())\n p2cread = self._make_inheritable(p2cread)\n\n if stdout is None:\n c2pwrite = GetStdHandle(STD_OUTPUT_HANDLE)\n if c2pwrite is not None:\n pass\n elif stdout is None or stdout == PIPE:\n c2pread, c2pwrite = CreatePipe(None, 0)\n c2pread = c2pread.Detach()\n c2pread = msvcrt.open_osfhandle(c2pread, 0)\n elif isinstance(stdout, int):\n c2pwrite = msvcrt.get_osfhandle(stdout)\n else:\n c2pwrite = msvcrt.get_osfhandle(stdout.fileno())\n c2pwrite = self._make_inheritable(c2pwrite)\n\n if stderr is None:\n errwrite = GetStdHandle(STD_ERROR_HANDLE)\n if errwrite is not None:\n pass\n elif stderr is None or stderr == PIPE:\n errread, errwrite = CreatePipe(None, 0)\n errread = errread.Detach()\n errread = msvcrt.open_osfhandle(errread, 0)\n elif stderr == STDOUT:\n errwrite = c2pwrite\n elif isinstance(stderr, int):\n errwrite = msvcrt.get_osfhandle(stderr)\n else:\n errwrite = msvcrt.get_osfhandle(stderr.fileno())\n errwrite = self._make_inheritable(errwrite)\n\n return (p2cread, p2cwrite,\n c2pread, c2pwrite,\n errread, errwrite)", "metadata": "root.Popen._get_handles", "header": "['class', 'Popen', '(', 'object', ')', ':', '___EOS___']", "index": 224 }, { "content": " def _make_inheritable(self, handle):\n return DuplicateHandle(GetCurrentProcess(), handle, GetCurrentProcess(), 0, 1, DUPLICATE_SAME_ACCESS)", "metadata": "root.Popen._make_inheritable", "header": "['class', 'Popen', '(', 'object', ')', ':', '___EOS___']", "index": 279 }, { "content": " def _find_w9xpopen(self):\n w9xpopen = os.path.join(os.path.dirname(GetModuleFileName(0)), \"w9xpopen.exe\")\n if not os.path.exists(w9xpopen):\n w9xpopen = os.path.join(os.path.dirname(sys.exec_prefix), \"w9xpopen.exe\")\n if not os.path.exists(w9xpopen):\n raise RuntimeError(\"Cannot locate w9xpopen.exe, which is needed for Popen to work with your shell or platform.\")\n return w9xpopen", "metadata": "root.Popen._find_w9xpopen", "header": "['class', 'Popen', '(', 'object', ')', ':', '___EOS___']", "index": 282 }, { "content": " def _execute_child(self, args, executable, preexec_fn, close_fds,\n cwd, env, universal_newlines,\n startupinfo, creationflags, shell,\n p2cread, p2cwrite,\n c2pread, c2pwrite,\n errread, errwrite):\n\n if not isinstance(args, types.StringTypes):\n args = list2cmdline(args)\n\n if startupinfo is None:\n startupinfo = STARTUPINFO()\n if None not in (p2cread, c2pwrite, errwrite):\n startupinfo.dwFlags |= STARTF_USESTDHANDLES\n startupinfo.hStdInput = p2cread\n startupinfo.hStdOutput = c2pwrite\n startupinfo.hStdError = errwrite\n\n if shell:\n startupinfo.dwFlags |= STARTF_USESHOWWINDOW\n startupinfo.wShowWindow = SW_HIDE\n comspec = os.environ.get(\"COMSPEC\", \"cmd.exe\")\n args = comspec + \" /c \" + args\n if (GetVersion() >= 0x80000000L or\n os.path.basename(comspec).lower() == \"command.com\"):\n w9xpopen = self._find_w9xpopen()\n args = '\"%s\" %s' % (w9xpopen, args)\n creationflags |= CREATE_NEW_CONSOLE\n\n try:\n hp, ht, pid, tid = CreateProcess(executable, args, None, None, 1, creationflags, env, cwd, startupinfo)\n except pywintypes.error, e:\n raise WindowsError(*e.args)\n\n self._child_created = True\n self._handle = hp\n self.pid = pid\n ht.Close()\n\n if p2cread is not None:\n p2cread.Close()\n if c2pwrite is not None:\n c2pwrite.Close()\n if errwrite is not None:\n errwrite.Close()", "metadata": "root.Popen._execute_child", "header": "['class', 'Popen', '(', 'object', ')', ':', '___EOS___']", "index": 290 }, { "content": " def poll(self, _deadstate=None):\n if self.returncode is None:\n if WaitForSingleObject(self._handle, 0) == WAIT_OBJECT_0:\n self.returncode = GetExitCodeProcess(self._handle)\n return self.returncode", "metadata": "root.Popen.poll", "header": "['class', 'Popen', '(', 'object', ')', ':', '___EOS___']", "index": 337 }, { "content": " def wait(self):\n if self.returncode is None:\n obj = WaitForSingleObject(self._handle, INFINITE)\n self.returncode = GetExitCodeProcess(self._handle)\n return self.returncode", "metadata": "root.Popen.wait", "header": "['class', 'Popen', '(', 'object', ')', ':', '___EOS___']", "index": 344 }, { "content": " def _readerthread(self, fh, buffer):\n buffer.append(fh.read())", "metadata": "root.Popen._readerthread", "header": "['class', 'Popen', '(', 'object', ')', ':', '___EOS___']", "index": 350 }, { "content": " def _communicate(self, input):\n stdout = None\n stderr = None\n\n if self.stdout:\n stdout = []\n stdout_thread = threading.Thread(target=self._readerthread, args=(self.stdout, stdout))\n stdout_thread.setDaemon(True)\n stdout_thread.start()\n if self.stderr:\n stderr = []\n stderr_thread = threading.Thread(target=self._readerthread, args=(self.stderr, stderr))\n stderr_thread.setDaemon(True)\n stderr_thread.start()\n\n if self.stdin:\n if input is not None:\n self.stdin.write(input)\n self.stdin.close()\n\n if self.stdout:\n stdout_thread.join()\n if self.stderr:\n stderr_thread.join()\n\n if stdout is not None:\n stdout = stdout[0]\n if stderr is not None:\n stderr = stderr[0]\n\n if self.universal_newlines and hasattr(file, 'newlines'):\n if stdout:\n stdout = self._translate_newlines(stdout)\n if stderr:\n stderr = self._translate_newlines(stderr)\n\n self.wait()\n return (stdout, stderr)", "metadata": "root.Popen._communicate", "header": "['class', 'Popen', '(', 'object', ')', ':', '___EOS___']", "index": 353 }, { "content": " def _get_handles(self, stdin, stdout, stderr):\n p2cread, p2cwrite = None, None\n c2pread, c2pwrite = None, None\n errread, errwrite = None, None\n\n if stdin is None:\n pass\n elif stdin == PIPE:\n p2cread, p2cwrite = os.pipe()\n elif isinstance(stdin, int):\n p2cread = stdin\n else:\n p2cread = stdin.fileno()\n\n if stdout is None:\n pass\n elif stdout == PIPE:\n c2pread, c2pwrite = os.pipe()\n elif isinstance(stdout, int):\n c2pwrite = stdout\n else:\n c2pwrite = stdout.fileno()\n\n if stderr is None:\n pass\n elif stderr == PIPE:\n errread, errwrite = os.pipe()\n elif stderr == STDOUT:\n errwrite = c2pwrite\n elif isinstance(stderr, int):\n errwrite = stderr\n else:\n errwrite = stderr.fileno()\n\n return (p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite)", "metadata": "root.Popen._get_handles", "header": "['class', 'Popen', '(', 'object', ')', ':', '___EOS___']", "index": 393 }, { "content": " def _set_cloexec_flag(self, fd):\n try:\n cloexec_flag = fcntl.FD_CLOEXEC\n except AttributeError:\n cloexec_flag = 1\n\n old = fcntl.fcntl(fd, fcntl.F_GETFD)\n fcntl.fcntl(fd, fcntl.F_SETFD, old | cloexec_flag)", "metadata": "root.Popen._set_cloexec_flag", "header": "['class', 'Popen', '(', 'object', ')', ':', '___EOS___']", "index": 429 }, { "content": " def _close_fds(self, but):\n for i in xrange(3, MAXFD):\n if i == but:\n continue\n try:\n os.close(i)\n except:\n pass", "metadata": "root.Popen._close_fds", "header": "['class', 'Popen', '(', 'object', ')', ':', '___EOS___']", "index": 438 }, { "content": " def _execute_child(self, args, executable, preexec_fn, close_fds,\n cwd, env, universal_newlines, startupinfo, creationflags, shell,\n p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite):\n\n if isinstance(args, types.StringTypes):\n args = [args]\n else:\n args = list(args)\n\n if shell:\n args = [\"/bin/sh\", \"-c\"] + args\n\n if executable is None:\n executable = args[0]\n\n errpipe_read, errpipe_write = os.pipe()\n self._set_cloexec_flag(errpipe_write)\n\n gc_was_enabled = gc.isenabled()\n gc.disable()\n try:\n self.pid = os.fork()\n except:\n if gc_was_enabled:\n gc.enable()\n raise\n self._child_created = True\n if self.pid == 0:\n try:\n if p2cwrite:\n os.close(p2cwrite)\n if c2pread:\n os.close(c2pread)\n if errread:\n os.close(errread)\n os.close(errpipe_read)\n\n if p2cread:\n os.dup2(p2cread, 0)\n if c2pwrite:\n os.dup2(c2pwrite, 1)\n if errwrite:\n os.dup2(errwrite, 2)\n\n if p2cread and p2cread not in (0,):\n os.close(p2cread)\n if c2pwrite and c2pwrite not in (p2cread, 1):\n os.close(c2pwrite)\n if errwrite and errwrite not in (p2cread, c2pwrite, 2):\n os.close(errwrite)\n\n if close_fds:\n self._close_fds(but=errpipe_write)\n\n if cwd is not None:\n os.chdir(cwd)\n\n if preexec_fn:\n apply(preexec_fn)\n\n if env is None:\n os.execvp(executable, args)\n else:\n os.execvpe(executable, args, env)\n\n except:\n exc_type, exc_value, tb = sys.exc_info()\n exc_lines = traceback.format_exception(exc_type, exc_value, tb)\n exc_value.child_traceback = ''.join(exc_lines)\n os.write(errpipe_write, pickle.dumps(exc_value))\n\n os._exit(255)\n\n if gc_was_enabled:\n gc.enable()\n os.close(errpipe_write)\n if p2cread and p2cwrite:\n os.close(p2cread)\n if c2pwrite and c2pread:\n os.close(c2pwrite)\n if errwrite and errread:\n os.close(errwrite)\n\n data = os.read(errpipe_read, 1048576)\n os.close(errpipe_read)\n if data != \"\":\n os.waitpid(self.pid, 0)\n child_exception = pickle.loads(data)\n raise child_exception", "metadata": "root.Popen._execute_child", "header": "['class', 'Popen', '(', 'object', ')', ':', '___EOS___']", "index": 447 }, { "content": " def _handle_exitstatus(self, sts):\n if os.WIFSIGNALED(sts):\n self.returncode = -os.WTERMSIG(sts)\n elif os.WIFEXITED(sts):\n self.returncode = os.WEXITSTATUS(sts)\n else:\n raise RuntimeError(\"Unknown child exit status!\")", "metadata": "root.Popen._handle_exitstatus", "header": "['class', 'Popen', '(', 'object', ')', ':', '___EOS___']", "index": 537 }, { "content": " def poll(self, _deadstate=None):\n if self.returncode is None:\n try:\n pid, sts = os.waitpid(self.pid, os.WNOHANG)\n if pid == self.pid:\n self._handle_exitstatus(sts)\n except os.error:\n if _deadstate is not None:\n self.returncode = _deadstate\n return self.returncode", "metadata": "root.Popen.poll", "header": "['class', 'Popen', '(', 'object', ')', ':', '___EOS___']", "index": 545 }, { "content": " def wait(self):\n if self.returncode is None:\n pid, sts = os.waitpid(self.pid, 0)\n self._handle_exitstatus(sts)\n return self.returncode", "metadata": "root.Popen.wait", "header": "['class', 'Popen', '(', 'object', ')', ':', '___EOS___']", "index": 556 }, { "content": " def _communicate(self, input):\n read_set = []\n write_set = []\n stdout = None\n stderr = None\n\n if self.stdin:\n self.stdin.flush()\n if input:\n write_set.append(self.stdin)\n else:\n self.stdin.close()\n if self.stdout:\n read_set.append(self.stdout)\n stdout = []\n if self.stderr:\n read_set.append(self.stderr)\n stderr = []\n\n input_offset = 0\n while read_set or write_set:\n rlist, wlist, xlist = select.select(read_set, write_set, [])\n\n if self.stdin in wlist:\n bytes_written = os.write(self.stdin.fileno(), buffer(input, input_offset, 512))\n input_offset += bytes_written\n if input_offset >= len(input):\n self.stdin.close()\n write_set.remove(self.stdin)\n\n if self.stdout in rlist:\n data = os.read(self.stdout.fileno(), 1024)\n if data == \"\":\n self.stdout.close()\n read_set.remove(self.stdout)\n stdout.append(data)\n\n if self.stderr in rlist:\n data = os.read(self.stderr.fileno(), 1024)\n if data == \"\":\n self.stderr.close()\n read_set.remove(self.stderr)\n stderr.append(data)\n\n if stdout is not None:\n stdout = ''.join(stdout)\n if stderr is not None:\n stderr = ''.join(stderr)\n\n if self.universal_newlines and hasattr(file, 'newlines'):\n if stdout:\n stdout = self._translate_newlines(stdout)\n if stderr:\n stderr = self._translate_newlines(stderr)\n\n self.wait()\n return (stdout, stderr)", "metadata": "root.Popen._communicate", "header": "['class', 'Popen', '(', 'object', ')', ':', '___EOS___']", "index": 562 } ]
[ { "span": "import errno", "start_line": 46, "start_column": 4, "end_line": 46, "end_column": 16 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "borrow", "ed", " ", "from", " ", "python", " ", "2.5", ".2", "c1_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2003", "-", "2005", " ", "by", " ", "Peter", " ", "Ast", "rand", " ", "<", "astr", "and", "@", "lys", "ator", ".", "li", "u", ".", "se", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", "d", " ", "to", " ", "PSF", " ", "under", " ", "a", " ", "Contributor", " ", "Agreement", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ms", "windows_", "=_", "(_", "sys_", "._", "platform_", "==_", "\"", "win32", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "types_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "traceback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "gc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ms", "windows_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "threading_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "msvcrt", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "pywi", "ntype", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "win32", "api_", "import_", "Get", "Std", "Handle_", ",_", "STD", "\\u", "INPUT", "\\u", "HANDLE_", ",_", "STD", "\\u", "OUTPU", "T", "\\u", "HANDLE_", ",_", "STD", "\\u", "ERROR", "\\u", "HANDLE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "win32", "api_", "import_", "Get", "Curr", "ent", "Process_", ",_", "Duplicate", "Handle_", ",_", "Get", "Modul", "e", "File", "Name_", ",_", "Get", "Version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "win32con_", "import_", "DUPL", "ICAT", "E", "\\u", "SAM", "E", "\\u", "ACCESS", "_", ",_", "SW", "\\u", "HID", "E_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "win32", "pipe_", "import_", "Creat", "e", "Pipe_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "win32", "process_", "import_", "Creat", "e", "Process_", ",_", "START", "UP", "INFO_", ",_", "Get", "Exi", "t", "Code", "Process_", ",_", "START", "F", "\\u", "USE", "STD", "HANDLE", "S_", ",_", "START", "F", "\\u", "USE", "SHOW", "WINDOW_", ",_", "CREATE", "\\u", "NEW", "\\u", "CONSOLE", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "win32", "event_", "import_", "Wait", "For", "Sing", "le", "Object_", ",_", "INFINIT", "E_", ",_", "WAIT", "\\u", "OBJ", "ECT", "\\u", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "\\u", "subprocess_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "select_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "errno_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "fcntl_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pickle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u", "all\\u\\u_", "=_", "[_", "\"", "Pop", "en", "\"_", ",_", "\"", "PIPE", "\"_", ",_", "\"", "STD", "OUT", "\"_", ",_", "\"", "call", "\"_", ",_", "\"", "check", "\\u", "call", "\"_", ",_", "\"", "Call", "ed", "Process", "Error", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "MAX", "FD_", "=_", "os_", "._", "sysc", "onf_", "(_", "\"", "SC", "\\u", "OPEN", "\\u", "MAX", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "MAX", "FD_", "=_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Name", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "False_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "True_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "active_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "PIPE_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STDOUT_", "=_", "-_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Call", "ed", "Process", "Error_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Call", "ed", "Process", "Error_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "returncode_", ",_", "cmd_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "returncode_", "=_", "returncode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cmd_", "=_", "cmd_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Call", "ed", "Process", "Error_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Command", " ", "'%", "s", "'", " ", "return", "ed", " ", "non", "-", "zero", " ", "exit", " ", "status", " ", "%", "d", "\"_", "%_", "(_", "self_", "._", "cmd_", ",_", "self_", "._", "returncode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "START", "UP", "INFO_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dw", "Flags_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h", "Std", "Input_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h", "Std", "Output_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h", "Std", "Error_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w", "Show", "Window_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "pywi", "ntype", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "error_", "=_", "IO", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "cleanup_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "inst_", "in_", "\\u", "active_", "[_", ":_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "inst_", "._", "poll_", "(_", "\\u", "dead", "state_", "=_", "sys_", "._", "maxint_", ")_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "active_", "._", "remove_", "(_", "inst_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "call_", "(_", "*_", "popen", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Popen_", "(_", "*_", "popen", "args_", ",_", "**_", "kwargs_", ")_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check", "\\u", "call_", "(_", "*_", "popen", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "retcode_", "=_", "call_", "(_", "*_", "popen", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd_", "=_", "kwargs_", "._", "get_", "(_", "\"", "args", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cmd_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "popen", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "retcode_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Call", "ed", "Process", "Error_", "(_", "retcode_", ",_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "retcode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "list", "2c", "mdl", "ine_", "(_", "seq_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "need", "quote_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "arg_", "in_", "seq_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bs", "\\u", "buf_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "append_", "(_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "need", "quote_", "=_", "(_", "\"", " ", "\"_", "in_", "arg_", ")_", "or_", "(_", "\"\\\\", "t", "\"_", "in_", "arg_", ")_", "or_", "arg_", "==_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "need", "quote_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "append_", "(_", "'\"'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "c_", "in_", "arg_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "c_", "==_", "'\\\\\\\\'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bs", "\\u", "buf_", "._", "append_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "c_", "==_", "'\"'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "append_", "(_", "'\\\\\\\\'_", "*_", "len_", "(_", "bs", "\\u", "buf_", ")_", "*_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bs", "\\u", "buf_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "append_", "(_", "'\\\\\\\\", "\"'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "bs", "\\u", "buf_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "result_", "._", "extend_", "(_", "bs", "\\u", "buf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bs", "\\u", "buf_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "._", "append_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "bs", "\\u", "buf_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "extend_", "(_", "bs", "\\u", "buf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "need", "quote_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "extend_", "(_", "bs", "\\u", "buf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "append_", "(_", "'\"'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "''_", "._", "join_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Popen_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ms", "windows_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Popen_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "args_", ",_", "bufsize_", "=_", "0_", ",_", "executable_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stdin_", "=_", "None_", ",_", "stdout_", "=_", "None_", ",_", "stderr_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pree", "xec", "\\u", "fn_", "=_", "None_", ",_", "close", "\\u", "fds_", "=_", "False_", ",_", "shell_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cwd_", "=_", "None_", ",_", "env_", "=_", "None_", ",_", "universal", "\\u", "newlines_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "upi", "nfo_", "=_", "None_", ",_", "creati", "onf", "lags_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "cleanup_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "child", "\\u", "created_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "bufsize_", ",_", "(_", "int_", ",_", "long_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "\"", "buf", "size", " ", "must", " ", "be", " ", "an", " ", "integ", "er", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ms", "windows_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "pree", "xec", "\\u", "fn_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "pree", "xec", "\\u", "fn", " ", "is", " ", "not", " ", "support", "ed", " ", "on", " ", "Window", "s", " ", "platform", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "close", "\\u", "fds_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "close", "\\u", "fds", " ", "is", " ", "not", " ", "support", "ed", " ", "on", " ", "Window", "s", " ", "platform", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "start", "upi", "nfo_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "start", "upi", "nfo", " ", "is", " ", "only", " ", "support", "ed", " ", "on", " ", "Window", "s", " ", "platform", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "creati", "onf", "lags_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "creati", "onf", "lags", " ", "is", " ", "only", " ", "support", "ed", " ", "on", " ", "Window", "s", " ", "platform", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "stdin_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "stdout_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "stderr_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "pid_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "returncode_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "universal", "\\u", "newlines_", "=_", "universal", "\\u", "newlines_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "p2", "crea", "d_", ",_", "p2", "cw", "rite_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "c2", "prea", "d_", ",_", "c2", "pwr", "ite_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "err", "read_", ",_", "err", "write_", ")_", "=_", "self_", "._", "\\u", "get", "\\u", "handles_", "(_", "stdin_", ",_", "stdout_", ",_", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "execute", "\\u", "child_", "(_", "args_", ",_", "executable_", ",_", "pree", "xec", "\\u", "fn_", ",_", "close", "\\u", "fds_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cwd_", ",_", "env_", ",_", "universal", "\\u", "newlines_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "upi", "nfo_", ",_", "creati", "onf", "lags_", ",_", "shell_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "p2", "crea", "d_", ",_", "p2", "cw", "rite_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "c2", "prea", "d_", ",_", "c2", "pwr", "ite_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "err", "read_", ",_", "err", "write_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "ms", "windows_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "stdin_", "is_", "None_", "and_", "p2", "cw", "rite_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "close_", "(_", "p2", "cw", "rite_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p2", "cw", "rite_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "stdout_", "is_", "None_", "and_", "c2", "prea", "d_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "close_", "(_", "c2", "prea", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2", "prea", "d_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "stderr_", "is_", "None_", "and_", "err", "read_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "close_", "(_", "err", "read_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "err", "read_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "p2", "cw", "rite_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "stdin_", "=_", "os_", "._", "fdo", "pen_", "(_", "p2", "cw", "rite_", ",_", "'", "wb", "'_", ",_", "bufsize_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "c2", "prea", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "universal", "\\u", "newlines_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "stdout_", "=_", "os_", "._", "fdo", "pen_", "(_", "c2", "prea", "d_", ",_", "'", "r", "U", "'_", ",_", "bufsize_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "stdout_", "=_", "os_", "._", "fdo", "pen_", "(_", "c2", "prea", "d_", ",_", "'", "rb", "'_", ",_", "bufsize_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "err", "read_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "universal", "\\u", "newlines_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "stderr_", "=_", "os_", "._", "fdo", "pen_", "(_", "err", "read_", ",_", "'", "r", "U", "'_", ",_", "bufsize_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "stderr_", "=_", "os_", "._", "fdo", "pen_", "(_", "err", "read_", ",_", "'", "rb", "'_", ",_", "bufsize_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Popen_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "translat", "e\\u", "newlines_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "data_", "._", "replace_", "(_", "\"\\\\", "r", "\\\\", "n", "\"_", ",_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "data_", "._", "replace_", "(_", "\"\\\\", "r", "\"_", ",_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Popen_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "del\\u\\u_", "(_", "self_", ",_", "sys_", "=_", "sys_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "\\u", "child", "\\u", "created_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "poll_", "(_", "\\u", "dead", "state_", "=_", "sys_", "._", "maxint_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "returncode_", "is_", "None_", "and_", "\\u", "active_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "active_", "._", "append_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Popen_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "communicate_", "(_", "self_", ",_", "input_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "[_", "self_", "._", "stdin_", ",_", "self_", "._", "stdout_", ",_", "self_", "._", "stderr_", "]_", "._", "count_", "(_", "None_", ")_", ">=_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stdout_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stderr_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "stdin_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "input_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "stdin_", "._", "write_", "(_", "input_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "stdin_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "stdout_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stdout_", "=_", "self_", "._", "stdout_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "stderr_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stderr_", "=_", "self_", "._", "stderr_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "stdout_", ",_", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u", "communicate_", "(_", "input_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Popen_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u", "get", "\\u", "handles_", "(_", "self_", ",_", "stdin_", ",_", "stdout_", ",_", "stderr_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "stdin_", "is_", "None_", "and_", "stdout_", "is_", "None_", "and_", "stderr_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "None_", ",_", "None_", ",_", "None_", ",_", "None_", ",_", "None_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "p2", "crea", "d_", ",_", "p2", "cw", "rite_", "=_", "None_", ",_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2", "prea", "d_", ",_", "c2", "pwr", "ite_", "=_", "None_", ",_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "err", "read_", ",_", "err", "write_", "=_", "None_", ",_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "stdin_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p2", "crea", "d_", "=_", "Get", "Std", "Handle_", "(_", "STD", "\\u", "INPUT", "\\u", "HANDLE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "p2", "crea", "d_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "stdin_", "is_", "None_", "or_", "stdin_", "==_", "PIPE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p2", "crea", "d_", ",_", "p2", "cw", "rite_", "=_", "Creat", "e", "Pipe_", "(_", "None_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p2", "cw", "rite_", "=_", "p2", "cw", "rite_", "._", "Detach", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p2", "cw", "rite_", "=_", "msvcrt", "_", "._", "open", "\\u", "os", "fhand", "le_", "(_", "p2", "cw", "rite_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "stdin_", ",_", "int_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p2", "crea", "d_", "=_", "msvcrt", "_", "._", "get", "\\u", "os", "fhand", "le_", "(_", "stdin_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p2", "crea", "d_", "=_", "msvcrt", "_", "._", "get", "\\u", "os", "fhand", "le_", "(_", "stdin_", "._", "fileno_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "p2", "crea", "d_", "=_", "self_", "._", "\\u", "make", "\\u", "inherita", "ble_", "(_", "p2", "crea", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "stdout_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c2", "pwr", "ite_", "=_", "Get", "Std", "Handle_", "(_", "STD", "\\u", "OUTPU", "T", "\\u", "HANDLE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "c2", "pwr", "ite_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "stdout_", "is_", "None_", "or_", "stdout_", "==_", "PIPE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c2", "prea", "d_", ",_", "c2", "pwr", "ite_", "=_", "Creat", "e", "Pipe_", "(_", "None_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2", "prea", "d_", "=_", "c2", "prea", "d_", "._", "Detach", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2", "prea", "d_", "=_", "msvcrt", "_", "._", "open", "\\u", "os", "fhand", "le_", "(_", "c2", "prea", "d_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "stdout_", ",_", "int_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c2", "pwr", "ite_", "=_", "msvcrt", "_", "._", "get", "\\u", "os", "fhand", "le_", "(_", "stdout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c2", "pwr", "ite_", "=_", "msvcrt", "_", "._", "get", "\\u", "os", "fhand", "le_", "(_", "stdout_", "._", "fileno_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "c2", "pwr", "ite_", "=_", "self_", "._", "\\u", "make", "\\u", "inherita", "ble_", "(_", "c2", "pwr", "ite_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "stderr_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "write_", "=_", "Get", "Std", "Handle_", "(_", "STD", "\\u", "ERROR", "\\u", "HANDLE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "err", "write_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "stderr_", "is_", "None_", "or_", "stderr_", "==_", "PIPE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "read_", ",_", "err", "write_", "=_", "Creat", "e", "Pipe_", "(_", "None_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "err", "read_", "=_", "err", "read_", "._", "Detach", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "err", "read_", "=_", "msvcrt", "_", "._", "open", "\\u", "os", "fhand", "le_", "(_", "err", "read_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "stderr_", "==_", "STDOUT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "write_", "=_", "c2", "pwr", "ite_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "stderr_", ",_", "int_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "write_", "=_", "msvcrt", "_", "._", "get", "\\u", "os", "fhand", "le_", "(_", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "write_", "=_", "msvcrt", "_", "._", "get", "\\u", "os", "fhand", "le_", "(_", "stderr_", "._", "fileno_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "err", "write_", "=_", "self_", "._", "\\u", "make", "\\u", "inherita", "ble_", "(_", "err", "write_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "(_", "p2", "crea", "d_", ",_", "p2", "cw", "rite_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "c2", "prea", "d_", ",_", "c2", "pwr", "ite_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "err", "read_", ",_", "err", "write_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Popen_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "make", "\\u", "inherita", "ble_", "(_", "self_", ",_", "handle_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Duplicate", "Handle_", "(_", "Get", "Curr", "ent", "Process_", "(_", ")_", ",_", "handle_", ",_", "Get", "Curr", "ent", "Process_", "(_", ")_", ",_", "0_", ",_", "1_", ",_", "DUPL", "ICAT", "E", "\\u", "SAM", "E", "\\u", "ACCESS", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Popen_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "find", "\\u", "w", "9", "xpo", "pen_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "w", "9", "xpo", "pen_", "=_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "Get", "Modul", "e", "File", "Name_", "(_", "0_", ")_", ")_", ",_", "\"", "w", "9", "xpo", "pen", ".", "exe", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "w", "9", "xpo", "pen_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "w", "9", "xpo", "pen_", "=_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "sys_", "._", "exec", "\\u", "prefix_", ")_", ",_", "\"", "w", "9", "xpo", "pen", ".", "exe", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "w", "9", "xpo", "pen_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "Run", "time", "Error_", "(_", "\"", "Cann", "ot", " ", "locat", "e", " ", "w", "9", "xpo", "pen", ".", "exe", ",", " ", "whi", "ch", " ", "is", " ", "need", "ed", " ", "for", " ", "Pop", "en", " ", "to", " ", "work", " ", "with", " ", "your", " ", "shell", " ", "or", " ", "platform", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "w", "9", "xpo", "pen_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Popen_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "execute", "\\u", "child_", "(_", "self_", ",_", "args_", ",_", "executable_", ",_", "pree", "xec", "\\u", "fn_", ",_", "close", "\\u", "fds_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cwd_", ",_", "env_", ",_", "universal", "\\u", "newlines_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "upi", "nfo_", ",_", "creati", "onf", "lags_", ",_", "shell_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "p2", "crea", "d_", ",_", "p2", "cw", "rite_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "c2", "prea", "d_", ",_", "c2", "pwr", "ite_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "err", "read_", ",_", "err", "write_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "isinstance_", "(_", "args_", ",_", "types_", "._", "String", "Types_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "list", "2c", "mdl", "ine_", "(_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "start", "upi", "nfo_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "upi", "nfo_", "=_", "START", "UP", "INFO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "None_", "not_", "in_", "(_", "p2", "crea", "d_", ",_", "c2", "pwr", "ite_", ",_", "err", "write_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "upi", "nfo_", "._", "dw", "Flags_", "|=_", "START", "F", "\\u", "USE", "STD", "HANDLE", "S_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "upi", "nfo_", "._", "h", "Std", "Input_", "=_", "p2", "crea", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "upi", "nfo_", "._", "h", "Std", "Output_", "=_", "c2", "pwr", "ite_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "upi", "nfo_", "._", "h", "Std", "Error_", "=_", "err", "write_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "shell_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "upi", "nfo_", "._", "dw", "Flags_", "|=_", "START", "F", "\\u", "USE", "SHOW", "WINDOW_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "upi", "nfo_", "._", "w", "Show", "Window_", "=_", "SW", "\\u", "HID", "E_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "com", "spec_", "=_", "os_", "._", "environ_", "._", "get_", "(_", "\"", "COM", "SPEC", "\"_", ",_", "\"", "cmd", ".", "exe", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "com", "spec_", "+_", "\"", " ", "/", "c", " ", "\"_", "+_", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "Get", "Version_", "(_", ")_", ">=_", "0x80000", "000_", "L_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "path_", "._", "basename_", "(_", "com", "spec_", ")_", "._", "lower_", "(_", ")_", "==_", "\"", "command", ".", "com", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "w", "9", "xpo", "pen_", "=_", "self_", "._", "\\u", "find", "\\u", "w", "9", "xpo", "pen_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "'\"", "%", "s", "\"", " ", "%", "s", "'_", "%_", "(_", "w", "9", "xpo", "pen_", ",_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "creati", "onf", "lags_", "|=_", "CREATE", "\\u", "NEW", "\\u", "CONSOLE", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hp_", ",_", "ht_", ",_", "pid_", ",_", "tid_", "=_", "Creat", "e", "Process_", "(_", "executable_", ",_", "args_", ",_", "None_", ",_", "None_", ",_", "1_", ",_", "creati", "onf", "lags_", ",_", "env_", ",_", "cwd_", ",_", "start", "upi", "nfo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "pywi", "ntype", "s_", "._", "error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Window", "s", "Error_", "(_", "*_", "e_", "._", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "child", "\\u", "created_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "handle_", "=_", "hp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "pid_", "=_", "pid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ht_", "._", "Close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "p2", "crea", "d_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p2", "crea", "d_", "._", "Close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "c2", "pwr", "ite_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c2", "pwr", "ite_", "._", "Close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "err", "write_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "write_", "._", "Close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Popen_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "poll_", "(_", "self_", ",_", "\\u", "dead", "state_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "returncode_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "Wait", "For", "Sing", "le", "Object_", "(_", "self_", "._", "\\u", "handle_", ",_", "0_", ")_", "==_", "WAIT", "\\u", "OBJ", "ECT", "\\u", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "returncode_", "=_", "Get", "Exi", "t", "Code", "Process_", "(_", "self_", "._", "\\u", "handle_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "returncode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Popen_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "wait_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "returncode_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "obj_", "=_", "Wait", "For", "Sing", "le", "Object_", "(_", "self_", "._", "\\u", "handle_", ",_", "INFINIT", "E_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "returncode_", "=_", "Get", "Exi", "t", "Code", "Process_", "(_", "self_", "._", "\\u", "handle_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "returncode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Popen_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "reader", "thread_", "(_", "self_", ",_", "fh_", ",_", "buffer_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "buffer_", "._", "append_", "(_", "fh_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Popen_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "communicate_", "(_", "self_", ",_", "input_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stdout_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stderr_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "stdout_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stdout_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stdout", "\\u", "thread_", "=_", "threading_", "._", "Thread_", "(_", "target_", "=_", "self_", "._", "\\u", "reader", "thread_", ",_", "args_", "=_", "(_", "self_", "._", "stdout_", ",_", "stdout_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stdout", "\\u", "thread_", "._", "set", "Daemon_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stdout", "\\u", "thread_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "stderr_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stderr_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "std", "err", "\\u", "thread_", "=_", "threading_", "._", "Thread_", "(_", "target_", "=_", "self_", "._", "\\u", "reader", "thread_", ",_", "args_", "=_", "(_", "self_", "._", "stderr_", ",_", "stderr_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "std", "err", "\\u", "thread_", "._", "set", "Daemon_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "std", "err", "\\u", "thread_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "stdin_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "input_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "stdin_", "._", "write_", "(_", "input_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "stdin_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "stdout_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stdout", "\\u", "thread_", "._", "join_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "stderr_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "std", "err", "\\u", "thread_", "._", "join_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "stdout_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stdout_", "=_", "stdout_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "stderr_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stderr_", "=_", "stderr_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "universal", "\\u", "newlines_", "and_", "hasattr_", "(_", "file_", ",_", "'", "newline", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "stdout_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "stdout_", "=_", "self_", "._", "\\u", "translat", "e\\u", "newlines_", "(_", "stdout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "stderr_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "stderr_", "=_", "self_", "._", "\\u", "translat", "e\\u", "newlines_", "(_", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "stdout_", ",_", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Popen_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u", "get", "\\u", "handles_", "(_", "self_", ",_", "stdin_", ",_", "stdout_", ",_", "stderr_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p2", "crea", "d_", ",_", "p2", "cw", "rite_", "=_", "None_", ",_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2", "prea", "d_", ",_", "c2", "pwr", "ite_", "=_", "None_", ",_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "err", "read_", ",_", "err", "write_", "=_", "None_", ",_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "stdin_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "stdin_", "==_", "PIPE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p2", "crea", "d_", ",_", "p2", "cw", "rite_", "=_", "os_", "._", "pipe_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "stdin_", ",_", "int_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p2", "crea", "d_", "=_", "stdin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p2", "crea", "d_", "=_", "stdin_", "._", "fileno_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "stdout_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "stdout_", "==_", "PIPE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c2", "prea", "d_", ",_", "c2", "pwr", "ite_", "=_", "os_", "._", "pipe_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "stdout_", ",_", "int_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c2", "pwr", "ite_", "=_", "stdout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c2", "pwr", "ite_", "=_", "stdout_", "._", "fileno_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "stderr_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "stderr_", "==_", "PIPE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "read_", ",_", "err", "write_", "=_", "os_", "._", "pipe_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "stderr_", "==_", "STDOUT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "write_", "=_", "c2", "pwr", "ite_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "stderr_", ",_", "int_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "write_", "=_", "stderr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "write_", "=_", "stderr_", "._", "fileno_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "p2", "crea", "d_", ",_", "p2", "cw", "rite_", ",_", "c2", "prea", "d_", ",_", "c2", "pwr", "ite_", ",_", "err", "read_", ",_", "err", "write_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Popen_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "set\\u", "clo", "exec", "\\u", "flag_", "(_", "self_", ",_", "fd_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "clo", "exec", "\\u", "flag_", "=_", "fcntl_", "._", "FD", "\\u", "CLO", "EXEC", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "clo", "exec", "\\u", "flag_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "old_", "=_", "fcntl_", "._", "fcntl_", "(_", "fd_", ",_", "fcntl_", "._", "F", "\\u", "GET", "FD_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fcntl_", "._", "fcntl_", "(_", "fd_", ",_", "fcntl_", "._", "F", "\\u", "SET", "FD_", ",_", "old_", "|_", "clo", "exec", "\\u", "flag_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Popen_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "close", "\\u", "fds_", "(_", "self_", ",_", "but", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "xrange_", "(_", "3_", ",_", "MAX", "FD_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "i_", "==_", "but", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "os_", "._", "close_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Popen_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "execute", "\\u", "child_", "(_", "self_", ",_", "args_", ",_", "executable_", ",_", "pree", "xec", "\\u", "fn_", ",_", "close", "\\u", "fds_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cwd_", ",_", "env_", ",_", "universal", "\\u", "newlines_", ",_", "start", "upi", "nfo_", ",_", "creati", "onf", "lags_", ",_", "shell_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "p2", "crea", "d_", ",_", "p2", "cw", "rite_", ",_", "c2", "prea", "d_", ",_", "c2", "pwr", "ite_", ",_", "err", "read_", ",_", "err", "write_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "args_", ",_", "types_", "._", "String", "Types_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "[_", "args_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "list_", "(_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "shell_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "[_", "\"/", "bin", "/", "sh", "\"_", ",_", "\"-", "c", "\"_", "]_", "+_", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "executable_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "executable_", "=_", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "err", "pipe", "\\u", "read_", ",_", "err", "pipe", "\\u", "write_", "=_", "os_", "._", "pipe_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "set\\u", "clo", "exec", "\\u", "flag_", "(_", "err", "pipe", "\\u", "write_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gc", "\\u", "was", "\\u", "enabled_", "=_", "gc_", "._", "ise", "nable", "d_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gc_", "._", "disable_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "pid_", "=_", "os_", "._", "fork_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "gc", "\\u", "was", "\\u", "enabled_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "gc_", "._", "enable_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "child", "\\u", "created_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "pid_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "p2", "cw", "rite_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "os_", "._", "close_", "(_", "p2", "cw", "rite_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "c2", "prea", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "os_", "._", "close_", "(_", "c2", "prea", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "err", "read_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "os_", "._", "close_", "(_", "err", "read_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "os_", "._", "close_", "(_", "err", "pipe", "\\u", "read_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "p2", "crea", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "os_", "._", "dup", "2_", "(_", "p2", "crea", "d_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "c2", "pwr", "ite_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "os_", "._", "dup", "2_", "(_", "c2", "pwr", "ite_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "err", "write_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "os_", "._", "dup", "2_", "(_", "err", "write_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "p2", "crea", "d_", "and_", "p2", "crea", "d_", "not_", "in_", "(_", "0_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "os_", "._", "close_", "(_", "p2", "crea", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "c2", "pwr", "ite_", "and_", "c2", "pwr", "ite_", "not_", "in_", "(_", "p2", "crea", "d_", ",_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "os_", "._", "close_", "(_", "c2", "pwr", "ite_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "err", "write_", "and_", "err", "write_", "not_", "in_", "(_", "p2", "crea", "d_", ",_", "c2", "pwr", "ite_", ",_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "os_", "._", "close_", "(_", "err", "write_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "close", "\\u", "fds_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "\\u", "close", "\\u", "fds_", "(_", "but", "_", "=_", "err", "pipe", "\\u", "write_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "cwd_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "os_", "._", "chdir_", "(_", "cwd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "pree", "xec", "\\u", "fn_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "apply_", "(_", "pree", "xec", "\\u", "fn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "env_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "os_", "._", "exec", "vp_", "(_", "executable_", ",_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "os_", "._", "exec", "vp", "e_", "(_", "executable_", ",_", "args_", ",_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "exc", "\\u", "type_", ",_", "exc", "\\u", "value_", ",_", "tb_", "=_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exc", "\\u", "lines_", "=_", "traceback_", "._", "format\\u", "exception_", "(_", "exc", "\\u", "type_", ",_", "exc", "\\u", "value_", ",_", "tb_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exc", "\\u", "value_", "._", "child", "\\u", "traceback_", "=_", "''_", "._", "join_", "(_", "exc", "\\u", "lines_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "write_", "(_", "err", "pipe", "\\u", "write_", ",_", "pickle_", "._", "dumps_", "(_", "exc", "\\u", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "os_", "._", "\\u", "exit_", "(_", "255_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "gc", "\\u", "was", "\\u", "enabled_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gc_", "._", "enable_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "os_", "._", "close_", "(_", "err", "pipe", "\\u", "write_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "p2", "crea", "d_", "and_", "p2", "cw", "rite_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "close_", "(_", "p2", "crea", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "c2", "pwr", "ite_", "and_", "c2", "prea", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "close_", "(_", "c2", "pwr", "ite_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "err", "write_", "and_", "err", "read_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "close_", "(_", "err", "write_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "=_", "os_", "._", "read_", "(_", "err", "pipe", "\\u", "read_", ",_", "104857", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "close_", "(_", "err", "pipe", "\\u", "read_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "data_", "!=_", "\"\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "wait", "pid_", "(_", "self_", "._", "pid_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "child", "\\u", "exception_", "=_", "pickle_", "._", "loads_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "child", "\\u", "exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Popen_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "handle", "\\u", "exits", "tatus_", "(_", "self_", ",_", "sts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "os_", "._", "WI", "FS", "IGN", "ALE", "D_", "(_", "sts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "returncode_", "=_", "-_", "os_", "._", "WT", "ERM", "SIG", "_", "(_", "sts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "os_", "._", "WI", "FE", "XI", "TED_", "(_", "sts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "returncode_", "=_", "os_", "._", "WE", "XI", "TST", "ATU", "S_", "(_", "sts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Run", "time", "Error_", "(_", "\"", "Un", "know", "n", " ", "child", " ", "exit", " ", "status", "!\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Popen_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "poll_", "(_", "self_", ",_", "\\u", "dead", "state_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "returncode_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pid_", ",_", "sts_", "=_", "os_", "._", "wait", "pid_", "(_", "self_", "._", "pid_", ",_", "os_", "._", "WN", "OH", "ANG", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pid_", "==_", "self_", "._", "pid_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "\\u", "handle", "\\u", "exits", "tatus_", "(_", "sts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "os_", "._", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "\\u", "dead", "state_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "returncode_", "=_", "\\u", "dead", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "returncode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Popen_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "wait_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "returncode_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pid_", ",_", "sts_", "=_", "os_", "._", "wait", "pid_", "(_", "self_", "._", "pid_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "handle", "\\u", "exits", "tatus_", "(_", "sts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "returncode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Popen_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "communicate_", "(_", "self_", ",_", "input_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "read", "\\u", "set_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "\\u", "set_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stdout_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stderr_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "stdin_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "stdin_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "input_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "write", "\\u", "set_", "._", "append_", "(_", "self_", "._", "stdin_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "stdin_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "stdout_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "read", "\\u", "set_", "._", "append_", "(_", "self_", "._", "stdout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stdout_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "stderr_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "read", "\\u", "set_", "._", "append_", "(_", "self_", "._", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stderr_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "input", "\\u", "offset_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "read", "\\u", "set_", "or_", "write", "\\u", "set_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rlist_", ",_", "wli", "st_", ",_", "xli", "st_", "=_", "select_", "._", "select_", "(_", "read", "\\u", "set_", ",_", "write", "\\u", "set_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "stdin_", "in_", "wli", "st_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "bytes", "\\u", "written_", "=_", "os_", "._", "write_", "(_", "self_", "._", "stdin_", "._", "fileno_", "(_", ")_", ",_", "buffer_", "(_", "input_", ",_", "input", "\\u", "offset_", ",_", "512_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "input", "\\u", "offset_", "+=_", "bytes", "\\u", "written_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "input", "\\u", "offset_", ">=_", "len_", "(_", "input_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "stdin_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "\\u", "set_", "._", "remove_", "(_", "self_", "._", "stdin_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "stdout_", "in_", "rlist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "data_", "=_", "os_", "._", "read_", "(_", "self_", "._", "stdout_", "._", "fileno_", "(_", ")_", ",_", "1024_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "data_", "==_", "\"\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "stdout_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "read", "\\u", "set_", "._", "remove_", "(_", "self_", "._", "stdout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "stdout_", "._", "append_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "stderr_", "in_", "rlist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "data_", "=_", "os_", "._", "read_", "(_", "self_", "._", "stderr_", "._", "fileno_", "(_", ")_", ",_", "1024_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "data_", "==_", "\"\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "stderr_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "read", "\\u", "set_", "._", "remove_", "(_", "self_", "._", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "stderr_", "._", "append_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "stdout_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stdout_", "=_", "''_", "._", "join_", "(_", "stdout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "stderr_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stderr_", "=_", "''_", "._", "join_", "(_", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "universal", "\\u", "newlines_", "and_", "hasattr_", "(_", "file_", ",_", "'", "newline", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "stdout_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "stdout_", "=_", "self_", "._", "\\u", "translat", "e\\u", "newlines_", "(_", "stdout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "stderr_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "stderr_", "=_", "self_", "._", "\\u", "translat", "e\\u", "newlines_", "(_", "stder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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
callowayproject/django-livevalidation/livevalidation/templatetags/live_validation.py
[ { "content": " def render(self, context):\n result = ['<script type=\"text/javascript\">']\n self.form = context[self.form]\n self.formcls = self.form.__class__\n try:\n # admin formset\n fields = self.form.form.fields\n prefix = '%s-'%self.form.prefix if self.form.form.prefix else ''\n except AttributeError:\n try:\n # regular form\n fields = self.form.fields\n except AttributeError:\n raise template.TemplateSyntaxError('Form %s has no fields'%self.form)\n prefix = '%s-'%self.form.prefix if self.form.prefix else ''\n for name,field in fields.items():\n result.append(self.do_field('%s%s'%(prefix,name),field))\n try:\n result.append(LV_EXTRA_SCRIPT%{'fieldname':'id_%s'%fields.keys()[1]})\n except:\n return ''\n result.append('</script>')\n return '\\n\\n'.join(filter(None,result))", "metadata": "root.ValidationNode.render", "header": "['class', 'ValidationNode', '(', 'template', '.', 'Node', ')', ':', '___EOS___']", "index": 17 } ]
[ { "span": "except:", "start_line": 36, "start_column": 8, "end_line": 36, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Validat", "ion", "Node_", "(_", "template_", "._", "Node_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "render_", "(_", "self_", ",_", "context_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "[_", "'<", "script", " ", "type", "=\"", "text", "/", "javascript", "\">'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "form_", "=_", "context_", "[_", "self_", "._", "form_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "form", "cls_", "=_", "self_", "._", "form_", "._", "\\u\\u", "class\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "admin", " ", "formset_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fields_", "=_", "self_", "._", "form_", "._", "form_", "._", "fields_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prefix_", "=_", "'%", "s", "-'_", "%_", "self_", "._", "form_", "._", "prefix_", "if_", "self_", "._", "form_", "._", "form_", "._", "prefix_", "else_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "regular", " ", "form_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fields_", "=_", "self_", "._", "form_", "._", "fields_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "template_", "._", "Templa", "te", "Syntax", "Error_", "(_", "'", "Form", " ", "%", "s", " ", "has", " ", "no", " ", "fields", "'_", "%_", "self_", "._", "form_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prefix_", "=_", "'%", "s", "-'_", "%_", "self_", "._", "form_", "._", "prefix_", "if_", "self_", "._", "form_", "._", "prefix_", "else_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "name_", ",_", "field_", "in_", "fields_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "append_", "(_", "self_", "._", "do", "\\u", "field_", "(_", "'%", "s", "%", "s", "'_", "%_", "(_", "prefix_", ",_", "name_", ")_", ",_", "field_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "append_", "(_", "LV", "\\u", "EXTRA", "\\u", "SCRIPT_", "%_", "{_", "'", "field", "name", "'_", ":_", "'", "id", "\\u", "%", "s", "'_", "%_", "fields_", "._", "keys_", "(_", ")_", "[_", "1_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "._", "append_", "(_", "'<", "/", "script", ">'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'\\\\", "n", "\\\\", "n", "'_", "._", "join_", "(_", "filter_", "(_", "None_", ",_", "result_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Variable defined multiple times
pydata/pandas/pandas/tests/series/test_misc_api.py
[ { "content": " def test_ndarray_compat(self):\n\n # test numpy compat with Series as sub-class of NDFrame\n tsdf = DataFrame(np.random.randn(1000, 3), columns=['A', 'B', 'C'],\n index=date_range('1/1/2000', periods=1000))\n\n def f(x):\n return x[x.argmax()]\n\n result = tsdf.apply(f)\n expected = tsdf.max()\n assert_series_equal(result, expected)\n\n # .item()\n s = Series([1])\n result = s.item()\n self.assertEqual(result, 1)\n self.assertEqual(s.item(), s.iloc[0])\n\n # using an ndarray like function\n s = Series(np.random.randn(10))\n result = np.ones_like(s)\n expected = Series(1, index=range(10), dtype='float64')\n # assert_series_equal(result,expected)\n\n # ravel\n s = Series(np.random.randn(10))\n tm.assert_almost_equal(s.ravel(order='F'), s.values.ravel(order='F'))\n\n # compress\n # GH 6658\n s = Series([0, 1., -1], index=list('abc'))\n result = np.compress(s > 0, s)\n assert_series_equal(result, Series([1.], index=['b']))\n\n result = np.compress(s < -1, s)\n # result empty Index(dtype=object) as the same as original\n exp = Series([], dtype='float64', index=Index([], dtype='object'))\n assert_series_equal(result, exp)\n\n s = Series([0, 1., -1], index=[.1, .2, .3])\n result = np.compress(s > 0, s)\n assert_series_equal(result, Series([1.], index=[.2]))\n\n result = np.compress(s < -1, s)\n # result empty Float64Index as the same as original\n exp = Series([], dtype='float64', index=Index([], dtype='float64'))\n assert_series_equal(result, exp)", "metadata": "root.TestSeriesMisc.test_ndarray_compat", "header": "['class', 'TestSeriesMisc', '(', 'TestData', ',', 'SharedWithSparse', ',', 'tm', '.', 'TestCase', ')', ':', '___EOS___']", "index": 282 } ]
[ { "span": "result ", "start_line": 303, "start_column": 8, "end_line": 303, "end_column": 14 } ]
[ { "span": "result ", "start_line": 314, "start_column": 8, "end_line": 314, "end_column": 14 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Test", "Serie", "s", "Mis", "c_", "(_", "Test", "Data_", ",_", "Share", "d", "With", "Spar", "se_", ",_", "tm_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "ndar", "ray", "\\u", "compat_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "nump", "y", " ", "compa", "t", " ", "with", " ", "Serie", "s", " ", "as", " ", "sub", "-", "class", " ", "of", " ", "ND", "Frame_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tsd", "f_", "=_", "Data", "Frame_", "(_", "np_", "._", "random_", "._", "randn_", "(_", "1000_", ",_", "3_", ")_", ",_", "columns_", "=_", "[_", "'", "A", "'_", ",_", "'", "B", "'_", ",_", "'", "C", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "index_", "=_", "date", "\\u", "range_", "(_", "'", "1", "/", "1", "/", "2000", "'_", ",_", "periods_", "=_", "1000_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "f_", "(_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "x_", "[_", "x_", "._", "argmax_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "tsd", "f_", "._", "apply_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "tsd", "f_", "._", "max_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "series", "\\u", "equal_", "(_", "result_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", ".", "item", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "Series_", "(_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "s_", "._", "item_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s_", "._", "item_", "(_", ")_", ",_", "s_", "._", "iloc_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "usi", "ng", " ", "an", " ", "ndar", "ray", " ", "like", " ", "function_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "Series_", "(_", "np_", "._", "random_", "._", "randn_", "(_", "10_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "np_", "._", "ones", "\\u", "like_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "Series_", "(_", "1_", ",_", "index_", "=_", "range_", "(_", "10_", ")_", ",_", "dtype_", "=_", "'", "float", "64", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "assert", "\\u", "series", "\\u", "equal", "(", "result", ",", "expected", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ravel_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "Series_", "(_", "np_", "._", "random_", "._", "randn_", "(_", "10_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tm_", "._", "assert", "\\u", "alm", "ost", "\\u", "equal_", "(_", "s_", "._", "ravel_", "(_", "order_", "=_", "'", "F", "'_", ")_", ",_", "s_", "._", "values_", "._", "ravel_", "(_", "order_", "=_", "'", "F", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "compress_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "GH", " ", "665", "8_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "Series_", "(_", "[_", "0_", ",_", "1._", ",_", "-_", "1_", "]_", ",_", "index_", "=_", "list_", "(_", "'", "abc", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "np_", "._", "compress_", "(_", "s_", ">_", "0_", ",_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "series", "\\u", "equal_", "(_", "result_", ",_", "Series_", "(_", "[_", "1._", "]_", ",_", "index_", "=_", "[_", "'", "b", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "np_", "._", "compress_", "(_", "s_", "<_", "-_", "1_", ",_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "result", " ", "empty", " ", "Index", "(", "dt", "ype", "=", "object", ")", " ", "as", " ", "the", " ", "same", " ", "as", " ", "original_", "\\u\\u\\uNL\\u\\u\\u_", "exp_", "=_", "Series_", "(_", "[_", "]_", ",_", "dtype_", "=_", "'", "float", "64", "'_", ",_", "index_", "=_", "Index_", "(_", "[_", "]_", ",_", "dtype_", "=_", "'", "object", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "series", "\\u", "equal_", "(_", "result_", ",_", "exp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "Series_", "(_", "[_", "0_", ",_", "1._", ",_", "-_", "1_", "]_", ",_", "index_", "=_", "[_", ".1_", ",_", ".2_", ",_", ".3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "np_", "._", "compress_", "(_", "s_", ">_", "0_", ",_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "series", "\\u", "equal_", "(_", "result_", ",_", "Series_", "(_", "[_", "1._", "]_", ",_", "index_", "=_", "[_", ".2_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "np_", "._", "compress_", "(_", "s_", "<_", "-_", "1_", ",_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "result", " ", "empty", " ", "Float", "64", "Index", " ", "as", " ", "the", " ", "same", " ", "as", " ", "original_", "\\u\\u\\uNL\\u\\u\\u_", "exp_", "=_", "Series_", "(_", "[_", "]_", ",_", "dtype_", "=_", "'", "float", "64", "'_", ",_", "index_", "=_", "Index_", "(_", "[_", "]_", ",_", "dtype_", "=_", "'", "float", "64", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "series", "\\u", "equal_", "(_", "result_", ",_", "exp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
anandology/pyjamas/library/gwt/Canvas2D.py
[ { "content": "# Canvas wrapper component for Pyjamas\n# Ported by Willie Gollino from Canvas component for GWT - Originally by Alexei Sokolov http://gwt.components.googlepages.com/\n#\n# Canvas API reference:\n# http://developer.apple.com/documentation/AppleApplications/Reference/SafariJSRef/Classes/Canvas.html#//apple_ref/js/Canvas.clearRect\n#\n# Usage Notes:\n# - IE support requires ExplorerCanvas from excanvas.sourceforge.net\n# - place excanvas.js in your apps public folder\n# - add this to your MainModule.html: <!--[if IE]><script src=\"excanvas.js\" type=\"text/javascript\"></script><![endif]-->\n\nfrom pyjamas import DOM\nfrom pyjamas.ui.Image import Image\nfrom pyjamas.ui.FocusWidget import FocusWidget\nfrom pyjamas.ui import Event\nfrom pyjamas.ui import MouseListener\nfrom pyjamas.ui import KeyboardListener\nfrom pyjamas.ui import Focus\nfrom pyjamas.ui import FocusListener\n\nfrom __pyjamas__ import JS\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Canvas(FocusWidget):\n\n\n\n\n", "metadata": "root.Canvas", "header": "['module', '___EOS___']", "index": 22 }, { "content": " def __init__(self, Width=0, Height=0, **kwargs):\n if not kwargs.has_key('StyleName'):\n kwargs['StyleName'] = 'gwt-Canvas'\n kwargs['Width'] = Width\n kwargs['Height'] = Height\n\n self.context = None\n \n focusable = Focus.createFocusable() \n self.canvas = DOM.createElement(\"canvas\")\n DOM.appendChild(focusable, self.canvas)\n FocusWidget.__init__(self, focusable, **kwargs)\n \n self.init()\n \n self.context.fillStyle = \"black\"\n self.context.strokeStyle = \"black\"", "metadata": "root.Canvas.__init__", "header": "['class', 'Canvas', '(', 'FocusWidget', ')', ':', '___EOS___']", "index": 23 }, { "content": " def setWidth(self, width):\n FocusWidget.setWidth(self, width)\n self.canvas.width = width", "metadata": "root.Canvas.setWidth", "header": "['class', 'Canvas', '(', 'FocusWidget', ')', ':', '___EOS___']", "index": 41 }, { "content": " def setHeight(self, height):\n FocusWidget.setHeight(self, height)\n self.canvas.height = height", "metadata": "root.Canvas.setHeight", "header": "['class', 'Canvas', '(', 'FocusWidget', ')', ':', '___EOS___']", "index": 45 }, { "content": " def getContext(self):\n return self.context", "metadata": "root.Canvas.getContext", "header": "['class', 'Canvas', '(', 'FocusWidget', ')', ':', '___EOS___']", "index": 49 }, { "content": " def isEmulation(self):\n return False", "metadata": "root.Canvas.isEmulation", "header": "['class', 'Canvas', '(', 'FocusWidget', ')', ':', '___EOS___']", "index": 52 }, { "content": " def init(self):\n el = self.getElement().firstChild\n ctx = el.getContext(\"2d\")\n \n \"\"\"\n ctx._createPattern = ctx.createPattern\n ctx.createPattern = function(img, rep) {\n if (!(img instanceof Image)) img = img.getElement(); \n return self._createPattern(img, rep)\n }\n\n ctx._drawImage = ctx.drawImage\n ctx.drawImage = function() {\n var a=arguments\n if (!(a[0] instanceof Image)) a[0] = a[0].getElement()\n if (a.length==9) return self._drawImage(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8])\n else if (a.length==5) return self._drawImage(a[0], a[1], a[2], a[3], a[4])\n return self._drawImage(a[0], a[1], a[2])\n }\n \"\"\"\n self.context = ctx", "metadata": "root.Canvas.init", "header": "['class', 'Canvas', '(', 'FocusWidget', ')', ':', '___EOS___']", "index": 55 }, { "content": "class CanvasImage(Image):\n", "metadata": "root.CanvasImage", "header": "['module', '___EOS___']", "index": 77 }, { "content": " def __init__(self, url=\"\", load_listener = None):\n Image.__init__(self, url)\n if load_listener:\n self.addLoadListener(load_listener) \n self.onAttach()", "metadata": "root.CanvasImage.__init__", "header": "['class', 'CanvasImage', '(', 'Image', ')', ':', '___EOS___']", "index": 78 }, { "content": " def isLoaded(self):\n return self.getElement().complete", "metadata": "root.CanvasImage.isLoaded", "header": "['class', 'CanvasImage', '(', 'Image', ')', ':', '___EOS___']", "index": 84 }, { "content": "class ImageLoadListener:\n\n \n\n\n ", "metadata": "root.ImageLoadListener", "header": "['module', '___EOS___']", "index": 88 }, { "content": " def __init__(self, listener = None):\n self.wait_list = []\n self.loadListeners = []\n \n if listener:\n self.addLoadListener(listener) ", "metadata": "root.ImageLoadListener.__init__", "header": "['class', 'ImageLoadListener', ':', '___EOS___']", "index": 89 }, { "content": " def add(self, sender):\n self.wait_list.append(sender)\n sender.addLoadListener(self)", "metadata": "root.ImageLoadListener.add", "header": "['class', 'ImageLoadListener', ':', '___EOS___']", "index": 96 }, { "content": " def addLoadListener(self, listener):\n self.loadListeners.append(listener)", "metadata": "root.ImageLoadListener.addLoadListener", "header": "['class', 'ImageLoadListener', ':', '___EOS___']", "index": 100 }, { "content": " def isLoaded(self):\n if len(self.wait_list):\n return False\n return True", "metadata": "root.ImageLoadListener.isLoaded", "header": "['class', 'ImageLoadListener', ':', '___EOS___']", "index": 103 }, { "content": " def onError(self, sender):\n for listener in self.loadListeners:\n listener.onError(sender)", "metadata": "root.ImageLoadListener.onError", "header": "['class', 'ImageLoadListener', ':', '___EOS___']", "index": 108 }, { "content": " def onLoad(self, sender):\n self.wait_list.remove(sender)\n \n if self.isLoaded():\n for listener in self.loadListeners:\n listener.onLoad(self)", "metadata": "root.ImageLoadListener.onLoad", "header": "['class', 'ImageLoadListener', ':', '___EOS___']", "index": 112 } ]
[ { "span": "from pyjamas.ui import Event", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 28 }, { "span": "from pyjamas.ui import MouseListener", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 36 }, { "span": "from pyjamas.ui import KeyboardListener", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 39 }, { "span": "from pyjamas.ui import FocusListener", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 36 }, { "span": "from __pyjamas__ import JS", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 26 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Can", "vas", " ", "wrapp", "er", " ", "component", " ", "for", " ", "Py", "jam", "as_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Port", "ed", " ", "by", " ", "Willi", "e", " ", "Gol", "lino", " ", "from", " ", "Can", "vas", " ", "component", " ", "for", " ", "GW", "T", " ", "-", " ", "Origina", "ll", "y", " ", "by", " ", "Alex", "ei", " ", "So", "kol", "ov", " ", "http", "://", "gw", "t", ".", "component", "s", ".", "google", "page", "s", ".", "com", "/_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Can", "vas", " ", "API", " ", "reference", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "developer", ".", "apple", ".", "com", "/", "documentation", "/", "Apple", "Applica", "tion", "s", "/", "Reference", "/", "Saf", "ari", "JS", "Ref", "/", "Class", "es", "/", "Can", "vas", ".", "html", "#", "//", "apple", "\\u", "ref", "/", "js", "/", "Can", "vas", ".", "clear", "Rect_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "age", " ", "Not", "es", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "-", " ", "IE", " ", "support", " ", "require", "s", " ", "Explorer", "Can", "vas", " ", "from", " ", "exc", "anv", "as", ".", "sourcef", "org", "e", ".", "net_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "-", " ", "place", " ", "exc", "anv", "as", ".", "js", " ", "in", " ", "your", " ", "apps", " ", "public", " ", "folder_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "-", " ", "add", " ", "this", " ", "to", " ", "your", " ", "Main", "Modul", "e", ".", "html", ":", " ", "<!", "--", "[", "if", " ", "IE", "]>", "<", "script", " ", "src", "=\"", "exc", "anv", "as", ".", "js", "\"", " ", "type", "=\"", "text", "/", "javascript", "\">", "</", "script", "><", "![", "endi", "f", "]-", "->_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "pyj", "ama", "s_", "import_", "DOM_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyj", "ama", "s_", "._", "ui_", "._", "Image_", "import_", "Image_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyj", "ama", "s_", "._", "ui_", "._", "Foc", "us", "Widget_", "import_", "Foc", "us", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyj", "ama", "s_", "._", "ui_", "import_", "Event_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyj", "ama", "s_", "._", "ui_", "import_", "Mouse", "Listener_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyj", "ama", "s_", "._", "ui_", "import_", "Key", "board", "Listener_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyj", "ama", "s_", "._", "ui_", "import_", "Focus_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyj", "ama", "s_", "._", "ui_", "import_", "Foc", "us", "Listener_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "pyj", "ama", "s\\u\\u_", "import_", "JS_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Canvas_", "(_", "Foc", "us", "Widget_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Canvas_", "(_", "Foc", "us", "Widget_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "Width_", "=_", "0_", ",_", "Height_", "=_", "0_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "kwargs_", "._", "has", "\\u", "key_", "(_", "'", "Style", "Name", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "'", "Style", "Name", "'_", "]_", "=_", "'", "gw", "t", "-", "Can", "vas", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "kwargs_", "[_", "'", "Wid", "th", "'_", "]_", "=_", "Width_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "[_", "'", "Hei", "ght", "'_", "]_", "=_", "Height_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "context_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "foc", "usable", "_", "=_", "Focus_", "._", "create", "Foc", "usable", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "canvas_", "=_", "DOM_", "._", "create", "Element_", "(_", "\"", "canv", "as", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DOM_", "._", "append", "Child_", "(_", "foc", "usable", "_", ",_", "self_", "._", "canvas_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Foc", "us", "Widget_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "foc", "usable", "_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "init_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "context_", "._", "fill", "Style_", "=_", "\"", "black", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "context_", "._", "strok", "e", "Style_", "=_", "\"", "black", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Canvas_", "(_", "Foc", "us", "Widget_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Width_", "(_", "self_", ",_", "width_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Foc", "us", "Widget_", "._", "set", "Width_", "(_", "self_", ",_", "width_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "canvas_", "._", "width_", "=_", "width_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Canvas_", "(_", "Foc", "us", "Widget_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Height_", "(_", "self_", ",_", "height_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Foc", "us", "Widget_", "._", "set", "Height_", "(_", "self_", ",_", "height_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "canvas_", "._", "height_", "=_", "height_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Canvas_", "(_", "Foc", "us", "Widget_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Context_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Canvas_", "(_", "Foc", "us", "Widget_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "Emulat", "ion_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Canvas_", "(_", "Foc", "us", "Widget_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "init_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "el_", "=_", "self_", "._", "get", "Element_", "(_", ")_", "._", "first", "Child_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "=_", "el_", "._", "get", "Context_", "(_", "\"", "2d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "ctx", ".\\u", "create", "Pat", "tern", " ", "=", " ", "ctx", ".", "create", "Pat", "tern", "\\", "10", ";", " ", " ", " ", " ", "ctx", ".", "create", "Pat", "tern", " ", "=", " ", "function", "(", "img", ",", " ", "rep", ")", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "(!", "(", "img", " ", "instance", "of", " ", "Image", "))", " ", "img", " ", "=", " ", "img", ".", "get", "Element", "();", " ", "\\", "10", ";", " ", " ", " ", " ", "return", " ", "self", ".\\u", "create", "Pat", "tern", "(", "img", ",", " ", "rep", ")", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "ctx", ".\\u", "draw", "Image", " ", "=", " ", "ctx", ".", "draw", "Image", "\\", "10", ";", " ", " ", " ", " ", "ctx", ".", "draw", "Image", " ", "=", " ", "function", "()", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "var", " ", "a", "=", "argu", "ment", "s", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "(!", "(", "a", "[", "0", "]", " ", "instance", "of", " ", "Image", "))", " ", "a", "[", "0", "]", " ", "=", " ", "a", "[", "0", "].", "get", "Element", "()", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "(", "a", ".", "length", "==", "9", ")", " ", "return", " ", "self", ".\\u", "draw", "Image", "(", "a", "[", "0", "],", " ", "a", "[", "1", "],", " ", "a", "[", "2", "],", " ", "a", "[", "3", "],", " ", "a", "[", "4", "],", " ", "a", "[", "5", "],", " ", "a", "[", "6", "],", " ", "a", "[", "7", "],", " ", "a", "[", "8", "])", "\\", "10", ";", " ", " ", " ", " ", "else", " ", "if", " ", "(", "a", ".", "length", "==", "5", ")", " ", "return", " ", "self", ".\\u", "draw", "Image", "(", "a", "[", "0", "],", " ", "a", "[", "1", "],", " ", "a", "[", "2", "],", " ", "a", "[", "3", "],", " ", "a", "[", "4", "])", "\\", "10", ";", " ", " ", " ", " ", "return", " ", "self", ".\\u", "draw", "Image", "(", "a", "[", "0", "],", " ", "a", "[", "1", "],", " ", "a", "[", "2", "])", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "context_", "=_", "ctx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Can", "vas", "Image_", "(_", "Image_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Can", "vas", "Image_", "(_", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "url_", "=_", "\"\"_", ",_", "load", "\\u", "listener_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Image_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "load", "\\u", "listener_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "Load", "Listener_", "(_", "load", "\\u", "listener_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "on", "Attach", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Can", "vas", "Image_", "(_", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "Load", "ed_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get", "Element_", "(_", ")_", "._", "complete_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Image", "Load", "Listener_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Image", "Load", "Listener_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "listener_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "wait", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "load", "Listen", "ers_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "listener_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "Load", "Listener_", "(_", "listener_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Image", "Load", "Listener_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add_", "(_", "self_", ",_", "sender_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "wait", "\\u", "list_", "._", "append_", "(_", "sender_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sender_", "._", "add", "Load", "Listener_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Image", "Load", "Listener_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "Load", "Listener_", "(_", "self_", ",_", "listener_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "load", "Listen", "ers_", "._", "append_", "(_", "listener_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Image", "Load", "Listener_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "Load", "ed_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "self_", "._", "wait", "\\u", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Image", "Load", "Listener_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Error_", "(_", "self_", ",_", "sender_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "listener_", "in_", "self_", "._", "load", "Listen", "ers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "listener_", "._", "on", "Error_", "(_", "sender_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Image", "Load", "Listener_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Load_", "(_", "self_", ",_", "sender_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "wait", "\\u", "list_", "._", "remove_", "(_", "sender_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "is", "Load", "ed_", "(_", ")_", ":_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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
CGATOxford/cgat/scripts/snp2table.py
[ { "content": " def update(self, snp):\n '''update with snp.'''\n\n junctions = list(self.mJunctions.get(snp.chromosome,\n snp.pos,\n snp.pos + 1))\n\n self.mResults = []\n\n reference_base = snp.reference_base\n\n if junctions:\n for start, end, data in junctions:\n strand, intron_start, intron_end, gene_id, transcript_id = data\n snp_pos = snp.pos\n\n if strand == \"-\":\n lcontig = self.mFasta.getLength(snp.chromosome)\n intron_start, intron_end = lcontig - \\\n intron_end, lcontig - intron_start\n snp_pos = lcontig - snp_pos - 1\n\n seq5 = self.mFasta.getSequence(\n snp.chromosome, strand, intron_start, intron_start + self.mSize).upper()\n seq3 = self.mFasta.getSequence(\n snp.chromosome, strand, intron_end - self.mSize, intron_end).upper()\n\n splice_name, prime5, prime3 = self.hasSpliceMotif(seq5, seq3)\n if splice_name:\n if intron_start <= snp_pos < intron_start + len(prime5):\n has_overlap = \"5\"\n elif intron_end - len(prime3) <= snp_pos < intron_end:\n has_overlap = \"3\"\n else:\n has_overlap = \"\"\n else:\n has_overlap = \"\"\n\n E.debug(\"building a splice site for %s:%s:%i, splice=%i:%i:%s (snp=%i), splice_name=%s, has_overlap=%s\" %\n (snp.chromosome, strand, snp.pos,\n intron_start, intron_end, strand, snp_pos,\n str(splice_name),\n str(has_overlap)))\n\n if intron_start <= snp_pos < intron_start + self.mSize:\n is_homozygous, new_seq5 = self.buildSequenceVariants(\n seq5, strand, snp_pos - intron_start, snp)\n new_seqs = [(x, seq3) for x in new_seq5]\n distance = snp_pos - intron_start\n elif intron_end - self.mSize <= snp_pos < intron_end:\n is_homozygous, new_seq3 = self.buildSequenceVariants(\n seq3, strand, self.mSize - (intron_end - snp_pos), snp)\n new_seqs = [(seq5, x) for x in new_seq3]\n distance = intron_end - snp_pos - 1\n else:\n raise ValueError(\"no overlap?\")\n\n E.debug(\"building a splice site for %s:%s:%i, splice=%i:%i:%s, splice_name=%s, distance=%i, has_overlap=%s, is_homozygous=%s, new_seqs=%s\" %\n (snp.chromosome, strand, snp.pos,\n intron_start, intron_end, strand,\n str(splice_name),\n distance,\n str(has_overlap),\n str(is_homozygous),\n str(new_seqs)))\n\n # indels at the end of size are out-of-range - ignore\n if new_seqs == []:\n continue\n\n for new_seq5, new_seq3 in new_seqs:\n new_splice_name, new_prime5, new_prime3 = self.hasSpliceMotif(\n new_seq5, new_seq3)\n\n if splice_name is None and new_splice_name is None:\n code = \"U\"\n elif new_splice_name is None:\n code = \"D\"\n elif splice_name is None:\n code = \"C\"\n elif splice_name == new_splice_name:\n code = \"S\"\n elif splice_name != new_splice_name:\n code = \"N\"\n\n if is_homozygous:\n is_homozygous = \"1\"\n else:\n is_homozygous = \"0\"\n if not splice_name:\n splice_name = \"\"\n if not new_splice_name:\n new_splice_name = \"\"\n self.mResults.append((transcript_id, gene_id, has_overlap, is_homozygous,\n splice_name, new_splice_name, str(distance), code))", "metadata": "root.BaseAnnotatorSpliceSites.update", "header": "['class', 'BaseAnnotatorSpliceSites', '(', 'BaseAnnotator', ')', ':', '___EOS___']", "index": 430 }, { "content": " def updateSNPs(self, snp, is_negative_strand, pos):\n '''update SNPs.'''\n\n contig = snp.chromosome\n lcontig = self.mFasta.getLength(contig)\n reference_base = snp.reference_base\n\n if snp.genotype in 'ACGTacgt':\n # homozygous substitution\n self.mVariantType.append(\"O\")\n else:\n # heterozygous substitution\n self.mVariantType.append(\"E\")\n\n # switch reference strand codon to correct strand\n if reference_base != \"*\" and is_negative_strand:\n reference_base = Genomics.complement(reference_base)\n\n # collect all possible variants of reference codons\n for reference_codon in self.mReferenceCodons:\n\n self.mReferenceAAs.append(Genomics.translate(reference_codon))\n\n # process single base changes\n variant_bases = Genomics.resolveAmbiguousNA(snp.genotype)\n\n if reference_codon[pos] != reference_base:\n raise ValueError(\"base mismatch at %i (codon=%s,%i): codon:%s != genome:%s; `%s`\" %\n (snp.pos, reference_codon, pos, reference_codon[pos], reference_base, \";\".join(map(str, snp))))\n\n for variant_base in variant_bases:\n if is_negative_strand:\n variant_base = Genomics.complement(variant_base)\n\n self.mVariantAAs.extend([Genomics.translate(x)\n for x in self.mVariantCodons])", "metadata": "root.BaseAnnotatorCodon.updateSNPs", "header": "['class', 'BaseAnnotatorCodon', '(', 'BaseAnnotator', ')', ':', '___EOS___']", "index": 566 }, { "content": " def updateIndels(self, snp, is_negative_strand):\n\n contig = snp.chromosome\n lcontig = self.mFasta.getLength(contig)\n\n # get location of insertion/deletion. The location\n # is after position, hence get position and position + 1\n code = self.mAnnotations.getSequence(contig, \"+\", snp.pos, snp.pos + 2)\n self.mCode = code\n\n variants = snp.genotype.split(\"/\")\n for variant in variants:\n\n if variant[0] == \"*\":\n self.mVariantType.append(\"W\")\n\n elif variant[0] == \"+\":\n toinsert = variant[1:]\n self.mVariantType.append(\"I\")\n\n elif variant[0] == \"-\":\n todelete = variant[1:]\n # deletions need to be looked at in a wider range\n self.mVariantType.append(\"D\")\n\n else:\n raise ValueError(\"unknown variant sign '%s'\" % variant[0])\n\n # ignore non-coding Indels\n if code[0] and code[1] not in 'abcABC':\n return\n\n if is_negative_strand:\n variants = [Genomics.complement(x) for x in variants]\n\n for reference_codon in self.mReferenceCodons:\n\n variants = snp.genotype.split(\"/\")\n variants = [x[1:] for x in variants]\n\n for variant in variants:\n if len(variant) % 3 != 0:\n self.mVariantCodons.append(\"!\")\n else:\n self.mVariantCodons.append(variant)\n\n self.mVariantAAs.extend(\n [Genomics.translate(x) for x in self.mVariantCodons])", "metadata": "root.BaseAnnotatorCodon.updateIndels", "header": "['class', 'BaseAnnotatorCodon', '(', 'BaseAnnotator', ')', ':', '___EOS___']", "index": 603 } ]
[ { "span": "reference_base ", "start_line": 439, "start_column": 8, "end_line": 439, "end_column": 22 }, { "span": "lcontig ", "start_line": 570, "start_column": 8, "end_line": 570, "end_column": 15 }, { "span": "lcontig ", "start_line": 606, "start_column": 8, "end_line": 606, "end_column": 15 }, { "span": "toinsert ", "start_line": 620, "start_column": 16, "end_line": 620, "end_column": 24 }, { "span": "todelete ", "start_line": 624, "start_column": 16, "end_line": 624, "end_column": 24 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Base", "Annot", "ator", "Spl", "ice", "Site", "s_", "(_", "Base", "Annot", "ator_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update_", "(_", "self_", ",_", "snp_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "update", " ", "with", " ", "snp", ".'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "junction", "s_", "=_", "list_", "(_", "self_", "._", "m", "Jun", "ctions", "_", "._", "get_", "(_", "snp_", "._", "chromosome_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "snp_", "._", "pos_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "snp_", "._", "pos_", "+_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "m", "Results_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "reference", "\\u", "base_", "=_", "snp_", "._", "reference", "\\u", "base_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "junction", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "start_", ",_", "end_", ",_", "data_", "in_", "junction", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "strand_", ",_", "intron", "\\u", "start_", ",_", "intron", "\\u", "end_", ",_", "gene", "\\u", "id_", ",_", "transcri", "pt", "\\u", "id_", "=_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "snp", "\\u", "pos_", "=_", "snp_", "._", "pos_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "strand_", "==_", "\"-\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "lco", "nti", "g_", "=_", "self_", "._", "m", "Fast", "a_", "._", "get", "Length_", "(_", "snp_", "._", "chromosome_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "intron", "\\u", "start_", ",_", "intron", "\\u", "end_", "=_", "lco", "nti", "g_", "-_", "intron", "\\u", "end_", ",_", "lco", "nti", "g_", "-_", "intron", "\\u", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "snp", "\\u", "pos_", "=_", "lco", "nti", "g_", "-_", "snp", "\\u", "pos_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "seq", "5_", "=_", "self_", "._", "m", "Fast", "a_", "._", "get", "Sequence_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "snp_", "._", "chromosome_", ",_", "strand_", ",_", "intron", "\\u", "start_", ",_", "intron", "\\u", "start_", "+_", "self_", "._", "m", "Size_", ")_", "._", "upper_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "seq", "3_", "=_", "self_", "._", "m", "Fast", "a_", "._", "get", "Sequence_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "snp_", "._", "chromosome_", ",_", "strand_", ",_", "intron", "\\u", "end_", "-_", "self_", "._", "m", "Size_", ",_", "intron", "\\u", "end_", ")_", "._", "upper_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "splice", "\\u", "name_", ",_", "prim", "e5", "_", ",_", "prim", "e3_", "=_", "self_", "._", "has", "Spl", "ice", "Moti", "f_", "(_", "seq", "5_", ",_", "seq", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "splice", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "intron", "\\u", "start_", "<=_", "snp", "\\u", "pos_", "<_", "intron", "\\u", "start_", "+_", "len_", "(_", "prim", "e5", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "has", "\\u", "overlap_", "=_", "\"", "5", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "intron", "\\u", "end_", "-_", "len_", "(_", "prim", "e3_", ")_", "<=_", "snp", "\\u", "pos_", "<_", "intron", "\\u", "end_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "has", "\\u", "overlap_", "=_", "\"", "3", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "has", "\\u", "overlap_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "has", "\\u", "overlap_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "E_", "._", "debug_", "(_", "\"", "buildi", "ng", " ", "a", " ", "splice", " ", "site", " ", "for", " ", "%", "s", ":", "%", "s", ":", "%", "i", ",", " ", "splice", "=", "%", "i", ":", "%", "i", ":", "%", "s", " ", "(", "snp", "=", "%", "i", "),", " ", "splice", "\\u", "name", "=", "%", "s", ",", " ", "has", "\\u", "overl", "ap", "=", "%", "s", "\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "snp_", "._", "chromosome_", ",_", "strand_", ",_", "snp_", "._", "pos_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "intron", "\\u", "start_", ",_", "intron", "\\u", "end_", ",_", "strand_", ",_", "snp", "\\u", "pos_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "splice", "\\u", "name_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "has", "\\u", "overlap_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "intron", "\\u", "start_", "<=_", "snp", "\\u", "pos_", "<_", "intron", "\\u", "start_", "+_", "self_", "._", "m", "Size_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "is", "\\u", "homo", "zy", "gou", "s_", ",_", "new", "\\u", "seq", "5_", "=_", "self_", "._", "build", "Sequ", "ence", "Varia", "nts_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "5_", ",_", "strand_", ",_", "snp", "\\u", "pos_", "-_", "intron", "\\u", "start_", ",_", "snp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "seqs_", "=_", "[_", "(_", "x_", ",_", "seq", "3_", ")_", "for_", "x_", "in_", "new", "\\u", "seq", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "distance_", "=_", "snp", "\\u", "pos_", "-_", "intron", "\\u", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "intron", "\\u", "end_", "-_", "self_", "._", "m", "Size_", "<=_", "snp", "\\u", "pos_", "<_", "intron", "\\u", "end_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "is", "\\u", "homo", "zy", "gou", "s_", ",_", "new", "\\u", "seq", "3_", "=_", "self_", "._", "build", "Sequ", "ence", "Varia", "nts_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "3_", ",_", "strand_", ",_", "self_", "._", "m", "Size_", "-_", "(_", "intron", "\\u", "end_", "-_", "snp", "\\u", "pos_", ")_", ",_", "snp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "seqs_", "=_", "[_", "(_", "seq", "5_", ",_", "x_", ")_", "for_", "x_", "in_", "new", "\\u", "seq", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "distance_", "=_", "intron", "\\u", "end_", "-_", "snp", "\\u", "pos_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "Value", "Error_", "(_", "\"", "no", " ", "overl", "ap", "?\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "E_", "._", "debug_", "(_", "\"", "buildi", "ng", " ", "a", " ", "splice", " ", "site", " ", "for", " ", "%", "s", ":", "%", "s", ":", "%", "i", ",", " ", "splice", "=", "%", "i", ":", "%", "i", ":", "%", "s", ",", " ", "splice", "\\u", "name", "=", "%", "s", ",", " ", "distance", "=", "%", "i", ",", " ", "has", "\\u", "overl", "ap", "=", "%", "s", ",", " ", "is", "\\u", "homo", "zy", "gou", "s", "=", "%", "s", ",", " ", "new", "\\u", "seqs", "=", "%", "s", "\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "snp_", "._", "chromosome_", ",_", "strand_", ",_", "snp_", "._", "pos_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "intron", "\\u", "start_", ",_", "intron", "\\u", "end_", ",_", "strand_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "splice", "\\u", "name_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "distance_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "has", "\\u", "overlap_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "is", "\\u", "homo", "zy", "gou", "s_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "new", "\\u", "seqs_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "indel", "s", " ", "at", " ", "the", " ", "end", " ", "of", " ", "size", " ", "are", " ", "out", "-", "of", "-", "range", " ", "-", " ", "ignore_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "new", "\\u", "seqs_", "==_", "[_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "new", "\\u", "seq", "5_", ",_", "new", "\\u", "seq", "3_", "in_", "new", "\\u", "seqs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "new", "\\u", "splice", "\\u", "name_", ",_", "new", "\\u", "prim", "e5", "_", ",_", "new", "\\u", "prim", "e3_", "=_", "self_", "._", "has", "Spl", "ice", "Moti", "f_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "seq", "5_", ",_", "new", "\\u", "seq", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "splice", "\\u", "name_", "is_", "None_", "and_", "new", "\\u", "splice", "\\u", "name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "code_", "=_", "\"", "U", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "new", "\\u", "splice", "\\u", "name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "code_", "=_", "\"", "D", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "splice", "\\u", "name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "code_", "=_", "\"", "C", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "splice", "\\u", "name_", "==_", "new", "\\u", "splice", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "code_", "=_", "\"", "S", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "splice", "\\u", "name_", "!=_", "new", "\\u", "splice", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "code_", "=_", "\"", "N", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "homo", "zy", "gou", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "is", "\\u", "homo", "zy", "gou", "s_", "=_", "\"", "1", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "is", "\\u", "homo", "zy", "gou", "s_", "=_", "\"", "0", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "splice", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "splice", "\\u", "name_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "new", "\\u", "splice", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "new", "\\u", "splice", "\\u", "name_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "m", "Results_", "._", "append_", "(_", "(_", "transcri", "pt", "\\u", "id_", ",_", "gene", "\\u", "id_", ",_", "has", "\\u", "overlap_", ",_", "is", "\\u", "homo", "zy", "gou", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "splice", "\\u", "name_", ",_", "new", "\\u", "splice", "\\u", "name_", ",_", "str_", "(_", "distance_", ")_", ",_", "code_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Annot", "ator", "Cod", "on_", "(_", "Base", "Annot", "ator_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update", "SN", "Ps_", "(_", "self_", ",_", "snp_", ",_", "is", "\\u", "negati", "ve", "\\u", "strand_", ",_", "pos_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "update", " ", "SN", "Ps", ".'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "contig_", "=_", "snp_", "._", "chromosome_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lco", "nti", "g_", "=_", "self_", "._", "m", "Fast", "a_", "._", "get", "Length_", "(_", "contig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reference", "\\u", "base_", "=_", "snp_", "._", "reference", "\\u", "base_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "snp_", "._", "genotype", "_", "in_", "'", "ACGT", "ac", "gt", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "homo", "zy", "gou", "s", " ", "substitution", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "m", "Varia", "nt", "Type_", "._", "append_", "(_", "\"", "O", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "hetero", "zy", "gou", "s", " ", "substitution", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "m", "Varia", "nt", "Type_", "._", "append_", "(_", "\"", "E", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "switch", " ", "reference", " ", "strand", " ", "codon", " ", "to", " ", "correct", " ", "strand_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "reference", "\\u", "base_", "!=_", "\"*\"_", "and_", "is", "\\u", "negati", "ve", "\\u", "strand_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "reference", "\\u", "base_", "=_", "Geno", "mic", "s_", "._", "complement_", "(_", "reference", "\\u", "base_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "collect", " ", "all", " ", "possib", "le", " ", "variant", "s", " ", "of", " ", "reference", " ", "codon", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "reference", "\\u", "codon", "_", "in_", "self_", "._", "m", "Reference", "Cod", "ons_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "m", "Reference", "AA", "s_", "._", "append_", "(_", "Geno", "mic", "s_", "._", "translate_", "(_", "reference", "\\u", "codon", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "process", " ", "single", " ", "base", " ", "changes_", "\\u\\u\\uNL\\u\\u\\u_", "variant", "\\u", "bases_", "=_", "Geno", "mic", "s_", "._", "resolve", "Ambi", "guous", "NA_", "(_", "snp_", "._", "genotype", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "reference", "\\u", "codon", "_", "[_", "pos_", "]_", "!=_", "reference", "\\u", "base_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "base", " ", "mism", "atch", " ", "at", " ", "%", "i", " ", "(", "codon", "=", "%", "s", ",%", "i", "):", " ", "codon", ":", "%", "s", " ", "!=", " ", "geno", "me", ":", "%", "s", ";", " ", "`", "%", "s", "`\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "snp_", "._", "pos_", ",_", "reference", "\\u", "codon", "_", ",_", "pos_", ",_", "reference", "\\u", "codon", "_", "[_", "pos_", "]_", ",_", "reference", "\\u", "base_", ",_", "\";\"_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "snp_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "variant", "\\u", "base_", "in_", "variant", "\\u", "bases_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "is", "\\u", "negati", "ve", "\\u", "strand_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "variant", "\\u", "base_", "=_", "Geno", "mic", "s_", "._", "complement_", "(_", "variant", "\\u", "base_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "m", "Varia", "nt", "AA", "s_", "._", "extend_", "(_", "[_", "Geno", "mic", "s_", "._", "translate_", "(_", "x_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x_", "in_", "self_", "._", "m", "Varia", "nt", "Cod", "ons_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Annot", "ator", "Cod", "on_", "(_", "Base", "Annot", "ator_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update", "Inde", "ls_", "(_", "self_", ",_", "snp_", ",_", "is", "\\u", "negati", "ve", "\\u", "strand_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "contig_", "=_", "snp_", "._", "chromosome_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lco", "nti", "g_", "=_", "self_", "._", "m", "Fast", "a_", "._", "get", "Length_", "(_", "contig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "location", " ", "of", " ", "insertion", "/", "deletion", ".", " ", "The", " ", "location_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "is", " ", "after", " ", "position", ",", " ", "hen", "ce", " ", "get", " ", "position", " ", "and", " ", "position", " ", "+", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", "code_", "=_", "self_", "._", "m", "Annotations", "_", "._", "get", "Sequence_", "(_", "contig_", ",_", "\"+\"_", ",_", "snp_", "._", "pos_", ",_", "snp_", "._", "pos_", "+_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Code_", "=_", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "variants_", "=_", "snp_", "._", "genotype", "_", "._", "split_", "(_", "\"/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "variant_", "in_", "variants_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "variant_", "[_", "0_", "]_", "==_", "\"*\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "m", "Varia", "nt", "Type_", "._", "append_", "(_", "\"", "W", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "variant_", "[_", "0_", "]_", "==_", "\"+\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "toi", "nse", "rt_", "=_", "variant_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "m", "Varia", "nt", "Type_", "._", "append_", "(_", "\"", "I", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "variant_", "[_", "0_", "]_", "==_", "\"-\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tod", "ele", "te_", "=_", "variant_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "deletion", "s", " ", "need", " ", "to", " ", "be", " ", "looke", "d", " ", "at", " ", "in", " ", "a", " ", "wide", "r", " ", "range_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "m", "Varia", "nt", "Type_", "._", "append_", "(_", "\"", "D", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "unknown", " ", "variant", " ", "sign", " ", "'%", "s", "'\"_", "%_", "variant_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ignore", " ", "non", "-", "codi", "ng", " ", "Inde", "ls_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "code_", "[_", "0_", "]_", "and_", "code_", "[_", "1_", "]_", "not_", "in_", "'", "abc", "ABC", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "negati", "ve", "\\u", "strand_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "variants_", "=_", "[_", "Geno", "mic", "s_", "._", "complement_", "(_", "x_", ")_", "for_", "x_", "in_", "variants_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "reference", "\\u", "codon", "_", "in_", "self_", "._", "m", "Reference", "Cod", "ons_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "variants_", "=_", "snp_", "._", "genotype", "_", "._", "split_", "(_", "\"/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "variants_", "=_", "[_", "x_", "[_", "1_", ":_", "]_", "for_", "x_", "in_", "variants_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "variant_", "in_", "variants_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "variant_", ")_", "%_", "3_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "m", "Varia", "nt", "Cod", "ons_", "._", "append_", "(_", "\"!\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "m", "Varia", "nt", "Cod", "ons_", "._", "append_", "(_", "variant_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "m", "Varia", "nt", "AA", "s_", "._", "extend_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "Geno", "mic", "s_", "._", "translate_", "(_", "x_", ")_", "for_", "x_", "in_", "self_", "._", "m", "Varia", "nt", "Cod", "ons_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
letsencrypt/letsencrypt/certbot/tests/cli_test.py
[ { "content": " def test_help(self):\n self.assertRaises(SystemExit, self._call, ['--help'])\n self.assertRaises(SystemExit, self._call, ['--help', 'all'])\n plugins = disco.PluginsRegistry.find_all()\n out = self._help_output(['--help', 'all'])\n self.assertTrue(\"--configurator\" in out)\n self.assertTrue(\"how a cert is deployed\" in out)\n self.assertTrue(\"--manual-test-mode\" in out)\n\n out = self._help_output(['-h', 'nginx'])\n if \"nginx\" in plugins:\n # may be false while building distributions without plugins\n self.assertTrue(\"--nginx-ctl\" in out)\n self.assertTrue(\"--manual-test-mode\" not in out)\n self.assertTrue(\"--checkpoints\" not in out)\n\n out = self._help_output(['-h'])\n self.assertTrue(\"letsencrypt-auto\" not in out) # test cli.cli_command\n if \"nginx\" in plugins:\n self.assertTrue(\"Use the Nginx plugin\" in out)\n else:\n self.assertTrue(\"(nginx support is experimental\" in out)\n\n out = self._help_output(['--help', 'plugins'])\n self.assertTrue(\"--manual-test-mode\" not in out)\n self.assertTrue(\"--prepare\" in out)\n self.assertTrue(\"Plugin options\" in out)\n\n out = self._help_output(['--help', 'install'])\n self.assertTrue(\"--cert-path\" in out)\n self.assertTrue(\"--key-path\" in out)\n\n out = self._help_output(['--help', 'revoke'])\n self.assertTrue(\"--cert-path\" in out)\n self.assertTrue(\"--key-path\" in out)\n\n out = self._help_output(['-h', 'config_changes'])\n self.assertTrue(\"--cert-path\" not in out)\n self.assertTrue(\"--key-path\" not in out)\n\n out = self._help_output(['-h'])\n self.assertTrue(cli.usage_strings(plugins)[0] in out)", "metadata": "root.CLITest.test_help", "header": "['class', 'CLITest', '(', 'unittest', '.', 'TestCase', ')', ':', '# pylint: disable=too-many-public-methods', '___EOS___']", "index": 88 }, { "content": " def _cli_missing_flag(self, args, message):\n \"Ensure that a particular error raises a missing cli flag error containing message\"\n exc = None\n try:\n with mock.patch('certbot.main.sys.stderr'):\n main.main(self.standard_args + args[:]) # NOTE: parser can alter its args!\n except errors.MissingCommandlineFlag as exc:\n self.assertTrue(message in str(exc))\n self.assertTrue(exc is not None)", "metadata": "root.CLITest._cli_missing_flag", "header": "['class', 'CLITest', '(', 'unittest', '.', 'TestCase', ')', ':', '# pylint: disable=too-many-public-methods', '___EOS___']", "index": 131 }, { "content": " @mock.patch('certbot.main.client.acme_client.Client')\n @mock.patch('certbot.main._determine_account')\n @mock.patch('certbot.main.client.Client.obtain_and_enroll_certificate')\n @mock.patch('certbot.main._auth_from_domains')\n def test_user_agent(self, afd, _obt, det, _client):\n # Normally the client is totally mocked out, but here we need more\n # arguments to automate it...\n args = [\"--standalone\", \"certonly\", \"-m\", \"[email protected]\",\n \"-d\", \"example.com\", '--agree-tos'] + self.standard_args\n det.return_value = mock.MagicMock(), None\n afd.return_value = mock.MagicMock(), \"newcert\"\n\n with mock.patch('certbot.main.client.acme_client.ClientNetwork') as acme_net:\n self._call_no_clientmock(args)\n os_ver = \" \".join(le_util.get_os_info())\n ua = acme_net.call_args[1][\"user_agent\"]\n self.assertTrue(os_ver in ua)\n import platform\n plat = platform.platform()\n if \"linux\" in plat.lower():\n self.assertTrue(platform.linux_distribution()[0] in ua)\n\n with mock.patch('certbot.main.client.acme_client.ClientNetwork') as acme_net:\n ua = \"bandersnatch\"\n args += [\"--user-agent\", ua]\n self._call_no_clientmock(args)\n acme_net.assert_called_once_with(mock.ANY, verify_ssl=True, user_agent=ua)", "metadata": "root.CLITest.test_user_agent", "header": "['class', 'CLITest', '(', 'unittest', '.', 'TestCase', ')', ':', '# pylint: disable=too-many-public-methods', '___EOS___']", "index": 151 }, { "content": " @mock.patch('certbot.le_util.exe_exists')\n def test_configurator_selection(self, mock_exe_exists):\n mock_exe_exists.return_value = True\n real_plugins = disco.PluginsRegistry.find_all()\n args = ['--apache', '--authenticator', 'standalone']\n\n # This needed two calls to find_all(), which we're avoiding for now\n # because of possible side effects:\n # https://github.com/letsencrypt/letsencrypt/commit/51ed2b681f87b1eb29088dd48718a54f401e4855\n #with mock.patch('certbot.cli.plugins_testable') as plugins:\n # plugins.return_value = {\"apache\": True, \"nginx\": True}\n # ret, _, _, _ = self._call(args)\n # self.assertTrue(\"Too many flags setting\" in ret)\n\n args = [\"install\", \"--nginx\", \"--cert-path\", \"/tmp/blah\", \"--key-path\", \"/tmp/blah\",\n \"--nginx-server-root\", \"/nonexistent/thing\", \"-d\",\n \"example.com\", \"--debug\"]\n if \"nginx\" in real_plugins:\n # Sending nginx a non-existent conf dir will simulate misconfiguration\n # (we can only do that if certbot-nginx is actually present)\n ret, _, _, _ = self._call(args)\n self.assertTrue(\"The nginx plugin is not working\" in ret)\n self.assertTrue(\"MisconfigurationError\" in ret)\n\n self._cli_missing_flag([\"--standalone\"], \"With the standalone plugin, you probably\")\n\n with mock.patch(\"certbot.main._init_le_client\") as mock_init:\n with mock.patch(\"certbot.main._auth_from_domains\") as mock_afd:\n mock_afd.return_value = (mock.MagicMock(), mock.MagicMock())\n self._call([\"certonly\", \"--manual\", \"-d\", \"foo.bar\"])\n unused_config, auth, unused_installer = mock_init.call_args[0]\n self.assertTrue(isinstance(auth, manual.Authenticator))\n\n with mock.patch('certbot.main.obtain_cert') as mock_certonly:\n self._call([\"auth\", \"--standalone\"])\n self.assertEqual(1, mock_certonly.call_count)", "metadata": "root.CLITest.test_configurator_selection", "header": "['class', 'CLITest', '(', 'unittest', '.', 'TestCase', ')', ':', '# pylint: disable=too-many-public-methods', '___EOS___']", "index": 203 }, { "content": " def test_certonly_bad_args(self):\n try:\n self._call(['-a', 'bad_auth', 'certonly'])\n assert False, \"Exception should have been raised\"\n except errors.PluginSelectionError as e:\n self.assertTrue('The requested bad_auth plugin does not appear' in e.message)", "metadata": "root.CLITest.test_certonly_bad_args", "header": "['class', 'CLITest', '(', 'unittest', '.', 'TestCase', ')', ':', '# pylint: disable=too-many-public-methods', '___EOS___']", "index": 320 }, { "content": " def _check_server_conflict_message(self, parser_args, conflicting_args):\n parse = self._get_argument_parser()\n try:\n parse(parser_args)\n self.fail( # pragma: no cover\n \"The following flags didn't conflict with \"\n '--server: {0}'.format(', '.join(conflicting_args)))\n except errors.Error as error:\n self.assertTrue('--server' in error.message)\n for arg in conflicting_args:\n self.assertTrue(arg in error.message)", "metadata": "root.CLITest._check_server_conflict_message", "header": "['class', 'CLITest', '(', 'unittest', '.', 'TestCase', ')', ':', '# pylint: disable=too-many-public-methods', '___EOS___']", "index": 400 }, { "content": " @mock.patch('certbot.main.zope.component.getUtility')\n def test_certonly_dry_run_new_request_success(self, mock_get_utility):\n mock_client = mock.MagicMock()\n mock_client.obtain_and_enroll_certificate.return_value = None\n self._certonly_new_request_common(mock_client, ['--dry-run'])\n self.assertEqual(\n mock_client.obtain_and_enroll_certificate.call_count, 1)\n self.assertTrue(\n 'dry run' in mock_get_utility().add_message.call_args[0][0])\n # Asserts we don't suggest donating after a successful dry run\n self.assertEqual(mock_get_utility().add_message.call_count, 1)", "metadata": "root.CLITest.test_certonly_dry_run_new_request_success", "header": "['class', 'CLITest', '(', 'unittest', '.', 'TestCase', ')', ':', '# pylint: disable=too-many-public-methods', '___EOS___']", "index": 475 }, { "content": " @mock.patch('certbot.crypto_util.notAfter')\n @mock.patch('certbot.main.zope.component.getUtility')\n def test_certonly_new_request_success(self, mock_get_utility, mock_notAfter):\n cert_path = '/etc/letsencrypt/live/foo.bar'\n date = '1970-01-01'\n mock_notAfter().date.return_value = date\n\n mock_lineage = mock.MagicMock(cert=cert_path, fullchain=cert_path)\n mock_client = mock.MagicMock()\n mock_client.obtain_and_enroll_certificate.return_value = mock_lineage\n self._certonly_new_request_common(mock_client)\n self.assertEqual(\n mock_client.obtain_and_enroll_certificate.call_count, 1)\n cert_msg = mock_get_utility().add_message.call_args_list[0][0][0]\n self.assertTrue(cert_path in cert_msg)\n self.assertTrue(date in cert_msg)\n self.assertTrue(\n 'donate' in mock_get_utility().add_message.call_args[0][0])", "metadata": "root.CLITest.test_certonly_new_request_success", "header": "['class', 'CLITest', '(', 'unittest', '.', 'TestCase', ')', ':', '# pylint: disable=too-many-public-methods', '___EOS___']", "index": 487 }, { "content": " def _test_renewal_common(self, due_for_renewal, extra_args, log_out=None,\n args=None, should_renew=True, error_expected=False):\n # pylint: disable=too-many-locals,too-many-arguments\n cert_path = 'certbot/tests/testdata/cert.pem'\n chain_path = '/etc/letsencrypt/live/foo.bar/fullchain.pem'\n mock_lineage = mock.MagicMock(cert=cert_path, fullchain=chain_path)\n mock_lineage.should_autorenew.return_value = due_for_renewal\n mock_certr = mock.MagicMock()\n mock_key = mock.MagicMock(pem='pem_key')\n mock_client = mock.MagicMock()\n stdout = None\n mock_client.obtain_certificate.return_value = (mock_certr, 'chain',\n mock_key, 'csr')\n try:\n with mock.patch('certbot.main._find_duplicative_certs') as mock_fdc:\n mock_fdc.return_value = (mock_lineage, None)\n with mock.patch('certbot.main._init_le_client') as mock_init:\n mock_init.return_value = mock_client\n get_utility_path = 'certbot.main.zope.component.getUtility'\n with mock.patch(get_utility_path) as mock_get_utility:\n with mock.patch('certbot.main.renewal.OpenSSL') as mock_ssl:\n mock_latest = mock.MagicMock()\n mock_latest.get_issuer.return_value = \"Fake fake\"\n mock_ssl.crypto.load_certificate.return_value = mock_latest\n with mock.patch('certbot.main.renewal.crypto_util'):\n if not args:\n args = ['-d', 'isnot.org', '-a', 'standalone', 'certonly']\n if extra_args:\n args += extra_args\n try:\n ret, stdout, _, _ = self._call(args)\n if ret:\n print(\"Returned\", ret)\n raise AssertionError(ret)\n assert not error_expected, \"renewal should have errored\"\n except: # pylint: disable=bare-except\n if not error_expected:\n raise AssertionError(\n \"Unexpected renewal error:\\n\" +\n traceback.format_exc())\n\n if should_renew:\n mock_client.obtain_certificate.assert_called_once_with(['isnot.org'])\n else:\n self.assertEqual(mock_client.obtain_certificate.call_count, 0)\n except:\n self._dump_log()\n raise\n finally:\n if log_out:\n with open(os.path.join(self.logs_dir, \"letsencrypt.log\")) as lf:\n self.assertTrue(log_out in lf.read())\n\n return mock_lineage, mock_get_utility, stdout", "metadata": "root.CLITest._test_renewal_common", "header": "['class', 'CLITest', '(', 'unittest', '.', 'TestCase', ')', ':', '# pylint: disable=too-many-public-methods', '___EOS___']", "index": 512 }, { "content": " def test_certonly_renewal(self):\n lineage, get_utility, _ = self._test_renewal_common(True, [])\n self.assertEqual(lineage.save_successor.call_count, 1)\n lineage.update_all_links_to.assert_called_once_with(\n lineage.latest_common_version())\n cert_msg = get_utility().add_message.call_args_list[0][0][0]\n self.assertTrue('fullchain.pem' in cert_msg)\n self.assertTrue('donate' in get_utility().add_message.call_args[0][0])", "metadata": "root.CLITest.test_certonly_renewal", "header": "['class', 'CLITest', '(', 'unittest', '.', 'TestCase', ')', ':', '# pylint: disable=too-many-public-methods', '___EOS___']", "index": 567 }, { "content": " def test_certonly_renewal_triggers(self):\n # --dry-run should force renewal\n _, get_utility, _ = self._test_renewal_common(False, ['--dry-run', '--keep'],\n log_out=\"simulating renewal\")\n self.assertEqual(get_utility().add_message.call_count, 1)\n self.assertTrue('dry run' in get_utility().add_message.call_args[0][0])\n\n self._test_renewal_common(False, ['--renew-by-default', '-tvv', '--debug'],\n log_out=\"Auto-renewal forced\")\n self.assertEqual(get_utility().add_message.call_count, 1)\n\n self._test_renewal_common(False, ['-tvv', '--debug', '--keep'],\n log_out=\"not yet due\", should_renew=False)", "metadata": "root.CLITest.test_certonly_renewal_triggers", "header": "['class', 'CLITest', '(', 'unittest', '.', 'TestCase', ')', ':', '# pylint: disable=too-many-public-methods', '___EOS___']", "index": 576 }, { "content": " def test_quiet_renew(self):\n self._make_test_renewal_conf('sample-renewal.conf')\n args = [\"renew\", \"--dry-run\"]\n _, _, stdout = self._test_renewal_common(True, [], args=args, should_renew=True)\n out = stdout.getvalue()\n self.assertTrue(\"renew\" in out)\n\n args = [\"renew\", \"--dry-run\", \"-q\"]\n _, _, stdout = self._test_renewal_common(True, [], args=args, should_renew=True)\n out = stdout.getvalue()\n self.assertEqual(\"\", out)", "metadata": "root.CLITest.test_quiet_renew", "header": "['class', 'CLITest', '(', 'unittest', '.', 'TestCase', ')', ':', '# pylint: disable=too-many-public-methods', '___EOS___']", "index": 614 }, { "content": " def test_certonly_csr(self):\n mock_get_utility = self._test_certonly_csr_common()\n cert_msg = mock_get_utility().add_message.call_args_list[0][0][0]\n self.assertTrue('cert.pem' in cert_msg)\n self.assertTrue(\n 'donate' in mock_get_utility().add_message.call_args[0][0])", "metadata": "root.CLITest.test_certonly_csr", "header": "['class', 'CLITest', '(', 'unittest', '.', 'TestCase', ')', ':', '# pylint: disable=too-many-public-methods', '___EOS___']", "index": 780 }, { "content": " def test_certonly_csr_dry_run(self):\n mock_get_utility = self._test_certonly_csr_common(['--dry-run'])\n self.assertEqual(mock_get_utility().add_message.call_count, 1)\n self.assertTrue(\n 'dry run' in mock_get_utility().add_message.call_args[0][0])", "metadata": "root.CLITest.test_certonly_csr_dry_run", "header": "['class', 'CLITest', '(', 'unittest', '.', 'TestCase', ')', ':', '# pylint: disable=too-many-public-methods', '___EOS___']", "index": 787 }, { "content": " @mock.patch('certbot.main.sys')\n def test_handle_exception(self, mock_sys):\n # pylint: disable=protected-access\n from acme import messages\n\n config = mock.MagicMock()\n mock_open = mock.mock_open()\n\n with mock.patch('certbot.main.open', mock_open, create=True):\n exception = Exception('detail')\n config.verbose_count = 1\n main._handle_exception(\n Exception, exc_value=exception, trace=None, config=None)\n mock_open().write.assert_called_once_with(''.join(\n traceback.format_exception_only(Exception, exception)))\n error_msg = mock_sys.exit.call_args_list[0][0][0]\n self.assertTrue('unexpected error' in error_msg)\n\n with mock.patch('certbot.main.open', mock_open, create=True):\n mock_open.side_effect = [KeyboardInterrupt]\n error = errors.Error('detail')\n main._handle_exception(\n errors.Error, exc_value=error, trace=None, config=None)\n # assert_any_call used because sys.exit doesn't exit in cli.py\n mock_sys.exit.assert_any_call(''.join(\n traceback.format_exception_only(errors.Error, error)))\n\n exception = messages.Error(detail='alpha', typ='urn:acme:error:triffid',\n title='beta')\n config = mock.MagicMock(debug=False, verbose_count=-3)\n main._handle_exception(\n messages.Error, exc_value=exception, trace=None, config=config)\n error_msg = mock_sys.exit.call_args_list[-1][0][0]\n self.assertTrue('unexpected error' in error_msg)\n self.assertTrue('acme:error' not in error_msg)\n self.assertTrue('alpha' in error_msg)\n self.assertTrue('beta' in error_msg)\n config = mock.MagicMock(debug=False, verbose_count=1)\n main._handle_exception(\n messages.Error, exc_value=exception, trace=None, config=config)\n error_msg = mock_sys.exit.call_args_list[-1][0][0]\n self.assertTrue('unexpected error' in error_msg)\n self.assertTrue('acme:error' in error_msg)\n self.assertTrue('alpha' in error_msg)\n\n interrupt = KeyboardInterrupt('detail')\n main._handle_exception(\n KeyboardInterrupt, exc_value=interrupt, trace=None, config=None)\n mock_sys.exit.assert_called_with(''.join(\n traceback.format_exception_only(KeyboardInterrupt, interrupt)))", "metadata": "root.CLITest.test_handle_exception", "header": "['class', 'CLITest', '(', 'unittest', '.', 'TestCase', ')', ':', '# pylint: disable=too-many-public-methods', '___EOS___']", "index": 815 }, { "content": " def test_args_account_set(self):\n self.account_storage.save(self.accs[1])\n self.config.account = self.accs[1].id\n self.assertEqual((self.accs[1], None), self._call())\n self.assertEqual(self.accs[1].id, self.config.account)\n self.assertTrue(self.config.email is None)", "metadata": "root.DetermineAccountTest.test_args_account_set", "header": "['class', 'DetermineAccountTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 902 }, { "content": " def test_single_account(self):\n self.account_storage.save(self.accs[0])\n self.assertEqual((self.accs[0], None), self._call())\n self.assertEqual(self.accs[0].id, self.config.account)\n self.assertTrue(self.config.email is None)", "metadata": "root.DetermineAccountTest.test_single_account", "header": "['class', 'DetermineAccountTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 909 }, { "content": " @mock.patch('certbot.client.display_ops.choose_account')\n def test_multiple_accounts(self, mock_choose_accounts):\n for acc in self.accs:\n self.account_storage.save(acc)\n mock_choose_accounts.return_value = self.accs[1]\n self.assertEqual((self.accs[1], None), self._call())\n self.assertEqual(\n set(mock_choose_accounts.call_args[0][0]), set(self.accs))\n self.assertEqual(self.accs[1].id, self.config.account)\n self.assertTrue(self.config.email is None)", "metadata": "root.DetermineAccountTest.test_multiple_accounts", "header": "['class', 'DetermineAccountTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 915 } ]
[ { "span": "self.assertTrue(\"--configurator\" in out)", "start_line": 93, "start_column": 8, "end_line": 93, "end_column": 48 }, { "span": "self.assertTrue(\"how a cert is deployed\" in out)", "start_line": 94, "start_column": 8, "end_line": 94, "end_column": 56 }, { "span": "self.assertTrue(\"--manual-test-mode\" in out)", "start_line": 95, "start_column": 8, "end_line": 95, "end_column": 52 }, { "span": "self.assertTrue(\"--nginx-ctl\" in out)", "start_line": 100, "start_column": 12, "end_line": 100, "end_column": 49 }, { "span": "self.assertTrue(\"--manual-test-mode\" not in out)", "start_line": 101, "start_column": 8, "end_line": 101, "end_column": 56 }, { "span": "self.assertTrue(\"--checkpoints\" not in out)", "start_line": 102, "start_column": 8, "end_line": 102, "end_column": 51 }, { "span": "self.assertTrue(\"letsencrypt-auto\" not in out) ", "start_line": 105, "start_column": 8, "end_line": 105, "end_column": 54 }, { "span": "self.assertTrue(\"Use the Nginx plugin\" in out)", "start_line": 107, "start_column": 12, "end_line": 107, "end_column": 58 }, { "span": "self.assertTrue(\"(nginx support is experimental\" in out)", "start_line": 109, "start_column": 12, "end_line": 109, "end_column": 68 }, { "span": "self.assertTrue(\"--manual-test-mode\" not in out)", "start_line": 112, "start_column": 8, "end_line": 112, "end_column": 56 }, { "span": "self.assertTrue(\"--prepare\" in out)", "start_line": 113, "start_column": 8, "end_line": 113, "end_column": 43 }, { "span": "self.assertTrue(\"Plugin options\" in out)", "start_line": 114, "start_column": 8, "end_line": 114, "end_column": 48 }, { "span": "self.assertTrue(\"--cert-path\" in out)", "start_line": 117, "start_column": 8, "end_line": 117, "end_column": 45 }, { "span": "self.assertTrue(\"--key-path\" in out)", "start_line": 118, "start_column": 8, "end_line": 118, "end_column": 44 }, { "span": "self.assertTrue(\"--cert-path\" in out)", "start_line": 121, "start_column": 8, "end_line": 121, "end_column": 45 }, { "span": "self.assertTrue(\"--key-path\" in out)", "start_line": 122, "start_column": 8, "end_line": 122, "end_column": 44 }, { "span": "self.assertTrue(\"--cert-path\" not in out)", "start_line": 125, "start_column": 8, "end_line": 125, "end_column": 49 }, { "span": "self.assertTrue(\"--key-path\" not in out)", "start_line": 126, "start_column": 8, "end_line": 126, "end_column": 48 }, { "span": "self.assertTrue(cli.usage_strings(plugins)[0] in out)", "start_line": 129, "start_column": 8, "end_line": 129, "end_column": 61 }, { "span": "self.assertTrue(message in str(exc))", "start_line": 138, "start_column": 12, "end_line": 138, "end_column": 48 }, { "span": "self.assertTrue(exc is not None)", "start_line": 139, "start_column": 8, "end_line": 139, "end_column": 40 }, { "span": "self.assertTrue(os_ver in ua)", "start_line": 167, "start_column": 12, "end_line": 167, "end_column": 41 }, { "span": "self.assertTrue(platform.linux_distribution()[0] in ua)", "start_line": 171, "start_column": 16, "end_line": 171, "end_column": 71 }, { "span": "self.assertTrue(\"The nginx plugin is not working\" in ret)", "start_line": 224, "start_column": 12, "end_line": 224, "end_column": 69 }, { "span": "self.assertTrue(\"MisconfigurationError\" in ret)", "start_line": 225, "start_column": 12, "end_line": 225, "end_column": 59 }, { "span": "self.assertTrue('The requested bad_auth plugin does not appear' in e.message)", "start_line": 325, "start_column": 12, "end_line": 325, "end_column": 89 }, { "span": "self.assertTrue('--server' in error.message)", "start_line": 408, "start_column": 12, "end_line": 408, "end_column": 56 }, { "span": "self.assertTrue(arg in error.message)", "start_line": 410, "start_column": 16, "end_line": 410, "end_column": 53 }, { "span": "self.assertTrue(\n 'dry run' in mock_get_utility().add_message.call_args[0][0])", "start_line": 482, "start_column": 8, "end_line": 483, "end_column": 72 }, { "span": "self.assertTrue(cert_path in cert_msg)", "start_line": 501, "start_column": 8, "end_line": 501, "end_column": 46 }, { "span": "self.assertTrue(date in cert_msg)", "start_line": 502, "start_column": 8, "end_line": 502, "end_column": 41 }, { "span": "self.assertTrue(\n 'donate' in mock_get_utility().add_message.call_args[0][0])", "start_line": 503, "start_column": 8, "end_line": 504, "end_column": 71 }, { "span": "self.assertTrue(log_out in lf.read())", "start_line": 563, "start_column": 20, "end_line": 563, "end_column": 57 }, { "span": "self.assertTrue('fullchain.pem' in cert_msg)", "start_line": 573, "start_column": 8, "end_line": 573, "end_column": 52 }, { "span": "self.assertTrue('donate' in get_utility().add_message.call_args[0][0])", "start_line": 574, "start_column": 8, "end_line": 574, "end_column": 78 }, { "span": "self.assertTrue('dry run' in get_utility().add_message.call_args[0][0])", "start_line": 581, "start_column": 8, "end_line": 581, "end_column": 79 }, { "span": "self.assertTrue(\"renew\" in out)", "start_line": 619, "start_column": 8, "end_line": 619, "end_column": 39 }, { "span": "self.assertTrue('cert.pem' in cert_msg)", "start_line": 783, "start_column": 8, "end_line": 783, "end_column": 47 }, { "span": "self.assertTrue(\n 'donate' in mock_get_utility().add_message.call_args[0][0])", "start_line": 784, "start_column": 8, "end_line": 785, "end_column": 71 }, { "span": "self.assertTrue(\n 'dry run' in mock_get_utility().add_message.call_args[0][0])", "start_line": 790, "start_column": 8, "end_line": 791, "end_column": 72 }, { "span": "self.assertTrue('unexpected error' in error_msg)", "start_line": 831, "start_column": 12, "end_line": 831, "end_column": 60 }, { "span": "self.assertTrue('unexpected error' in error_msg)", "start_line": 848, "start_column": 8, "end_line": 848, "end_column": 56 }, { "span": "self.assertTrue('acme:error' not in error_msg)", "start_line": 849, "start_column": 8, "end_line": 849, "end_column": 54 }, { "span": "self.assertTrue('alpha' in error_msg)", "start_line": 850, "start_column": 8, "end_line": 850, "end_column": 45 }, { "span": "self.assertTrue('beta' in error_msg)", "start_line": 851, "start_column": 8, "end_line": 851, "end_column": 44 }, { "span": "self.assertTrue('unexpected error' in error_msg)", "start_line": 856, "start_column": 8, "end_line": 856, "end_column": 56 }, { "span": "self.assertTrue('acme:error' in error_msg)", "start_line": 857, "start_column": 8, "end_line": 857, "end_column": 50 }, { "span": "self.assertTrue('alpha' in error_msg)", "start_line": 858, "start_column": 8, "end_line": 858, "end_column": 45 }, { "span": "self.assertTrue(self.config.email is None)", "start_line": 907, "start_column": 8, "end_line": 907, "end_column": 50 }, { "span": "self.assertTrue(self.config.email is None)", "start_line": 913, "start_column": 8, "end_line": 913, "end_column": 50 }, { "span": "self.assertTrue(self.config.email is None)", "start_line": 924, "start_column": 8, "end_line": 924, "end_column": 50 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "CLI", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "#", " ", "pylint", ":", " ", "disable", "=", "too", "-", "many", "-", "public", "-", "methods_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "help_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Raises_", "(_", "System", "Exit_", ",_", "self_", "._", "\\u", "call_", ",_", "[_", "'--", "help", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "System", "Exit_", ",_", "self_", "._", "\\u", "call_", ",_", "[_", "'--", "help", "'_", ",_", "'", "all", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plugins_", "=_", "disco", "_", "._", "Plug", "ins", "Registry_", "._", "find", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "=_", "self_", "._", "\\u", "help", "\\u", "output_", "(_", "[_", "'--", "help", "'_", ",_", "'", "all", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"--", "configurator", "\"_", "in_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "how", " ", "a", " ", "cert", " ", "is", " ", "deploye", "d", "\"_", "in_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"--", "manu", "al", "-", "test", "-", "mode", "\"_", "in_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "out_", "=_", "self_", "._", "\\u", "help", "\\u", "output_", "(_", "[_", "'-", "h", "'_", ",_", "'", "ngin", "x", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\"", "ngin", "x", "\"_", "in_", "plugins_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "may", " ", "be", " ", "fal", "se", " ", "whi", "le", " ", "buildi", "ng", " ", "distribu", "tion", "s", " ", "with", "out", " ", "plugins_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "\"--", "ngin", "x", "-", "ctl", "\"_", "in_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"--", "manu", "al", "-", "test", "-", "mode", "\"_", "not_", "in_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"--", "checkpoints", "\"_", "not_", "in_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "out_", "=_", "self_", "._", "\\u", "help", "\\u", "output_", "(_", "[_", "'-", "h", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "lets", "encrypt", "-", "auto", "\"_", "not_", "in_", "out_", ")_", "#", " ", "test", " ", "cli", ".", "cli", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\"", "ngin", "x", "\"_", "in_", "plugins_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "\"", "Us", "e", " ", "the", " ", "Ng", "inx", " ", "plugin", "\"_", "in_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "\"(", "ngin", "x", " ", "support", " ", "is", " ", "experimental", "\"_", "in_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "out_", "=_", "self_", "._", "\\u", "help", "\\u", "output_", "(_", "[_", "'--", "help", "'_", ",_", "'", "plugin", "s", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"--", "manu", "al", "-", "test", "-", "mode", "\"_", "not_", "in_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"--", "prepar", "e", "\"_", "in_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "Plug", "in", " ", "options", "\"_", "in_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "out_", "=_", "self_", "._", "\\u", "help", "\\u", "output_", "(_", "[_", "'--", "help", "'_", ",_", "'", "install", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"--", "cert", "-", "path", "\"_", "in_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"--", "key", "-", "path", "\"_", "in_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "out_", "=_", "self_", "._", "\\u", "help", "\\u", "output_", "(_", "[_", "'--", "help", "'_", ",_", "'", "revoke", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"--", "cert", "-", "path", "\"_", "in_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"--", "key", "-", "path", "\"_", "in_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "out_", "=_", "self_", "._", "\\u", "help", "\\u", "output_", "(_", "[_", "'-", "h", "'_", ",_", "'", "config", "\\u", "change", "s", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"--", "cert", "-", "path", "\"_", "not_", "in_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"--", "key", "-", "path", "\"_", "not_", "in_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "out_", "=_", "self_", "._", "\\u", "help", "\\u", "output_", "(_", "[_", "'-", "h", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "cli_", "._", "usage", "\\u", "strings_", "(_", "plugins_", ")_", "[_", "0_", "]_", "in_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CLI", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "#", " ", "pylint", ":", " ", "disable", "=", "too", "-", "many", "-", "public", "-", "methods_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "cli", "\\u", "missi", "ng", "\\u", "flag_", "(_", "self_", ",_", "args_", ",_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Ensur", "e", " ", "tha", "t", " ", "a", " ", "partic", "ular", " ", "error", " ", "raise", "s", " ", "a", " ", "missi", "ng", " ", "cli", " ", "flag", " ", "error", " ", "contain", "ing", " ", "message", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exc_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "mock_", "._", "patch_", "(_", "'", "cert", "bot", ".", "main", ".", "sys", ".", "std", "err", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "main_", "._", "main_", "(_", "self_", "._", "standard", "\\u", "args_", "+_", "args_", "[_", ":_", "]_", ")_", "#", " ", "NOTE", ":", " ", "parser", " ", "can", " ", "alter", " ", "its", " ", "args", "!", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "errors_", "._", "Missing", "Command", "line", "Flag_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "message_", "in_", "str_", "(_", "exc_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "exc_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CLI", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "#", " ", "pylint", ":", " ", "disable", "=", "too", "-", "many", "-", "public", "-", "methods_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "(_", "'", "cert", "bot", ".", "main", ".", "client", ".", "acm", "e\\u", "client", ".", "Client", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "(_", "'", "cert", "bot", ".", "main", ".\\u", "dete", "rmin", "e\\u", "account", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "(_", "'", "cert", "bot", ".", "main", ".", "client", ".", "Client", ".", "obtain", "\\u", "and", "\\u", "enroll", "\\u", "certifica", "te", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "(_", "'", "cert", "bot", ".", "main", ".\\u", "auth", "\\u", "from", "\\u", "domains", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "user", "\\u", "agent_", "(_", "self_", ",_", "af", "d_", ",_", "\\u", "ob", "t_", ",_", "det_", ",_", "\\u", "client_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Normal", "ly", " ", "the", " ", "client", " ", "is", " ", "total", "ly", " ", "mocked", " ", "out", ",", " ", "but", " ", "here", " ", "we", " ", "need", " ", "more_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "argu", "ment", "s", " ", "to", " ", "automat", "e", " ", "it", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "[_", "\"--", "standalone", "\"_", ",_", "\"", "cert", "only", "\"_", ",_", "\"-", "m", "\"_", ",_", "\"", "none", "@", "none", ".", "com", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"-", "d", "\"_", ",_", "\"", "example", ".", "com", "\"_", ",_", "'--", "agree", "-", "tos", "'_", "]_", "+_", "self_", "._", "standard", "\\u", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "det_", "._", "return", "\\u", "value_", "=_", "mock_", "._", "Mag", "ic", "Mock_", "(_", ")_", ",_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "af", "d_", "._", "return", "\\u", "value_", "=_", "mock_", "._", "Mag", "ic", "Mock_", "(_", ")_", ",_", "\"", "newc", "ert", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "mock_", "._", "patch_", "(_", "'", "cert", "bot", ".", "main", ".", "client", ".", "acm", "e\\u", "client", ".", "Client", "Network", "'_", ")_", "as_", "acm", "e\\u", "net_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "call", "\\u", "no", "\\u", "client", "mock_", "(_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os", "\\u", "ver_", "=_", "\"", " ", "\"_", "._", "join_", "(_", "le", "\\u", "util_", "._", "get", "\\u", "os", "\\u", "info_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ua_", "=_", "acm", "e\\u", "net_", "._", "call", "\\u", "args_", "[_", "1_", "]_", "[_", "\"", "user", "\\u", "agent", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "os", "\\u", "ver_", "in_", "ua_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "platform_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plat", "_", "=_", "platform_", "._", "platform_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\"", "linux", "\"_", "in_", "plat", "_", "._", "lower_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "platform_", "._", "linux", "\\u", "distribution_", "(_", ")_", "[_", "0_", "]_", "in_", "ua_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "mock_", "._", "patch_", "(_", "'", "cert", "bot", ".", "main", ".", "client", ".", "acm", "e\\u", "client", ".", "Client", "Network", "'_", ")_", "as_", "acm", "e\\u", "net_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ua_", "=_", "\"", "band", "ers", "nat", "ch", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "+=_", "[_", "\"--", "user", "-", "agent", "\"_", ",_", "ua_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "call", "\\u", "no", "\\u", "client", "mock_", "(_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "acm", "e\\u", "net_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "mock_", "._", "ANY_", ",_", "verify", "\\u", "ssl_", "=_", "True_", ",_", "user", "\\u", "agent_", "=_", "ua_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CLI", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "#", " ", "pylint", ":", " ", "disable", "=", "too", "-", "many", "-", "public", "-", "methods_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "(_", "'", "cert", "bot", ".", "le", "\\u", "util", ".", "exe", "\\u", "exist", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "configurator", "\\u", "selection_", "(_", "self_", ",_", "mock", "\\u", "exe", "\\u", "exists_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "exe", "\\u", "exists_", "._", "return", "\\u", "value_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "real", "\\u", "plugins_", "=_", "disco", "_", "._", "Plug", "ins", "Registry_", "._", "find", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "[_", "'--", "apa", "che", "'_", ",_", "'--", "authenticator", "'_", ",_", "'", "standalone", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "need", "ed", " ", "two", " ", "calls", " ", "to", " ", "find", "\\u", "all", "()", ",", " ", "whi", "ch", " ", "we", "'", "re", " ", "avoid", "ing", " ", "for", " ", "now_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bec", "aus", "e", " ", "of", " ", "possib", "le", " ", "side", " ", "effect", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "https", "://", "git", "hub", ".", "com", "/", "lets", "encrypt", "/", "lets", "encrypt", "/", "commit", "/", "5", "1e", "d2", "b6", "8", "1f", "87", "b1", "eb", "290", "88", "dd", "487", "1", "8a", "5", "4f", "401", "e4", "855", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "with", " ", "mock", ".", "patch", "('", "cert", "bot", ".", "cli", ".", "plugin", "s", "\\u", "testa", "ble", "')", " ", "as", " ", "plugin", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "plugin", "s", ".", "return", "\\u", "value", " ", "=", " ", "{", "\"", "apa", "che", "\":", " ", "Tru", "e", ",", " ", "\"", "ngin", "x", "\":", " ", "Tru", "e", "}_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "ret", ",", " ", "\\u", ",", " ", "\\u", ",", " ", "\\u", " ", "=", " ", "self", ".\\u", "call", "(", "args", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "assert", "Tru", "e", "(\"", "Too", " ", "many", " ", "flags", " ", "setti", "ng", "\"", " ", "in", " ", "ret", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "\"", "install", "\"_", ",_", "\"--", "ngin", "x", "\"_", ",_", "\"--", "cert", "-", "path", "\"_", ",_", "\"/", "tmp", "/", "bla", "h", "\"_", ",_", "\"--", "key", "-", "path", "\"_", ",_", "\"/", "tmp", "/", "bla", "h", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"--", "ngin", "x", "-", "server", "-", "root", "\"_", ",_", "\"/", "nonexist", "ent", "/", "thing", "\"_", ",_", "\"-", "d", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "example", ".", "com", "\"_", ",_", "\"--", "debug", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\"", "ngin", "x", "\"_", "in_", "real", "\\u", "plugins_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Sen", "ding", " ", "ngin", "x", " ", "a", " ", "non", "-", "existen", "t", " ", "conf", " ", "dir", " ", "will", " ", "simulat", "e", " ", "misc", "onfi", "gur", "ation_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "we", " ", "can", " ", "only", " ", "do", " ", "tha", "t", " ", "if", " ", "cert", "bot", "-", "ngin", "x", " ", "is", " ", "actual", "ly", " ", "presen", "t", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ret_", ",_", "\\u_", ",_", "\\u_", ",_", "\\u_", "=_", "self_", "._", "\\u", "call_", "(_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "The", " ", "ngin", "x", " ", "plugin", " ", "is", " ", "not", " ", "working", "\"_", "in_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "Mis", "configura", "tion", "Error", "\"_", "in_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "cli", "\\u", "missi", "ng", "\\u", "flag_", "(_", "[_", "\"--", "standalone", "\"_", "]_", ",_", "\"", "With", " ", "the", " ", "standalone", " ", "plugin", ",", " ", "you", " ", "probab", "ly", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "mock_", "._", "patch_", "(_", "\"", "cert", "bot", ".", "main", ".\\u", "init", "\\u", "le", "\\u", "client", "\"_", ")_", "as_", "mock", "\\u", "init_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "mock_", "._", "patch_", "(_", "\"", "cert", "bot", ".", "main", ".\\u", "auth", "\\u", "from", "\\u", "domains", "\"_", ")_", "as_", "mock", "\\u", "af", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "af", "d_", "._", "return", "\\u", "value_", "=_", "(_", "mock_", "._", "Mag", "ic", "Mock_", "(_", ")_", ",_", "mock_", "._", "Mag", "ic", "Mock_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "call_", "(_", "[_", "\"", "cert", "only", "\"_", ",_", "\"--", "manu", "al", "\"_", ",_", "\"-", "d", "\"_", ",_", "\"", "foo", ".", "bar", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unu", "sed", "\\u", "config_", ",_", "auth_", ",_", "unu", "sed", "\\u", "installer_", "=_", "mock", "\\u", "init_", "._", "call", "\\u", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "auth_", ",_", "manual_", "._", "Authenticator", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "mock_", "._", "patch_", "(_", "'", "cert", "bot", ".", "main", ".", "obtain", "\\u", "cert", "'_", ")_", "as_", "mock", "\\u", "cert", "only_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "call_", "(_", "[_", "\"", "auth", "\"_", ",_", "\"--", "standalone", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1_", ",_", "mock", "\\u", "cert", "only_", "._", "call", "\\u", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CLI", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "#", " ", "pylint", ":", " ", "disable", "=", "too", "-", "many", "-", "public", "-", "methods_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "cert", "only", "\\u", "bad", "\\u", "args_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "call_", "(_", "[_", "'-", "a", "'_", ",_", "'", "bad", "\\u", "auth", "'_", ",_", "'", "cert", "only", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "False_", ",_", "\"", "Except", "ion", " ", "shou", "ld", " ", "have", " ", "bee", "n", " ", "raise", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "errors_", "._", "Plug", "in", "Selecti", "on", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "'", "The", " ", "request", "ed", " ", "bad", "\\u", "auth", " ", "plugin", " ", "doe", "s", " ", "not", " ", "appear", "'_", "in_", "e_", "._", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CLI", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "#", " ", "pylint", ":", " ", "disable", "=", "too", "-", "many", "-", "public", "-", "methods_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "check", "\\u", "server", "\\u", "confl", "ict", "\\u", "message_", "(_", "self_", ",_", "parser", "\\u", "args_", ",_", "conflicting", "\\u", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parse_", "=_", "self_", "._", "\\u", "get", "\\u", "argu", "ment", "\\u", "parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parse_", "(_", "parser", "\\u", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "(_", "#", " ", "pragma", ":", " ", "no", " ", "cover_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "The", " ", "follow", "ing", " ", "flags", " ", "did", "n", "'", "t", " ", "confl", "ict", " ", "with", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "server", ":", " ", "{", "0", "}'_", "._", "format_", "(_", "',", " ", "'_", "._", "join_", "(_", "conflicting", "\\u", "args_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "errors_", "._", "Error_", "as_", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "'--", "server", "'_", "in_", "error_", "._", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "arg_", "in_", "conflicting", "\\u", "args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "arg_", "in_", "error_", "._", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CLI", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "#", " ", "pylint", ":", " ", "disable", "=", "too", "-", "many", "-", "public", "-", "methods_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "(_", "'", "cert", "bot", ".", "main", ".", "zop", "e", ".", "component", ".", "get", "Utili", "ty", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "cert", "only", "\\u", "dry", "\\u", "run", "\\u", "new", "\\u", "request", "\\u", "success_", "(_", "self_", ",_", "mock", "\\u", "get", "\\u", "utility_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "client_", "=_", "mock_", "._", "Mag", "ic", "Mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "client_", "._", "obtain", "\\u", "and", "\\u", "enroll", "\\u", "certificate_", "._", "return", "\\u", "value_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "cert", "only", "\\u", "new", "\\u", "request", "\\u", "common_", "(_", "mock", "\\u", "client_", ",_", "[_", "'--", "dry", "-", "run", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "client_", "._", "obtain", "\\u", "and", "\\u", "enroll", "\\u", "certificate_", "._", "call", "\\u", "count_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dry", " ", "run", "'_", "in_", "mock", "\\u", "get", "\\u", "utility_", "(_", ")_", "._", "add", "\\u", "message_", "._", "call", "\\u", "args_", "[_", "0_", "]_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Assert", "s", " ", "we", " ", "don", "'", "t", " ", "suggest", " ", "dona", "ting", " ", "after", " ", "a", " ", "success", "ful", " ", "dry", " ", "run_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "mock", "\\u", "get", "\\u", "utility_", "(_", ")_", "._", "add", "\\u", "message_", "._", "call", "\\u", "count_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CLI", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "#", " ", "pylint", ":", " ", "disable", "=", "too", "-", "many", "-", "public", "-", "methods_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "(_", "'", "cert", "bot", ".", "crypto", "\\u", "util", ".", "not", "Af", "ter", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "(_", "'", "cert", "bot", ".", "main", ".", "zop", "e", ".", "component", ".", "get", "Utili", "ty", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "cert", "only", "\\u", "new", "\\u", "request", "\\u", "success_", "(_", "self_", ",_", "mock", "\\u", "get", "\\u", "utility_", ",_", "mock", "\\u", "not", "After_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cert", "\\u", "path_", "=_", "'/", "etc", "/", "lets", "encrypt", "/", "live", "/", "foo", ".", "bar", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "date_", "=_", "'", "197", "0", "-0", "1", "-0", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "not", "After_", "(_", ")_", "._", "date_", "._", "return", "\\u", "value_", "=_", "date_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "lineage", "_", "=_", "mock_", "._", "Mag", "ic", "Mock_", "(_", "cert_", "=_", "cert", "\\u", "path_", ",_", "full", "chain_", "=_", "cert", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "client_", "=_", "mock_", "._", "Mag", "ic", "Mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "client_", "._", "obtain", "\\u", "and", "\\u", "enroll", "\\u", "certificate_", "._", "return", "\\u", "value_", "=_", "mock", "\\u", "lineage", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "cert", "only", "\\u", "new", "\\u", "request", "\\u", "common_", "(_", "mock", "\\u", "client_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "client_", "._", "obtain", "\\u", "and", "\\u", "enroll", "\\u", "certificate_", "._", "call", "\\u", "count_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cert", "\\u", "msg_", "=_", "mock", "\\u", "get", "\\u", "utility_", "(_", ")_", "._", "add", "\\u", "message_", "._", "call", "\\u", "args", "\\u", "list_", "[_", "0_", "]_", "[_", "0_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "cert", "\\u", "path_", "in_", "cert", "\\u", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "date_", "in_", "cert", "\\u", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dona", "te", "'_", "in_", "mock", "\\u", "get", "\\u", "utility_", "(_", ")_", "._", "add", "\\u", "message_", "._", "call", "\\u", "args_", "[_", "0_", "]_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CLI", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "#", " ", "pylint", ":", " ", "disable", "=", "too", "-", "many", "-", "public", "-", "methods_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "test\\u", "renew", "al", "\\u", "common_", "(_", "self_", ",_", "due", "\\u", "for", "\\u", "renew", "al_", ",_", "extra", "\\u", "args_", ",_", "log", "\\u", "out_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "None_", ",_", "shou", "ld", "\\u", "renew", "_", "=_", "True_", ",_", "error", "\\u", "expected_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "pylint", ":", " ", "disable", "=", "too", "-", "many", "-", "locals", ",", "too", "-", "many", "-", "arguments_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cert", "\\u", "path_", "=_", "'", "cert", "bot", "/", "tests", "/", "testd", "ata", "/", "cert", ".", "pe", "m", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chain", "\\u", "path_", "=_", "'/", "etc", "/", "lets", "encrypt", "/", "live", "/", "foo", ".", "bar", "/", "full", "chain", ".", "pe", "m", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "lineage", "_", "=_", "mock_", "._", "Mag", "ic", "Mock_", "(_", "cert_", "=_", "cert", "\\u", "path_", ",_", "full", "chain_", "=_", "chain", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "lineage", "_", "._", "shou", "ld", "\\u", "autore", "new_", "._", "return", "\\u", "value_", "=_", "due", "\\u", "for", "\\u", "renew", "al_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "cert", "r_", "=_", "mock_", "._", "Mag", "ic", "Mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "key_", "=_", "mock_", "._", "Mag", "ic", "Mock_", "(_", "pem_", "=_", "'", "pe", "m", "\\u", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "client_", "=_", "mock_", "._", "Mag", "ic", "Mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stdout_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "client_", "._", "obtain", "\\u", "certificate_", "._", "return", "\\u", "value_", "=_", "(_", "mock", "\\u", "cert", "r_", ",_", "'", "chain", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "key_", ",_", "'", "csr", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "mock_", "._", "patch_", "(_", "'", "cert", "bot", ".", "main", ".\\u", "find", "\\u", "duplicat", "ive", "\\u", "cert", "s", "'_", ")_", "as_", "mock", "\\u", "fd", "c_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "fd", "c_", "._", "return", "\\u", "value_", "=_", "(_", "mock", "\\u", "lineage", "_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "mock_", "._", "patch_", "(_", "'", "cert", "bot", ".", "main", ".\\u", "init", "\\u", "le", "\\u", "client", "'_", ")_", "as_", "mock", "\\u", "init_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "mock", "\\u", "init_", "._", "return", "\\u", "value_", "=_", "mock", "\\u", "client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "get", "\\u", "utility", "\\u", "path_", "=_", "'", "cert", "bot", ".", "main", ".", "zop", "e", ".", "component", ".", "get", "Utili", "ty", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "mock_", "._", "patch_", "(_", "get", "\\u", "utility", "\\u", "path_", ")_", "as_", "mock", "\\u", "get", "\\u", "utility_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "with_", "mock_", "._", "patch_", "(_", "'", "cert", "bot", ".", "main", ".", "renew", "al", ".", "Open", "SS", "L", "'_", ")_", "as_", "mock", "\\u", "ssl_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "mock", "\\u", "latest_", "=_", "mock_", "._", "Mag", "ic", "Mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "latest_", "._", "get", "\\u", "issuer_", "._", "return", "\\u", "value_", "=_", "\"", "Fake", " ", "fake", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "ssl_", "._", "crypto_", "._", "load", "\\u", "certificate_", "._", "return", "\\u", "value_", "=_", "mock", "\\u", "latest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "mock_", "._", "patch_", "(_", "'", "cert", "bot", ".", "main", ".", "renew", "al", ".", "crypto", "\\u", "util", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "not_", "args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "args_", "=_", "[_", "'-", "d", "'_", ",_", "'", "isn", "ot", ".", "org", "'_", ",_", "'-", "a", "'_", ",_", "'", "standalone", "'_", ",_", "'", "cert", "only", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "extra", "\\u", "args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "args_", "+=_", "extra", "\\u", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "ret_", ",_", "stdout_", ",_", "\\u_", ",_", "\\u_", "=_", "self_", "._", "\\u", "call_", "(_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ret_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "print_", "(_", "\"", "Return", "ed", "\"_", ",_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Assert", "ion", "Error_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "not_", "error", "\\u", "expected_", ",_", "\"", "renew", "al", " ", "shou", "ld", " ", "have", " ", "errore", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "#", " ", "pylint", ":", " ", "disable", "=", "bare", "-", "except_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "not_", "error", "\\u", "expected_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "raise_", "Assert", "ion", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Une", "xpe", "cte", "d", " ", "renew", "al", " ", "error", ":\\\\", "n", "\"_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "traceback_", "._", "format\\u", "exc_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "shou", "ld", "\\u", "renew", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "client_", "._", "obtain", "\\u", "certificate_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "[_", "'", "isn", "ot", ".", "org", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "mock", "\\u", "client_", "._", "obtain", "\\u", "certificate_", "._", "call", "\\u", "count_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "dump", "\\u", "log_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "log", "\\u", "out_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "logs", "\\u", "dir_", ",_", "\"", "lets", "encrypt", ".", "log", "\"_", ")_", ")_", "as_", "lf_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "assert", "True_", "(_", "log", "\\u", "out_", "in_", "lf_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "mock", "\\u", "lineage", "_", ",_", "mock", "\\u", "get", "\\u", "utility_", ",_", "stdout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CLI", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "#", " ", "pylint", ":", " ", "disable", "=", "too", "-", "many", "-", "public", "-", "methods_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "cert", "only", "\\u", "renew", "al_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lineage", "_", ",_", "get", "\\u", "utility_", ",_", "\\u_", "=_", "self_", "._", "\\u", "test\\u", "renew", "al", "\\u", "common_", "(_", "True_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "lineage", "_", "._", "save", "\\u", "successor", "_", "._", "call", "\\u", "count_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lineage", "_", "._", "update", "\\u", "all", "\\u", "link", "s", "\\u", "to_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "lineage", "_", "._", "late", "st", "\\u", "common", "\\u", "version_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cert", "\\u", "msg_", "=_", "get", "\\u", "utility_", "(_", ")_", "._", "add", "\\u", "message_", "._", "call", "\\u", "args", "\\u", "list_", "[_", "0_", "]_", "[_", "0_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "full", "chain", ".", "pe", "m", "'_", "in_", "cert", "\\u", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "dona", "te", "'_", "in_", "get", "\\u", "utility_", "(_", ")_", "._", "add", "\\u", "message_", "._", "call", "\\u", "args_", "[_", "0_", "]_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CLI", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "#", " ", "pylint", ":", " ", "disable", "=", "too", "-", "many", "-", "public", "-", "methods_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "cert", "only", "\\u", "renew", "al", "\\u", "triggers_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "--", "dry", "-", "run", " ", "shou", "ld", " ", "force", " ", "renew", "al_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u_", ",_", "get", "\\u", "utility_", ",_", "\\u_", "=_", "self_", "._", "\\u", "test\\u", "renew", "al", "\\u", "common_", "(_", "False_", ",_", "[_", "'--", "dry", "-", "run", "'_", ",_", "'--", "keep", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "log", "\\u", "out_", "=_", "\"", "simulati", "ng", " ", "renew", "al", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "get", "\\u", "utility_", "(_", ")_", "._", "add", "\\u", "message_", "._", "call", "\\u", "count_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "dry", " ", "run", "'_", "in_", "get", "\\u", "utility_", "(_", ")_", "._", "add", "\\u", "message_", "._", "call", "\\u", "args_", "[_", "0_", "]_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "test\\u", "renew", "al", "\\u", "common_", "(_", "False_", ",_", "[_", "'--", "renew", "-", "by", "-", "default", "'_", ",_", "'-", "tv", "v", "'_", ",_", "'--", "debug", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "log", "\\u", "out_", "=_", "\"", "Auto", "-", "renew", "al", " ", "forced", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "get", "\\u", "utility_", "(_", ")_", "._", "add", "\\u", "message_", "._", "call", "\\u", "count_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "test\\u", "renew", "al", "\\u", "common_", "(_", "False_", ",_", "[_", "'-", "tv", "v", "'_", ",_", "'--", "debug", "'_", ",_", "'--", "keep", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "log", "\\u", "out_", "=_", "\"", "not", " ", "ye", "t", " ", "due", "\"_", ",_", "shou", "ld", "\\u", "renew", "_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CLI", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "#", " ", "pylint", ":", " ", "disable", "=", "too", "-", "many", "-", "public", "-", "methods_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "quie", "t", "\\u", "renew", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "make", "\\u", "test\\u", "renew", "al", "\\u", "conf_", "(_", "'", "sample", "-", "renew", "al", ".", "conf", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "[_", "\"", "renew", "\"_", ",_", "\"--", "dry", "-", "run", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u_", ",_", "\\u_", ",_", "stdout_", "=_", "self_", "._", "\\u", "test\\u", "renew", "al", "\\u", "common_", "(_", "True_", ",_", "[_", "]_", ",_", "args_", "=_", "args_", ",_", "shou", "ld", "\\u", "renew", "_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "=_", "stdout_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "renew", "\"_", "in_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "\"", "renew", "\"_", ",_", "\"--", "dry", "-", "run", "\"_", ",_", "\"-", "q", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u_", ",_", "\\u_", ",_", "stdout_", "=_", "self_", "._", "\\u", "test\\u", "renew", "al", "\\u", "common_", "(_", "True_", ",_", "[_", "]_", ",_", "args_", "=_", "args_", ",_", "shou", "ld", "\\u", "renew", "_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "=_", "stdout_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\"\"_", ",_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CLI", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "#", " ", "pylint", ":", " ", "disable", "=", "too", "-", "many", "-", "public", "-", "methods_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "cert", "only", "\\u", "csr_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "get", "\\u", "utility_", "=_", "self_", "._", "\\u", "test\\u", "cert", "only", "\\u", "csr", "\\u", "common_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cert", "\\u", "msg_", "=_", "mock", "\\u", "get", "\\u", "utility_", "(_", ")_", "._", "add", "\\u", "message_", "._", "call", "\\u", "args", "\\u", "list_", "[_", "0_", "]_", "[_", "0_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "cert", ".", "pe", "m", "'_", "in_", "cert", "\\u", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dona", "te", "'_", "in_", "mock", "\\u", "get", "\\u", "utility_", "(_", ")_", "._", "add", "\\u", "message_", "._", "call", "\\u", "args_", "[_", "0_", "]_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CLI", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "#", " ", "pylint", ":", " ", "disable", "=", "too", "-", "many", "-", "public", "-", "methods_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "cert", "only", "\\u", "csr", "\\u", "dry", "\\u", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "get", "\\u", "utility_", "=_", "self_", "._", "\\u", "test\\u", "cert", "only", "\\u", "csr", "\\u", "common_", "(_", "[_", "'--", "dry", "-", "run", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "mock", "\\u", "get", "\\u", "utility_", "(_", ")_", "._", "add", "\\u", "message_", "._", "call", "\\u", "count_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dry", " ", "run", "'_", "in_", "mock", "\\u", "get", "\\u", "utility_", "(_", ")_", "._", "add", "\\u", "message_", "._", "call", "\\u", "args_", "[_", "0_", "]_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CLI", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "#", " ", "pylint", ":", " ", "disable", "=", "too", "-", "many", "-", "public", "-", "methods_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "(_", "'", "cert", "bot", ".", "main", ".", "sys", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "handle", "\\u", "exception_", "(_", "self_", ",_", "mock", "\\u", "sys_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "pylint", ":", " ", "disable", "=", "protect", "ed", "-", "access_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "acm", "e_", "import_", "messages_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "config_", "=_", "mock_", "._", "Mag", "ic", "Mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "open_", "=_", "mock_", "._", "mock", "\\u", "open_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "mock_", "._", "patch_", "(_", "'", "cert", "bot", ".", "main", ".", "open", "'_", ",_", "mock", "\\u", "open_", ",_", "create_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exception_", "=_", "Exception_", "(_", "'", "deta", "il", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "config_", "._", "verbo", "se", "\\u", "count_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "main_", "._", "\\u", "handle", "\\u", "exception_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Exception_", ",_", "exc", "\\u", "value_", "=_", "exception_", ",_", "trace_", "=_", "None_", ",_", "config_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "open_", "(_", ")_", "._", "write_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "''_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "traceback_", "._", "format\\u", "exception", "\\u", "only_", "(_", "Exception_", ",_", "exception_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "msg_", "=_", "mock", "\\u", "sys_", "._", "exit_", "._", "call", "\\u", "args", "\\u", "list_", "[_", "0_", "]_", "[_", "0_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "unexpected", " ", "error", "'_", "in_", "error", "\\u", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "mock_", "._", "patch_", "(_", "'", "cert", "bot", ".", "main", ".", "open", "'_", ",_", "mock", "\\u", "open_", ",_", "create_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "open_", "._", "side", "\\u", "effect_", "=_", "[_", "Key", "board", "Interrupt_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error_", "=_", "errors_", "._", "Error_", "(_", "'", "deta", "il", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "main_", "._", "\\u", "handle", "\\u", "exception_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "errors_", "._", "Error_", ",_", "exc", "\\u", "value_", "=_", "error_", ",_", "trace_", "=_", "None_", ",_", "config_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "assert", "\\u", "any", "\\u", "call", " ", "used", " ", "bec", "aus", "e", " ", "sys", ".", "exit", " ", "doe", "sn", "'", "t", " ", "exit", " ", "in", " ", "cli", ".", "py_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "sys_", "._", "exit_", "._", "assert", "\\u", "any", "\\u", "call_", "(_", "''_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "traceback_", "._", "format\\u", "exception", "\\u", "only_", "(_", "errors_", "._", "Error_", ",_", "error_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "exception_", "=_", "messages_", "._", "Error_", "(_", "detail_", "=_", "'", "alpha", "'_", ",_", "typ_", "=_", "'", "urn", ":", "acm", "e", ":", "error", ":", "tri", "ffi", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "title_", "=_", "'", "beta", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "config_", "=_", "mock_", "._", "Mag", "ic", "Mock_", "(_", "debug_", "=_", "False_", ",_", "verbo", "se", "\\u", "count_", "=_", "-_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "main_", "._", "\\u", "handle", "\\u", "exception_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "messages_", "._", "Error_", ",_", "exc", "\\u", "value_", "=_", "exception_", ",_", "trace_", "=_", "None_", ",_", "config_", "=_", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "msg_", "=_", "mock", "\\u", "sys_", "._", "exit_", "._", "call", "\\u", "args", "\\u", "list_", "[_", "-_", "1_", "]_", "[_", "0_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "unexpected", " ", "error", "'_", "in_", "error", "\\u", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "acm", "e", ":", "error", "'_", "not_", "in_", "error", "\\u", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "alpha", "'_", "in_", "error", "\\u", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "beta", "'_", "in_", "error", "\\u", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "config_", "=_", "mock_", "._", "Mag", "ic", "Mock_", "(_", "debug_", "=_", "False_", ",_", "verbo", "se", "\\u", "count_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "main_", "._", "\\u", "handle", "\\u", "exception_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "messages_", "._", "Error_", ",_", "exc", "\\u", "value_", "=_", "exception_", ",_", "trace_", "=_", "None_", ",_", "config_", "=_", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "msg_", "=_", "mock", "\\u", "sys_", "._", "exit_", "._", "call", "\\u", "args", "\\u", "list_", "[_", "-_", "1_", "]_", "[_", "0_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "unexpected", " ", "error", "'_", "in_", "error", "\\u", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "acm", "e", ":", "error", "'_", "in_", "error", "\\u", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "alpha", "'_", "in_", "error", "\\u", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "interrupt", "_", "=_", "Key", "board", "Interrupt_", "(_", "'", "deta", "il", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "main_", "._", "\\u", "handle", "\\u", "exception_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Key", "board", "Interrupt_", ",_", "exc", "\\u", "value_", "=_", "interrupt", "_", ",_", "trace_", "=_", "None_", ",_", "config_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "sys_", "._", "exit_", "._", "assert", "\\u", "call", "ed", "\\u", "with_", "(_", "''_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "traceback_", "._", "format\\u", "exception", "\\u", "only_", "(_", "Key", "board", "Interrupt_", ",_", "interrupt", "_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Det", "erm", "ine", "Account", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "args", "\\u", "account", "\\u", "set_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "account", "\\u", "storage_", "._", "save_", "(_", "self_", "._", "acc", "s_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "config_", "._", "account_", "=_", "self_", "._", "acc", "s_", "[_", "1_", "]_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "(_", "self_", "._", "acc", "s_", "[_", "1_", "]_", ",_", "None_", ")_", ",_", "self_", "._", "\\u", "call_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "acc", "s_", "[_", "1_", "]_", "._", "id_", ",_", "self_", "._", "config_", "._", "account_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "config_", "._", "email_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Det", "erm", "ine", "Account", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "single", "\\u", "account_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "account", "\\u", "storage_", "._", "save_", "(_", "self_", "._", "acc", "s_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "(_", "self_", "._", "acc", "s_", "[_", "0_", "]_", ",_", "None_", ")_", ",_", "self_", "._", "\\u", "call_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "acc", "s_", "[_", "0_", "]_", "._", "id_", ",_", "self_", "._", "config_", "._", "account_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "config_", "._", "email_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Det", "erm", "ine", "Account", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "(_", "'", "cert", "bot", ".", "client", ".", "display", "\\u", "ops", ".", "choose", "\\u", "account", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "multiple", "\\u", "accounts_", "(_", "self_", ",_", "mock", "\\u", "choose", "\\u", "accounts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "acc_", "in_", "self_", "._", "acc", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "account", "\\u", "storage_", "._", "save_", "(_", "acc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mock", "\\u", "choose", "\\u", "accounts_", "._", "return", "\\u", "value_", "=_", "self_", "._", "acc", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "(_", "self_", "._", "acc", "s_", "[_", "1_", "]_", ",_", "None_", ")_", ",_", "self_", "._", "\\u", "call_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "set_", "(_", "mock", "\\u", "choose", "\\u", "accounts_", "._", "call", "\\u", "args_", "[_", "0_", "]_", "[_", "0_", "]_", ")_", ",_", "set_", "(_", "self_", "._", "acc", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "acc", "s_", "[_", "1_", "]_", "._", "id_", ",_", "self_", "._", "config_", "._", "account_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "config_", "._", "email_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Except block handles 'BaseException'
weblabdeusto/weblabdeusto/tools/wcloud/wcloud/test/test_wcloud_tasks.py
[ { "content": " def tearDown(self):\n\n # Delete the deployed directory.\n try:\n pass\n #shutil.rmtree(\"weblabtest\")\n except:\n pass\n\n # Remove running weblab instances.\n os.system(\"kill $(ps aux | grep 'python -OO.*wcloud' | awk '{print $2}')\")\n\n # Remove the testentity line if present. Otherwise, the next attempt to start-weblab will fail\n # because its folder will be removed.\n try:\n instances_file = os.path.join(flask_app.config[\"DIR_BASE\"], \"instances.txt\")\n f = file(instances_file)\n lines = f.readlines()\n lines = [line.replace(\"\\n\", \"\") + \"\\n\" for line in lines if not \"testentity\" in line]\n f.close()\n f = file(instances_file, \"w\")\n f.writelines(lines)\n f.close()\n except:\n pass\n\n # Remove the include from apache.conf\n apacheconf = os.path.join(flask_app.config[\"DIR_BASE\"], \"apache.conf\")\n lines = open(apacheconf, \"r\").readlines()\n cleared_lines = [line.strip() + \"\\n\" for line in lines if \"testentity\" not in line]\n open(apacheconf, \"w\").writelines(cleared_lines)\n\n # Make sure all the instances are stopped. DANGEROUS: This will kill all running instances of WebLab.\n # This is done, specifically, so that \"testentity\" instance is killed after being run, so that\n # the test can be run again without issues.l\n try:\n os.system(\"killall weblab-admin\")\n except:\n pass\n\n # TODO: Careful with this. It is dangerous, in production if configured wrongly it would\n # erase the whole deployments directory.\n try:\n base_url = os.path.join(flask_app.config[\"DIR_BASE\"], self._settings[Creation.BASE_URL])\n shutil.rmtree(base_url)\n except:\n pass\n\n # Give it some time. It seems to be necessary.\n time.sleep(1.5)", "metadata": "root.TestWcloudTasks.tearDown", "header": "['class', 'TestWcloudTasks', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 167 } ]
[ { "span": "except:", "start_line": 190, "start_column": 8, "end_line": 190, "end_column": 15 }, { "span": "except:", "start_line": 204, "start_column": 8, "end_line": 204, "end_column": 15 }, { "span": "except:", "start_line": 212, "start_column": 8, "end_line": 212, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Test", "Wc", "loud", "Tasks_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Delete", " ", "the", " ", "deploye", "d", " ", "director", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "shut", "il", ".", "rm", "tree", "(\"", "webla", "bt", "est", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Remove", " ", "runn", "ing", " ", "webla", "b", " ", "instance", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "os_", "._", "system_", "(_", "\"", "kill", " ", "$(", "ps", " ", "aux", " ", "|", " ", "grep", " ", "'", "python", " ", "-", "OO", ".*", "wc", "loud", "'", " ", "|", " ", "aw", "k", " ", "'{", "print", " ", "$", "2", "}')", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Remove", " ", "the", " ", "teste", "nti", "ty", " ", "line", " ", "if", " ", "presen", "t", ".", " ", "Ot", "her", "wis", "e", ",", " ", "the", " ", "next", " ", "atte", "mpt", " ", "to", " ", "start", "-", "webla", "b", " ", "will", " ", "fail_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bec", "aus", "e", " ", "its", " ", "folder", " ", "will", " ", "be", " ", "remove", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "instance", "s", "\\u", "file_", "=_", "os_", "._", "path_", "._", "join_", "(_", "fla", "sk", "\\u", "app_", "._", "config_", "[_", "\"", "DIR", "\\u", "BASE", "\"_", "]_", ",_", "\"", "instance", "s", ".", "txt", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "file_", "(_", "instance", "s", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "=_", "f_", "._", "readlines_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "=_", "[_", "line_", "._", "replace_", "(_", "\"\\\\", "n", "\"_", ",_", "\"\"_", ")_", "+_", "\"\\\\", "n", "\"_", "for_", "line_", "in_", "lines_", "if_", "not_", "\"", "teste", "nti", "ty", "\"_", "in_", "line_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "file_", "(_", "instance", "s", "\\u", "file_", ",_", "\"", "w", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "writelines_", "(_", "lines_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Remove", " ", "the", " ", "include", " ", "from", " ", "apa", "che", ".", "conf_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "apa", "che", "conf_", "=_", "os_", "._", "path_", "._", "join_", "(_", "fla", "sk", "\\u", "app_", "._", "config_", "[_", "\"", "DIR", "\\u", "BASE", "\"_", "]_", ",_", "\"", "apa", "che", ".", "conf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "=_", "open_", "(_", "apa", "che", "conf_", ",_", "\"", "r", "\"_", ")_", "._", "readlines_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "clear", "ed", "\\u", "lines_", "=_", "[_", "line_", "._", "strip_", "(_", ")_", "+_", "\"\\\\", "n", "\"_", "for_", "line_", "in_", "lines_", "if_", "\"", "teste", "nti", "ty", "\"_", "not_", "in_", "line_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "open_", "(_", "apa", "che", "conf_", ",_", "\"", "w", "\"_", ")_", "._", "writelines_", "(_", "clear", "ed", "\\u", "lines_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "all", " ", "the", " ", "instance", "s", " ", "are", " ", "stopp", "ed", ".", " ", "DAN", "GER", "OUS", ":", " ", "Thi", "s", " ", "will", " ", "kill", " ", "all", " ", "runn", "ing", " ", "instance", "s", " ", "of", " ", "Web", "Lab", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "don", "e", ",", " ", "specifica", "ll", "y", ",", " ", "so", " ", "tha", "t", " ", "\"", "teste", "nti", "ty", "\"", " ", "instance", " ", "is", " ", "kille", "d", " ", "after", " ", "bei", "ng", " ", "run", ",", " ", "so", " ", "that_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "test", " ", "can", " ", "be", " ", "run", " ", "again", " ", "with", "out", " ", "issue", "s", ".", "l_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "system_", "(_", "\"", "kill", "all", " ", "webla", "b", "-", "admin", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "Care", "ful", " ", "with", " ", "this", ".", " ", "It", " ", "is", " ", "danger", "ous", ",", " ", "in", " ", "producti", "on", " ", "if", " ", "configur", "ed", " ", "wrong", "ly", " ", "it", " ", "wou", "ld_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "erase", " ", "the", " ", "whole", " ", "deployments", " ", "director", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "base", "\\u", "url_", "=_", "os_", "._", "path_", "._", "join_", "(_", "fla", "sk", "\\u", "app_", "._", "config_", "[_", "\"", "DIR", "\\u", "BASE", "\"_", "]_", ",_", "self_", "._", "\\u", "settings_", "[_", "Creat", "ion_", "._", "BASE", "\\u", "URL_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shutil_", "._", "rmtree_", "(_", "base", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Give", " ", "it", " ", "some", " ", "time", ".", " ", "It", " ", "see", "ms", " ", "to", " ", "be", " ", "necessar", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "time_", "._", "sleep_", "(_", "1.5_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Variable defined multiple times
Jackeriss/Email_My_PC/shell/shellcon.py
[ { "content": "# Generated by h2py from \\mssdk\\include\\shlobj.h and shellapi.h\nWM_USER = 1024\nDROPEFFECT_NONE = 0\nDROPEFFECT_COPY = 1\nDROPEFFECT_MOVE = 2\nDROPEFFECT_LINK = 4\nDROPEFFECT_SCROLL = -2147483648\n\nFO_MOVE = 1\nFO_COPY = 2\nFO_DELETE = 3\nFO_RENAME = 4\n\n## File operation flags used with shell.SHFileOperation\nFOF_MULTIDESTFILES = 1\nFOF_CONFIRMMOUSE = 2\nFOF_SILENT = 4\nFOF_RENAMEONCOLLISION = 8\nFOF_NOCONFIRMATION = 16\nFOF_WANTMAPPINGHANDLE = 32\nFOF_ALLOWUNDO = 64\nFOF_FILESONLY = 128\nFOF_SIMPLEPROGRESS = 256\nFOF_NOCONFIRMMKDIR = 512\nFOF_NOERRORUI = 1024\nFOF_NOCOPYSECURITYATTRIBS = 2048\nFOF_NORECURSION = 4096\nFOF_NO_CONNECTED_ELEMENTS = 8192\nFOF_WANTNUKEWARNING = 16384\nFOF_NORECURSEREPARSE = 32768\nFOF_NO_UI = FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_NOCONFIRMMKDIR\n\n## Extended file operation flags, used with IFileOperation\nFOFX_NOSKIPJUNCTIONS =0x00010000\nFOFX_PREFERHARDLINK =0x00020000\nFOFX_SHOWELEVATIONPROMPT =0x00040000\nFOFX_EARLYFAILURE =0x00100000\nFOFX_PRESERVEFILEEXTENSIONS =0x00200000\nFOFX_KEEPNEWERFILE =0x00400000\nFOFX_NOCOPYHOOKS =0x00800000\nFOFX_NOMINIMIZEBOX =0x01000000\nFOFX_MOVEACLSACROSSVOLUMES =0x02000000\nFOFX_DONTDISPLAYSOURCEPATH =0x04000000\nFOFX_DONTDISPLAYDESTPATH =0x08000000\nFOFX_REQUIREELEVATION =0x10000000\nFOFX_COPYASDOWNLOAD =0x40000000\nFOFX_DONTDISPLAYLOCATIONS =0x80000000\n\nPO_DELETE = 19\nPO_RENAME = 20\nPO_PORTCHANGE = 32\nPO_REN_PORT = 52\nSE_ERR_FNF = 2\nSE_ERR_PNF = 3\nSE_ERR_ACCESSDENIED = 5\nSE_ERR_OOM = 8\nSE_ERR_DLLNOTFOUND = 32\nSE_ERR_SHARE = 26\nSE_ERR_ASSOCINCOMPLETE = 27\nSE_ERR_DDETIMEOUT = 28\nSE_ERR_DDEFAIL = 29\nSE_ERR_DDEBUSY = 30\nSE_ERR_NOASSOC = 31\nSEE_MASK_CLASSNAME = 1\nSEE_MASK_CLASSKEY = 3\nSEE_MASK_IDLIST = 4\nSEE_MASK_INVOKEIDLIST = 12\nSEE_MASK_ICON = 16\nSEE_MASK_HOTKEY = 32\nSEE_MASK_NOCLOSEPROCESS = 64\nSEE_MASK_CONNECTNETDRV = 128\nSEE_MASK_FLAG_DDEWAIT = 256\nSEE_MASK_DOENVSUBST = 512\nSEE_MASK_FLAG_NO_UI = 1024\nSEE_MASK_UNICODE = 16384\nSEE_MASK_NO_CONSOLE = 32768\nSEE_MASK_ASYNCOK = 1048576\nSEE_MASK_HMONITOR = 2097152\nSEE_MASK_CLASSNAME = 1\nSEE_MASK_CLASSKEY = 3\nSEE_MASK_IDLIST = 4\nSEE_MASK_INVOKEIDLIST = 12\nSEE_MASK_ICON = 16\nSEE_MASK_HOTKEY = 32\nSEE_MASK_NOCLOSEPROCESS = 64\nSEE_MASK_CONNECTNETDRV = 128\nSEE_MASK_FLAG_DDEWAIT = 256\nSEE_MASK_DOENVSUBST = 512\nSEE_MASK_FLAG_NO_UI = 1024\nSEE_MASK_UNICODE = 16384\nSEE_MASK_NO_CONSOLE = 32768\nSEE_MASK_ASYNCOK = 1048576\nSEE_MASK_HMONITOR = 2097152\nSHERB_NOCONFIRMATION = 1\nSHERB_NOPROGRESSUI = 2\nSHERB_NOSOUND = 4\nNIM_ADD = 0\nNIM_MODIFY = 1\nNIM_DELETE = 2\nNIF_MESSAGE = 1\nNIF_ICON = 2\nNIF_TIP = 4\nSHGFI_ICON = 256\nSHGFI_DISPLAYNAME = 512\nSHGFI_TYPENAME = 1024\nSHGFI_ATTRIBUTES = 2048\nSHGFI_ICONLOCATION = 4096\nSHGFI_EXETYPE = 8192\nSHGFI_SYSICONINDEX = 16384\nSHGFI_LINKOVERLAY = 32768\nSHGFI_SELECTED = 65536\nSHGFI_ATTR_SPECIFIED = 131072\nSHGFI_LARGEICON = 0\nSHGFI_SMALLICON = 1\nSHGFI_OPENICON = 2\nSHGFI_SHELLICONSIZE = 4\nSHGFI_PIDL = 8\nSHGFI_USEFILEATTRIBUTES = 16\nSHGNLI_PIDL = 1\nSHGNLI_PREFIXNAME = 2\nSHGNLI_NOUNIQUE = 4\nPRINTACTION_OPEN = 0\nPRINTACTION_PROPERTIES = 1\nPRINTACTION_NETINSTALL = 2\nPRINTACTION_NETINSTALLLINK = 3\nPRINTACTION_TESTPAGE = 4\nPRINTACTION_OPENNETPRN = 5\nPRINTACTION_DOCUMENTDEFAULTS = 6\nPRINTACTION_SERVERPROPERTIES = 7\n\n# Flags used with IContextMenu.QueryContextMenu\nCMF_NORMAL = 0\nCMF_DEFAULTONLY = 1\nCMF_VERBSONLY = 2\nCMF_EXPLORE = 4\nCMF_NOVERBS = 8\nCMF_CANRENAME = 16\nCMF_NODEFAULT = 32\nCMF_INCLUDESTATIC = 64\nCMF_ITEMMENU = 128\nCMF_EXTENDEDVERBS = 256\nCMF_DISABLEDVERBS = 512\nCMF_ASYNCVERBSTATE = 1024\nCMF_OPTIMIZEFORINVOKE = 2048\nCMF_SYNCCASCADEMENU = 4096\nCMF_DONOTPICKDEFAULT = 8192\nCMF_RESERVED = 4294901760 # 0xffff0000\n\nGCS_VERBA = 0\nGCS_HELPTEXTA = 1\nGCS_VALIDATEA = 2\nGCS_VERBW = 4\nGCS_HELPTEXTW = 5\nGCS_VALIDATEW = 6\nGCS_UNICODE = 4\nGCS_VERB = GCS_VERBW\nGCS_HELPTEXT = GCS_HELPTEXTW\nGCS_VALIDATE = GCS_VALIDATEW\nGCS_VERB = GCS_VERBA\nGCS_HELPTEXT = GCS_HELPTEXTA\nGCS_VALIDATE = GCS_VALIDATEA\nCMDSTR_NEWFOLDERA = \"NewFolder\"\nCMDSTR_VIEWLISTA = \"ViewList\"\nCMDSTR_VIEWDETAILSA = \"ViewDetails\"\nCMDSTR_NEWFOLDER = CMDSTR_NEWFOLDERA\nCMDSTR_VIEWLIST = CMDSTR_VIEWLISTA\nCMDSTR_VIEWDETAILS = CMDSTR_VIEWDETAILSA\nCMIC_MASK_HOTKEY = SEE_MASK_HOTKEY\nCMIC_MASK_ICON = SEE_MASK_ICON\nCMIC_MASK_FLAG_NO_UI = SEE_MASK_FLAG_NO_UI\nCMIC_MASK_UNICODE = SEE_MASK_UNICODE\nCMIC_MASK_NO_CONSOLE = SEE_MASK_NO_CONSOLE\nCMIC_MASK_ASYNCOK = SEE_MASK_ASYNCOK\nCMIC_MASK_PTINVOKE = 536870912\nGIL_OPENICON = 1\nGIL_FORSHELL = 2\nGIL_ASYNC = 32\nGIL_DEFAULTICON = 64\nGIL_FORSHORTCUT = 128\nGIL_CHECKSHIELD = 512\nGIL_SIMULATEDOC = 1\nGIL_PERINSTANCE = 2\nGIL_PERCLASS = 4\nGIL_NOTFILENAME = 8\nGIL_DONTCACHE = 16\nGIL_SHIELD = 512\nGIL_FORCENOSHIELD = 1024\nISIOI_ICONFILE = 1\nISIOI_ICONINDEX = 2\nISIOI_SYSIMAGELISTINDEX = 4\nFO_MOVE = 1\nFO_COPY = 2\nFO_DELETE = 3\nFO_RENAME = 4\nFOF_MULTIDESTFILES = 1\nFOF_CONFIRMMOUSE = 2\nFOF_SILENT = 4\nFOF_RENAMEONCOLLISION = 8\nFOF_NOCONFIRMATION = 16\nFOF_WANTMAPPINGHANDLE = 32\nFOF_ALLOWUNDO = 64\nFOF_FILESONLY = 128\nFOF_SIMPLEPROGRESS = 256\nFOF_NOCONFIRMMKDIR = 512\nFOF_NOERRORUI = 1024\nFOF_NOCOPYSECURITYATTRIBS = 2048\nPO_DELETE = 19\nPO_RENAME = 20\nPO_PORTCHANGE = 32\nPO_REN_PORT = 52\nFVSIF_RECT = 1\nFVSIF_PINNED = 2\nFVSIF_NEWFAILED = 134217728\nFVSIF_NEWFILE = -2147483648\nFVSIF_CANVIEWIT = 1073741824\nFCIDM_SHVIEWFIRST = 0\nFCIDM_SHVIEWLAST = 32767\nFCIDM_BROWSERFIRST = 40960\nFCIDM_BROWSERLAST = 48896\nFCIDM_GLOBALFIRST = 32768\nFCIDM_GLOBALLAST = 40959\nFCIDM_MENU_FILE = (FCIDM_GLOBALFIRST+0)\nFCIDM_MENU_EDIT = (FCIDM_GLOBALFIRST+64)\nFCIDM_MENU_VIEW = (FCIDM_GLOBALFIRST+128)\nFCIDM_MENU_VIEW_SEP_OPTIONS = (FCIDM_GLOBALFIRST+129)\nFCIDM_MENU_TOOLS = (FCIDM_GLOBALFIRST+192)\nFCIDM_MENU_TOOLS_SEP_GOTO = (FCIDM_GLOBALFIRST+193)\nFCIDM_MENU_HELP = (FCIDM_GLOBALFIRST+256)\nFCIDM_MENU_FIND = (FCIDM_GLOBALFIRST+320)\nFCIDM_MENU_EXPLORE = (FCIDM_GLOBALFIRST+336)\nFCIDM_MENU_FAVORITES = (FCIDM_GLOBALFIRST+368)\nFCIDM_TOOLBAR = (FCIDM_BROWSERFIRST + 0)\nFCIDM_STATUS = (FCIDM_BROWSERFIRST + 1)\nIDC_OFFLINE_HAND = 103\nSBSP_DEFBROWSER = 0\nSBSP_SAMEBROWSER = 1\nSBSP_NEWBROWSER = 2\nSBSP_DEFMODE = 0\nSBSP_OPENMODE = 16\nSBSP_EXPLOREMODE = 32\nSBSP_ABSOLUTE = 0\nSBSP_RELATIVE = 4096\nSBSP_PARENT = 8192\nSBSP_NAVIGATEBACK = 16384\nSBSP_NAVIGATEFORWARD = 32768\nSBSP_ALLOW_AUTONAVIGATE = 65536\nSBSP_INITIATEDBYHLINKFRAME = -2147483648\nSBSP_REDIRECT = 1073741824\nSBSP_WRITENOHISTORY = 134217728\nSBSP_NOAUTOSELECT = 67108864\nFCW_STATUS = 1\nFCW_TOOLBAR = 2\nFCW_TREE = 3\nFCW_INTERNETBAR = 6\nFCW_PROGRESS = 8\nFCT_MERGE = 1\nFCT_CONFIGABLE = 2\nFCT_ADDTOEND = 4\nCDBOSC_SETFOCUS = 0\nCDBOSC_KILLFOCUS = 1\nCDBOSC_SELCHANGE = 2\nCDBOSC_RENAME = 3\nSVSI_DESELECT = 0\nSVSI_SELECT = 1\nSVSI_EDIT = 3\nSVSI_DESELECTOTHERS = 4\nSVSI_ENSUREVISIBLE = 8\nSVSI_FOCUSED = 16\nSVSI_TRANSLATEPT = 32\nSVGIO_BACKGROUND = 0\nSVGIO_SELECTION = 1\nSVGIO_ALLVIEW = 2\nSVGIO_CHECKED\t= 0x3,\nSVGIO_TYPE_MASK\t= 0xf,\nSVGIO_FLAG_VIEWORDER = -2147483648 # 0x80000000\nSTRRET_WSTR = 0\nSTRRET_OFFSET = 1\nSTRRET_CSTR = 2\nCSIDL_DESKTOP = 0\nCSIDL_INTERNET = 1\nCSIDL_PROGRAMS = 2\nCSIDL_CONTROLS = 3\nCSIDL_PRINTERS = 4\nCSIDL_PERSONAL = 5\nCSIDL_FAVORITES = 6\nCSIDL_STARTUP = 7\nCSIDL_RECENT = 8\nCSIDL_SENDTO = 9\nCSIDL_BITBUCKET = 10\nCSIDL_STARTMENU = 11\nCSIDL_MYDOCUMENTS = 12\nCSIDL_MYMUSIC = 13\nCSIDL_MYVIDEO = 14\nCSIDL_DESKTOPDIRECTORY = 16\nCSIDL_DRIVES = 17\nCSIDL_NETWORK = 18\nCSIDL_NETHOOD = 19\nCSIDL_FONTS = 20\nCSIDL_TEMPLATES = 21\nCSIDL_COMMON_STARTMENU = 22\nCSIDL_COMMON_PROGRAMS = 23\nCSIDL_COMMON_STARTUP = 24\nCSIDL_COMMON_DESKTOPDIRECTORY = 25\nCSIDL_APPDATA = 26\nCSIDL_PRINTHOOD = 27\nCSIDL_LOCAL_APPDATA = 28\nCSIDL_ALTSTARTUP = 29\nCSIDL_COMMON_ALTSTARTUP = 30\nCSIDL_COMMON_FAVORITES = 31\nCSIDL_INTERNET_CACHE = 32\nCSIDL_COOKIES = 33\nCSIDL_HISTORY = 34\nCSIDL_COMMON_APPDATA = 35\nCSIDL_WINDOWS = 36\nCSIDL_SYSTEM = 37\nCSIDL_PROGRAM_FILES = 38\nCSIDL_MYPICTURES = 39\nCSIDL_PROFILE = 40\nCSIDL_SYSTEMX86 = 41\nCSIDL_PROGRAM_FILESX86 = 42\nCSIDL_PROGRAM_FILES_COMMON = 43\nCSIDL_PROGRAM_FILES_COMMONX86 = 44\nCSIDL_COMMON_TEMPLATES = 45\nCSIDL_COMMON_DOCUMENTS = 46\nCSIDL_COMMON_ADMINTOOLS = 47\nCSIDL_ADMINTOOLS = 48\nCSIDL_CONNECTIONS = 49\nCSIDL_COMMON_MUSIC = 53\nCSIDL_COMMON_PICTURES = 54\nCSIDL_COMMON_VIDEO = 55\nCSIDL_RESOURCES = 56\nCSIDL_RESOURCES_LOCALIZED = 57\nCSIDL_COMMON_OEM_LINKS = 58\nCSIDL_CDBURN_AREA = 59\n# 60 unused\nCSIDL_COMPUTERSNEARME = 61\n\nBIF_RETURNONLYFSDIRS = 1\nBIF_DONTGOBELOWDOMAIN = 2\nBIF_STATUSTEXT = 4\nBIF_RETURNFSANCESTORS = 8\nBIF_EDITBOX = 16\nBIF_VALIDATE = 32\nBIF_BROWSEFORCOMPUTER = 4096\nBIF_BROWSEFORPRINTER = 8192\nBIF_BROWSEINCLUDEFILES = 16384\nBFFM_INITIALIZED = 1\nBFFM_SELCHANGED = 2\nBFFM_VALIDATEFAILEDA = 3\nBFFM_VALIDATEFAILEDW = 4\nBFFM_SETSTATUSTEXTA = (WM_USER + 100)\nBFFM_ENABLEOK = (WM_USER + 101)\nBFFM_SETSELECTIONA = (WM_USER + 102)\nBFFM_SETSELECTIONW = (WM_USER + 103)\nBFFM_SETSTATUSTEXTW = (WM_USER + 104)\nBFFM_SETSTATUSTEXT = BFFM_SETSTATUSTEXTW\nBFFM_SETSELECTION = BFFM_SETSELECTIONW\nBFFM_VALIDATEFAILED = BFFM_VALIDATEFAILEDW\nBFFM_SETSTATUSTEXT = BFFM_SETSTATUSTEXTA\nBFFM_SETSELECTION = BFFM_SETSELECTIONA\nBFFM_VALIDATEFAILED = BFFM_VALIDATEFAILEDA\nSFGAO_CANCOPY = DROPEFFECT_COPY\nSFGAO_CANMOVE = DROPEFFECT_MOVE\nSFGAO_CANLINK = DROPEFFECT_LINK\nSFGAO_CANRENAME = 16\nSFGAO_CANDELETE = 32\nSFGAO_HASPROPSHEET = 64\nSFGAO_DROPTARGET = 256\nSFGAO_CAPABILITYMASK = 375\nSFGAO_LINK = 65536\nSFGAO_SHARE = 131072\nSFGAO_READONLY = 262144\nSFGAO_GHOSTED = 524288\nSFGAO_HIDDEN = 524288\nSFGAO_DISPLAYATTRMASK = 983040\nSFGAO_FILESYSANCESTOR = 268435456\nSFGAO_FOLDER = 536870912\nSFGAO_FILESYSTEM = 1073741824\nSFGAO_HASSUBFOLDER = (-2147483648)\nSFGAO_CONTENTSMASK = (-2147483648)\nSFGAO_VALIDATE = 16777216\nSFGAO_REMOVABLE = 33554432\nSFGAO_COMPRESSED = 67108864\nSFGAO_BROWSABLE = 134217728\nSFGAO_NONENUMERATED = 1048576\nSFGAO_NEWCONTENT = 2097152\nSFGAO_STORAGE = 8\nDWFRF_NORMAL = 0\nDWFRF_DELETECONFIGDATA = 1\nDWFAF_HIDDEN = 1\nDBIM_MINSIZE = 1\nDBIM_MAXSIZE = 2\nDBIM_INTEGRAL = 4\nDBIM_ACTUAL = 8\nDBIM_TITLE = 16\nDBIM_MODEFLAGS = 32\nDBIM_BKCOLOR = 64\nDBIMF_NORMAL = 0\nDBIMF_VARIABLEHEIGHT = 8\nDBIMF_DEBOSSED = 32\nDBIMF_BKCOLOR = 64\nDBIF_VIEWMODE_NORMAL = 0\nDBIF_VIEWMODE_VERTICAL = 1\nDBIF_VIEWMODE_FLOATING = 2\nDBIF_VIEWMODE_TRANSPARENT = 4\nCOMPONENT_TOP = (2147483647)\nCOMP_TYPE_HTMLDOC = 0\nCOMP_TYPE_PICTURE = 1\nCOMP_TYPE_WEBSITE = 2\nCOMP_TYPE_CONTROL = 3\nCOMP_TYPE_CFHTML = 4\nCOMP_TYPE_MAX = 4\nAD_APPLY_SAVE = 1\nAD_APPLY_HTMLGEN = 2\nAD_APPLY_REFRESH = 4\nAD_APPLY_ALL = (AD_APPLY_SAVE | AD_APPLY_HTMLGEN | AD_APPLY_REFRESH)\nAD_APPLY_FORCE = 8\nAD_APPLY_BUFFERED_REFRESH = 16\nWPSTYLE_CENTER = 0\nWPSTYLE_TILE = 1\nWPSTYLE_STRETCH = 2\nWPSTYLE_MAX = 3\nCOMP_ELEM_TYPE = 1\nCOMP_ELEM_CHECKED = 2\nCOMP_ELEM_DIRTY = 4\nCOMP_ELEM_NOSCROLL = 8\nCOMP_ELEM_POS_LEFT = 16\nCOMP_ELEM_POS_TOP = 32\nCOMP_ELEM_SIZE_WIDTH = 64\nCOMP_ELEM_SIZE_HEIGHT = 128\nCOMP_ELEM_POS_ZINDEX = 256\nCOMP_ELEM_SOURCE = 512\nCOMP_ELEM_FRIENDLYNAME = 1024\nCOMP_ELEM_SUBSCRIBEDURL = 2048\nADDURL_SILENT = 0X0001\nCFSTR_SHELLIDLIST = \"Shell IDList Array\"\nCFSTR_SHELLIDLISTOFFSET = \"Shell Object Offsets\"\nCFSTR_NETRESOURCES = \"Net Resource\"\nCFSTR_FILEDESCRIPTORA = \"FileGroupDescriptor\"\nCFSTR_FILEDESCRIPTORW = \"FileGroupDescriptorW\"\nCFSTR_FILECONTENTS = \"FileContents\"\nCFSTR_FILENAMEA = \"FileName\"\nCFSTR_FILENAMEW = \"FileNameW\"\nCFSTR_PRINTERGROUP = \"PrinterFriendlyName\"\nCFSTR_FILENAMEMAPA = \"FileNameMap\"\nCFSTR_FILENAMEMAPW = \"FileNameMapW\"\nCFSTR_SHELLURL = \"UniformResourceLocator\"\nCFSTR_INETURLA = CFSTR_SHELLURL\nCFSTR_INETURLW = \"UniformResourceLocatorW\"\nCFSTR_PREFERREDDROPEFFECT = \"Preferred DropEffect\"\nCFSTR_PERFORMEDDROPEFFECT = \"Performed DropEffect\"\nCFSTR_PASTESUCCEEDED = \"Paste Succeeded\"\nCFSTR_INDRAGLOOP = \"InShellDragLoop\"\nCFSTR_DRAGCONTEXT = \"DragContext\"\nCFSTR_MOUNTEDVOLUME = \"MountedVolume\"\nCFSTR_PERSISTEDDATAOBJECT = \"PersistedDataObject\"\nCFSTR_TARGETCLSID = \"TargetCLSID\"\nCFSTR_LOGICALPERFORMEDDROPEFFECT = \"Logical Performed DropEffect\"\nCFSTR_AUTOPLAY_SHELLIDLISTS = \"Autoplay Enumerated IDList Array\"\nCFSTR_FILEDESCRIPTOR = CFSTR_FILEDESCRIPTORW\nCFSTR_FILENAME = CFSTR_FILENAMEW\nCFSTR_FILENAMEMAP = CFSTR_FILENAMEMAPW\nCFSTR_FILEDESCRIPTOR = CFSTR_FILEDESCRIPTORA\nCFSTR_FILENAME = CFSTR_FILENAMEA\nCFSTR_FILENAMEMAP = CFSTR_FILENAMEMAPA\nDVASPECT_SHORTNAME = 2\nSHCNE_RENAMEITEM = 1\nSHCNE_CREATE = 2\nSHCNE_DELETE = 4\nSHCNE_MKDIR = 8\nSHCNE_RMDIR = 16\nSHCNE_MEDIAINSERTED = 32\nSHCNE_MEDIAREMOVED = 64\nSHCNE_DRIVEREMOVED = 128\nSHCNE_DRIVEADD = 256\nSHCNE_NETSHARE = 512\nSHCNE_NETUNSHARE = 1024\nSHCNE_ATTRIBUTES = 2048\nSHCNE_UPDATEDIR = 4096\nSHCNE_UPDATEITEM = 8192\nSHCNE_SERVERDISCONNECT = 16384\nSHCNE_UPDATEIMAGE = 32768\nSHCNE_DRIVEADDGUI = 65536\nSHCNE_RENAMEFOLDER = 131072\nSHCNE_FREESPACE = 262144\nSHCNE_EXTENDED_EVENT = 67108864\nSHCNE_ASSOCCHANGED = 134217728\nSHCNE_DISKEVENTS = 145439\nSHCNE_GLOBALEVENTS = 201687520\nSHCNE_ALLEVENTS = 2147483647\nSHCNE_INTERRUPT = -2147483648\nSHCNEE_ORDERCHANGED = 2\nSHCNF_IDLIST = 0\nSHCNF_PATHA = 1\nSHCNF_PRINTERA = 2\nSHCNF_DWORD = 3\nSHCNF_PATHW = 5\nSHCNF_PRINTERW = 6\nSHCNF_TYPE = 255\nSHCNF_FLUSH = 4096\nSHCNF_FLUSHNOWAIT = 8192\nSHCNF_PATH = SHCNF_PATHW\nSHCNF_PRINTER = SHCNF_PRINTERW\nSHCNF_PATH = SHCNF_PATHA\nSHCNF_PRINTER = SHCNF_PRINTERA\nQIF_CACHED = 1\nQIF_DONTEXPANDFOLDER = 2\n\n# SHARD enum for SHAddToRecentDocs\nSHARD_PIDL = 1\nSHARD_PATHA = 2\nSHARD_PATHW = 3\nSHARD_APPIDINFO = 4\nSHARD_APPIDINFOIDLIST = 5\nSHARD_LINK = 6\nSHARD_APPIDINFOLINK = 7\nSHARD_SHELLITEM = 8\n## SHARD_PATH = SHARD_PATHW\nSHARD_PATH = SHARD_PATHA\n\nSHGDFIL_FINDDATA = 1\nSHGDFIL_NETRESOURCE = 2\nSHGDFIL_DESCRIPTIONID = 3\nSHDID_ROOT_REGITEM = 1\nSHDID_FS_FILE = 2\nSHDID_FS_DIRECTORY = 3\nSHDID_FS_OTHER = 4\nSHDID_COMPUTER_DRIVE35 = 5\nSHDID_COMPUTER_DRIVE525 = 6\nSHDID_COMPUTER_REMOVABLE = 7\nSHDID_COMPUTER_FIXED = 8\nSHDID_COMPUTER_NETDRIVE = 9\nSHDID_COMPUTER_CDROM = 10\nSHDID_COMPUTER_RAMDISK = 11\nSHDID_COMPUTER_OTHER = 12\nSHDID_NET_DOMAIN = 13\nSHDID_NET_SERVER = 14\nSHDID_NET_SHARE = 15\nSHDID_NET_RESTOFNET = 16\nSHDID_NET_OTHER = 17\nPID_IS_URL = 2\nPID_IS_NAME = 4\nPID_IS_WORKINGDIR = 5\nPID_IS_HOTKEY = 6\nPID_IS_SHOWCMD = 7\nPID_IS_ICONINDEX = 8\nPID_IS_ICONFILE = 9\nPID_IS_WHATSNEW = 10\nPID_IS_AUTHOR = 11\nPID_IS_DESCRIPTION = 12\nPID_IS_COMMENT = 13\nPID_INTSITE_WHATSNEW = 2\nPID_INTSITE_AUTHOR = 3\nPID_INTSITE_LASTVISIT = 4\nPID_INTSITE_LASTMOD = 5\nPID_INTSITE_VISITCOUNT = 6\nPID_INTSITE_DESCRIPTION = 7\nPID_INTSITE_COMMENT = 8\nPID_INTSITE_FLAGS = 9\nPID_INTSITE_CONTENTLEN = 10\nPID_INTSITE_CONTENTCODE = 11\nPID_INTSITE_RECURSE = 12\nPID_INTSITE_WATCH = 13\nPID_INTSITE_SUBSCRIPTION = 14\nPID_INTSITE_URL = 15\nPID_INTSITE_TITLE = 16\nPID_INTSITE_CODEPAGE = 18\nPID_INTSITE_TRACKING = 19\nPIDISF_RECENTLYCHANGED = 1\nPIDISF_CACHEDSTICKY = 2\nPIDISF_CACHEIMAGES = 16\nPIDISF_FOLLOWALLLINKS = 32\nPIDISM_GLOBAL = 0\nPIDISM_WATCH = 1\nPIDISM_DONTWATCH = 2\nSSF_SHOWALLOBJECTS = 1\nSSF_SHOWEXTENSIONS = 2\nSSF_SHOWCOMPCOLOR = 8\nSSF_SHOWSYSFILES = 32\nSSF_DOUBLECLICKINWEBVIEW = 128\nSSF_SHOWATTRIBCOL = 256\nSSF_DESKTOPHTML = 512\nSSF_WIN95CLASSIC = 1024\nSSF_DONTPRETTYPATH = 2048\nSSF_SHOWINFOTIP = 8192\nSSF_MAPNETDRVBUTTON = 4096\nSSF_NOCONFIRMRECYCLE = 32768\nSSF_HIDEICONS = 16384\n\nABM_NEW = 0\nABM_REMOVE = 1\nABM_QUERYPOS = 2\nABM_SETPOS = 3\nABM_GETSTATE = 4\nABM_GETTASKBARPOS = 5\nABM_ACTIVATE = 6\nABM_GETAUTOHIDEBAR = 7\nABM_SETAUTOHIDEBAR = 8\nABM_WINDOWPOSCHANGED = 9\nABN_STATECHANGE = 0\nABN_POSCHANGED = 1\nABN_FULLSCREENAPP = 2\nABN_WINDOWARRANGE = 3\nABS_AUTOHIDE = 1\nABS_ALWAYSONTOP = 2\nABE_LEFT = 0\nABE_TOP = 1\nABE_RIGHT = 2\nABE_BOTTOM = 3\n\n# Some manually added ones\nCSIDL_COMMON_APPDATA = 35\nCSIDL_LOCAL_APPDATA = 28\n\nSHCONTF_FOLDERS = 32 # for shell browser\nSHCONTF_NONFOLDERS = 64 # for default view\nSHCONTF_INCLUDEHIDDEN = 128 # for hidden/system objects\nSHCONTF_INIT_ON_FIRST_NEXT = 256\nSHCONTF_NETPRINTERSRCH = 512\nSHCONTF_SHAREABLE = 1024\nSHCONTF_STORAGE = 2048\n\nSHGDN_NORMAL = 0 # default (display purpose)\nSHGDN_INFOLDER = 1 # displayed under a folder (relative)\nSHGDN_FOREDITING = 4096 # for in-place editing\nSHGDN_INCLUDE_NONFILESYS = 8192 # if not set, display names for shell name space items that are not in the file system will fail.\nSHGDN_FORADDRESSBAR = 16384 # for displaying in the address (drives dropdown) bar\nSHGDN_FORPARSING = 32768 # for ParseDisplayName or path\n\nSHCONTF_FOLDERS = 32 # for shell browser\nSHCONTF_NONFOLDERS = 64 # for default view\nSHCONTF_INCLUDEHIDDEN = 128 # for hidden/system objects\n\nBFO_NONE\t= 0\nBFO_BROWSER_PERSIST_SETTINGS\t= 1\nBFO_RENAME_FOLDER_OPTIONS_TOINTERNET\t= 2\nBFO_BOTH_OPTIONS\t= 4\nBIF_PREFER_INTERNET_SHORTCUT\t= 8\nBFO_BROWSE_NO_IN_NEW_PROCESS\t= 16\nBFO_ENABLE_HYPERLINK_TRACKING\t= 32\nBFO_USE_IE_OFFLINE_SUPPORT\t= 64\nBFO_SUBSTITUE_INTERNET_START_PAGE\t= 128\nBFO_USE_IE_LOGOBANDING\t= 256\nBFO_ADD_IE_TOCAPTIONBAR\t= 512\nBFO_USE_DIALUP_REF\t= 1024\nBFO_USE_IE_TOOLBAR\t= 2048\nBFO_NO_PARENT_FOLDER_SUPPORT\t= 4096\nBFO_NO_REOPEN_NEXT_RESTART\t= 8192\nBFO_GO_HOME_PAGE\t= 16384\nBFO_PREFER_IEPROCESS\t= 32768\nBFO_SHOW_NAVIGATION_CANCELLED\t= 65536\nBFO_QUERY_ALL\t= -1\n# From ShlGuid.h\nPID_FINDDATA = 0\nPID_NETRESOURCE = 1\nPID_DESCRIPTIONID = 2\nPID_WHICHFOLDER = 3\nPID_NETWORKLOCATION = 4\nPID_COMPUTERNAME = 5\nPID_DISPLACED_FROM = 2\nPID_DISPLACED_DATE = 3\nPID_SYNC_COPY_IN = 2\nPID_MISC_STATUS = 2\nPID_MISC_ACCESSCOUNT = 3\nPID_MISC_OWNER = 4\nPID_HTMLINFOTIPFILE = 5\nPID_MISC_PICS = 6\nPID_DISPLAY_PROPERTIES = 0\nPID_INTROTEXT = 1\nPIDSI_ARTIST = 2\nPIDSI_SONGTITLE = 3\nPIDSI_ALBUM = 4\nPIDSI_YEAR = 5\nPIDSI_COMMENT = 6\nPIDSI_TRACK = 7\nPIDSI_GENRE = 11\nPIDSI_LYRICS = 12\nPIDDRSI_PROTECTED = 2\nPIDDRSI_DESCRIPTION = 3\nPIDDRSI_PLAYCOUNT = 4\nPIDDRSI_PLAYSTARTS = 5\nPIDDRSI_PLAYEXPIRES = 6\nPIDVSI_STREAM_NAME = 2\nPIDVSI_FRAME_WIDTH = 3\nPIDVSI_FRAME_HEIGHT = 4\nPIDVSI_TIMELENGTH = 7\nPIDVSI_FRAME_COUNT = 5\nPIDVSI_FRAME_RATE = 6\nPIDVSI_DATA_RATE = 8\nPIDVSI_SAMPLE_SIZE = 9\nPIDVSI_COMPRESSION = 10\nPIDVSI_STREAM_NUMBER = 11\nPIDASI_FORMAT = 2\nPIDASI_TIMELENGTH = 3\nPIDASI_AVG_DATA_RATE = 4\nPIDASI_SAMPLE_RATE = 5\nPIDASI_SAMPLE_SIZE = 6\nPIDASI_CHANNEL_COUNT = 7\nPIDASI_STREAM_NUMBER = 8\nPIDASI_STREAM_NAME = 9\nPIDASI_COMPRESSION = 10\nPID_CONTROLPANEL_CATEGORY = 2\nPID_VOLUME_FREE = 2\nPID_VOLUME_CAPACITY = 3\nPID_VOLUME_FILESYSTEM = 4\nPID_SHARE_CSC_STATUS = 2\nPID_LINK_TARGET = 2\nPID_QUERY_RANK = 2\n# From PropIdl.h\nPROPSETFLAG_DEFAULT = ( 0 )\nPROPSETFLAG_NONSIMPLE = ( 1 )\nPROPSETFLAG_ANSI = ( 2 )\nPROPSETFLAG_UNBUFFERED = ( 4 )\nPROPSETFLAG_CASE_SENSITIVE = ( 8 )\nPROPSET_BEHAVIOR_CASE_SENSITIVE = ( 1 )\nPID_DICTIONARY = ( 0 )\nPID_CODEPAGE = ( 1 )\nPID_FIRST_USABLE = ( 2 )\nPID_FIRST_NAME_DEFAULT = ( 4095 )\nPID_LOCALE = ( (-2147483648) )\nPID_MODIFY_TIME = ( (-2147483647) )\nPID_SECURITY = ( (-2147483646) )\nPID_BEHAVIOR = ( (-2147483645) )\nPID_ILLEGAL = ( (-1) )\nPID_MIN_READONLY = ( (-2147483648) )\nPID_MAX_READONLY = ( (-1073741825) )\nPIDDI_THUMBNAIL = 2\nPIDSI_TITLE = 2\nPIDSI_SUBJECT = 3\nPIDSI_AUTHOR = 4\nPIDSI_KEYWORDS = 5\nPIDSI_COMMENTS = 6\nPIDSI_TEMPLATE = 7\nPIDSI_LASTAUTHOR = 8\nPIDSI_REVNUMBER = 9\nPIDSI_EDITTIME = 10\nPIDSI_LASTPRINTED = 11\nPIDSI_CREATE_DTM = 12\nPIDSI_LASTSAVE_DTM = 13\nPIDSI_PAGECOUNT = 14\nPIDSI_WORDCOUNT = 15\nPIDSI_CHARCOUNT = 16\nPIDSI_THUMBNAIL = 17\nPIDSI_APPNAME = 18\nPIDSI_DOC_SECURITY = 19\nPIDDSI_CATEGORY = 2\nPIDDSI_PRESFORMAT = 3\nPIDDSI_BYTECOUNT = 4\nPIDDSI_LINECOUNT = 5\nPIDDSI_PARCOUNT = 6\nPIDDSI_SLIDECOUNT = 7\nPIDDSI_NOTECOUNT = 8\nPIDDSI_HIDDENCOUNT = 9\nPIDDSI_MMCLIPCOUNT = 10\nPIDDSI_SCALE = 11\nPIDDSI_HEADINGPAIR = 12\nPIDDSI_DOCPARTS = 13\nPIDDSI_MANAGER = 14\nPIDDSI_COMPANY = 15\nPIDDSI_LINKSDIRTY = 16\nPIDMSI_EDITOR = 2\nPIDMSI_SUPPLIER = 3\nPIDMSI_SOURCE = 4\nPIDMSI_SEQUENCE_NO = 5\nPIDMSI_PROJECT = 6\nPIDMSI_STATUS = 7\nPIDMSI_OWNER = 8\nPIDMSI_RATING = 9\nPIDMSI_PRODUCTION = 10\nPIDMSI_COPYRIGHT = 11\nPRSPEC_INVALID = ( (-1) )\nPRSPEC_LPWSTR = ( 0 )\nPRSPEC_PROPID = ( 1 )\n# From ShObjIdl.h\nSHCIDS_ALLFIELDS = (-2147483648)\nSHCIDS_CANONICALONLY = 268435456\nSHCIDS_BITMASK = (-65536)\nSHCIDS_COLUMNMASK = 65535\nSFGAO_CANMONIKER = 4194304\nSFGAO_HASSTORAGE = 4194304\nSFGAO_STREAM = 4194304\nSFGAO_STORAGEANCESTOR = 8388608\nSFGAO_STORAGECAPMASK = 1891958792\n\nMAXPROPPAGES = 100\nPSP_DEFAULT = 0\nPSP_DLGINDIRECT = 1\nPSP_USEHICON = 2\nPSP_USEICONID = 4\nPSP_USETITLE = 8\nPSP_RTLREADING = 16\nPSP_HASHELP = 32\nPSP_USEREFPARENT = 64\nPSP_USECALLBACK = 128\nPSP_PREMATURE = 1024\nPSP_HIDEHEADER = 2048\nPSP_USEHEADERTITLE = 4096\nPSP_USEHEADERSUBTITLE = 8192\nPSP_USEFUSIONCONTEXT = 16384\nPSPCB_ADDREF = 0\nPSPCB_RELEASE = 1\nPSPCB_CREATE = 2\n\nPSH_DEFAULT = 0\nPSH_PROPTITLE = 1\nPSH_USEHICON = 2\nPSH_USEICONID = 4\nPSH_PROPSHEETPAGE = 8\nPSH_WIZARDHASFINISH = 16\nPSH_WIZARD = 32\nPSH_USEPSTARTPAGE = 64\nPSH_NOAPPLYNOW = 128\nPSH_USECALLBACK = 256\nPSH_HASHELP = 512\nPSH_MODELESS = 1024\nPSH_RTLREADING = 2048\nPSH_WIZARDCONTEXTHELP = 4096\nPSH_WIZARD97 = 8192\nPSH_WIZARD97 = 16777216\nPSH_WATERMARK = 32768\nPSH_USEHBMWATERMARK = 65536\nPSH_USEHPLWATERMARK = 131072\nPSH_STRETCHWATERMARK = 262144\nPSH_HEADER = 524288\nPSH_USEHBMHEADER = 1048576\nPSH_USEPAGELANG = 2097152\nPSH_WIZARD_LITE = 4194304\nPSH_NOCONTEXTHELP = 33554432\n\nPSCB_INITIALIZED = 1\nPSCB_PRECREATE = 2\nPSCB_BUTTONPRESSED = 3\nPSNRET_NOERROR = 0\nPSNRET_INVALID = 1\nPSNRET_INVALID_NOCHANGEPAGE = 2\nPSNRET_MESSAGEHANDLED = 3\n\nPSWIZB_BACK = 1\nPSWIZB_NEXT = 2\nPSWIZB_FINISH = 4\nPSWIZB_DISABLEDFINISH = 8\nPSBTN_BACK = 0\nPSBTN_NEXT = 1\nPSBTN_FINISH = 2\nPSBTN_OK = 3\nPSBTN_APPLYNOW = 4\nPSBTN_CANCEL = 5\nPSBTN_HELP = 6\nPSBTN_MAX = 6\n\nID_PSRESTARTWINDOWS = 2\nID_PSREBOOTSYSTEM = (ID_PSRESTARTWINDOWS | 1)\nWIZ_CXDLG = 276\nWIZ_CYDLG = 140\nWIZ_CXBMP = 80\nWIZ_BODYX = 92\nWIZ_BODYCX = 184\nPROP_SM_CXDLG = 212\nPROP_SM_CYDLG = 188\nPROP_MED_CXDLG = 227\nPROP_MED_CYDLG = 215\nPROP_LG_CXDLG = 252\nPROP_LG_CYDLG = 218\nISOLATION_AWARE_USE_STATIC_LIBRARY = 0\nISOLATION_AWARE_BUILD_STATIC_LIBRARY = 0\n\nSHCOLSTATE_TYPE_STR\t= 1\nSHCOLSTATE_TYPE_INT\t= 2\nSHCOLSTATE_TYPE_DATE\t= 3\nSHCOLSTATE_TYPEMASK\t= 15\nSHCOLSTATE_ONBYDEFAULT\t= 16\nSHCOLSTATE_SLOW\t= 32\nSHCOLSTATE_EXTENDED\t= 64\nSHCOLSTATE_SECONDARYUI\t= 128\nSHCOLSTATE_HIDDEN\t= 256\nSHCOLSTATE_PREFER_VARCMP\t= 512\n\nFWF_AUTOARRANGE\t= 1\nFWF_ABBREVIATEDNAMES\t= 2\nFWF_SNAPTOGRID\t= 4\nFWF_OWNERDATA\t= 8\nFWF_BESTFITWINDOW\t= 16\nFWF_DESKTOP\t= 32\nFWF_SINGLESEL\t= 64\nFWF_NOSUBFOLDERS\t= 128\nFWF_TRANSPARENT\t= 256\nFWF_NOCLIENTEDGE\t= 512\nFWF_NOSCROLL\t= 1024\nFWF_ALIGNLEFT\t= 2048\nFWF_NOICONS\t= 4096\nFWF_SHOWSELALWAYS\t= 8192\nFWF_NOVISIBLE\t= 16384\nFWF_SINGLECLICKACTIVATE\t= 32768\nFWF_NOWEBVIEW\t= 65536\nFWF_HIDEFILENAMES\t= 131072\nFWF_CHECKSELECT\t= 262144\n\nFVM_FIRST\t= 1\nFVM_ICON\t= 1\nFVM_SMALLICON\t= 2\nFVM_LIST\t= 3\nFVM_DETAILS\t= 4\nFVM_THUMBNAIL\t= 5\nFVM_TILE\t= 6\nFVM_THUMBSTRIP\t= 7\n\nSVUIA_DEACTIVATE\t= 0\nSVUIA_ACTIVATE_NOFOCUS\t= 1\nSVUIA_ACTIVATE_FOCUS\t= 2\nSVUIA_INPLACEACTIVATE\t= 3\n\n# SHChangeNotifyRegister flags\nSHCNRF_InterruptLevel = 1\nSHCNRF_ShellLevel = 2\nSHCNRF_RecursiveInterrupt = 4096\nSHCNRF_NewDelivery = 32768\n\nFD_CLSID = 0x0001\nFD_SIZEPOINT = 0x0002\nFD_ATTRIBUTES = 0x0004\nFD_CREATETIME = 0x0008\nFD_ACCESSTIME = 0x0010\nFD_WRITESTIME = 0x0020\nFD_FILESIZE = 0x0040\nFD_PROGRESSUI = 0x4000\nFD_LINKUI = 0x8000\n\n# shlwapi stuff\nASSOCF_INIT_NOREMAPCLSID = 0x00000001 # do not remap clsids to progids\nASSOCF_INIT_BYEXENAME = 0x00000002 # executable is being passed in\nASSOCF_OPEN_BYEXENAME = 0x00000002 # executable is being passed in\nASSOCF_INIT_DEFAULTTOSTAR = 0x00000004 # treat \"*\" as the BaseClass\nASSOCF_INIT_DEFAULTTOFOLDER = 0x00000008 # treat \"Folder\" as the BaseClass\nASSOCF_NOUSERSETTINGS = 0x00000010 # dont use HKCU\nASSOCF_NOTRUNCATE = 0x00000020 # dont truncate the return string\nASSOCF_VERIFY = 0x00000040 # verify data is accurate (DISK HITS)\nASSOCF_REMAPRUNDLL = 0x00000080 # actually gets info about rundlls target if applicable\nASSOCF_NOFIXUPS = 0x00000100 # attempt to fix errors if found\nASSOCF_IGNOREBASECLASS = 0x00000200 # dont recurse into the baseclass\n\nASSOCSTR_COMMAND = 1 # shell\\verb\\command string\nASSOCSTR_EXECUTABLE = 2 # the executable part of command string\nASSOCSTR_FRIENDLYDOCNAME = 3 # friendly name of the document type\nASSOCSTR_FRIENDLYAPPNAME = 4 # friendly name of executable\nASSOCSTR_NOOPEN = 5 # noopen value\nASSOCSTR_SHELLNEWVALUE = 6 # query values under the shellnew key\nASSOCSTR_DDECOMMAND = 7 # template for DDE commands\nASSOCSTR_DDEIFEXEC = 8 # DDECOMMAND to use if just create a process\nASSOCSTR_DDEAPPLICATION = 9 # Application name in DDE broadcast\nASSOCSTR_DDETOPIC = 10 # Topic Name in DDE broadcast\nASSOCSTR_INFOTIP = 11 # info tip for an item, or list of properties to create info tip from\nASSOCSTR_QUICKTIP = 12 # same as ASSOCSTR_INFOTIP, except, this list contains only quickly retrievable properties\nASSOCSTR_TILEINFO = 13 # similar to ASSOCSTR_INFOTIP - lists important properties for tileview\nASSOCSTR_CONTENTTYPE = 14 # MIME Content type\nASSOCSTR_DEFAULTICON = 15 # Default icon source\nASSOCSTR_SHELLEXTENSION = 16 # Guid string pointing to the Shellex\\Shellextensionhandler value.\n\nASSOCKEY_SHELLEXECCLASS = 1 # the key that should be passed to ShellExec(hkeyClass)\nASSOCKEY_APP = 2 # the \"Application\" key for the association\nASSOCKEY_CLASS = 3 # the progid or class key\nASSOCKEY_BASECLASS = 4 # the BaseClass key\n\nASSOCDATA_MSIDESCRIPTOR = 1 # Component Descriptor to pass to MSI APIs\nASSOCDATA_NOACTIVATEHANDLER = 2 # restrict attempts to activate window\nASSOCDATA_QUERYCLASSSTORE = 3 # should check with the NT Class Store\nASSOCDATA_HASPERUSERASSOC = 4 # defaults to user specified association\nASSOCDATA_EDITFLAGS = 5 # Edit flags.\nASSOCDATA_VALUE = 6 # use pszExtra as the Value name\n\n# flags used with SHGetViewStatePropertyBag\nSHGVSPB_PERUSER = 1\nSHGVSPB_ALLUSERS = 2\nSHGVSPB_PERFOLDER = 4\nSHGVSPB_ALLFOLDERS = 8\nSHGVSPB_INHERIT = 16\nSHGVSPB_ROAM = 32\nSHGVSPB_NOAUTODEFAULTS = 2147483648 # 0x80000000\nSHGVSPB_FOLDER = SHGVSPB_PERUSER | SHGVSPB_PERFOLDER\nSHGVSPB_FOLDERNODEFAULTS = SHGVSPB_PERUSER | SHGVSPB_PERFOLDER | SHGVSPB_NOAUTODEFAULTS\nSHGVSPB_USERDEFAULTS = SHGVSPB_PERUSER | SHGVSPB_ALLFOLDERS\nSHGVSPB_GLOBALDEAFAULTS = SHGVSPB_ALLUSERS | SHGVSPB_ALLFOLDERS\n\n# IDeskband and related\nDBIM_MINSIZE = 0x0001\nDBIM_MAXSIZE = 0x0002\nDBIM_INTEGRAL = 0x0004\nDBIM_ACTUAL = 0x0008\nDBIM_TITLE = 0x0010\nDBIM_MODEFLAGS = 0x0020\nDBIM_BKCOLOR = 0x0040\n\nDBIMF_NORMAL = 0x0000\nDBIMF_VARIABLEHEIGHT = 0x0008\nDBIMF_DEBOSSED = 0x0020\nDBIMF_BKCOLOR = 0x0040\n\nDBIF_VIEWMODE_NORMAL = 0x0000\nDBIF_VIEWMODE_VERTICAL = 0x0001\nDBIF_VIEWMODE_FLOATING = 0x0002\nDBIF_VIEWMODE_TRANSPARENT = 0x0004\n\n# Message types used with SHShellFolderView_Message\nSFVM_REARRANGE = 1\nSFVM_ADDOBJECT = 3\nSFVM_REMOVEOBJECT = 6\nSFVM_UPDATEOBJECT = 7\nSFVM_GETSELECTEDOBJECTS = 9\nSFVM_SETITEMPOS = 14\nSFVM_SETCLIPBOARD = 16\nSFVM_SETPOINTS = 23\n\n# SHELL_LINK_DATA_FLAGS enum, used with IShellLinkDatalist\nSLDF_HAS_ID_LIST = 1\nSLDF_HAS_LINK_INFO = 2\nSLDF_HAS_NAME = 4\nSLDF_HAS_RELPATH = 8\nSLDF_HAS_WORKINGDIR = 16\nSLDF_HAS_ARGS = 32\nSLDF_HAS_ICONLOCATION = 64\nSLDF_UNICODE = 128\nSLDF_FORCE_NO_LINKINFO = 256\nSLDF_HAS_EXP_SZ = 512\nSLDF_RUN_IN_SEPARATE = 1024\nSLDF_HAS_LOGO3ID = 2048\nSLDF_HAS_DARWINID = 4096\nSLDF_RUNAS_USER = 8192\nSLDF_NO_PIDL_ALIAS = 32768\nSLDF_FORCE_UNCNAME = 65536\nSLDF_HAS_EXP_ICON_SZ = 16384\nSLDF_RUN_WITH_SHIMLAYER = 131072\nSLDF_RESERVED = 2147483648\n\n# IShellLinkDataList data block signatures\nEXP_SPECIAL_FOLDER_SIG = 2684354565\nNT_CONSOLE_PROPS_SIG = 2684354562\nNT_FE_CONSOLE_PROPS_SIG = 2684354564\nEXP_DARWIN_ID_SIG = 2684354566\nEXP_LOGO3_ID_SIG = 2684354567\nEXP_SZ_ICON_SIG = 2684354567\nEXP_SZ_LINK_SIG = 2684354561\n\n# IURL_SETURL_FLAGS enum, used with PyIUniformResourceLocator.SetURL\nIURL_SETURL_FL_GUESS_PROTOCOL = 1\nIURL_SETURL_FL_USE_DEFAULT_PROTOCOL = 2\n\n# IURL_INVOKECOMMAND_FLAGS enum, used with PyIUniformResourceLocator.InvokeCommand\nIURL_INVOKECOMMAND_FL_ALLOW_UI = 1\nIURL_INVOKECOMMAND_FL_USE_DEFAULT_VERB = 2\nIURL_INVOKECOMMAND_FL_DDEWAIT = 4\n\n## constants used with IActiveDesktop\n# COMPONENT.ComponentType\nCOMP_TYPE_HTMLDOC = 0\nCOMP_TYPE_PICTURE = 1\nCOMP_TYPE_WEBSITE = 2\nCOMP_TYPE_CONTROL = 3\nCOMP_TYPE_CFHTML = 4\nCOMP_TYPE_MAX\t = 4\n# COMPONENT.CurItemState\nIS_NORMAL = 1\nIS_FULLSCREEN = 2\nIS_SPLIT = 4\nIS_VALIDSIZESTATEBITS = IS_NORMAL|IS_SPLIT|IS_FULLSCREEN\nIS_VALIDSTATEBITS = IS_NORMAL|IS_SPLIT|IS_FULLSCREEN|2147483648|1073741824 ## 0x80000000|0x40000000\n# IActiveDesktop.ApplyChanges Flags\nAD_APPLY_SAVE = 1\nAD_APPLY_HTMLGEN = 2\nAD_APPLY_REFRESH = 4\nAD_APPLY_ALL = AD_APPLY_SAVE|AD_APPLY_HTMLGEN|AD_APPLY_REFRESH\nAD_APPLY_FORCE = 8\nAD_APPLY_BUFFERED_REFRESH = 16\nAD_APPLY_DYNAMICREFRESH = 32\n# Wallpaper styles used with GetWallpaper and SetWallpaper\nWPSTYLE_CENTER = 0\nWPSTYLE_TILE = 1\nWPSTYLE_STRETCH = 2\nWPSTYLE_MAX = 3\n# ModifyDesktopItem flags\nCOMP_ELEM_TYPE = 1 ## 0x00000001\nCOMP_ELEM_CHECKED = 2 ## 0x00000002\nCOMP_ELEM_DIRTY = 4 ## 0x00000004\nCOMP_ELEM_NOSCROLL = 8 ## 0x00000008\nCOMP_ELEM_POS_LEFT = 16\t ## 0x00000010\nCOMP_ELEM_POS_TOP = 32 ## 0x00000020\nCOMP_ELEM_SIZE_WIDTH = 64 ## 0x00000040\nCOMP_ELEM_SIZE_HEIGHT = 128 ## 0x00000080\nCOMP_ELEM_POS_ZINDEX = 256 ## 0x00000100\nCOMP_ELEM_SOURCE = 512 ## 0x00000200\nCOMP_ELEM_FRIENDLYNAME = 1024 ## 0x00000400\nCOMP_ELEM_SUBSCRIBEDURL = 2048 ## 0x00000800\nCOMP_ELEM_ORIGINAL_CSI = 4096 ## 0x00001000\nCOMP_ELEM_RESTORED_CSI = 8192 ## 0x00002000\nCOMP_ELEM_CURITEMSTATE = 16384 ## 0x00004000\nCOMP_ELEM_ALL = COMP_ELEM_TYPE|COMP_ELEM_CHECKED|COMP_ELEM_DIRTY|COMP_ELEM_NOSCROLL|COMP_ELEM_POS_LEFT \\\n\t|COMP_ELEM_SIZE_WIDTH|COMP_ELEM_SIZE_HEIGHT|COMP_ELEM_POS_ZINDEX|COMP_ELEM_SOURCE \\\n\t|COMP_ELEM_FRIENDLYNAME|COMP_ELEM_POS_TOP|COMP_ELEM_SUBSCRIBEDURL|COMP_ELEM_ORIGINAL_CSI \\\n\t|COMP_ELEM_RESTORED_CSI|COMP_ELEM_CURITEMSTATE\n\nDTI_ADDUI_DEFAULT = 0\nDTI_ADDUI_DISPSUBWIZARD = 1\nDTI_ADDUI_POSITIONITEM = 2\nADDURL_SILENT = 1\nCOMPONENT_TOP = 1073741823 ## 0x3fffffff\nCOMPONENT_DEFAULT_LEFT = 65535 ## 0xFFFF\nCOMPONENT_DEFAULT_TOP = 65535 ## 0xFFFF\n\nSSM_CLEAR = 0\nSSM_SET = 1\nSSM_REFRESH = 2\nSSM_UPDATE = 4\n\nSCHEME_DISPLAY = 1 ##0x0001\nSCHEME_EDIT = 2 ##0x0002\nSCHEME_LOCAL = 4 ##0x0004\nSCHEME_GLOBAL = 8 ##0x0008\nSCHEME_REFRESH = 16 ##0x0010\nSCHEME_UPDATE = 32 ##0x0020\nSCHEME_DONOTUSE = 64 ##0x0040\nSCHEME_CREATE = 128 ##0x0080\n\nGADOF_DIRTY = 1\n\n# From EmptyVC.h\nEVCF_HASSETTINGS = 0x0001\nEVCF_ENABLEBYDEFAULT = 0x0002\nEVCF_REMOVEFROMLIST = 0x0004\nEVCF_ENABLEBYDEFAULT_AUTO = 0x0008\nEVCF_DONTSHOWIFZERO = 0x0010\nEVCF_SETTINGSMODE = 0x0020\nEVCF_OUTOFDISKSPACE = 0x0040\nEVCCBF_LASTNOTIFICATION = 0x0001\n\n# ShObjIdl.h IExplorer* related\nEBO_NONE\t= 0\nEBO_NAVIGATEONCE\t= 0x1\nEBO_SHOWFRAMES\t= 0x2\nEBO_ALWAYSNAVIGATE\t= 0x4\nEBO_NOTRAVELLOG\t= 0x8\nEBO_NOWRAPPERWINDOW\t= 0x10\nEBF_NONE\t= 0\nEBF_SELECTFROMDATAOBJECT\t= 0x100\nEBF_NODROPTARGET\t= 0x200\nECS_ENABLED\t= 0\nECS_DISABLED\t= 0x1\nECS_HIDDEN\t= 0x2\nECS_CHECKBOX\t= 0x4\nECS_CHECKED\t= 0x8\n\nECF_HASSUBCOMMANDS\t= 0x1\nECF_HASSPLITBUTTON\t= 0x2\nECF_HIDELABEL\t= 0x4\nECF_ISSEPARATOR\t= 0x8\nECF_HASLUASHIELD\t= 0x10\n\nSIATTRIBFLAGS_AND\t= 0x1\nSIATTRIBFLAGS_OR\t= 0x2\nSIATTRIBFLAGS_APPCOMPAT\t= 0x3\nSIATTRIBFLAGS_MASK\t= 0x3\n\nSIGDN_NORMALDISPLAY\t= 0\nSIGDN_PARENTRELATIVEPARSING\t= -2147385343 ## 0x80018001\nSIGDN_DESKTOPABSOLUTEPARSING\t= -2147319808 ## 0x80028000\nSIGDN_PARENTRELATIVEEDITING\t= -2147282943 ## 0x80031001\nSIGDN_DESKTOPABSOLUTEEDITING\t= -2147172352 ## 0x8004c000\nSIGDN_FILESYSPATH\t= -2147123200 ## 0x80058000\nSIGDN_URL\t= -2147057664 ## 0x80068000\nSIGDN_PARENTRELATIVEFORADDRESSBAR\t= -2146975743 ## 0x8007c001,\nSIGDN_PARENTRELATIVE\t= -2146959359 ## 0x80080001\n\nSICHINT_DISPLAY\t= 0,\nSICHINT_ALLFIELDS\t= -2147483648 ## 0x80000000\nSICHINT_CANONICAL\t= 0x10000000\n\nASSOCCLASS_SHELL_KEY = 0\nASSOCCLASS_PROGID_KEY = 1 # hkeyClass\nASSOCCLASS_PROGID_STR = 2 # pszClass (HKCR\\pszClass)\nASSOCCLASS_CLSID_KEY = 3 # hkeyClass\nASSOCCLASS_CLSID_STR = 4 # pszClass (HKCR\\CLSID\\pszClass)\nASSOCCLASS_APP_KEY = 5 # hkeyClass\nASSOCCLASS_APP_STR = 6 # pszClass (HKCR\\Applications\\PathFindFileName(pszClass))\nASSOCCLASS_SYSTEM_STR = 7 # pszClass\nASSOCCLASS_FOLDER = 8 # none\nASSOCCLASS_STAR = 9 # none\n\nNSTCS_HASEXPANDOS\t= 0x1\nNSTCS_HASLINES\t= 0x2\nNSTCS_SINGLECLICKEXPAND\t= 0x4\nNSTCS_FULLROWSELECT\t= 0x8\nNSTCS_SPRINGEXPAND\t= 0x10\nNSTCS_HORIZONTALSCROLL\t= 0x20\nNSTCS_ROOTHASEXPANDO\t= 0x40\nNSTCS_SHOWSELECTIONALWAYS\t= 0x80\nNSTCS_NOINFOTIP\t= 0x200\nNSTCS_EVENHEIGHT\t= 0x400\nNSTCS_NOREPLACEOPEN\t= 0x800\nNSTCS_DISABLEDRAGDROP\t= 0x1000\nNSTCS_NOORDERSTREAM\t= 0x2000\nNSTCS_RICHTOOLTIP\t= 0x4000\nNSTCS_BORDER\t= 0x8000\nNSTCS_NOEDITLABELS\t= 0x10000\nNSTCS_TABSTOP\t= 0x20000\nNSTCS_FAVORITESMODE\t= 0x80000\nNSTCS_AUTOHSCROLL\t= 0x100000\nNSTCS_FADEINOUTEXPANDOS\t= 0x200000\nNSTCS_EMPTYTEXT\t= 0x400000\nNSTCS_CHECKBOXES\t= 0x800000\nNSTCS_PARTIALCHECKBOXES\t= 0x1000000\nNSTCS_EXCLUSIONCHECKBOXES\t= 0x2000000\nNSTCS_DIMMEDCHECKBOXES\t= 0x4000000\nNSTCS_NOINDENTCHECKS\t= 0x8000000\nNSTCS_ALLOWJUNCTIONS\t= 0x10000000\nNSTCS_SHOWTABSBUTTON\t= 0x20000000\nNSTCS_SHOWDELETEBUTTON\t= 0x40000000\nNSTCS_SHOWREFRESHBUTTON\t= -2147483648 # 0x80000000\n\nNSTCRS_VISIBLE\t= 0\nNSTCRS_HIDDEN\t= 0x1\nNSTCRS_EXPANDED\t= 0x2\nNSTCIS_NONE\t= 0\nNSTCIS_SELECTED\t= 0x1\nNSTCIS_EXPANDED\t= 0x2\nNSTCIS_BOLD\t= 0x4\nNSTCIS_DISABLED\t= 0x8\nNSTCGNI_NEXT\t= 0\nNSTCGNI_NEXTVISIBLE\t= 0x1\nNSTCGNI_PREV\t= 0x2\nNSTCGNI_PREVVISIBLE\t= 0x3\nNSTCGNI_PARENT\t= 0x4\nNSTCGNI_CHILD\t= 0x5\nNSTCGNI_FIRSTVISIBLE\t= 0x6\nNSTCGNI_LASTVISIBLE\t= 0x7\n\nCLSID_ExplorerBrowser = \"{71f96385-ddd6-48d3-a0c1-ae06e8b055fb}\"\n\n# Names of the methods of many shell interfaces; used by implementation of\n# the interfaces.\nIBrowserFrame_Methods = [\"GetFrameOptions\"]\nICategorizer_Methods = [\"GetDescription\", \"GetCategory\",\n \"GetCategoryInfo\", \"CompareCategory\"]\nICategoryProvider_Methods = [\"CanCategorizeOnSCID\", \"GetDefaultCategory\",\n \"GetCategoryForSCID\", \"EnumCategories\",\n \"GetCategoryName\", \"CreateCategory\"]\nIContextMenu_Methods = [\"QueryContextMenu\", \"InvokeCommand\", \"GetCommandString\"]\nIExplorerCommand_Methods = [\"GetTitle\", \"GetIcon\", \"GetToolTip\",\n \"GetCanonicalName\", \"GetState\", \"Invoke\",\n \"GetFlags\", \"EnumSubCommands\"]\nIExplorerCommandProvider_Methods = [\"GetCommand\", \"GetCommands\"]\nIOleWindow_Methods = [\"GetWindow\", \"ContextSensitiveHelp\"] # XXX - this should be somewhere in win32com\nIPersist_Methods = [\"GetClassID\"]\nIPersistFolder_Methods = IPersist_Methods + [\"Initialize\"]\nIPersistFolder2_Methods = IPersistFolder_Methods + [\"GetCurFolder\"]\nIShellExtInit_Methods = [\"Initialize\"]\nIShellView_Methods = IOleWindow_Methods + \\\n [\"TranslateAccelerator\", \"EnableModeless\", \"UIActivate\",\n \"Refresh\", \"CreateViewWindow\", \"DestroyViewWindow\",\n \"GetCurrentInfo\", \"AddPropertySheetPages\",\n \"SaveViewState\", \"SelectItem\", \"GetItemObject\"]\n\nIShellFolder_Methods = [\"ParseDisplayName\", \"EnumObjects\", \"BindToObject\",\n \"BindToStorage\", \"CompareIDs\", \"CreateViewObject\",\n \"GetAttributesOf\", \"GetUIObjectOf\",\n \"GetDisplayNameOf\", \"SetNameOf\"]\nIShellFolder2_Methods = IShellFolder_Methods + \\\n [\"GetDefaultSearchGUID\", \"EnumSearches\",\n \"GetDefaultColumn\", \"GetDefaultColumnState\",\n \"GetDetailsEx\", \"GetDetailsOf\", \"MapColumnToSCID\"]\n\n## enum GETPROPERTYSTOREFLAGS, used with IShellItem2 methods\nGPS_DEFAULT\t= 0\nGPS_HANDLERPROPERTIESONLY = 0x1\nGPS_READWRITE = 0x2\nGPS_TEMPORARY = 0x4\nGPS_FASTPROPERTIESONLY = 0x8\nGPS_OPENSLOWITEM = 0x10\nGPS_DELAYCREATION = 0x20\nGPS_BESTEFFORT = 0x40\nGPS_MASK_VALID = 0x7f\n\n## Bind context parameter names, used with IBindCtx::RegisterObjectParam\nSTR_AVOID_DRIVE_RESTRICTION_POLICY = \"Avoid Drive Restriction Policy\"\nSTR_BIND_DELEGATE_CREATE_OBJECT = \"Delegate Object Creation\"\nSTR_BIND_FOLDERS_READ_ONLY = \"Folders As Read Only\"\nSTR_BIND_FOLDER_ENUM_MODE = \"Folder Enum Mode\"\nSTR_BIND_FORCE_FOLDER_SHORTCUT_RESOLVE = \"Force Folder Shortcut Resolve\"\nSTR_DONT_PARSE_RELATIVE = \"Don't Parse Relative\"\nSTR_DONT_RESOLVE_LINK = \"Don't Resolve Link\"\n## STR_ENUM_ITEMS_FLAGS\nSTR_FILE_SYS_BIND_DATA = \"File System Bind Data\"\nSTR_GET_ASYNC_HANDLER = \"GetAsyncHandler\"\nSTR_GPS_BESTEFFORT = \"GPS_BESTEFFORT\"\nSTR_GPS_DELAYCREATION = \"GPS_DELAYCREATION\"\nSTR_GPS_FASTPROPERTIESONLY = \"GPS_FASTPROPERTIESONLY\"\nSTR_GPS_HANDLERPROPERTIESONLY = \"GPS_HANDLERPROPERTIESONLY\"\nSTR_GPS_NO_OPLOCK = \"GPS_NO_OPLOCK\"\nSTR_GPS_OPENSLOWITEM = \"GPS_OPENSLOWITEM\"\nSTR_IFILTER_FORCE_TEXT_FILTER_FALLBACK = \"Always bind persistent handlers\"\nSTR_IFILTER_LOAD_DEFINED_FILTER = \"Only bind registered persistent handlers\"\nSTR_INTERNAL_NAVIGATE = \"Internal Navigation\"\nSTR_INTERNETFOLDER_PARSE_ONLY_URLMON_BINDABLE = \"Validate URL\"\nSTR_ITEM_CACHE_CONTEXT = \"ItemCacheContext\"\nSTR_NO_VALIDATE_FILENAME_CHARS = \"NoValidateFilenameChars\"\nSTR_PARSE_ALLOW_INTERNET_SHELL_FOLDERS = \"Allow binding to Internet shell folder handlers and negate STR_PARSE_PREFER_WEB_BROWSING\"\nSTR_PARSE_AND_CREATE_ITEM = \"ParseAndCreateItem\"\nSTR_PARSE_DONT_REQUIRE_VALIDATED_URLS = \"Do not require validated URLs\"\nSTR_PARSE_EXPLICIT_ASSOCIATION_SUCCESSFUL = \"ExplicitAssociationSuccessful\"\nSTR_PARSE_PARTIAL_IDLIST = \"ParseOriginalItem\"\nSTR_PARSE_PREFER_FOLDER_BROWSING = \"Parse Prefer Folder Browsing\"\nSTR_PARSE_PREFER_WEB_BROWSING = \"Do not bind to Internet shell folder handlers\"\nSTR_PARSE_PROPERTYSTORE = \"DelegateNamedProperties\"\nSTR_PARSE_SHELL_PROTOCOL_TO_FILE_OBJECTS = \"Parse Shell Protocol To File Objects\"\nSTR_PARSE_SHOW_NET_DIAGNOSTICS_UI = \"Show network diagnostics UI\"\nSTR_PARSE_SKIP_NET_CACHE = \"Skip Net Resource Cache\"\nSTR_PARSE_TRANSLATE_ALIASES = \"Parse Translate Aliases\"\nSTR_PARSE_WITH_EXPLICIT_ASSOCAPP = \"ExplicitAssociationApp\"\nSTR_PARSE_WITH_EXPLICIT_PROGID = \"ExplicitProgid\"\nSTR_PARSE_WITH_PROPERTIES = \"ParseWithProperties\"\n## STR_PROPERTYBAG_PARAM\nSTR_SKIP_BINDING_CLSID = \"Skip Binding CLSID\"\nSTR_TRACK_CLSID = \"Track the CLSID\"\n\n## KF_REDIRECTION_CAPABILITIES enum\nKF_REDIRECTION_CAPABILITIES_ALLOW_ALL = 0x000000FF\nKF_REDIRECTION_CAPABILITIES_REDIRECTABLE = 0x00000001\nKF_REDIRECTION_CAPABILITIES_DENY_ALL = 0x000FFF00\nKF_REDIRECTION_CAPABILITIES_DENY_POLICY_REDIRECTED = 0x00000100\nKF_REDIRECTION_CAPABILITIES_DENY_POLICY = 0x00000200\nKF_REDIRECTION_CAPABILITIES_DENY_PERMISSIONS = 0x00000400\n\n## KF_REDIRECT_FLAGS enum\nKF_REDIRECT_USER_EXCLUSIVE = 0x00000001\nKF_REDIRECT_COPY_SOURCE_DACL = 0x00000002\nKF_REDIRECT_OWNER_USER = 0x00000004\nKF_REDIRECT_SET_OWNER_EXPLICIT = 0x00000008\nKF_REDIRECT_CHECK_ONLY = 0x00000010\nKF_REDIRECT_WITH_UI = 0x00000020\nKF_REDIRECT_UNPIN = 0x00000040\nKF_REDIRECT_PIN = 0x00000080\nKF_REDIRECT_COPY_CONTENTS = 0x00000200\nKF_REDIRECT_DEL_SOURCE_CONTENTS = 0x00000400\nKF_REDIRECT_EXCLUDE_ALL_KNOWN_SUBFOLDERS = 0x00000800\n\n## KF_CATEGORY enum\nKF_CATEGORY_VIRTUAL = 0x00000001\nKF_CATEGORY_FIXED = 0x00000002\nKF_CATEGORY_COMMON = 0x00000003\nKF_CATEGORY_PERUSER = 0x00000004\n\n## FFFP_MODE enum\nFFFP_EXACTMATCH = 0\nFFFP_NEARESTPARENTMATCH = 1\n\nKF_FLAG_CREATE = 0x00008000\nKF_FLAG_DONT_VERIFY = 0x00004000\nKF_FLAG_DONT_UNEXPAND = 0x00002000\nKF_FLAG_NO_ALIAS = 0x00001000\nKF_FLAG_INIT = 0x00000800\nKF_FLAG_DEFAULT_PATH = 0x00000400\nKF_FLAG_NOT_PARENT_RELATIVE = 0x00000200\nKF_FLAG_SIMPLE_IDLIST = 0x00000100\n\n## APPDOCLISTTYPE, used with IApplicationDocumentLists.GetList\nADLT_RECENT = 0\nADLT_FREQUENT = 1\n\n## KNOWNDESTCATEGORY used with ICustomDestinationList.AppendKnownCategory\nKDC_FREQUENT = 1\nKDC_RECENT = 2\n\n## LIBRARYFOLDERFILTER used with IShellLibrary.GetFolders\nLFF_FORCEFILESYSTEM = 1\nLFF_STORAGEITEMS = 2\nLFF_ALLITEMS = 3\n\n## DEFAULTSAVEFOLDERTYPE used with IShellLibrary.Get/SetDefaultSaveFolder\nDSFT_DETECT = 1\nDSFT_PRIVATE = 2\nDSFT_PUBLIC = 3\n\n## LIBRARYOPTIONFLAGS used with IShellLibrary.Get/SetOptions\nLOF_DEFAULT = 0\nLOF_PINNEDTONAVPANE = 1\nLOF_MASK_ALL = 1\n\n## LIBRARYSAVEFLAGS Used with PyIShellLibrary.Save\nLSF_FAILIFTHERE = 0\nLSF_OVERRIDEEXISTING = 1\nLSF_MAKEUNIQUENAME = 2\n\n## TRANSFER_SOURCE_FLAGS, used with IFileOperationProgressSink\nTSF_NORMAL = 0\nTSF_FAIL_EXIST = 0\nTSF_RENAME_EXIST = 0x1\nTSF_OVERWRITE_EXIST = 0x2\nTSF_ALLOW_DECRYPTION = 0x4\nTSF_NO_SECURITY = 0x8\nTSF_COPY_CREATION_TIME = 0x10\nTSF_COPY_WRITE_TIME = 0x20\nTSF_USE_FULL_ACCESS = 0x40\nTSF_DELETE_RECYCLE_IF_POSSIBLE = 0x80\nTSF_COPY_HARD_LINK = 0x100\nTSF_COPY_LOCALIZED_NAME = 0x200\nTSF_MOVE_AS_COPY_DELETE = 0x400\nTSF_SUSPEND_SHELLEVENTS = 0x800\n\n## TRANSFER_ADVISE_STATE, used with ITransferAdviseSink\nTS_NONE = 0\nTS_PERFORMING = 1\nTS_PREPARING = 2\nTS_INDETERMINATE = 4\n\n## Success HRESULTs returned by ITransfer* interface operations\nCOPYENGINE_S_YES = 0x00270001\nCOPYENGINE_S_NOT_HANDLED = 0x00270003\nCOPYENGINE_S_USER_RETRY = 0x00270004\nCOPYENGINE_S_USER_IGNORED = 0x00270005\nCOPYENGINE_S_MERGE = 0x00270006\nCOPYENGINE_S_DONT_PROCESS_CHILDREN = 0x00270008\nCOPYENGINE_S_ALREADY_DONE = 0x0027000A\nCOPYENGINE_S_PENDING = 0x0027000B\nCOPYENGINE_S_KEEP_BOTH = 0x0027000C\nCOPYENGINE_S_CLOSE_PROGRAM = 0x0027000D\nCOPYENGINE_S_COLLISIONRESOLVED = 0x0027000E\n\n## Error HRESULTS\nCOPYENGINE_E_USER_CANCELLED = 0x80270000\nCOPYENGINE_E_CANCELLED = 0x80270001\nCOPYENGINE_E_REQUIRES_ELEVATION = 0x80270002\nCOPYENGINE_E_SAME_FILE = 0x80270003\nCOPYENGINE_E_DIFF_DIR = 0x80270004\nCOPYENGINE_E_MANY_SRC_1_DEST = 0x80270005\nCOPYENGINE_E_DEST_SUBTREE = 0x80270009\nCOPYENGINE_E_DEST_SAME_TREE = 0x8027000A\nCOPYENGINE_E_FLD_IS_FILE_DEST = 0x8027000B\nCOPYENGINE_E_FILE_IS_FLD_DEST = 0x8027000C\nCOPYENGINE_E_FILE_TOO_LARGE = 0x8027000D\nCOPYENGINE_E_REMOVABLE_FULL = 0x8027000E\nCOPYENGINE_E_DEST_IS_RO_CD = 0x8027000F\nCOPYENGINE_E_DEST_IS_RW_CD = 0x80270010\nCOPYENGINE_E_DEST_IS_R_CD = 0x80270011\nCOPYENGINE_E_DEST_IS_RO_DVD = 0x80270012\nCOPYENGINE_E_DEST_IS_RW_DVD = 0x80270013\nCOPYENGINE_E_DEST_IS_R_DVD = 0x80270014\nCOPYENGINE_E_SRC_IS_RO_CD = 0x80270015\nCOPYENGINE_E_SRC_IS_RW_CD = 0x80270016\nCOPYENGINE_E_SRC_IS_R_CD = 0x80270017\nCOPYENGINE_E_SRC_IS_RO_DVD = 0x80270018\nCOPYENGINE_E_SRC_IS_RW_DVD = 0x80270019\nCOPYENGINE_E_SRC_IS_R_DVD = 0x8027001A\nCOPYENGINE_E_INVALID_FILES_SRC = 0x8027001B\nCOPYENGINE_E_INVALID_FILES_DEST = 0x8027001C\nCOPYENGINE_E_PATH_TOO_DEEP_SRC = 0x8027001D\nCOPYENGINE_E_PATH_TOO_DEEP_DEST = 0x8027001E\nCOPYENGINE_E_ROOT_DIR_SRC = 0x8027001F\nCOPYENGINE_E_ROOT_DIR_DEST = 0x80270020\nCOPYENGINE_E_ACCESS_DENIED_SRC = 0x80270021\nCOPYENGINE_E_ACCESS_DENIED_DEST = 0x80270022\nCOPYENGINE_E_PATH_NOT_FOUND_SRC = 0x80270023\nCOPYENGINE_E_PATH_NOT_FOUND_DEST = 0x80270024\nCOPYENGINE_E_NET_DISCONNECT_SRC = 0x80270025\nCOPYENGINE_E_NET_DISCONNECT_DEST = 0x80270026\nCOPYENGINE_E_SHARING_VIOLATION_SRC = 0x80270027\nCOPYENGINE_E_SHARING_VIOLATION_DEST = 0x80270028\nCOPYENGINE_E_ALREADY_EXISTS_NORMAL = 0x80270029\nCOPYENGINE_E_ALREADY_EXISTS_READONLY = 0x8027002A\nCOPYENGINE_E_ALREADY_EXISTS_SYSTEM = 0x8027002B\nCOPYENGINE_E_ALREADY_EXISTS_FOLDER = 0x8027002C\nCOPYENGINE_E_STREAM_LOSS = 0x8027002D\nCOPYENGINE_E_EA_LOSS = 0x8027002E\nCOPYENGINE_E_PROPERTY_LOSS = 0x8027002F\nCOPYENGINE_E_PROPERTIES_LOSS = 0x80270030\nCOPYENGINE_E_ENCRYPTION_LOSS = 0x80270031\nCOPYENGINE_E_DISK_FULL = 0x80270032\nCOPYENGINE_E_DISK_FULL_CLEAN = 0x80270033\nCOPYENGINE_E_EA_NOT_SUPPORTED = 0x80270034\nCOPYENGINE_E_CANT_REACH_SOURCE = 0x80270035\nCOPYENGINE_E_RECYCLE_UNKNOWN_ERROR = 0x80270035\nCOPYENGINE_E_RECYCLE_FORCE_NUKE = 0x80270036\nCOPYENGINE_E_RECYCLE_SIZE_TOO_BIG = 0x80270037\nCOPYENGINE_E_RECYCLE_PATH_TOO_LONG = 0x80270038\nCOPYENGINE_E_RECYCLE_BIN_NOT_FOUND = 0x8027003A\nCOPYENGINE_E_NEWFILE_NAME_TOO_LONG = 0x8027003B\nCOPYENGINE_E_NEWFOLDER_NAME_TOO_LONG = 0x8027003C\nCOPYENGINE_E_DIR_NOT_EMPTY = 0x8027003D\nCOPYENGINE_E_FAT_MAX_IN_ROOT = 0x8027003E\nCOPYENGINE_E_ACCESSDENIED_READONLY = 0x8027003F\nCOPYENGINE_E_REDIRECTED_TO_WEBPAGE = 0x80270040\nCOPYENGINE_E_SERVER_BAD_FILE_TYPE = 0x80270041\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "FO_MOVE ", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 7 }, { "span": "FO_COPY ", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 7 }, { "span": "FO_DELETE ", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 9 }, { "span": "FO_RENAME ", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 9 }, { "span": "FOF_MULTIDESTFILES ", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 18 }, { "span": "FOF_CONFIRMMOUSE ", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 16 }, { "span": "FOF_RENAMEONCOLLISION ", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 21 }, { "span": "FOF_WANTMAPPINGHANDLE ", "start_line": 19, "start_column": 0, "end_line": 19, "end_column": 21 }, { "span": "FOF_ALLOWUNDO ", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 13 }, { "span": "FOF_FILESONLY ", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 13 }, { "span": "FOF_SIMPLEPROGRESS ", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 18 }, { "span": "FOF_NOCOPYSECURITYATTRIBS ", "start_line": 25, "start_column": 0, "end_line": 25, "end_column": 25 }, { "span": "PO_DELETE ", "start_line": 48, "start_column": 0, "end_line": 48, "end_column": 9 }, { "span": "PO_RENAME ", "start_line": 49, "start_column": 0, "end_line": 49, "end_column": 9 }, { "span": "PO_PORTCHANGE ", "start_line": 50, "start_column": 0, "end_line": 50, "end_column": 13 }, { "span": "PO_REN_PORT ", "start_line": 51, "start_column": 0, "end_line": 51, "end_column": 11 }, { "span": "SEE_MASK_CLASSNAME ", "start_line": 63, "start_column": 0, "end_line": 63, "end_column": 18 }, { "span": "SEE_MASK_CLASSKEY ", "start_line": 64, "start_column": 0, "end_line": 64, "end_column": 17 }, { "span": "SEE_MASK_IDLIST ", "start_line": 65, "start_column": 0, "end_line": 65, "end_column": 15 }, { "span": "SEE_MASK_INVOKEIDLIST ", "start_line": 66, "start_column": 0, "end_line": 66, "end_column": 21 }, { "span": "SEE_MASK_ICON ", "start_line": 67, "start_column": 0, "end_line": 67, "end_column": 13 }, { "span": "SEE_MASK_HOTKEY ", "start_line": 68, "start_column": 0, "end_line": 68, "end_column": 15 }, { "span": "SEE_MASK_NOCLOSEPROCESS ", "start_line": 69, "start_column": 0, "end_line": 69, "end_column": 23 }, { "span": "SEE_MASK_CONNECTNETDRV ", "start_line": 70, "start_column": 0, "end_line": 70, "end_column": 22 }, { "span": "SEE_MASK_FLAG_DDEWAIT ", "start_line": 71, "start_column": 0, "end_line": 71, "end_column": 21 }, { "span": "SEE_MASK_DOENVSUBST ", "start_line": 72, "start_column": 0, "end_line": 72, "end_column": 19 }, { "span": "SEE_MASK_FLAG_NO_UI ", "start_line": 73, "start_column": 0, "end_line": 73, "end_column": 19 }, { "span": "SEE_MASK_UNICODE ", "start_line": 74, "start_column": 0, "end_line": 74, "end_column": 16 }, { "span": "SEE_MASK_NO_CONSOLE ", "start_line": 75, "start_column": 0, "end_line": 75, "end_column": 19 }, { "span": "SEE_MASK_ASYNCOK ", "start_line": 76, "start_column": 0, "end_line": 76, "end_column": 16 }, { "span": "SEE_MASK_HMONITOR ", "start_line": 77, "start_column": 0, "end_line": 77, "end_column": 17 }, { "span": "GCS_VERB ", "start_line": 155, "start_column": 0, "end_line": 155, "end_column": 8 }, { "span": "GCS_HELPTEXT ", "start_line": 156, "start_column": 0, "end_line": 156, "end_column": 12 }, { "span": "GCS_VALIDATE ", "start_line": 157, "start_column": 0, "end_line": 157, "end_column": 12 }, { "span": "CSIDL_LOCAL_APPDATA ", "start_line": 305, "start_column": 0, "end_line": 305, "end_column": 19 }, { "span": "CSIDL_COMMON_APPDATA ", "start_line": 312, "start_column": 0, "end_line": 312, "end_column": 20 }, { "span": "BFFM_SETSTATUSTEXT ", "start_line": 355, "start_column": 0, "end_line": 355, "end_column": 18 }, { "span": "BFFM_SETSELECTION ", "start_line": 356, "start_column": 0, "end_line": 356, "end_column": 17 }, { "span": "BFFM_VALIDATEFAILED ", "start_line": 357, "start_column": 0, "end_line": 357, "end_column": 19 }, { "span": "DBIM_MINSIZE ", "start_line": 390, "start_column": 0, "end_line": 390, "end_column": 12 }, { "span": "DBIM_MAXSIZE ", "start_line": 391, "start_column": 0, "end_line": 391, "end_column": 12 }, { "span": "DBIM_INTEGRAL ", "start_line": 392, "start_column": 0, "end_line": 392, "end_column": 13 }, { "span": "DBIM_ACTUAL ", "start_line": 393, "start_column": 0, "end_line": 393, "end_column": 11 }, { "span": "DBIM_TITLE ", "start_line": 394, "start_column": 0, "end_line": 394, "end_column": 10 }, { "span": "DBIM_MODEFLAGS ", "start_line": 395, "start_column": 0, "end_line": 395, "end_column": 14 }, { "span": "DBIM_BKCOLOR ", "start_line": 396, "start_column": 0, "end_line": 396, "end_column": 12 }, { "span": "DBIMF_VARIABLEHEIGHT ", "start_line": 398, "start_column": 0, "end_line": 398, "end_column": 20 }, { "span": "DBIMF_DEBOSSED ", "start_line": 399, "start_column": 0, "end_line": 399, "end_column": 14 }, { "span": "DBIMF_BKCOLOR ", "start_line": 400, "start_column": 0, "end_line": 400, "end_column": 13 }, { "span": "DBIF_VIEWMODE_VERTICAL ", "start_line": 402, "start_column": 0, "end_line": 402, "end_column": 22 }, { "span": "DBIF_VIEWMODE_FLOATING ", "start_line": 403, "start_column": 0, "end_line": 403, "end_column": 22 }, { "span": "DBIF_VIEWMODE_TRANSPARENT ", "start_line": 404, "start_column": 0, "end_line": 404, "end_column": 25 }, { "span": "COMPONENT_TOP ", "start_line": 405, "start_column": 0, "end_line": 405, "end_column": 13 }, { "span": "COMP_TYPE_PICTURE ", "start_line": 407, "start_column": 0, "end_line": 407, "end_column": 17 }, { "span": "COMP_TYPE_WEBSITE ", "start_line": 408, "start_column": 0, "end_line": 408, "end_column": 17 }, { "span": "COMP_TYPE_CONTROL ", "start_line": 409, "start_column": 0, "end_line": 409, "end_column": 17 }, { "span": "COMP_TYPE_CFHTML ", "start_line": 410, "start_column": 0, "end_line": 410, "end_column": 16 }, { "span": "COMP_TYPE_MAX ", "start_line": 411, "start_column": 0, "end_line": 411, "end_column": 13 }, { "span": "AD_APPLY_ALL ", "start_line": 415, "start_column": 0, "end_line": 415, "end_column": 12 }, { "span": "AD_APPLY_FORCE ", "start_line": 416, "start_column": 0, "end_line": 416, "end_column": 14 }, { "span": "AD_APPLY_BUFFERED_REFRESH ", "start_line": 417, "start_column": 0, "end_line": 417, "end_column": 25 }, { "span": "WPSTYLE_TILE ", "start_line": 419, "start_column": 0, "end_line": 419, "end_column": 12 }, { "span": "WPSTYLE_STRETCH ", "start_line": 420, "start_column": 0, "end_line": 420, "end_column": 15 }, { "span": "WPSTYLE_MAX ", "start_line": 421, "start_column": 0, "end_line": 421, "end_column": 11 }, { "span": "COMP_ELEM_TYPE ", "start_line": 422, "start_column": 0, "end_line": 422, "end_column": 14 }, { "span": "COMP_ELEM_CHECKED ", "start_line": 423, "start_column": 0, "end_line": 423, "end_column": 17 }, { "span": "COMP_ELEM_DIRTY ", "start_line": 424, "start_column": 0, "end_line": 424, "end_column": 15 }, { "span": "COMP_ELEM_NOSCROLL ", "start_line": 425, "start_column": 0, "end_line": 425, "end_column": 18 }, { "span": "COMP_ELEM_POS_LEFT ", "start_line": 426, "start_column": 0, "end_line": 426, "end_column": 18 }, { "span": "COMP_ELEM_POS_TOP ", "start_line": 427, "start_column": 0, "end_line": 427, "end_column": 17 }, { "span": "COMP_ELEM_SIZE_WIDTH ", "start_line": 428, "start_column": 0, "end_line": 428, "end_column": 20 }, { "span": "COMP_ELEM_SIZE_HEIGHT ", "start_line": 429, "start_column": 0, "end_line": 429, "end_column": 21 }, { "span": "COMP_ELEM_POS_ZINDEX ", "start_line": 430, "start_column": 0, "end_line": 430, "end_column": 20 }, { "span": "COMP_ELEM_SOURCE ", "start_line": 431, "start_column": 0, "end_line": 431, "end_column": 16 }, { "span": "COMP_ELEM_FRIENDLYNAME ", "start_line": 432, "start_column": 0, "end_line": 432, "end_column": 22 }, { "span": "COMP_ELEM_SUBSCRIBEDURL ", "start_line": 433, "start_column": 0, "end_line": 433, "end_column": 23 }, { "span": "ADDURL_SILENT ", "start_line": 434, "start_column": 0, "end_line": 434, "end_column": 13 }, { "span": "CFSTR_FILEDESCRIPTOR ", "start_line": 459, "start_column": 0, "end_line": 459, "end_column": 20 }, { "span": "CFSTR_FILENAME ", "start_line": 460, "start_column": 0, "end_line": 460, "end_column": 14 }, { "span": "CFSTR_FILENAMEMAP ", "start_line": 461, "start_column": 0, "end_line": 461, "end_column": 17 }, { "span": "SHCNF_PATH ", "start_line": 501, "start_column": 0, "end_line": 501, "end_column": 10 }, { "span": "SHCNF_PRINTER ", "start_line": 502, "start_column": 0, "end_line": 502, "end_column": 13 }, { "span": "SHCONTF_FOLDERS ", "start_line": 615, "start_column": 0, "end_line": 615, "end_column": 15 }, { "span": "SHCONTF_NONFOLDERS ", "start_line": 616, "start_column": 0, "end_line": 616, "end_column": 18 }, { "span": "SHCONTF_INCLUDEHIDDEN ", "start_line": 617, "start_column": 0, "end_line": 617, "end_column": 21 }, { "span": "PSH_WIZARD97 ", "start_line": 818, "start_column": 0, "end_line": 818, "end_column": 12 } ]
[ { "span": "SEE_MASK_CLASSNAME ", "start_line": 78, "start_column": 0, "end_line": 78, "end_column": 18 }, { "span": "SEE_MASK_CLASSKEY ", "start_line": 79, "start_column": 0, "end_line": 79, "end_column": 17 }, { "span": "SEE_MASK_IDLIST ", "start_line": 80, "start_column": 0, "end_line": 80, "end_column": 15 }, { "span": "SEE_MASK_INVOKEIDLIST ", "start_line": 81, "start_column": 0, "end_line": 81, "end_column": 21 }, { "span": "SEE_MASK_ICON ", "start_line": 82, "start_column": 0, "end_line": 82, "end_column": 13 }, { "span": "SEE_MASK_HOTKEY ", "start_line": 83, "start_column": 0, "end_line": 83, "end_column": 15 }, { "span": "SEE_MASK_NOCLOSEPROCESS ", "start_line": 84, "start_column": 0, "end_line": 84, "end_column": 23 }, { "span": "SEE_MASK_CONNECTNETDRV ", "start_line": 85, "start_column": 0, "end_line": 85, "end_column": 22 }, { "span": "SEE_MASK_FLAG_DDEWAIT ", "start_line": 86, "start_column": 0, "end_line": 86, "end_column": 21 }, { "span": "SEE_MASK_DOENVSUBST ", "start_line": 87, "start_column": 0, "end_line": 87, "end_column": 19 }, { "span": "SEE_MASK_FLAG_NO_UI ", "start_line": 88, "start_column": 0, "end_line": 88, "end_column": 19 }, { "span": "SEE_MASK_UNICODE ", "start_line": 89, "start_column": 0, "end_line": 89, "end_column": 16 }, { "span": "SEE_MASK_NO_CONSOLE ", "start_line": 90, "start_column": 0, "end_line": 90, "end_column": 19 }, { "span": "SEE_MASK_ASYNCOK ", "start_line": 91, "start_column": 0, "end_line": 91, "end_column": 16 }, { "span": "SEE_MASK_HMONITOR ", "start_line": 92, "start_column": 0, "end_line": 92, "end_column": 17 }, { "span": "GCS_VERB ", "start_line": 158, "start_column": 0, "end_line": 158, "end_column": 8 }, { "span": "GCS_HELPTEXT ", "start_line": 159, "start_column": 0, "end_line": 159, "end_column": 12 }, { "span": "GCS_VALIDATE ", "start_line": 160, "start_column": 0, "end_line": 160, "end_column": 12 }, { "span": "FO_MOVE ", "start_line": 190, "start_column": 0, "end_line": 190, "end_column": 7 }, { "span": "FO_COPY ", "start_line": 191, "start_column": 0, "end_line": 191, "end_column": 7 }, { "span": "FO_DELETE ", "start_line": 192, "start_column": 0, "end_line": 192, "end_column": 9 }, { "span": "FO_RENAME ", "start_line": 193, "start_column": 0, "end_line": 193, "end_column": 9 }, { "span": "FOF_MULTIDESTFILES ", "start_line": 194, "start_column": 0, "end_line": 194, "end_column": 18 }, { "span": "FOF_CONFIRMMOUSE ", "start_line": 195, "start_column": 0, "end_line": 195, "end_column": 16 }, { "span": "FOF_RENAMEONCOLLISION ", "start_line": 197, "start_column": 0, "end_line": 197, "end_column": 21 }, { "span": "FOF_WANTMAPPINGHANDLE ", "start_line": 199, "start_column": 0, "end_line": 199, "end_column": 21 }, { "span": "FOF_ALLOWUNDO ", "start_line": 200, "start_column": 0, "end_line": 200, "end_column": 13 }, { "span": "FOF_FILESONLY ", "start_line": 201, "start_column": 0, "end_line": 201, "end_column": 13 }, { "span": "FOF_SIMPLEPROGRESS ", "start_line": 202, "start_column": 0, "end_line": 202, "end_column": 18 }, { "span": "FOF_NOCOPYSECURITYATTRIBS ", "start_line": 205, "start_column": 0, "end_line": 205, "end_column": 25 }, { "span": "PO_DELETE ", "start_line": 206, "start_column": 0, "end_line": 206, "end_column": 9 }, { "span": "PO_RENAME ", "start_line": 207, "start_column": 0, "end_line": 207, "end_column": 9 }, { "span": "PO_PORTCHANGE ", "start_line": 208, "start_column": 0, "end_line": 208, "end_column": 13 }, { "span": "PO_REN_PORT ", "start_line": 209, "start_column": 0, "end_line": 209, "end_column": 11 }, { "span": "BFFM_SETSTATUSTEXT ", "start_line": 358, "start_column": 0, "end_line": 358, "end_column": 18 }, { "span": "BFFM_SETSELECTION ", "start_line": 359, "start_column": 0, "end_line": 359, "end_column": 17 }, { "span": "BFFM_VALIDATEFAILED ", "start_line": 360, "start_column": 0, "end_line": 360, "end_column": 19 }, { "span": "CFSTR_FILEDESCRIPTOR ", "start_line": 462, "start_column": 0, "end_line": 462, "end_column": 20 }, { "span": "CFSTR_FILENAME ", "start_line": 463, "start_column": 0, "end_line": 463, "end_column": 14 }, { "span": "CFSTR_FILENAMEMAP ", "start_line": 464, "start_column": 0, "end_line": 464, "end_column": 17 }, { "span": "SHCNF_PATH ", "start_line": 503, "start_column": 0, "end_line": 503, "end_column": 10 }, { "span": "SHCNF_PRINTER ", "start_line": 504, "start_column": 0, "end_line": 504, "end_column": 13 }, { "span": "CSIDL_COMMON_APPDATA ", "start_line": 612, "start_column": 0, "end_line": 612, "end_column": 20 }, { "span": "CSIDL_LOCAL_APPDATA ", "start_line": 613, "start_column": 0, "end_line": 613, "end_column": 19 }, { "span": "SHCONTF_FOLDERS ", "start_line": 630, "start_column": 0, "end_line": 630, "end_column": 15 }, { "span": "SHCONTF_NONFOLDERS ", "start_line": 631, "start_column": 0, "end_line": 631, "end_column": 18 }, { "span": "SHCONTF_INCLUDEHIDDEN ", "start_line": 632, "start_column": 0, "end_line": 632, "end_column": 21 }, { "span": "PSH_WIZARD97 ", "start_line": 819, "start_column": 0, "end_line": 819, "end_column": 12 }, { "span": "DBIM_MINSIZE ", "start_line": 984, "start_column": 0, "end_line": 984, "end_column": 12 }, { "span": "DBIM_MAXSIZE ", "start_line": 985, "start_column": 0, "end_line": 985, "end_column": 12 }, { "span": "DBIM_INTEGRAL ", "start_line": 986, "start_column": 0, "end_line": 986, "end_column": 13 }, { "span": "DBIM_ACTUAL ", "start_line": 987, "start_column": 0, "end_line": 987, "end_column": 11 }, { "span": "DBIM_TITLE ", "start_line": 988, "start_column": 0, "end_line": 988, "end_column": 10 }, { "span": "DBIM_MODEFLAGS ", "start_line": 989, "start_column": 0, "end_line": 989, "end_column": 14 }, { "span": "DBIM_BKCOLOR ", "start_line": 990, "start_column": 0, "end_line": 990, "end_column": 12 }, { "span": "DBIMF_VARIABLEHEIGHT ", "start_line": 993, "start_column": 0, "end_line": 993, "end_column": 20 }, { "span": "DBIMF_DEBOSSED ", "start_line": 994, "start_column": 0, "end_line": 994, "end_column": 14 }, { "span": "DBIMF_BKCOLOR ", "start_line": 995, "start_column": 0, "end_line": 995, "end_column": 13 }, { "span": "DBIF_VIEWMODE_VERTICAL ", "start_line": 998, "start_column": 0, "end_line": 998, "end_column": 22 }, { "span": "DBIF_VIEWMODE_FLOATING ", "start_line": 999, "start_column": 0, "end_line": 999, "end_column": 22 }, { "span": "DBIF_VIEWMODE_TRANSPARENT ", "start_line": 1000, "start_column": 0, "end_line": 1000, "end_column": 25 }, { "span": "COMP_TYPE_PICTURE ", "start_line": 1054, "start_column": 0, "end_line": 1054, "end_column": 17 }, { "span": "COMP_TYPE_WEBSITE ", "start_line": 1055, "start_column": 0, "end_line": 1055, "end_column": 17 }, { "span": "COMP_TYPE_CONTROL ", "start_line": 1056, "start_column": 0, "end_line": 1056, "end_column": 17 }, { "span": "COMP_TYPE_CFHTML ", "start_line": 1057, "start_column": 0, "end_line": 1057, "end_column": 16 }, { "span": "COMP_TYPE_MAX\t", "start_line": 1058, "start_column": 0, "end_line": 1058, "end_column": 13 }, { "span": "AD_APPLY_ALL ", "start_line": 1069, "start_column": 0, "end_line": 1069, "end_column": 12 }, { "span": "AD_APPLY_FORCE ", "start_line": 1070, "start_column": 0, "end_line": 1070, "end_column": 14 }, { "span": "AD_APPLY_BUFFERED_REFRESH ", "start_line": 1071, "start_column": 0, "end_line": 1071, "end_column": 25 }, { "span": "WPSTYLE_TILE ", "start_line": 1075, "start_column": 0, "end_line": 1075, "end_column": 12 }, { "span": "WPSTYLE_STRETCH ", "start_line": 1076, "start_column": 0, "end_line": 1076, "end_column": 15 }, { "span": "WPSTYLE_MAX ", "start_line": 1077, "start_column": 0, "end_line": 1077, "end_column": 11 }, { "span": "COMP_ELEM_TYPE ", "start_line": 1079, "start_column": 0, "end_line": 1079, "end_column": 14 }, { "span": "COMP_ELEM_CHECKED ", "start_line": 1080, "start_column": 0, "end_line": 1080, "end_column": 17 }, { "span": "COMP_ELEM_DIRTY ", "start_line": 1081, "start_column": 0, "end_line": 1081, "end_column": 15 }, { "span": "COMP_ELEM_NOSCROLL ", "start_line": 1082, "start_column": 0, "end_line": 1082, "end_column": 18 }, { "span": "COMP_ELEM_POS_LEFT ", "start_line": 1083, "start_column": 0, "end_line": 1083, "end_column": 18 }, { "span": "COMP_ELEM_POS_TOP ", "start_line": 1084, "start_column": 0, "end_line": 1084, "end_column": 17 }, { "span": "COMP_ELEM_SIZE_WIDTH ", "start_line": 1085, "start_column": 0, "end_line": 1085, "end_column": 20 }, { "span": "COMP_ELEM_SIZE_HEIGHT ", "start_line": 1086, "start_column": 0, "end_line": 1086, "end_column": 21 }, { "span": "COMP_ELEM_POS_ZINDEX ", "start_line": 1087, "start_column": 0, "end_line": 1087, "end_column": 20 }, { "span": "COMP_ELEM_SOURCE ", "start_line": 1088, "start_column": 0, "end_line": 1088, "end_column": 16 }, { "span": "COMP_ELEM_FRIENDLYNAME ", "start_line": 1089, "start_column": 0, "end_line": 1089, "end_column": 22 }, { "span": "COMP_ELEM_SUBSCRIBEDURL ", "start_line": 1090, "start_column": 0, "end_line": 1090, "end_column": 23 }, { "span": "ADDURL_SILENT ", "start_line": 1102, "start_column": 0, "end_line": 1102, "end_column": 13 }, { "span": "COMPONENT_TOP ", "start_line": 1103, "start_column": 0, "end_line": 1103, "end_column": 13 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Generate", "d", " ", "by", " ", "h2", "py", " ", "from", " ", "\\\\", "mss", "dk", "\\\\", "include", "\\\\", "shl", "obj", ".", "h", " ", "and", " ", "shell", "api", ".", "h_", "\\u\\u\\uNL\\u\\u\\u_", "WM", "\\u", "USER_", "=_", "1024_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DROP", "EFFECT", "\\u", "NONE_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DROP", "EFFECT", "\\u", "COPY", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DROP", "EFFECT", "\\u", "MOVE", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DROP", "EFFECT", "\\u", "LINK_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DROP", "EFFECT", "\\u", "SCROLL", "_", "=_", "-_", "2147483648", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "FO", "\\u", "MOVE", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "\\u", "COPY", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "\\u", "DELETE_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "\\u", "RENA", "ME_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "File", " ", "operati", "on", " ", "flags", " ", "used", " ", "with", " ", "shell", ".", "SH", "File", "Operation_", "\\u\\u\\uNL\\u\\u\\u_", "FO", "F", "\\u", "MULTI", "DEST", "FILES_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "CONFIRM", "MOUSE", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "SIL", "ENT_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "RENA", "ME", "ON", "COLL", "ISI", "ON_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "NOC", "ONF", "IR", "MAT", "ION_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "WAN", "TM", "APP", "ING", "HANDLE_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "ALLOW", "UND", "O_", "=_", "64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "FILE", "SON", "LY_", "=_", "128_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "SIMPLE", "PROGRESS", "_", "=_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "NOC", "ONF", "IR", "MM", "KD", "IR_", "=_", "512_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "NO", "ERROR", "UI_", "=_", "1024_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "NOC", "OP", "YS", "ECU", "RIT", "YA", "TT", "RIB", "S_", "=_", "2048_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "NOR", "ECU", "RSI", "ON_", "=_", "4096_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "NO", "\\u", "CONNECTED", "\\u", "ELEMENT", "S_", "=_", "8192_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "WAN", "TN", "UK", "EW", "AR", "NING", "_", "=_", "1638", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "NOR", "ECU", "RSE", "REP", "AR", "SE_", "=_", "32768_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "NO", "\\u", "UI_", "=_", "FO", "F", "\\u", "SIL", "ENT_", "|_", "FO", "F", "\\u", "NOC", "ONF", "IR", "MAT", "ION_", "|_", "FO", "F", "\\u", "NO", "ERROR", "UI_", "|_", "FO", "F", "\\u", "NOC", "ONF", "IR", "MM", "KD", "IR_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Extend", "ed", " ", "file", " ", "operati", "on", " ", "flags", ",", " ", "used", " ", "with", " ", "IF", "ile", "Operation_", "\\u\\u\\uNL\\u\\u\\u_", "FO", "FX", "\\u", "NOS", "KI", "PJ", "UNC", "TIONS", "_", "=_", "0x0001", "0000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "FX", "\\u", "PREFER", "HARD", "LINK_", "=_", "0x000", "20000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "FX", "\\u", "SHOW", "ELE", "VAT", "ION", "PROMPT", "_", "=_", "0x000", "40000", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "FX", "\\u", "EAR", "LY", "FAILURE_", "=_", "0x001", "00000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "FX", "\\u", "PRESE", "RV", "EFI", "LE", "EXTENSIONS_", "=_", "0x002", "00000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "FX", "\\u", "KEEP", "NEW", "ER", "FILE_", "=_", "0x004", "00000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "FX", "\\u", "NOC", "OP", "YH", "OO", "KS", "_", "=_", "0x008", "00000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "FX", "\\u", "NOM", "INI", "MI", "ZE", "BOX_", "=_", "0x010", "00000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "FX", "\\u", "MOVE", "ACL", "SA", "CROSS", "VOLUM", "ES_", "=_", "0x02", "000000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "FX", "\\u", "DON", "TD", "IS", "PLAY", "SOU", "RC", "EPA", "TH_", "=_", "0x04", "000000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "FX", "\\u", "DON", "TD", "IS", "PLAY", "DEST", "PATH_", "=_", "0x08", "000000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "FX", "\\u", "REQUIRE", "ELE", "VAT", "ION_", "=_", "0x10000", "000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "FX", "\\u", "COPY", "AS", "DOWNLOAD", "_", "=_", "0x400", "00000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "FX", "\\u", "DON", "TD", "IS", "PLAY", "LOCATION", "S_", "=_", "0x80000", "000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "PO", "\\u", "DELETE_", "=_", "19_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PO", "\\u", "RENA", "ME_", "=_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PO", "\\u", "PORT", "CHANGE", "_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PO", "\\u", "REN", "\\u", "PORT_", "=_", "52_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SE", "\\u", "ERR", "\\u", "FN", "F_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SE", "\\u", "ERR", "\\u", "PN", "F_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SE", "\\u", "ERR", "\\u", "ACCESS", "DEN", "IED", "_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SE", "\\u", "ERR", "\\u", "OOM", "_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SE", "\\u", "ERR", "\\u", "DLL", "NOT", "FOUND_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SE", "\\u", "ERR", "\\u", "SHAR", "E_", "=_", "26_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SE", "\\u", "ERR", "\\u", "ASSOC", "INCOM", "PLE", "TE_", "=_", "27_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SE", "\\u", "ERR", "\\u", "DD", "ETI", "ME", "OUT_", "=_", "28_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SE", "\\u", "ERR", "\\u", "DD", "EF", "AI", "L_", "=_", "29_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SE", "\\u", "ERR", "\\u", "DD", "EB", "US", "Y_", "=_", "30_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SE", "\\u", "ERR", "\\u", "NO", "ASSOC", "_", "=_", "31_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "CLASS", "NAME_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "CLASS", "KEY_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "ID", "LIST_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "INV", "OKE", "ID", "LIST_", "=_", "12_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "ICON_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "HOT", "KEY_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "NOC", "LOS", "EP", "ROC", "ESS", "_", "=_", "64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "CONNECT", "NET", "DR", "V_", "=_", "128_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "FLAG", "\\u", "DD", "EW", "AI", "T_", "=_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "DO", "ENV", "SUBST", "_", "=_", "512_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "FLAG", "\\u", "NO", "\\u", "UI_", "=_", "1024_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "UNICODE_", "=_", "1638", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "NO", "\\u", "CONSOLE", "_", "=_", "32768_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "ASYN", "CO", "K_", "=_", "104857", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "HM", "ONI", "TOR", "_", "=_", "209", "715", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "CLASS", "NAME_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "CLASS", "KEY_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "ID", "LIST_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "INV", "OKE", "ID", "LIST_", "=_", "12_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "ICON_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "HOT", "KEY_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "NOC", "LOS", "EP", "ROC", "ESS", "_", "=_", "64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "CONNECT", "NET", "DR", "V_", "=_", "128_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "FLAG", "\\u", "DD", "EW", "AI", "T_", "=_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "DO", "ENV", "SUBST", "_", "=_", "512_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "FLAG", "\\u", "NO", "\\u", "UI_", "=_", "1024_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "UNICODE_", "=_", "1638", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "NO", "\\u", "CONSOLE", "_", "=_", "32768_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "ASYN", "CO", "K_", "=_", "104857", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SEE", "\\u", "MASK", "\\u", "HM", "ONI", "TOR", "_", "=_", "209", "715", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SHE", "RB", "\\u", "NOC", "ONF", "IR", "MAT", "ION_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SHE", "RB", "\\u", "NOP", "RO", "GRES", "SU", "I_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SHE", "RB", "\\u", "NOS", "OUN", "D_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NI", "M", "\\u", "ADD_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NI", "M", "\\u", "MODIFY", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NI", "M", "\\u", "DELETE_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NI", "F", "\\u", "MESSAGE_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NI", "F", "\\u", "ICON_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NI", "F", "\\u", "TIP", "_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GF", "I", "\\u", "ICON_", "=_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GF", "I", "\\u", "DISPLAY", "NAME_", "=_", "512_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GF", "I", "\\u", "TYPE", "NAME_", "=_", "1024_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GF", "I", "\\u", "ATTRIBUTES_", "=_", "2048_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GF", "I", "\\u", "ICON", "LOCATION_", "=_", "4096_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GF", "I", "\\u", "EXE", "TYPE_", "=_", "8192_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GF", "I", "\\u", "SYS", "ICON", "INDEX_", "=_", "1638", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GF", "I", "\\u", "LINK", "OVERLA", "Y_", "=_", "32768_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GF", "I", "\\u", "SELECTED", "_", "=_", "65536_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GF", "I", "\\u", "ATT", "R", "\\u", "SPECIFI", "ED_", "=_", "1310", "72_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GF", "I", "\\u", "LARGE", "ICON_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GF", "I", "\\u", "SMALL", "ICON_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GF", "I", "\\u", "OPEN", "ICON_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GF", "I", "\\u", "SHELL", "ICON", "SIZE_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GF", "I", "\\u", "PID", "L_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GF", "I", "\\u", "USE", "FILE", "ATTRIBUTES_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GN", "LI", "\\u", "PID", "L_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GN", "LI", "\\u", "PREF", "IX", "NAME_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GN", "LI", "\\u", "NOUN", "IQ", "UE", "_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PRINT", "ACTI", "ON", "\\u", "OPEN_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PRINT", "ACTI", "ON", "\\u", "PROPERTIES_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PRINT", "ACTI", "ON", "\\u", "NET", "INSTA", "LL_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PRINT", "ACTI", "ON", "\\u", "NET", "INSTA", "LL", "LINK_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PRINT", "ACTI", "ON", "\\u", "TEST", "PAGE_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PRINT", "ACTI", "ON", "\\u", "OPEN", "NET", "PR", "N_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PRINT", "ACTI", "ON", "\\u", "DOCUMENT", "DEFAULTS_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PRINT", "ACTI", "ON", "\\u", "SERVER", "PROPERTIES_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fla", "gs", " ", "used", " ", "with", " ", "IC", "onte", "xt", "Menu", ".", "Query", "Context", "Menu_", "\\u\\u\\uNL\\u\\u\\u_", "CM", "F", "\\u", "NORMAL_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CM", "F", "\\u", "DEF", "AUL", "TON", "LY_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CM", "F", "\\u", "VERB", "SON", "LY_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CM", "F", "\\u", "EXPL", "ORE", "_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CM", "F", "\\u", "NOV", "ER", "BS", "_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CM", "F", "\\u", "CAN", "RENA", "ME_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CM", "F", "\\u", "NODE", "FA", "ULT", "_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CM", "F", "\\u", "INCLUDE", "STATI", "C_", "=_", "64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CM", "F", "\\u", "ITEM", "MENU_", "=_", "128_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CM", "F", "\\u", "EXTEND", "ED", "VERB", "S_", "=_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CM", "F", "\\u", "DISABLED", "VERB", "S_", "=_", "512_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CM", "F", "\\u", "ASYN", "CV", "ER", "BST", "ATE_", "=_", "1024_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CM", "F", "\\u", "OPTI", "MI", "ZE", "FOR", "INV", "OKE", "_", "=_", "2048_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CM", "F", "\\u", "SYNC", "CAS", "CA", "DEM", "EN", "U_", "=_", "4096_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CM", "F", "\\u", "DON", "OT", "PIC", "KD", "EF", "AUL", "T_", "=_", "8192_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CM", "F", "\\u", "RESERVED", "_", "=_", "429", "490", "176", "0_", "#", " ", "0xfff", "f0", "000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "GC", "S", "\\u", "VERB", "A_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GC", "S", "\\u", "HELP", "TEXT", "A_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GC", "S", "\\u", "VALID", "ATE", "A_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GC", "S", "\\u", "VERB", "W_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GC", "S", "\\u", "HELP", "TEXT", "W_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GC", "S", "\\u", "VALID", "ATE", "W_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GC", "S", "\\u", "UNICODE_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GC", "S", "\\u", "VERB", "_", "=_", "GC", "S", "\\u", "VERB", "W_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GC", "S", "\\u", "HELP", "TEXT_", "=_", "GC", "S", "\\u", "HELP", "TEXT", "W_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GC", "S", "\\u", "VALID", "ATE_", "=_", "GC", "S", "\\u", "VALID", "ATE", "W_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GC", "S", "\\u", "VERB", "_", "=_", "GC", "S", "\\u", "VERB", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GC", "S", "\\u", "HELP", "TEXT_", "=_", "GC", "S", "\\u", "HELP", "TEXT", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GC", "S", "\\u", "VALID", "ATE_", "=_", "GC", "S", "\\u", "VALID", "ATE", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CMD", "STR", "\\u", "NEW", "FOLDER", "A_", "=_", "\"", "New", "Fold", "er", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CMD", "STR", "\\u", "VIEW", "LIST", "A_", "=_", "\"", "View", "List", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CMD", "STR", "\\u", "VIEW", "DETAIL", "SA", "_", "=_", "\"", "View", "Det", "ail", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CMD", "STR", "\\u", "NEW", "FOLDER_", "=_", "CMD", "STR", "\\u", "NEW", "FOLDER", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CMD", "STR", "\\u", "VIEW", "LIST_", "=_", "CMD", "STR", "\\u", "VIEW", "LIST", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CMD", "STR", "\\u", "VIEW", "DETAIL", "S_", "=_", "CMD", "STR", "\\u", "VIEW", "DETAIL", "SA", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CM", "IC", "\\u", "MASK", "\\u", "HOT", "KEY_", "=_", "SEE", "\\u", "MASK", "\\u", "HOT", "KEY_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CM", "IC", "\\u", "MASK", "\\u", "ICON_", "=_", "SEE", "\\u", "MASK", "\\u", "ICON_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CM", "IC", "\\u", "MASK", "\\u", "FLAG", "\\u", "NO", "\\u", "UI_", "=_", "SEE", "\\u", "MASK", "\\u", "FLAG", "\\u", "NO", "\\u", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CM", "IC", "\\u", "MASK", "\\u", "UNICODE_", "=_", "SEE", "\\u", "MASK", "\\u", "UNICODE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CM", "IC", "\\u", "MASK", "\\u", "NO", "\\u", "CONSOLE", "_", "=_", "SEE", "\\u", "MASK", "\\u", "NO", "\\u", "CONSOLE", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CM", "IC", "\\u", "MASK", "\\u", "ASYN", "CO", "K_", "=_", "SEE", "\\u", "MASK", "\\u", "ASYN", "CO", "K_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CM", "IC", "\\u", "MASK", "\\u", "PTI", "NV", "OKE", "_", "=_", "536", "870", "912", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GI", "L", "\\u", "OPEN", "ICON_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GI", "L", "\\u", "FOR", "SHELL", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GI", "L", "\\u", "ASYN", "C_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GI", "L", "\\u", "DEF", "AUL", "TIC", "ON_", "=_", "64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GI", "L", "\\u", "FOR", "SHORT", "CUT", "_", "=_", "128_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GI", "L", "\\u", "CHECKS", "HI", "EL", "D_", "=_", "512_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GI", "L", "\\u", "SIM", "ULAT", "ED", "OC", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GI", "L", "\\u", "PER", "INSTANCE", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GI", "L", "\\u", "PER", "CLASS_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GI", "L", "\\u", "NOT", "FILENAME_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GI", "L", "\\u", "DON", "TCA", "CHE", "_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GI", "L", "\\u", "SHI", "EL", "D_", "=_", "512_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GI", "L", "\\u", "FORCE", "NOS", "HI", "EL", "D_", "=_", "1024_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ISI", "OI", "\\u", "ICON", "FILE_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ISI", "OI", "\\u", "ICON", "INDEX_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ISI", "OI", "\\u", "SYS", "IMA", "GE", "LIST", "INDEX_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "\\u", "MOVE", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "\\u", "COPY", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "\\u", "DELETE_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "\\u", "RENA", "ME_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "MULTI", "DEST", "FILES_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "CONFIRM", "MOUSE", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "SIL", "ENT_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "RENA", "ME", "ON", "COLL", "ISI", "ON_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "NOC", "ONF", "IR", "MAT", "ION_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "WAN", "TM", "APP", "ING", "HANDLE_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "ALLOW", "UND", "O_", "=_", "64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "FILE", "SON", "LY_", "=_", "128_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "SIMPLE", "PROGRESS", "_", "=_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "NOC", "ONF", "IR", "MM", "KD", "IR_", "=_", "512_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "NO", "ERROR", "UI_", "=_", "1024_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FO", "F", "\\u", "NOC", "OP", "YS", "ECU", "RIT", "YA", "TT", "RIB", "S_", "=_", "2048_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PO", "\\u", "DELETE_", "=_", "19_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PO", "\\u", "RENA", "ME_", "=_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PO", "\\u", "PORT", "CHANGE", "_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PO", "\\u", "REN", "\\u", "PORT_", "=_", "52_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FV", "SI", "F", "\\u", "RECT", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FV", "SI", "F", "\\u", "PIN", "NED", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FV", "SI", "F", "\\u", "NEW", "FAILED_", "=_", "134", "217", "728", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FV", "SI", "F", "\\u", "NEW", "FILE_", "=_", "-_", "2147483648", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FV", "SI", "F", "\\u", "CAN", "VIEW", "IT", "_", "=_", "1073", "741", "824", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "ID", "M", "\\u", "SH", "VIEW", "FIRST_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "ID", "M", "\\u", "SH", "VIEW", "LAST_", "=_", "3276", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "ID", "M", "\\u", "BROWSER", "FIRST_", "=_", "409", "60_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "ID", "M", "\\u", "BROWSER", "LAST_", "=_", "488", "96_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "ID", "M", "\\u", "GLOB", "AL", "FIRST_", "=_", "32768_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "ID", "M", "\\u", "GLOB", "ALL", "AST_", "=_", "409", "59_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "ID", "M", "\\u", "MENU", "\\u", "FILE_", "=_", "(_", "FC", "ID", "M", "\\u", "GLOB", "AL", "FIRST_", "+_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "ID", "M", "\\u", "MENU", "\\u", "EDIT", "_", "=_", "(_", "FC", "ID", "M", "\\u", "GLOB", "AL", "FIRST_", "+_", "64_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "ID", "M", "\\u", "MENU", "\\u", "VIEW_", "=_", "(_", "FC", "ID", "M", "\\u", "GLOB", "AL", "FIRST_", "+_", "128_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "ID", "M", "\\u", "MENU", "\\u", "VIEW", "\\u", "SEP", "\\u", "OPTIONS_", "=_", "(_", "FC", "ID", "M", "\\u", "GLOB", "AL", "FIRST_", "+_", "129_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "ID", "M", "\\u", "MENU", "\\u", "TOOLS", "_", "=_", "(_", "FC", "ID", "M", "\\u", "GLOB", "AL", "FIRST_", "+_", "192_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "ID", "M", "\\u", "MENU", "\\u", "TOOLS", "\\u", "SEP", "\\u", "GOT", "O_", "=_", "(_", "FC", "ID", "M", "\\u", "GLOB", "AL", "FIRST_", "+_", "193_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "ID", "M", "\\u", "MENU", "\\u", "HELP_", "=_", "(_", "FC", "ID", "M", "\\u", "GLOB", "AL", "FIRST_", "+_", "256_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "ID", "M", "\\u", "MENU", "\\u", "FIND", "_", "=_", "(_", "FC", "ID", "M", "\\u", "GLOB", "AL", "FIRST_", "+_", "320_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "ID", "M", "\\u", "MENU", "\\u", "EXPL", "ORE", "_", "=_", "(_", "FC", "ID", "M", "\\u", "GLOB", "AL", "FIRST_", "+_", "336", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "ID", "M", "\\u", "MENU", "\\u", "FA", "VOR", "ITE", "S_", "=_", "(_", "FC", "ID", "M", "\\u", "GLOB", "AL", "FIRST_", "+_", "368", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "ID", "M", "\\u", "TOOL", "BAR_", "=_", "(_", "FC", "ID", "M", "\\u", "BROWSER", "FIRST_", "+_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "ID", "M", "\\u", "STATUS_", "=_", "(_", "FC", "ID", "M", "\\u", "BROWSER", "FIRST_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ID", "C", "\\u", "OFF", "LINE", "\\u", "HAND", "_", "=_", "103_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SB", "SP", "\\u", "DEF", "BROWSER", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SB", "SP", "\\u", "SAM", "EB", "ROWS", "ER_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SB", "SP", "\\u", "NEW", "BROWSER", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SB", "SP", "\\u", "DEF", "MODE_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SB", "SP", "\\u", "OPEN", "MODE_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SB", "SP", "\\u", "EXPL", "ORE", "MODE_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SB", "SP", "\\u", "ABS", "OLUT", "E_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SB", "SP", "\\u", "RELAT", "IVE_", "=_", "4096_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SB", "SP", "\\u", "PARENT", "_", "=_", "8192_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SB", "SP", "\\u", "NAV", "IG", "ATE", "BACK_", "=_", "1638", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SB", "SP", "\\u", "NAV", "IG", "ATE", "FORWARD", "_", "=_", "32768_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SB", "SP", "\\u", "ALLOW", "\\u", "AUTO", "NAV", "IG", "ATE_", "=_", "65536_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SB", "SP", "\\u", "INIT", "IAT", "ED", "BY", "HL", "INK", "FRAME", "_", "=_", "-_", "2147483648", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SB", "SP", "\\u", "REDIRECT", "_", "=_", "1073", "741", "824", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SB", "SP", "\\u", "WRITE", "NO", "HISTORY", "_", "=_", "134", "217", "728", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SB", "SP", "\\u", "NO", "AUTOS", "ELECT", "_", "=_", "671", "088", "64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "W", "\\u", "STATUS_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "W", "\\u", "TOOL", "BAR_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "W", "\\u", "TREE", "_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "W", "\\u", "INTERN", "ET", "BAR_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "W", "\\u", "PROGRESS", "_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "T", "\\u", "MERGE", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "T", "\\u", "CONFIG", "ABLE_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FC", "T", "\\u", "ADD", "TO", "END_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CD", "BO", "SC", "\\u", "SET", "FOC", "US_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CD", "BO", "SC", "\\u", "KILL", "FOC", "US_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CD", "BO", "SC", "\\u", "SEL", "CHANGE", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CD", "BO", "SC", "\\u", "RENA", "ME_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SV", "SI", "\\u", "DES", "ELECT", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SV", "SI", "\\u", "SELECT", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SV", "SI", "\\u", "EDIT", "_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SV", "SI", "\\u", "DES", "ELECT", "OTHER", "S_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SV", "SI", "\\u", "ENS", "URE", "VISI", "BLE_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SV", "SI", "\\u", "FOC", "USED", "_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SV", "SI", "\\u", "TRANSLAT", "EP", "T_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SV", "GI", "O", "\\u", "BACKGROUND", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SV", "GI", "O", "\\u", "SELECTION", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SV", "GI", "O", "\\u", "ALL", "VIEW_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SV", "GI", "O", "\\u", "CHECK", "ED_", "=_", "0x3", "_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SV", "GI", "O", "\\u", "TYPE", "\\u", "MASK_", "=_", "0xf", "_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SV", "GI", "O", "\\u", "FLAG", "\\u", "VIEW", "ORDER_", "=_", "-_", "2147483648", "_", "#", " ", "0x80000", "000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "RET", "\\u", "WS", "TR_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "RET", "\\u", "OFFSET_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "RET", "\\u", "CST", "R_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "DES", "KT", "OP_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "INTERN", "ET_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "PROGRAM", "S_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "CONTR", "OL", "S_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "PRINT", "ERS_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "PERSON", "AL_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "FA", "VOR", "ITE", "S_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "START", "UP_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "REC", "ENT_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "SEND", "TO_", "=_", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "BIT", "BUCKET", "_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "START", "MENU_", "=_", "11_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "MY", "DOCUMENT", "S_", "=_", "12_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "MY", "MUS", "IC_", "=_", "13_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "MY", "VIDEO", "_", "=_", "14_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "DES", "KT", "OP", "DIRECTORY_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "DRI", "VE", "S_", "=_", "17_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "NETWORK_", "=_", "18_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "NET", "HO", "OD_", "=_", "19_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "FONT", "S_", "=_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "TEMPLATES_", "=_", "21_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "COMMON", "\\u", "START", "MENU_", "=_", "22_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "COMMON", "\\u", "PROGRAM", "S_", "=_", "23_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "COMMON", "\\u", "START", "UP_", "=_", "24_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "COMMON", "\\u", "DES", "KT", "OP", "DIRECTORY_", "=_", "25_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "APP", "DATA_", "=_", "26_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "PRINT", "HO", "OD_", "=_", "27_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "LOCAL", "\\u", "APP", "DATA_", "=_", "28_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "ALT", "START", "UP_", "=_", "29_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "COMMON", "\\u", "ALT", "START", "UP_", "=_", "30_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "COMMON", "\\u", "FA", "VOR", "ITE", "S_", "=_", "31_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "INTERN", "ET", "\\u", "CACHE_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "COOKIE", "S_", "=_", "33_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "HISTORY", "_", "=_", "34_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "COMMON", "\\u", "APP", "DATA_", "=_", "35_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "WINDOWS", "_", "=_", "36_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "SYSTEM", "_", "=_", "37_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "PROGRAM", "\\u", "FILES_", "=_", "38_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "MY", "PIC", "TUR", "ES_", "=_", "39_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "PROFILE", "_", "=_", "40_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "SYSTEM", "X", "86_", "=_", "41_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "PROGRAM", "\\u", "FILE", "SX", "86_", "=_", "42_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "PROGRAM", "\\u", "FILE", "S", "\\u", "COMMON", "_", "=_", "43_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "PROGRAM", "\\u", "FILE", "S", "\\u", "COMMON", "X", "86_", "=_", "44_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "COMMON", "\\u", "TEMPLATES_", "=_", "45_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "COMMON", "\\u", "DOCUMENT", "S_", "=_", "46_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "COMMON", "\\u", "ADM", "INT", "OO", "LS_", "=_", "47_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "ADM", "INT", "OO", "LS_", "=_", "48_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "CONNECTION", "S_", "=_", "49_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "COMMON", "\\u", "MUS", "IC_", "=_", "53_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "COMMON", "\\u", "PIC", "TUR", "ES_", "=_", "54_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "COMMON", "\\u", "VIDEO", "_", "=_", "55_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "RESOURCES", "_", "=_", "56_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "RESOURCES", "\\u", "LOCAL", "IZED", "_", "=_", "57_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "COMMON", "\\u", "OE", "M", "\\u", "LINKS", "_", "=_", "58_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "CD", "BUR", "N", "\\u", "AREA", "_", "=_", "59_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "60", " ", "unused_", "\\u\\u\\uNL\\u\\u\\u_", "CSI", "DL", "\\u", "COMPUTE", "RS", "NEA", "RM", "E_", "=_", "61_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "BI", "F", "\\u", "RETURN", "ONL", "YF", "SD", "IR", "S_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BI", "F", "\\u", "DON", "TG", "OB", "EL", "OW", "DOMAIN_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BI", "F", "\\u", "STATUS", "TEXT_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BI", "F", "\\u", "RETURN", "FS", "ANCE", "STOR", "S_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BI", "F", "\\u", "EDIT", "BOX_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BI", "F", "\\u", "VALID", "ATE_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BI", "F", "\\u", "BRO", "WS", "EF", "ORC", "OMP", "UT", "ER_", "=_", "4096_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BI", "F", "\\u", "BRO", "WS", "EF", "OR", "PRINT", "ER_", "=_", "8192_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BI", "F", "\\u", "BRO", "WS", "EIN", "CL", "UD", "EFI", "LES", "_", "=_", "1638", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "FM", "\\u", "INITIAL", "IZED", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "FM", "\\u", "SEL", "CHANGED", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "FM", "\\u", "VALID", "ATE", "FAIL", "EDA", "_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "FM", "\\u", "VALID", "ATE", "FAIL", "ED", "W_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "FM", "\\u", "SET", "STATUS", "TEXT", "A_", "=_", "(_", "WM", "\\u", "USER_", "+_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "FM", "\\u", "ENABLE", "OK_", "=_", "(_", "WM", "\\u", "USER_", "+_", "101_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "FM", "\\u", "SET", "SELECTION", "A_", "=_", "(_", "WM", "\\u", "USER_", "+_", "102_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "FM", "\\u", "SET", "SELECTION", "W_", "=_", "(_", "WM", "\\u", "USER_", "+_", "103_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "FM", "\\u", "SET", "STATUS", "TEXT", "W_", "=_", "(_", "WM", "\\u", "USER_", "+_", "104_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "FM", "\\u", "SET", "STATUS", "TEXT_", "=_", "BF", "FM", "\\u", "SET", "STATUS", "TEXT", "W_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "FM", "\\u", "SET", "SELECTION", "_", "=_", "BF", "FM", "\\u", "SET", "SELECTION", "W_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "FM", "\\u", "VALID", "ATE", "FAILED_", "=_", "BF", "FM", "\\u", "VALID", "ATE", "FAIL", "ED", "W_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "FM", "\\u", "SET", "STATUS", "TEXT_", "=_", "BF", "FM", "\\u", "SET", "STATUS", "TEXT", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "FM", "\\u", "SET", "SELECTION", "_", "=_", "BF", "FM", "\\u", "SET", "SELECTION", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "FM", "\\u", "VALID", "ATE", "FAILED_", "=_", "BF", "FM", "\\u", "VALID", "ATE", "FAIL", "EDA", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "CAN", "COPY", "_", "=_", "DROP", "EFFECT", "\\u", "COPY", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "CAN", "MOVE", "_", "=_", "DROP", "EFFECT", "\\u", "MOVE", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "CAN", "LINK_", "=_", "DROP", "EFFECT", "\\u", "LINK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "CAN", "RENA", "ME_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "CAN", "DELETE_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "HAS", "PROP", "SHE", "ET_", "=_", "64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "DROP", "TARGET_", "=_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "CAPA", "BILITY", "MASK_", "=_", "375_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "LINK_", "=_", "65536_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "SHAR", "E_", "=_", "1310", "72_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "READO", "NLY", "_", "=_", "262", "144_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "GH", "OST", "ED_", "=_", "524", "288_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "HIDDEN", "_", "=_", "524", "288_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "DISPLAY", "ATT", "RM", "ASK", "_", "=_", "983", "040", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "FILE", "SYS", "ANCE", "STOR", "_", "=_", "268", "435", "456_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "FOLDER_", "=_", "536", "870", "912", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "FILE", "SYSTEM", "_", "=_", "1073", "741", "824", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "HAS", "SUB", "FOLDER_", "=_", "(_", "-_", "2147483648", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "CONTE", "NTS", "MASK_", "=_", "(_", "-_", "2147483648", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "VALID", "ATE_", "=_", "1677721", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "REMO", "VA", "BLE_", "=_", "335", "544", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "COMPRESS", "ED_", "=_", "671", "088", "64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "BRO", "WS", "ABLE_", "=_", "134", "217", "728", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "NON", "ENUM", "ERA", "TED_", "=_", "104857", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "NEW", "CONTENT_", "=_", "209", "715", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "STORAGE_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DW", "FR", "F", "\\u", "NORMAL_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DW", "FR", "F", "\\u", "DELET", "ECO", "NF", "IG", "DATA_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DW", "FA", "F", "\\u", "HIDDEN", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IM", "\\u", "MIN", "SIZE_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IM", "\\u", "MAX", "SIZE_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IM", "\\u", "INTEG", "RAL", "_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IM", "\\u", "ACT", "UAL", "_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IM", "\\u", "TITLE_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IM", "\\u", "MODE", "FLAGS_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IM", "\\u", "BK", "COLOR_", "=_", "64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IM", "F", "\\u", "NORMAL_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IM", "F", "\\u", "VARIABLE", "HEIGHT_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IM", "F", "\\u", "DEB", "OSS", "ED_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IM", "F", "\\u", "BK", "COLOR_", "=_", "64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IF", "\\u", "VIEW", "MODE", "\\u", "NORMAL_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IF", "\\u", "VIEW", "MODE", "\\u", "VERTICAL_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IF", "\\u", "VIEW", "MODE", "\\u", "FLOAT", "ING_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IF", "\\u", "VIEW", "MODE", "\\u", "TRANSP", "ARE", "NT_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPONENT", "\\u", "TOP_", "=_", "(_", "2147483647", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "TYPE", "\\u", "HTM", "LD", "OC", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "TYPE", "\\u", "PIC", "TUR", "E_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "TYPE", "\\u", "WEBS", "ITE", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "TYPE", "\\u", "CONTROL_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "TYPE", "\\u", "CF", "HTML_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "TYPE", "\\u", "MAX_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AD", "\\u", "APPL", "Y", "\\u", "SAVE", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AD", "\\u", "APPL", "Y", "\\u", "HTM", "LG", "EN_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AD", "\\u", "APPL", "Y", "\\u", "REFRESH", "_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AD", "\\u", "APPL", "Y", "\\u", "ALL_", "=_", "(_", "AD", "\\u", "APPL", "Y", "\\u", "SAVE", "_", "|_", "AD", "\\u", "APPL", "Y", "\\u", "HTM", "LG", "EN_", "|_", "AD", "\\u", "APPL", "Y", "\\u", "REFRESH", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AD", "\\u", "APPL", "Y", "\\u", "FORCE", "_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AD", "\\u", "APPL", "Y", "\\u", "BUFF", "ERE", "D", "\\u", "REFRESH", "_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "WP", "STYLE", "\\u", "CENTER_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "WP", "STYLE", "\\u", "TILE", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "WP", "STYLE", "\\u", "STRE", "TCH", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "WP", "STYLE", "\\u", "MAX_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "TYPE_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "CHECK", "ED_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "DIR", "TY_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "NOS", "CRO", "LL_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "POS", "\\u", "LEFT_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "POS", "\\u", "TOP_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "SIZE", "\\u", "WIDTH_", "=_", "64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "SIZE", "\\u", "HEIGHT_", "=_", "128_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "POS", "\\u", "ZI", "NDE", "X_", "=_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "SOURCE_", "=_", "512_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "FRI", "END", "LY", "NAME_", "=_", "1024_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "SUBSCRI", "BED", "URL_", "=_", "2048_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ADD", "URL", "\\u", "SIL", "ENT_", "=_", "0X", "0001", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "SHELL", "ID", "LIST_", "=_", "\"", "Shel", "l", " ", "ID", "List", " ", "Array", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "SHELL", "ID", "LIST", "OFFSET_", "=_", "\"", "Shel", "l", " ", "Object", " ", "Offsets", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "NET", "RESOURCES", "_", "=_", "\"", "Net", " ", "Reso", "urc", "e", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "FILE", "DESCRIPT", "ORA", "_", "=_", "\"", "File", "Group", "Descrip", "tor", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "FILE", "DESCRIPT", "OR", "W_", "=_", "\"", "File", "Group", "Descrip", "tor", "W", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "FILE", "CONTE", "NTS", "_", "=_", "\"", "File", "Conten", "ts", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "FILE", "NAME", "A_", "=_", "\"", "File", "Name", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "FILE", "NAME", "W_", "=_", "\"", "File", "Name", "W", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "PRINT", "ER", "GROUP_", "=_", "\"", "Print", "er", "Friend", "ly", "Name", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "FILE", "NAME", "MAP", "A_", "=_", "\"", "File", "Name", "Map", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "FILE", "NAME", "MAP", "W_", "=_", "\"", "File", "Name", "Map", "W", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "SHELL", "URL_", "=_", "\"", "Uniform", "Reso", "urc", "e", "Locator", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "INE", "TUR", "LA_", "=_", "CF", "STR", "\\u", "SHELL", "URL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "INE", "TUR", "LW", "_", "=_", "\"", "Uniform", "Reso", "urc", "e", "Locator", "W", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "PREFER", "RED", "DROP", "EFFECT", "_", "=_", "\"", "Prefe", "rre", "d", " ", "Drop", "Effe", "ct", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "PERF", "ORM", "ED", "DROP", "EFFECT", "_", "=_", "\"", "Perform", "ed", " ", "Drop", "Effe", "ct", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "PAS", "TES", "UC", "CEE", "DED", "_", "=_", "\"", "Past", "e", " ", "Succeed", "ed", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "IND", "RA", "GL", "OO", "P_", "=_", "\"", "In", "Shel", "l", "Drag", "Loop", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "DRA", "GC", "ONT", "EXT_", "=_", "\"", "Drag", "Context", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "MOUNT", "ED", "VOLUME_", "=_", "\"", "Mount", "ed", "Volume", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "PERS", "ISTE", "DD", "ATA", "OBJECT_", "=_", "\"", "Persi", "sted", "Data", "Object", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "TARGET", "CLS", "ID_", "=_", "\"", "Target", "CLS", "ID", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "LOGI", "CAL", "PERF", "ORM", "ED", "DROP", "EFFECT", "_", "=_", "\"", "Logi", "cal", " ", "Perform", "ed", " ", "Drop", "Effe", "ct", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "AUTO", "PLAY", "\\u", "SHELL", "ID", "LIST", "S_", "=_", "\"", "Auto", "play", " ", "Enumerate", "d", " ", "ID", "List", " ", "Array", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "FILE", "DESCRIPTOR_", "=_", "CF", "STR", "\\u", "FILE", "DESCRIPT", "OR", "W_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "FILENAME_", "=_", "CF", "STR", "\\u", "FILE", "NAME", "W_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "FILE", "NAME", "MAP_", "=_", "CF", "STR", "\\u", "FILE", "NAME", "MAP", "W_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "FILE", "DESCRIPTOR_", "=_", "CF", "STR", "\\u", "FILE", "DESCRIPT", "ORA", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "FILENAME_", "=_", "CF", "STR", "\\u", "FILE", "NAME", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CF", "STR", "\\u", "FILE", "NAME", "MAP_", "=_", "CF", "STR", "\\u", "FILE", "NAME", "MAP", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DV", "ASP", "ECT", "\\u", "SHORT", "NAME_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "E", "\\u", "RENA", "ME", "ITEM_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "E", "\\u", "CREATE_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "E", "\\u", "DELETE_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "E", "\\u", "MK", "DIR_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "E", "\\u", "RM", "DIR_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "E", "\\u", "MEDIA", "INSERT", "ED_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "E", "\\u", "MEDIA", "REMOVE", "D_", "=_", "64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "E", "\\u", "DRIVER", "EMO", "VED", "_", "=_", "128_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "E", "\\u", "DRI", "VE", "ADD_", "=_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "E", "\\u", "NET", "SHAR", "E_", "=_", "512_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "E", "\\u", "NET", "UNS", "HAR", "E_", "=_", "1024_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "E", "\\u", "ATTRIBUTES_", "=_", "2048_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "E", "\\u", "UPDATE", "DIR_", "=_", "4096_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "E", "\\u", "UPDATE", "ITEM_", "=_", "8192_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "E", "\\u", "SERVER", "DISCONNECT", "_", "=_", "1638", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "E", "\\u", "UPDATE", "IMAGE_", "=_", "32768_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "E", "\\u", "DRI", "VE", "ADD", "GUI_", "=_", "65536_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "E", "\\u", "RENA", "ME", "FOLDER_", "=_", "1310", "72_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "E", "\\u", "FREE", "SPACE_", "=_", "262", "144_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "E", "\\u", "EXTEND", "ED", "\\u", "EVENT_", "=_", "671", "088", "64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "E", "\\u", "ASSOC", "CHANGED", "_", "=_", "134", "217", "728", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "E", "\\u", "DISK", "EVENTS", "_", "=_", "145", "439", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "E", "\\u", "GLOB", "ALE", "VEN", "TS_", "=_", "2016", "875", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "E", "\\u", "ALL", "EVENTS", "_", "=_", "2147483647", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "E", "\\u", "INTER", "RU", "PT_", "=_", "-_", "2147483648", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "EE", "\\u", "ORDE", "RC", "HAN", "GED_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "F", "\\u", "ID", "LIST_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "F", "\\u", "PATH", "A_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "F", "\\u", "PRINT", "ERA", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "F", "\\u", "DWORD_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "F", "\\u", "PATH", "W_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "F", "\\u", "PRINT", "ER", "W_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "F", "\\u", "TYPE_", "=_", "255_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "F", "\\u", "FLU", "SH_", "=_", "4096_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "F", "\\u", "FLU", "SH", "NOW", "AI", "T_", "=_", "8192_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "F", "\\u", "PATH_", "=_", "SH", "CN", "F", "\\u", "PATH", "W_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "F", "\\u", "PRINT", "ER_", "=_", "SH", "CN", "F", "\\u", "PRINT", "ER", "W_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "F", "\\u", "PATH_", "=_", "SH", "CN", "F", "\\u", "PATH", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "F", "\\u", "PRINT", "ER_", "=_", "SH", "CN", "F", "\\u", "PRINT", "ERA", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "QI", "F", "\\u", "CACHE", "D_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "QI", "F", "\\u", "DON", "TEX", "PAN", "DF", "OLD", "ER_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "SHAR", "D", " ", "enum", " ", "for", " ", "SHA", "dd", "To", "Rece", "nt", "Docs", "_", "\\u\\u\\uNL\\u\\u\\u_", "SHAR", "D", "\\u", "PID", "L_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SHAR", "D", "\\u", "PATH", "A_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SHAR", "D", "\\u", "PATH", "W_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SHAR", "D", "\\u", "APP", "IDI", "NF", "O_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SHAR", "D", "\\u", "APP", "IDI", "NF", "OID", "LIST_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SHAR", "D", "\\u", "LINK_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SHAR", "D", "\\u", "APP", "IDI", "NF", "OL", "INK", "_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SHAR", "D", "\\u", "SHELL", "ITEM_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "##", " ", "SHAR", "D", "\\u", "PATH", " ", "=", " ", "SHAR", "D", "\\u", "PATH", "W_", "\\u\\u\\uNL\\u\\u\\u_", "SHAR", "D", "\\u", "PATH_", "=_", "SHAR", "D", "\\u", "PATH", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "SH", "GD", "FIL", "\\u", "FIND", "DATA_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GD", "FIL", "\\u", "NET", "RESOURCE_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GD", "FIL", "\\u", "DESCRIPT", "ION", "ID_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "DID", "\\u", "ROO", "T", "\\u", "REGI", "TEM", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "DID", "\\u", "FS", "\\u", "FILE_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "DID", "\\u", "FS", "\\u", "DIRECTORY_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "DID", "\\u", "FS", "\\u", "OTHER", "_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "DID", "\\u", "COMPUTE", "R", "\\u", "DRI", "VE", "35_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "DID", "\\u", "COMPUTE", "R", "\\u", "DRI", "VE", "525", "_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "DID", "\\u", "COMPUTE", "R", "\\u", "REMO", "VA", "BLE_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "DID", "\\u", "COMPUTE", "R", "\\u", "FIXED", "_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "DID", "\\u", "COMPUTE", "R", "\\u", "NET", "DRI", "VE_", "=_", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "DID", "\\u", "COMPUTE", "R", "\\u", "CD", "ROM", "_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "DID", "\\u", "COMPUTE", "R", "\\u", "RAM", "DISK", "_", "=_", "11_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "DID", "\\u", "COMPUTE", "R", "\\u", "OTHER", "_", "=_", "12_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "DID", "\\u", "NET", "\\u", "DOMAIN_", "=_", "13_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "DID", "\\u", "NET", "\\u", "SERVER_", "=_", "14_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "DID", "\\u", "NET", "\\u", "SHAR", "E_", "=_", "15_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "DID", "\\u", "NET", "\\u", "REST", "OF", "NET", "_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "DID", "\\u", "NET", "\\u", "OTHER", "_", "=_", "17_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "IS", "\\u", "URL_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "IS", "\\u", "NAME_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "IS", "\\u", "WORK", "ING", "DIR_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "IS", "\\u", "HOT", "KEY_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "IS", "\\u", "SHOW", "CMD_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "IS", "\\u", "ICON", "INDEX_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "IS", "\\u", "ICON", "FILE_", "=_", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "IS", "\\u", "WH", "ATS", "NEW_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "IS", "\\u", "AUTHOR", "_", "=_", "11_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "IS", "\\u", "DESCRIPTION_", "=_", "12_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "IS", "\\u", "COMMENT_", "=_", "13_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "INT", "SITE", "\\u", "WH", "ATS", "NEW_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "INT", "SITE", "\\u", "AUTHOR", "_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "INT", "SITE", "\\u", "LAS", "TV", "ISI", "T_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "INT", "SITE", "\\u", "LAS", "TM", "OD_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "INT", "SITE", "\\u", "VISI", "TC", "OUN", "T_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "INT", "SITE", "\\u", "DESCRIPTION_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "INT", "SITE", "\\u", "COMMENT_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "INT", "SITE", "\\u", "FLAGS_", "=_", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "INT", "SITE", "\\u", "CONTE", "NT", "LEN_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "INT", "SITE", "\\u", "CONTE", "NT", "CODE_", "=_", "11_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "INT", "SITE", "\\u", "REC", "URS", "E_", "=_", "12_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "INT", "SITE", "\\u", "WATCH", "_", "=_", "13_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "INT", "SITE", "\\u", "SUBSCRI", "PTION", "_", "=_", "14_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "INT", "SITE", "\\u", "URL_", "=_", "15_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "INT", "SITE", "\\u", "TITLE_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "INT", "SITE", "\\u", "CODE", "PAGE_", "=_", "18_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "INT", "SITE", "\\u", "TRACK", "ING_", "=_", "19_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "IS", "F", "\\u", "REC", "ENT", "LY", "CHANGED", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "IS", "F", "\\u", "CACHE", "DST", "IC", "KY", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "IS", "F", "\\u", "CACHE", "IMAGES", "_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "IS", "F", "\\u", "FOL", "LOW", "ALL", "LINKS", "_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "IS", "M", "\\u", "GLOBAL_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "IS", "M", "\\u", "WATCH", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "IS", "M", "\\u", "DON", "TW", "ATCH", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SS", "F", "\\u", "SHOW", "ALL", "OBJECTS", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SS", "F", "\\u", "SHOW", "EXTENSIONS_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SS", "F", "\\u", "SHOW", "COMP", "COLOR_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SS", "F", "\\u", "SHOW", "SYS", "FILES_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SS", "F", "\\u", "DOUBLE", "CLICK", "IN", "WEB", "VIEW_", "=_", "128_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SS", "F", "\\u", "SHOW", "ATTRIB", "COL_", "=_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SS", "F", "\\u", "DES", "KT", "OP", "HTML_", "=_", "512_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SS", "F", "\\u", "WIN", "9", "5", "CLASS", "IC_", "=_", "1024_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SS", "F", "\\u", "DON", "TP", "RET", "TYP", "ATH", "_", "=_", "2048_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SS", "F", "\\u", "SHOW", "INFO", "TIP", "_", "=_", "8192_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SS", "F", "\\u", "MAP", "NET", "DR", "VB", "UT", "TON", "_", "=_", "4096_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SS", "F", "\\u", "NOC", "ONF", "IR", "MR", "EC", "YC", "LE_", "=_", "32768_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SS", "F", "\\u", "HID", "EI", "CONS", "_", "=_", "1638", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "AB", "M", "\\u", "NEW_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AB", "M", "\\u", "REMOVE", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AB", "M", "\\u", "QUE", "RY", "POS_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AB", "M", "\\u", "SET", "POS_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AB", "M", "\\u", "GET", "STATE_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AB", "M", "\\u", "GET", "TASK", "BAR", "POS_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AB", "M", "\\u", "ACTIVAT", "E_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AB", "M", "\\u", "GET", "AUTO", "HID", "EBA", "R_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AB", "M", "\\u", "SET", "AUTO", "HID", "EBA", "R_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AB", "M", "\\u", "WIND", "OW", "POS", "CHANGED", "_", "=_", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AB", "N", "\\u", "STATE", "CHANGE", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AB", "N", "\\u", "POS", "CHANGED", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AB", "N", "\\u", "FULL", "SCREEN", "APP_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AB", "N", "\\u", "WIND", "OW", "ARR", "ANGE", "_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ABS", "\\u", "AUTO", "HID", "E_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ABS", "\\u", "ALWAYS", "ONT", "OP_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AB", "E", "\\u", "LEFT_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AB", "E", "\\u", "TOP_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AB", "E", "\\u", "RIGHT_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AB", "E", "\\u", "BOTTOM_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Some", " ", "manu", "ally", " ", "adde", "d", " ", "ones_", "\\u\\u\\uNL\\u\\u\\u_", "CSI", "DL", "\\u", "COMMON", "\\u", "APP", "DATA_", "=_", "35_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CSI", "DL", "\\u", "LOCAL", "\\u", "APP", "DATA_", "=_", "28_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "SH", "CONT", "F", "\\u", "FOLDER", "S_", "=_", "32_", "#", " ", "for", " ", "shell", " ", "browser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CONT", "F", "\\u", "NON", "FOLDER", "S_", "=_", "64_", "#", " ", "for", " ", "default", " ", "view_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CONT", "F", "\\u", "INCLUDE", "HIDDEN", "_", "=_", "128_", "#", " ", "for", " ", "hidden", "/", "system", " ", "objects_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CONT", "F", "\\u", "INIT", "\\u", "ON", "\\u", "FIR", "ST", "\\u", "NEXT", "_", "=_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CONT", "F", "\\u", "NET", "PRINT", "ERS", "RC", "H_", "=_", "512_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CONT", "F", "\\u", "SHAR", "EA", "BLE_", "=_", "1024_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CONT", "F", "\\u", "STORAGE_", "=_", "2048_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "SH", "GD", "N", "\\u", "NORMAL_", "=_", "0_", "#", " ", "default", " ", "(", "display", " ", "purpose", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GD", "N", "\\u", "INFO", "LD", "ER_", "=_", "1_", "#", " ", "displaye", "d", " ", "under", " ", "a", " ", "folder", " ", "(", "relative", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GD", "N", "\\u", "FORE", "DI", "TIN", "G_", "=_", "4096_", "#", " ", "for", " ", "in", "-", "place", " ", "editin", "g_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GD", "N", "\\u", "INCLUDE", "\\u", "NON", "FILE", "SYS", "_", "=_", "8192_", "#", " ", "if", " ", "not", " ", "set", ",", " ", "display", " ", "names", " ", "for", " ", "shell", " ", "name", " ", "space", " ", "items", " ", "tha", "t", " ", "are", " ", "not", " ", "in", " ", "the", " ", "file", " ", "system", " ", "will", " ", "fail", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GD", "N", "\\u", "FOR", "ADDR", "ESS", "BAR_", "=_", "1638", "4_", "#", " ", "for", " ", "display", "ing", " ", "in", " ", "the", " ", "address", " ", "(", "drives", " ", "dropdown", ")", " ", "bar_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GD", "N", "\\u", "FOR", "PAR", "SIN", "G_", "=_", "32768_", "#", " ", "for", " ", "Pars", "e", "Display", "Name", " ", "or", " ", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "SH", "CONT", "F", "\\u", "FOLDER", "S_", "=_", "32_", "#", " ", "for", " ", "shell", " ", "browser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CONT", "F", "\\u", "NON", "FOLDER", "S_", "=_", "64_", "#", " ", "for", " ", "default", " ", "view_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CONT", "F", "\\u", "INCLUDE", "HIDDEN", "_", "=_", "128_", "#", " ", "for", " ", "hidden", "/", "system", " ", "objects_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "BF", "O", "\\u", "NONE_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "O", "\\u", "BROWSER", "\\u", "PERS", "IST", "\\u", "SETTINGS_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "O", "\\u", "RENA", "ME", "\\u", "FOLDER", "\\u", "OPTION", "S", "\\u", "TO", "INTERN", "ET_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "O", "\\u", "BOT", "H", "\\u", "OPTIONS_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BI", "F", "\\u", "PREFER", "\\u", "INTERN", "ET", "\\u", "SHORT", "CUT", "_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "O", "\\u", "BRO", "WS", "E", "\\u", "NO", "\\u", "IN", "\\u", "NEW", "\\u", "PROCESS", "_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "O", "\\u", "ENABLE", "\\u", "HYP", "ER", "LINK", "\\u", "TRACK", "ING_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "O", "\\u", "USE", "\\u", "IE", "\\u", "OFF", "LINE", "\\u", "SUPPORT", "_", "=_", "64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "O", "\\u", "SUBST", "ITU", "E", "\\u", "INTERN", "ET", "\\u", "START", "\\u", "PAGE_", "=_", "128_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "O", "\\u", "USE", "\\u", "IE", "\\u", "LOGO", "BAND", "ING_", "=_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "O", "\\u", "ADD", "\\u", "IE", "\\u", "TOC", "AP", "TIO", "NB", "AR_", "=_", "512_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "O", "\\u", "USE", "\\u", "DIAL", "UP", "\\u", "REF_", "=_", "1024_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "O", "\\u", "USE", "\\u", "IE", "\\u", "TOOL", "BAR_", "=_", "2048_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "O", "\\u", "NO", "\\u", "PARENT", "\\u", "FOLDER", "\\u", "SUPPORT", "_", "=_", "4096_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "O", "\\u", "NO", "\\u", "RE", "OPEN", "\\u", "NEXT", "\\u", "RESTA", "RT_", "=_", "8192_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "O", "\\u", "GO", "\\u", "HOM", "E", "\\u", "PAGE_", "=_", "1638", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "O", "\\u", "PREFER", "\\u", "IE", "PROCESS", "_", "=_", "32768_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "O", "\\u", "SHOW", "\\u", "NAV", "IG", "ATION", "\\u", "CANCELLED", "_", "=_", "65536_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BF", "O", "\\u", "QUE", "RY", "\\u", "ALL_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fro", "m", " ", "Sh", "l", "Guid", ".", "h_", "\\u\\u\\uNL\\u\\u\\u_", "PID", "\\u", "FIND", "DATA_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "NET", "RESOURCE_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "DESCRIPT", "ION", "ID_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "WH", "IC", "HF", "OLD", "ER_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "NET", "WORK", "LOCATION_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "COMPUTE", "RNA", "ME_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "DISP", "LAC", "ED", "\\u", "FROM", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "DISP", "LAC", "ED", "\\u", "DATE_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "SYNC", "\\u", "COPY", "\\u", "IN_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "MIS", "C", "\\u", "STATUS_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "MIS", "C", "\\u", "ACCESS", "COUNT_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "MIS", "C", "\\u", "OWNER", "_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "HTM", "LIN", "FO", "TIP", "FILE_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "MIS", "C", "\\u", "PIC", "S_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "DISPLAY", "\\u", "PROPERTIES_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "INT", "ROT", "EXT_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "ARTI", "ST_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "SON", "GT", "IT", "LE_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "ALB", "UM_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "YEAR_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "COMMENT_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "TRACK", "_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "GEN", "RE_", "=_", "11_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "LY", "RIC", "S_", "=_", "12_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "DR", "SI", "\\u", "PROT", "ECTED", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "DR", "SI", "\\u", "DESCRIPTION_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "DR", "SI", "\\u", "PLAY", "COUNT_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "DR", "SI", "\\u", "PLAY", "START", "S_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "DR", "SI", "\\u", "PLAY", "EXPIRE", "S_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "VS", "I", "\\u", "STRE", "AM", "\\u", "NAME_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "VS", "I", "\\u", "FRAME", "\\u", "WIDTH_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "VS", "I", "\\u", "FRAME", "\\u", "HEIGHT_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "VS", "I", "\\u", "TIME", "LENGTH_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "VS", "I", "\\u", "FRAME", "\\u", "COUNT_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "VS", "I", "\\u", "FRAME", "\\u", "RATE_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "VS", "I", "\\u", "DATA", "\\u", "RATE_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "VS", "I", "\\u", "SAMPLE", "\\u", "SIZE_", "=_", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "VS", "I", "\\u", "COMPRESS", "ION_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "VS", "I", "\\u", "STRE", "AM", "\\u", "NUMBER_", "=_", "11_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "ASI", "\\u", "FORMAT_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "ASI", "\\u", "TIME", "LENGTH_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "ASI", "\\u", "AVG", "\\u", "DATA", "\\u", "RATE_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "ASI", "\\u", "SAMPLE", "\\u", "RATE_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "ASI", "\\u", "SAMPLE", "\\u", "SIZE_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "ASI", "\\u", "CHAN", "NEL", "\\u", "COUNT_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "ASI", "\\u", "STRE", "AM", "\\u", "NUMBER_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "ASI", "\\u", "STRE", "AM", "\\u", "NAME_", "=_", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "ASI", "\\u", "COMPRESS", "ION_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "CONTR", "OL", "PANEL", "\\u", "CATEGORY", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "VOLUM", "E", "\\u", "FREE", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "VOLUM", "E", "\\u", "CAPA", "CITY", "_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "VOLUM", "E", "\\u", "FILE", "SYSTEM", "_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "SHAR", "E", "\\u", "CS", "C", "\\u", "STATUS_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "LINK", "\\u", "TARGET_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "QUE", "RY", "\\u", "RANK", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fro", "m", " ", "Prop", "Id", "l", ".", "h_", "\\u\\u\\uNL\\u\\u\\u_", "PROP", "SET", "FLAG", "\\u", "DEFAULT_", "=_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PROP", "SET", "FLAG", "\\u", "NON", "SIMPLE", "_", "=_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PROP", "SET", "FLAG", "\\u", "ANSI", "_", "=_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PROP", "SET", "FLAG", "\\u", "UN", "BUFF", "ERE", "D_", "=_", "(_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PROP", "SET", "FLAG", "\\u", "CASE", "\\u", "SENS", "ITIVE", "_", "=_", "(_", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PROP", "SET", "\\u", "BE", "HA", "VIO", "R", "\\u", "CASE", "\\u", "SENS", "ITIVE", "_", "=_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "DICT", "ION", "ARY", "_", "=_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "CODE", "PAGE_", "=_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "FIR", "ST", "\\u", "USA", "BLE_", "=_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "FIR", "ST", "\\u", "NAME", "\\u", "DEFAULT_", "=_", "(_", "409", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "LOCALE", "_", "=_", "(_", "(_", "-_", "2147483648", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "MODIFY", "\\u", "TIME_", "=_", "(_", "(_", "-_", "2147483647", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "SECURITY", "_", "=_", "(_", "(_", "-_", "214", "748", "364", "6_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "BE", "HA", "VIO", "R_", "=_", "(_", "(_", "-_", "214", "748", "364", "5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "ILL", "EGA", "L_", "=_", "(_", "(_", "-_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "MIN", "\\u", "READO", "NLY", "_", "=_", "(_", "(_", "-_", "2147483648", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "\\u", "MAX", "\\u", "READO", "NLY", "_", "=_", "(_", "(_", "-_", "1073", "741", "825", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "DI", "\\u", "THUMB", "NA", "IL", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "TITLE_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "SUBJECT", "_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "AUTHOR", "_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "KEYWORDS", "_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "COMMENT", "S_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "TEMPLATE_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "LAS", "TA", "UTH", "OR_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "REV", "NUMBER_", "=_", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "EDIT", "TIME_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "LAS", "TP", "RIN", "TED_", "=_", "11_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "CREATE", "\\u", "DT", "M_", "=_", "12_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "LAS", "TS", "AV", "E", "\\u", "DT", "M_", "=_", "13_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "PAGE", "COUNT_", "=_", "14_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "WORD", "COUNT_", "=_", "15_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "CHAR", "COUNT_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "THUMB", "NA", "IL", "_", "=_", "17_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "APP", "NAME_", "=_", "18_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "SI", "\\u", "DOC", "\\u", "SECURITY", "_", "=_", "19_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "DS", "I", "\\u", "CATEGORY", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "DS", "I", "\\u", "PRE", "SF", "ORM", "AT_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "DS", "I", "\\u", "BYTE", "COUNT_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "DS", "I", "\\u", "LINE", "COUNT_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "DS", "I", "\\u", "PAR", "COUNT_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "DS", "I", "\\u", "SLI", "DECO", "UNT", "_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "DS", "I", "\\u", "NOTE", "COUNT_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "DS", "I", "\\u", "HIDDEN", "COUNT_", "=_", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "DS", "I", "\\u", "MM", "CLIP", "COUNT_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "DS", "I", "\\u", "SCALE_", "=_", "11_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "DS", "I", "\\u", "HEAD", "ING", "PAIR", "_", "=_", "12_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "DS", "I", "\\u", "DOC", "PART", "S_", "=_", "13_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "DS", "I", "\\u", "MANAGER", "_", "=_", "14_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "DS", "I", "\\u", "COMPA", "NY", "_", "=_", "15_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "DS", "I", "\\u", "LINKS", "DIR", "TY_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "MS", "I", "\\u", "EDITOR", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "MS", "I", "\\u", "SUP", "PLI", "ER_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "MS", "I", "\\u", "SOURCE_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "MS", "I", "\\u", "SEQUENCE", "\\u", "NO_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "MS", "I", "\\u", "PROJECT_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "MS", "I", "\\u", "STATUS_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "MS", "I", "\\u", "OWNER", "_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "MS", "I", "\\u", "RAT", "ING_", "=_", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "MS", "I", "\\u", "PRODUCT", "ION_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PID", "MS", "I", "\\u", "COPY", "RIGHT_", "=_", "11_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PR", "SPEC", "\\u", "INVALID", "_", "=_", "(_", "(_", "-_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PR", "SPEC", "\\u", "LP", "WS", "TR_", "=_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PR", "SPEC", "\\u", "PROP", "ID_", "=_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fro", "m", " ", "Sh", "Obj", "Id", "l", ".", "h_", "\\u\\u\\uNL\\u\\u\\u_", "SH", "CID", "S", "\\u", "ALL", "FIELDS_", "=_", "(_", "-_", "2147483648", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CID", "S", "\\u", "CAN", "ONI", "CAL", "ONLY_", "=_", "268", "435", "456_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CID", "S", "\\u", "BIT", "MASK_", "=_", "(_", "-_", "65536_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CID", "S", "\\u", "COL", "UM", "NM", "ASK", "_", "=_", "65535_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "CAN", "MON", "IK", "ER_", "=_", "419", "430", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "HAS", "STORAGE_", "=_", "419", "430", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "STREAM_", "=_", "419", "430", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "STOR", "AGE", "ANCE", "STOR", "_", "=_", "838", "860", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "GA", "O", "\\u", "STOR", "AGE", "CAP", "MASK_", "=_", "189", "195", "879", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "MAX", "PROP", "PAGE", "S_", "=_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "P", "\\u", "DEFAULT_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "P", "\\u", "DL", "GIN", "DIRECT", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "P", "\\u", "USE", "HI", "CON", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "P", "\\u", "USE", "ICON", "ID_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "P", "\\u", "USE", "TITLE_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "P", "\\u", "RTL", "READ", "ING_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "P", "\\u", "HAS", "HELP_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "P", "\\u", "USER", "EF", "PARENT", "_", "=_", "64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "P", "\\u", "USE", "CALL", "BACK_", "=_", "128_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "P", "\\u", "PRE", "MAT", "URE_", "=_", "1024_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "P", "\\u", "HID", "EH", "EAD", "ER_", "=_", "2048_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "P", "\\u", "USE", "HEAD", "ERT", "IT", "LE_", "=_", "4096_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "P", "\\u", "USE", "HEAD", "ERS", "UB", "TITLE_", "=_", "8192_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "P", "\\u", "USE", "FU", "SION", "CONTEXT_", "=_", "1638", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "PC", "B", "\\u", "ADDR", "EF", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "PC", "B", "\\u", "RELEASE", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "PC", "B", "\\u", "CREATE_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "PS", "H", "\\u", "DEFAULT_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "H", "\\u", "PROP", "TITLE_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "H", "\\u", "USE", "HI", "CON", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "H", "\\u", "USE", "ICON", "ID_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "H", "\\u", "PROP", "SHE", "ET", "PAGE_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "H", "\\u", "WI", "ZA", "RD", "HAS", "FINISH", "_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "H", "\\u", "WI", "ZA", "RD", "_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "H", "\\u", "USE", "PS", "TAR", "TP", "AGE_", "=_", "64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "H", "\\u", "NO", "APPL", "YN", "OW", "_", "=_", "128_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "H", "\\u", "USE", "CALL", "BACK_", "=_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "H", "\\u", "HAS", "HELP_", "=_", "512_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "H", "\\u", "MODEL", "ESS", "_", "=_", "1024_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "H", "\\u", "RTL", "READ", "ING_", "=_", "2048_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "H", "\\u", "WI", "ZA", "RD", "CONTE", "XT", "HELP_", "=_", "4096_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "H", "\\u", "WI", "ZA", "RD", "97_", "=_", "8192_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "H", "\\u", "WI", "ZA", "RD", "97_", "=_", "1677721", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "H", "\\u", "WAT", "ERM", "AR", "K_", "=_", "32768_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "H", "\\u", "USE", "HB", "MW", "ATE", "RM", "AR", "K_", "=_", "65536_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "H", "\\u", "USE", "HP", "LW", "ATE", "RM", "AR", "K_", "=_", "1310", "72_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "H", "\\u", "STRE", "TCH", "WAT", "ERM", "AR", "K_", "=_", "262", "144_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "H", "\\u", "HEADER_", "=_", "524", "288_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "H", "\\u", "USE", "HB", "MH", "EAD", "ER_", "=_", "104857", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "H", "\\u", "USE", "PAGE", "LANG_", "=_", "209", "715", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "H", "\\u", "WI", "ZA", "RD", "\\u", "LIT", "E_", "=_", "419", "430", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "H", "\\u", "NOC", "ONT", "EXT", "HELP_", "=_", "335", "544", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "PS", "CB", "\\u", "INITIAL", "IZED", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "CB", "\\u", "PRE", "CREATE_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "CB", "\\u", "BUTTON", "PRESS", "ED_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "NR", "ET", "\\u", "NO", "ERROR_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "NR", "ET", "\\u", "INVALID", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "NR", "ET", "\\u", "INVALID", "\\u", "NOC", "HAN", "GE", "PAGE_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "NR", "ET", "\\u", "MESSAGE", "HANDLE", "D_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "PS", "WI", "ZB", "\\u", "BACK_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "WI", "ZB", "\\u", "NEXT", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "WI", "ZB", "\\u", "FINISH", "_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "WI", "ZB", "\\u", "DISABLED", "FINISH", "_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "BTN", "\\u", "BACK_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "BTN", "\\u", "NEXT", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "BTN", "\\u", "FINISH", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "BTN", "\\u", "OK_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "BTN", "\\u", "APPL", "YN", "OW", "_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "BTN", "\\u", "CANCEL_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "BTN", "\\u", "HELP_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PS", "BTN", "\\u", "MAX_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ID", "\\u", "PSR", "EST", "ART", "WINDOWS", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ID", "\\u", "PSR", "EB", "OOT", "SYSTEM", "_", "=_", "(_", "ID", "\\u", "PSR", "EST", "ART", "WINDOWS", "_", "|_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "WI", "Z", "\\u", "CX", "DL", "G_", "=_", "276", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "WI", "Z", "\\u", "CY", "DL", "G_", "=_", "140_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "WI", "Z", "\\u", "CX", "BM", "P_", "=_", "80_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "WI", "Z", "\\u", "BODY", "X_", "=_", "92_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "WI", "Z", "\\u", "BODY", "CX", "_", "=_", "184_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PROP", "\\u", "SM", "\\u", "CX", "DL", "G_", "=_", "212_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PROP", "\\u", "SM", "\\u", "CY", "DL", "G_", "=_", "188_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PROP", "\\u", "MED", "\\u", "CX", "DL", "G_", "=_", "227_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PROP", "\\u", "MED", "\\u", "CY", "DL", "G_", "=_", "215_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PROP", "\\u", "LG", "\\u", "CX", "DL", "G_", "=_", "252_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PROP", "\\u", "LG", "\\u", "CY", "DL", "G_", "=_", "218_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ISO", "LATI", "ON", "\\u", "AWA", "RE", "\\u", "USE", "\\u", "STATI", "C", "\\u", "LIBRARY", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ISO", "LATI", "ON", "\\u", "AWA", "RE", "\\u", "BUILD", "\\u", "STATI", "C", "\\u", "LIBRARY", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "SH", "COLS", "TAT", "E", "\\u", "TYPE", "\\u", "STR_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "COLS", "TAT", "E", "\\u", "TYPE", "\\u", "INT_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "COLS", "TAT", "E", "\\u", "TYPE", "\\u", "DATE_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "COLS", "TAT", "E", "\\u", "TYPE", "MASK_", "=_", "15_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "COLS", "TAT", "E", "\\u", "ON", "BY", "DEFAULT_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "COLS", "TAT", "E", "\\u", "SLO", "W_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "COLS", "TAT", "E", "\\u", "EXTEND", "ED_", "=_", "64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "COLS", "TAT", "E", "\\u", "SECOND", "ARY", "UI_", "=_", "128_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "COLS", "TAT", "E", "\\u", "HIDDEN", "_", "=_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "COLS", "TAT", "E", "\\u", "PREFER", "\\u", "VAR", "CMP", "_", "=_", "512_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "FW", "F", "\\u", "AUTO", "ARR", "ANGE", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FW", "F", "\\u", "ABB", "REVI", "ATED", "NAMES_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FW", "F", "\\u", "SNAP", "TOG", "RID", "_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FW", "F", "\\u", "OWNER", "DATA_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FW", "F", "\\u", "BES", "TF", "IT", "WINDOW_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FW", "F", "\\u", "DES", "KT", "OP_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FW", "F", "\\u", "SINGLE", "SEL", "_", "=_", "64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FW", "F", "\\u", "NOS", "UB", "FOLDER", "S_", "=_", "128_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FW", "F", "\\u", "TRANSP", "ARE", "NT_", "=_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FW", "F", "\\u", "NOC", "LIE", "NT", "EDGE", "_", "=_", "512_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FW", "F", "\\u", "NOS", "CRO", "LL_", "=_", "1024_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FW", "F", "\\u", "ALIGN", "LEFT_", "=_", "2048_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FW", "F", "\\u", "NO", "ICON", "S_", "=_", "4096_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FW", "F", "\\u", "SHOW", "SEL", "ALWAYS", "_", "=_", "8192_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FW", "F", "\\u", "NOV", "ISI", "BLE_", "=_", "1638", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FW", "F", "\\u", "SINGLE", "CLICK", "ACTIVAT", "E_", "=_", "32768_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FW", "F", "\\u", "NOW", "EB", "VIEW_", "=_", "65536_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FW", "F", "\\u", "HID", "EFI", "LEN", "AME", "S_", "=_", "1310", "72_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FW", "F", "\\u", "CHECKS", "ELECT", "_", "=_", "262", "144_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "FV", "M", "\\u", "FIRST_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FV", "M", "\\u", "ICON_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FV", "M", "\\u", "SMALL", "ICON_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FV", "M", "\\u", "LIST_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FV", "M", "\\u", "DETAIL", "S_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FV", "M", "\\u", "THUMB", "NA", "IL", "_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FV", "M", "\\u", "TILE", "_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FV", "M", "\\u", "THUMB", "STRIP", "_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "SV", "UI", "A", "\\u", "DEA", "CTIV", "ATE_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SV", "UI", "A", "\\u", "ACTIVAT", "E", "\\u", "NO", "FOC", "US_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SV", "UI", "A", "\\u", "ACTIVAT", "E", "\\u", "FOC", "US_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SV", "UI", "A", "\\u", "IN", "PLACE", "ACTIVAT", "E_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "SH", "Change", "Noti", "fy", "Register", " ", "flags_", "\\u\\u\\uNL\\u\\u\\u_", "SH", "CN", "RF", "\\u", "Interr", "upt", "Level_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "RF", "\\u", "Shel", "l", "Level_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "RF", "\\u", "Recursive", "Interrupt_", "=_", "4096_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "CN", "RF", "\\u", "New", "Deliver", "y_", "=_", "32768_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "FD", "\\u", "CLS", "ID_", "=_", "0x0001", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FD", "\\u", "SIZE", "POINT_", "=_", "0x000", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FD", "\\u", "ATTRIBUTES_", "=_", "0x000", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FD", "\\u", "CREATE", "TIME_", "=_", "0x000", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FD", "\\u", "ACCESS", "TIME_", "=_", "0x001", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FD", "\\u", "WRITE", "STI", "ME_", "=_", "0x002", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FD", "\\u", "FILE", "SIZE_", "=_", "0x004", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FD", "\\u", "PROGRESS", "UI_", "=_", "0x400", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FD", "\\u", "LINK", "UI_", "=_", "0x800", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "shl", "wap", "i", " ", "stuff_", "\\u\\u\\uNL\\u\\u\\u_", "ASSOC", "F", "\\u", "INIT", "\\u", "NOR", "EMA", "PC", "LS", "ID_", "=_", "0x0000000", "1_", "#", " ", " ", "do", " ", "not", " ", "remap", " ", "cls", "ids", " ", "to", " ", "prog", "ids_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "F", "\\u", "INIT", "\\u", "BY", "EXE", "NAME_", "=_", "0x0000000", "2_", "#", " ", "executable", " ", "is", " ", "bei", "ng", " ", "pass", "ed", " ", "in_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "F", "\\u", "OPEN", "\\u", "BY", "EXE", "NAME_", "=_", "0x0000000", "2_", "#", " ", "executable", " ", "is", " ", "bei", "ng", " ", "pass", "ed", " ", "in_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "F", "\\u", "INIT", "\\u", "DEF", "AUL", "TT", "OST", "AR_", "=_", "0x0000000", "4_", "#", " ", "treat", " ", "\"*", "\"", " ", "as", " ", "the", " ", "Base", "Class_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "F", "\\u", "INIT", "\\u", "DEF", "AUL", "TT", "OF", "OLD", "ER_", "=_", "0x0000000", "8_", "#", " ", "treat", " ", "\"", "Fold", "er", "\"", " ", "as", " ", "the", " ", "Base", "Class_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "F", "\\u", "NO", "USERS", "ETT", "INGS", "_", "=_", "0x000000", "10_", "#", " ", " ", "don", "t", " ", "use", " ", "HK", "CU", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "F", "\\u", "NOT", "RUN", "CATE", "_", "=_", "0x000000", "20_", "#", " ", "don", "t", " ", "truncat", "e", " ", "the", " ", "return", " ", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "F", "\\u", "VERIFY", "_", "=_", "0x000000", "40_", "#", " ", " ", "verify", " ", "data", " ", "is", " ", "accurate", " ", "(", "DISK", " ", "HIT", "S", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "F", "\\u", "REM", "AP", "RUN", "DLL", "_", "=_", "0x000000", "80_", "#", " ", "actual", "ly", " ", "gets", " ", "info", " ", "abo", "ut", " ", "rund", "lls", " ", "target", " ", "if", " ", "applica", "ble_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "F", "\\u", "NO", "FIX", "UPS", "_", "=_", "0x00000", "100_", "#", " ", "atte", "mpt", " ", "to", " ", "fix", " ", "error", "s", " ", "if", " ", "found_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "F", "\\u", "IGNORE", "BASE", "CLASS_", "=_", "0x00000", "200_", "#", " ", "don", "t", " ", "recurse", " ", "int", "o", " ", "the", " ", "basec", "lass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ASSOC", "STR", "\\u", "COMMAND_", "=_", "1_", "#", " ", "shell", "\\\\", "verb", "\\\\", "command", " ", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "STR", "\\u", "EXECUT", "ABLE_", "=_", "2_", "#", " ", "the", " ", "executable", " ", "part", " ", "of", " ", "command", " ", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "STR", "\\u", "FRI", "END", "LY", "DOC", "NAME_", "=_", "3_", "#", " ", "frie", "ndl", "y", " ", "name", " ", "of", " ", "the", " ", "document", " ", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "STR", "\\u", "FRI", "END", "LY", "APP", "NAME_", "=_", "4_", "#", " ", "frie", "ndl", "y", " ", "name", " ", "of", " ", "executable_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "STR", "\\u", "NOO", "PEN", "_", "=_", "5_", "#", " ", "noop", "en", " ", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "STR", "\\u", "SHELL", "NEW", "VALUE_", "=_", "6_", "#", " ", "query", " ", "values", " ", "under", " ", "the", " ", "shell", "new", " ", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "STR", "\\u", "DD", "ECO", "MM", "AND_", "=_", "7_", "#", " ", "template", " ", "for", " ", "DD", "E", " ", "commands_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "STR", "\\u", "DD", "EI", "FE", "XE", "C_", "=_", "8_", "#", " ", "DD", "ECO", "MM", "AND", " ", "to", " ", "use", " ", "if", " ", "just", " ", "create", " ", "a", " ", "process_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "STR", "\\u", "DD", "EAP", "PLI", "CAT", "ION_", "=_", "9_", "#", " ", "Applica", "tion", " ", "name", " ", "in", " ", "DD", "E", " ", "broadcast_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "STR", "\\u", "DD", "ET", "OP", "IC_", "=_", "10_", "#", " ", "Topic", " ", "Name", " ", "in", " ", "DD", "E", " ", "broadcast_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "STR", "\\u", "INFO", "TIP", "_", "=_", "11_", "#", " ", "info", " ", "tip", " ", "for", " ", "an", " ", "item", ",", " ", "or", " ", "list", " ", "of", " ", "proper", "ties", " ", "to", " ", "create", " ", "info", " ", "tip", " ", "from_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "STR", "\\u", "QUI", "CK", "TIP", "_", "=_", "12_", "#", " ", "same", " ", "as", " ", "ASSOC", "STR", "\\u", "INFO", "TIP", ",", " ", "except", ",", " ", "this", " ", "list", " ", "contain", "s", " ", "only", " ", "quickl", "y", " ", "retrie", "vable", " ", "properties_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "STR", "\\u", "TILE", "INFO_", "=_", "13_", "#", " ", "similar", " ", "to", " ", "ASSOC", "STR", "\\u", "INFO", "TIP", " ", "-", " ", "lists", " ", "importa", "nt", " ", "proper", "ties", " ", "for", " ", "tile", "view_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "STR", "\\u", "CONTE", "NT", "TYPE_", "=_", "14_", "#", " ", "MIME", " ", "Conten", "t", " ", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "STR", "\\u", "DEF", "AUL", "TIC", "ON_", "=_", "15_", "#", " ", "Default", " ", "icon", " ", "source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "STR", "\\u", "SHELL", "EXTENSION", "_", "=_", "16_", "#", " ", "Guid", " ", "string", " ", "pointi", "ng", " ", "to", " ", "the", " ", "Shel", "lex", "\\\\", "Shel", "lex", "tens", "ion", "handler", " ", "value", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ASSOC", "KEY", "\\u", "SHELL", "EXEC", "CLASS_", "=_", "1_", "#", " ", "the", " ", "key", " ", "tha", "t", " ", "shou", "ld", " ", "be", " ", "pass", "ed", " ", "to", " ", "Shel", "l", "Exe", "c", "(", "hk", "ey", "Class", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "KEY", "\\u", "APP_", "=_", "2_", "#", " ", "the", " ", "\"", "Applica", "tion", "\"", " ", "key", " ", "for", " ", "the", " ", "association_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "KEY", "\\u", "CLASS_", "=_", "3_", "#", " ", "the", " ", "prog", "id", " ", "or", " ", "class", " ", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "KEY", "\\u", "BASE", "CLASS_", "=_", "4_", "#", " ", "the", " ", "Base", "Class", " ", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ASSOC", "DATA", "\\u", "MS", "IDE", "SCRIPT", "OR_", "=_", "1_", "#", " ", "Compo", "nent", " ", "Descrip", "tor", " ", "to", " ", "pass", " ", "to", " ", "MS", "I", " ", "API", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "DATA", "\\u", "NO", "ACTIVAT", "EH", "AND", "LER", "_", "=_", "2_", "#", " ", "restrict", " ", "atte", "mpt", "s", " ", "to", " ", "activat", "e", " ", "window_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "DATA", "\\u", "QUE", "RY", "CLASS", "STORE", "_", "=_", "3_", "#", " ", "shou", "ld", " ", "check", " ", "with", " ", "the", " ", "NT", " ", "Class", " ", "Store_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "DATA", "\\u", "HAS", "PER", "USER", "ASSOC", "_", "=_", "4_", "#", " ", "default", "s", " ", "to", " ", "user", " ", "specified", " ", "association_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "DATA", "\\u", "EDIT", "FLAGS_", "=_", "5_", "#", " ", "Edit", " ", "flags", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "DATA", "\\u", "VALUE_", "=_", "6_", "#", " ", "use", " ", "ps", "z", "Extra", " ", "as", " ", "the", " ", "Value", " ", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "flags", " ", "used", " ", "with", " ", "SH", "Get", "View", "State", "Proper", "ty", "Bag", "_", "\\u\\u\\uNL\\u\\u\\u_", "SH", "GV", "SP", "B", "\\u", "PER", "USER_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GV", "SP", "B", "\\u", "ALL", "USERS", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GV", "SP", "B", "\\u", "PERF", "OLD", "ER_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GV", "SP", "B", "\\u", "ALL", "FOLDER", "S_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GV", "SP", "B", "\\u", "INH", "ERIT", "_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GV", "SP", "B", "\\u", "RO", "AM", "_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GV", "SP", "B", "\\u", "NO", "AUTO", "DEFAULTS_", "=_", "2147483648", "_", "#", " ", "0x80000", "000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GV", "SP", "B", "\\u", "FOLDER_", "=_", "SH", "GV", "SP", "B", "\\u", "PER", "USER_", "|_", "SH", "GV", "SP", "B", "\\u", "PERF", "OLD", "ER_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GV", "SP", "B", "\\u", "FOLDER", "NODE", "FA", "ULT", "S_", "=_", "SH", "GV", "SP", "B", "\\u", "PER", "USER_", "|_", "SH", "GV", "SP", "B", "\\u", "PERF", "OLD", "ER_", "|_", "SH", "GV", "SP", "B", "\\u", "NO", "AUTO", "DEFAULTS_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GV", "SP", "B", "\\u", "USER", "DEFAULTS_", "=_", "SH", "GV", "SP", "B", "\\u", "PER", "USER_", "|_", "SH", "GV", "SP", "B", "\\u", "ALL", "FOLDER", "S_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SH", "GV", "SP", "B", "\\u", "GLOB", "AL", "DEA", "FA", "ULT", "S_", "=_", "SH", "GV", "SP", "B", "\\u", "ALL", "USERS", "_", "|_", "SH", "GV", "SP", "B", "\\u", "ALL", "FOLDER", "S_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ID", "es", "kb", "and", " ", "and", " ", "related_", "\\u\\u\\uNL\\u\\u\\u_", "DB", "IM", "\\u", "MIN", "SIZE_", "=_", "0x0001", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IM", "\\u", "MAX", "SIZE_", "=_", "0x000", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IM", "\\u", "INTEG", "RAL", "_", "=_", "0x000", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IM", "\\u", "ACT", "UAL", "_", "=_", "0x000", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IM", "\\u", "TITLE_", "=_", "0x001", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IM", "\\u", "MODE", "FLAGS_", "=_", "0x002", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IM", "\\u", "BK", "COLOR_", "=_", "0x004", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "DB", "IM", "F", "\\u", "NORMAL_", "=_", "0x0000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IM", "F", "\\u", "VARIABLE", "HEIGHT_", "=_", "0x000", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IM", "F", "\\u", "DEB", "OSS", "ED_", "=_", "0x002", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IM", "F", "\\u", "BK", "COLOR_", "=_", "0x004", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "DB", "IF", "\\u", "VIEW", "MODE", "\\u", "NORMAL_", "=_", "0x0000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IF", "\\u", "VIEW", "MODE", "\\u", "VERTICAL_", "=_", "0x0001", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IF", "\\u", "VIEW", "MODE", "\\u", "FLOAT", "ING_", "=_", "0x000", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DB", "IF", "\\u", "VIEW", "MODE", "\\u", "TRANSP", "ARE", "NT_", "=_", "0x000", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Messag", "e", " ", "types", " ", "used", " ", "with", " ", "SH", "Shel", "l", "Fold", "er", "View", "\\u", "Message_", "\\u\\u\\uNL\\u\\u\\u_", "SF", "VM", "\\u", "REA", "RR", "ANGE", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "VM", "\\u", "ADD", "OBJECT_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "VM", "\\u", "REMOVE", "OBJECT_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "VM", "\\u", "UPDATE", "OBJECT_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "VM", "\\u", "GET", "SELECTED", "OBJECTS", "_", "=_", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "VM", "\\u", "SET", "ITEM", "POS_", "=_", "14_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "VM", "\\u", "SET", "CLIP", "BOARD", "_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SF", "VM", "\\u", "SET", "POINTS_", "=_", "23_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "SHELL", "\\u", "LINK", "\\u", "DATA", "\\u", "FLAG", "S", " ", "enum", ",", " ", "used", " ", "with", " ", "IS", "hell", "Link", "Data", "list_", "\\u\\u\\uNL\\u\\u\\u_", "SL", "DF", "\\u", "HAS", "\\u", "ID", "\\u", "LIST_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SL", "DF", "\\u", "HAS", "\\u", "LINK", "\\u", "INFO_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SL", "DF", "\\u", "HAS", "\\u", "NAME_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SL", "DF", "\\u", "HAS", "\\u", "REL", "PATH_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SL", "DF", "\\u", "HAS", "\\u", "WORK", "ING", "DIR_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SL", "DF", "\\u", "HAS", "\\u", "ARGS_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SL", "DF", "\\u", "HAS", "\\u", "ICON", "LOCATION_", "=_", "64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SL", "DF", "\\u", "UNICODE_", "=_", "128_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SL", "DF", "\\u", "FORCE", "\\u", "NO", "\\u", "LINK", "INFO_", "=_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SL", "DF", "\\u", "HAS", "\\u", "EXP", "\\u", "SZ", "_", "=_", "512_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SL", "DF", "\\u", "RUN", "\\u", "IN", "\\u", "SEPA", "RATE_", "=_", "1024_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SL", "DF", "\\u", "HAS", "\\u", "LOGO", "3", "ID_", "=_", "2048_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SL", "DF", "\\u", "HAS", "\\u", "DAR", "WIN", "ID_", "=_", "4096_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SL", "DF", "\\u", "RUN", "AS", "\\u", "USER_", "=_", "8192_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SL", "DF", "\\u", "NO", "\\u", "PID", "L", "\\u", "ALIAS_", "=_", "32768_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SL", "DF", "\\u", "FORCE", "\\u", "UNC", "NAME_", "=_", "65536_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SL", "DF", "\\u", "HAS", "\\u", "EXP", "\\u", "ICON", "\\u", "SZ", "_", "=_", "1638", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SL", "DF", "\\u", "RUN", "\\u", "WITH", "\\u", "SHI", "ML", "AY", "ER_", "=_", "1310", "72_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SL", "DF", "\\u", "RESERVED", "_", "=_", "2147483648", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "IS", "hell", "Link", "Data", "List", " ", "data", " ", "block", " ", "signatures_", "\\u\\u\\uNL\\u\\u\\u_", "EXP", "\\u", "SPECIAL", "\\u", "FOLDER", "\\u", "SIG", "_", "=_", "268", "435", "456", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NT", "\\u", "CONSOLE", "\\u", "PROP", "S", "\\u", "SIG", "_", "=_", "268", "435", "456", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NT", "\\u", "FE", "\\u", "CONSOLE", "\\u", "PROP", "S", "\\u", "SIG", "_", "=_", "268", "435", "456", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EXP", "\\u", "DAR", "WIN", "\\u", "ID", "\\u", "SIG", "_", "=_", "268", "435", "456", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EXP", "\\u", "LOGO", "3", "\\u", "ID", "\\u", "SIG", "_", "=_", "268", "435", "4567", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EXP", "\\u", "SZ", "\\u", "ICON", "\\u", "SIG", "_", "=_", "268", "435", "4567", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EXP", "\\u", "SZ", "\\u", "LINK", "\\u", "SIG", "_", "=_", "268", "435", "456", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "IU", "RL", "\\u", "SET", "URL", "\\u", "FLAG", "S", " ", "enum", ",", " ", "used", " ", "with", " ", "Py", "IU", "nif", "orm", "Reso", "urc", "e", "Locator", ".", "Set", "URL_", "\\u\\u\\uNL\\u\\u\\u_", "IU", "RL", "\\u", "SET", "URL", "\\u", "FL", "\\u", "GUE", "SS", "\\u", "PROTOCOL_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "IU", "RL", "\\u", "SET", "URL", "\\u", "FL", "\\u", "USE", "\\u", "DEF", "AUL", "T", "\\u", "PROTOCOL_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "IU", "RL", "\\u", "INV", "OKE", "COMMA", "ND", "\\u", "FLAG", "S", " ", "enum", ",", " ", "used", " ", "with", " ", "Py", "IU", "nif", "orm", "Reso", "urc", "e", "Locator", ".", "Invok", "e", "Command_", "\\u\\u\\uNL\\u\\u\\u_", "IU", "RL", "\\u", "INV", "OKE", "COMMA", "ND", "\\u", "FL", "\\u", "ALLOW", "\\u", "UI_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "IU", "RL", "\\u", "INV", "OKE", "COMMA", "ND", "\\u", "FL", "\\u", "USE", "\\u", "DEF", "AUL", "T", "\\u", "VERB", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "IU", "RL", "\\u", "INV", "OKE", "COMMA", "ND", "\\u", "FL", "\\u", "DD", "EW", "AI", "T_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "constant", "s", " ", "used", " ", "with", " ", "IA", "ctive", "Des", "kto", "p_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "COMPONENT", ".", "Compo", "nent", "Type_", "\\u\\u\\uNL\\u\\u\\u_", "COMP", "\\u", "TYPE", "\\u", "HTM", "LD", "OC", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "TYPE", "\\u", "PIC", "TUR", "E_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "TYPE", "\\u", "WEBS", "ITE", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "TYPE", "\\u", "CONTROL_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "TYPE", "\\u", "CF", "HTML_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "TYPE", "\\u", "MAX_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "COMPONENT", ".", "Cur", "Item", "State_", "\\u\\u\\uNL\\u\\u\\u_", "IS", "\\u", "NORMAL_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "IS", "\\u", "FULL", "SCREEN", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "IS", "\\u", "SPLIT", "_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "IS", "\\u", "VALID", "SIZE", "STATE", "BITS_", "=_", "IS", "\\u", "NORMAL_", "|_", "IS", "\\u", "SPLIT", "_", "|_", "IS", "\\u", "FULL", "SCREEN", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "IS", "\\u", "VALID", "STATE", "BITS_", "=_", "IS", "\\u", "NORMAL_", "|_", "IS", "\\u", "SPLIT", "_", "|_", "IS", "\\u", "FULL", "SCREEN", "_", "|_", "2147483648", "_", "|_", "1073", "741", "824", "_", "##", " ", "0x80000", "000", "|", "0x400", "00000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "IA", "ctive", "Des", "kto", "p", ".", "Apply", "Change", "s", " ", "Flags_", "\\u\\u\\uNL\\u\\u\\u_", "AD", "\\u", "APPL", "Y", "\\u", "SAVE", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AD", "\\u", "APPL", "Y", "\\u", "HTM", "LG", "EN_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AD", "\\u", "APPL", "Y", "\\u", "REFRESH", "_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AD", "\\u", "APPL", "Y", "\\u", "ALL_", "=_", "AD", "\\u", "APPL", "Y", "\\u", "SAVE", "_", "|_", "AD", "\\u", "APPL", "Y", "\\u", "HTM", "LG", "EN_", "|_", "AD", "\\u", "APPL", "Y", "\\u", "REFRESH", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AD", "\\u", "APPL", "Y", "\\u", "FORCE", "_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AD", "\\u", "APPL", "Y", "\\u", "BUFF", "ERE", "D", "\\u", "REFRESH", "_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AD", "\\u", "APPL", "Y", "\\u", "DYNAMIC", "REFRESH", "_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Wall", "pape", "r", " ", "style", "s", " ", "used", " ", "with", " ", "Get", "Wall", "pape", "r", " ", "and", " ", "Set", "Wall", "paper_", "\\u\\u\\uNL\\u\\u\\u_", "WP", "STYLE", "\\u", "CENTER_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "WP", "STYLE", "\\u", "TILE", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "WP", "STYLE", "\\u", "STRE", "TCH", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "WP", "STYLE", "\\u", "MAX_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Modif", "y", "Des", "kto", "p", "Item", " ", "flags_", "\\u\\u\\uNL\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "TYPE_", "=_", "1_", "##", " ", "0x0000000", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "CHECK", "ED_", "=_", "2_", "##", " ", "0x0000000", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "DIR", "TY_", "=_", "4_", "##", " ", "0x0000000", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "NOS", "CRO", "LL_", "=_", "8_", "##", " ", "0x0000000", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "POS", "\\u", "LEFT_", "=_", "16_", "##", " ", "0x000000", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "POS", "\\u", "TOP_", "=_", "32_", "##", " ", "0x000000", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "SIZE", "\\u", "WIDTH_", "=_", "64_", "##", " ", "0x000000", "40_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "SIZE", "\\u", "HEIGHT_", "=_", "128_", "##", " ", "0x000000", "80_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "POS", "\\u", "ZI", "NDE", "X_", "=_", "256_", "##", " ", "0x00000", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "SOURCE_", "=_", "512_", "##", " ", "0x00000", "200_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "FRI", "END", "LY", "NAME_", "=_", "1024_", "##", " ", "0x00000", "400_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "SUBSCRI", "BED", "URL_", "=_", "2048_", "##", " ", "0x00000", "800_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "ORIGIN", "AL", "\\u", "CSI", "_", "=_", "4096_", "##", " ", "0x0000", "1000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "REST", "ORE", "D", "\\u", "CSI", "_", "=_", "8192_", "##", " ", "0x0000", "2000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "CUR", "ITEM", "STATE_", "=_", "1638", "4_", "##", " ", "0x0000", "4000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMP", "\\u", "ELE", "M", "\\u", "ALL_", "=_", "COMP", "\\u", "ELE", "M", "\\u", "TYPE_", "|_", "COMP", "\\u", "ELE", "M", "\\u", "CHECK", "ED_", "|_", "COMP", "\\u", "ELE", "M", "\\u", "DIR", "TY_", "|_", "COMP", "\\u", "ELE", "M", "\\u", "NOS", "CRO", "LL_", "|_", "COMP", "\\u", "ELE", "M", "\\u", "POS", "\\u", "LEFT_", "|_", "COMP", "\\u", "ELE", "M", "\\u", "SIZE", "\\u", "WIDTH_", "|_", "COMP", "\\u", "ELE", "M", "\\u", "SIZE", "\\u", "HEIGHT_", "|_", "COMP", "\\u", "ELE", "M", "\\u", "POS", "\\u", "ZI", "NDE", "X_", "|_", "COMP", "\\u", "ELE", "M", "\\u", "SOURCE_", "|_", "COMP", "\\u", "ELE", "M", "\\u", "FRI", "END", "LY", "NAME_", "|_", "COMP", "\\u", "ELE", "M", "\\u", "POS", "\\u", "TOP_", "|_", "COMP", "\\u", "ELE", "M", "\\u", "SUBSCRI", "BED", "URL_", "|_", "COMP", "\\u", "ELE", "M", "\\u", "ORIGIN", "AL", "\\u", "CSI", "_", "|_", "COMP", "\\u", "ELE", "M", "\\u", "REST", "ORE", "D", "\\u", "CSI", "_", "|_", "COMP", "\\u", "ELE", "M", "\\u", "CUR", "ITEM", "STATE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "DT", "I", "\\u", "ADD", "UI", "\\u", "DEFAULT_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DT", "I", "\\u", "ADD", "UI", "\\u", "DISP", "SUB", "WI", "ZA", "RD", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DT", "I", "\\u", "ADD", "UI", "\\u", "POSITION", "ITEM_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ADD", "URL", "\\u", "SIL", "ENT_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPONENT", "\\u", "TOP_", "=_", "1073", "741", "823", "_", "##", " ", "0x3f", "ffffff", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPONENT", "\\u", "DEF", "AUL", "T", "\\u", "LEFT_", "=_", "65535_", "##", " ", "0xFFFF", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPONENT", "\\u", "DEF", "AUL", "T", "\\u", "TOP_", "=_", "65535_", "##", " ", "0xFFFF", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "SS", "M", "\\u", "CLEAR", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SS", "M", "\\u", "SET_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SS", "M", "\\u", "REFRESH", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SS", "M", "\\u", "UPDATE_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "SCHEME", "\\u", "DISPLAY", "_", "=_", "1_", "##", "0x0001", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SCHEME", "\\u", "EDIT", "_", "=_", "2_", "##", "0x000", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SCHEME", "\\u", "LOCAL_", "=_", "4_", "##", "0x000", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SCHEME", "\\u", "GLOBAL_", "=_", "8_", "##", "0x000", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SCHEME", "\\u", "REFRESH", "_", "=_", "16_", "##", "0x001", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SCHEME", "\\u", "UPDATE_", "=_", "32_", "##", "0x002", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SCHEME", "\\u", "DON", "OT", "USE", "_", "=_", "64_", "##", "0x004", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SCHEME", "\\u", "CREATE_", "=_", "128_", "##", "0x008", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "GA", "DO", "F", "\\u", "DIR", "TY_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fro", "m", " ", "Emp", "ty", "VC", ".", "h_", "\\u\\u\\uNL\\u\\u\\u_", "EV", "CF", "\\u", "HAS", "SETTINGS_", "=_", "0x0001", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EV", "CF", "\\u", "ENABLE", "BY", "DEFAULT_", "=_", "0x000", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EV", "CF", "\\u", "REMOVE", "FROM", "LIST_", "=_", "0x000", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EV", "CF", "\\u", "ENABLE", "BY", "DEF", "AUL", "T", "\\u", "AUTO", "_", "=_", "0x000", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EV", "CF", "\\u", "DON", "TS", "HO", "WI", "FZ", "ERO", "_", "=_", "0x001", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EV", "CF", "\\u", "SETTING", "SMO", "DE_", "=_", "0x002", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EV", "CF", "\\u", "OUT", "OF", "DISK", "SPACE_", "=_", "0x004", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EV", "CC", "BF", "\\u", "LAS", "TN", "OT", "IFIC", "ATION_", "=_", "0x0001", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sh", "Obj", "Id", "l", ".", "h", " ", "IE", "xpl", "ore", "r", "*", " ", "related_", "\\u\\u\\uNL\\u\\u\\u_", "EB", "O", "\\u", "NONE_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EB", "O", "\\u", "NAV", "IG", "ATE", "ON", "CE_", "=_", "0x1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EB", "O", "\\u", "SHOW", "FRAME", "S_", "=_", "0x2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EB", "O", "\\u", "ALWAYS", "NAV", "IG", "ATE_", "=_", "0x4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EB", "O", "\\u", "NOT", "RA", "VEL", "LOG_", "=_", "0x8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EB", "O", "\\u", "NOW", "RA", "PPE", "RW", "IND", "OW", "_", "=_", "0x10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EB", "F", "\\u", "NONE_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EB", "F", "\\u", "SELECT", "FROM", "DATA", "OBJECT_", "=_", "0x100", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EB", "F", "\\u", "NOD", "ROP", "TARGET_", "=_", "0x200", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EC", "S", "\\u", "ENABLED_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EC", "S", "\\u", "DISABLED_", "=_", "0x1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EC", "S", "\\u", "HIDDEN", "_", "=_", "0x2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EC", "S", "\\u", "CHECK", "BOX_", "=_", "0x4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EC", "S", "\\u", "CHECK", "ED_", "=_", "0x8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "EC", "F", "\\u", "HAS", "SUB", "COMMANDS_", "=_", "0x1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EC", "F", "\\u", "HAS", "SPLIT", "BUTTON_", "=_", "0x2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EC", "F", "\\u", "HID", "ELA", "BEL", "_", "=_", "0x4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EC", "F", "\\u", "ISS", "EPA", "RAT", "OR_", "=_", "0x8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EC", "F", "\\u", "HAS", "LU", "AS", "HI", "EL", "D_", "=_", "0x10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "SI", "ATTRIB", "FLAG", "S", "\\u", "AND_", "=_", "0x1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SI", "ATTRIB", "FLAG", "S", "\\u", "OR_", "=_", "0x2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SI", "ATTRIB", "FLAG", "S", "\\u", "APP", "COMPA", "T_", "=_", "0x3", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SI", "ATTRIB", "FLAG", "S", "\\u", "MASK_", "=_", "0x3", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "SIG", "DN", "\\u", "NORMA", "LD", "IS", "PLAY", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SIG", "DN", "\\u", "PARENT", "RELAT", "IV", "EPA", "RSI", "NG_", "=_", "-_", "214", "738", "534", "3_", "##", " ", "0x800", "1800", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SIG", "DN", "\\u", "DES", "KT", "OP", "ABS", "OLUT", "EPA", "RSI", "NG_", "=_", "-_", "214", "731", "980", "8_", "##", " ", "0x800", "2800", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SIG", "DN", "\\u", "PARENT", "RELAT", "IV", "EE", "DI", "TIN", "G_", "=_", "-_", "214", "728", "294", "3_", "##", " ", "0x800", "3100", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SIG", "DN", "\\u", "DES", "KT", "OP", "ABS", "OLUT", "EE", "DI", "TIN", "G_", "=_", "-_", "214", "717", "235", "2_", "##", " ", "0x800", "4c", "000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SIG", "DN", "\\u", "FILE", "SYS", "PATH_", "=_", "-_", "214", "712", "3200", "_", "##", " ", "0x800", "580", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SIG", "DN", "\\u", "URL_", "=_", "-_", "214", "705", "766", "4_", "##", " ", "0x800", "680", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SIG", "DN", "\\u", "PARENT", "RELAT", "IV", "EF", "ORA", "DDR", "ESS", "BAR_", "=_", "-_", "214", "697", "574", "3_", "##", " ", "0x800", "7c", "001", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SIG", "DN", "\\u", "PARENT", "RELAT", "IVE_", "=_", "-_", "214", "695", "935", "9_", "##", " ", "0x800", "800", "01_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "SI", "CHI", "NT", "\\u", "DISPLAY", "_", "=_", "0_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SI", "CHI", "NT", "\\u", "ALL", "FIELDS_", "=_", "-_", "2147483648", "_", "##", " ", "0x80000", "000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SI", "CHI", "NT", "\\u", "CAN", "ONI", "CAL", "_", "=_", "0x10000", "000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ASSOC", "CLASS", "\\u", "SHELL", "\\u", "KEY_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "CLASS", "\\u", "PROG", "ID", "\\u", "KEY_", "=_", "1_", "#", " ", "hk", "ey", "Class_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "CLASS", "\\u", "PROG", "ID", "\\u", "STR_", "=_", "2_", "#", " ", "ps", "z", "Class", " ", "(", "HK", "CR", "\\\\", "ps", "z", "Class", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "CLASS", "\\u", "CLS", "ID", "\\u", "KEY_", "=_", "3_", "#", " ", "hk", "ey", "Class_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "CLASS", "\\u", "CLS", "ID", "\\u", "STR_", "=_", "4_", "#", " ", " ", "ps", "z", "Class", " ", "(", "HK", "CR", "\\\\", "CLS", "ID", "\\\\", "ps", "z", "Class", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "CLASS", "\\u", "APP", "\\u", "KEY_", "=_", "5_", "#", " ", "hk", "ey", "Class_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "CLASS", "\\u", "APP", "\\u", "STR_", "=_", "6_", "#", " ", "ps", "z", "Class", " ", "(", "HK", "CR", "\\\\", "Applica", "tion", "s", "\\\\", "Path", "Fin", "d", "File", "Name", "(", "ps", "z", "Class", "))", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "CLASS", "\\u", "SYSTEM", "\\u", "STR_", "=_", "7_", "#", " ", "ps", "z", "Class_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "CLASS", "\\u", "FOLDER_", "=_", "8_", "#", " ", "none_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ASSOC", "CLASS", "\\u", "STAR", "_", "=_", "9_", "#", " ", "none_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "NS", "TC", "S", "\\u", "HAS", "EXPAN", "DOS", "_", "=_", "0x1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "HAS", "LINES_", "=_", "0x2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "SINGLE", "CLICK", "EXPAND_", "=_", "0x4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "FULL", "ROWS", "ELECT", "_", "=_", "0x8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "SPR", "ING", "EXPAND_", "=_", "0x10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "HORI", "ZON", "TAL", "SCROLL", "_", "=_", "0x20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "ROO", "THA", "SE", "XP", "AND", "O_", "=_", "0x40_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "SHOW", "SELECTION", "ALWAYS", "_", "=_", "0x80_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "NO", "INFO", "TIP", "_", "=_", "0x200", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "EVE", "NH", "EI", "GHT", "_", "=_", "0x400", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "NOR", "EP", "LAC", "EO", "PEN", "_", "=_", "0x800", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "DISABLED", "RA", "GD", "ROP", "_", "=_", "0x1000", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "NOO", "RD", "ERS", "TREAM", "_", "=_", "0x2000", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "RIC", "HT", "OO", "LT", "IP_", "=_", "0x400", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "BORDER", "_", "=_", "0x800", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "NO", "EDIT", "LABELS_", "=_", "0x10000", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "TAB", "STOP_", "=_", "0x2000", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "FA", "VOR", "ITE", "SMO", "DE_", "=_", "0x80000", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "AUTO", "HS", "CRO", "LL_", "=_", "0x10000", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "FA", "DE", "IN", "OUTE", "XP", "AND", "OS_", "=_", "0x2000", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "EMP", "TY", "TEXT_", "=_", "0x400", "000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "CHECK", "BO", "XE", "S_", "=_", "0x80000", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "PARTI", "ALC", "HE", "CK", "BO", "XE", "S_", "=_", "0x10000", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "EXC", "LUS", "ION", "CHECK", "BO", "XE", "S_", "=_", "0x2000", "000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "DIM", "MED", "CHECK", "BO", "XE", "S_", "=_", "0x400", "0000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "NO", "INDENT", "CHECKS", "_", "=_", "0x80000", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "ALLOW", "JU", "NC", "TIONS", "_", "=_", "0x10000", "000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "SHOW", "TAB", "SB", "UT", "TON", "_", "=_", "0x2000", "0000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "SHOW", "DELET", "EB", "UT", "TON", "_", "=_", "0x400", "00000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "S", "\\u", "SHOW", "REFRESH", "BUTTON_", "=_", "-_", "2147483648", "_", "#", " ", "0x80000", "000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "NS", "TC", "RS", "\\u", "VISI", "BLE_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "RS", "\\u", "HIDDEN", "_", "=_", "0x1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "RS", "\\u", "EXPAN", "DED", "_", "=_", "0x2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "IS", "\\u", "NONE_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "IS", "\\u", "SELECTED", "_", "=_", "0x1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "IS", "\\u", "EXPAN", "DED", "_", "=_", "0x2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "IS", "\\u", "BOLD_", "=_", "0x4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TC", "IS", "\\u", "DISABLED_", "=_", "0x8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TCG", "NI", "\\u", "NEXT", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TCG", "NI", "\\u", "NEXT", "VISI", "BLE_", "=_", "0x1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TCG", "NI", "\\u", "PRE", "V_", "=_", "0x2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TCG", "NI", "\\u", "PRE", "VV", "ISI", "BLE_", "=_", "0x3", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TCG", "NI", "\\u", "PARENT", "_", "=_", "0x4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TCG", "NI", "\\u", "CHILD", "_", "=_", "0x5", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TCG", "NI", "\\u", "FIR", "ST", "VISI", "BLE_", "=_", "0x6", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NS", "TCG", "NI", "\\u", "LAS", "TV", "ISI", "BLE_", "=_", "0x7", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "CLS", "ID", "\\u", "Explorer", "Browser_", "=_", "\"{", "7", "1f", "963", "85", "-", "ddd", "6", "-", "4", "8d", "3", "-", "a0", "c1", "-", "ae", "0", "6e", "8b", "055", "fb", "}\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Names", " ", "of", " ", "the", " ", "method", "s", " ", "of", " ", "many", " ", "shell", " ", "interface", "s", ";", " ", "used", " ", "by", " ", "implementation", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "interface", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "IB", "rowse", "r", "Frame", "\\u", "Methods_", "=_", "[_", "\"", "Get", "Frame", "Optio", "ns", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "IC", "ate", "gori", "zer", "\\u", "Methods_", "=_", "[_", "\"", "Get", "Descripti", "on", "\"_", ",_", "\"", "Get", "Cate", "gory", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Get", "Cate", "gory", "Info", "\"_", ",_", "\"", "Compare", "Cate", "gory", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "IC", "ate", "gory", "Provider", "\\u", "Methods_", "=_", "[_", "\"", "Can", "Categori", "ze", "On", "SCI", "D", "\"_", ",_", "\"", "Get", "Default", "Cate", "gory", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Get", "Cate", "gory", "For", "SCI", "D", "\"_", ",_", "\"", "Enum", "Categori", "es", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Get", "Cate", "gory", "Name", "\"_", ",_", "\"", "Creat", "e", "Cate", "gory", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "IC", "onte", "xt", "Menu", "\\u", "Methods_", "=_", "[_", "\"", "Query", "Context", "Menu", "\"_", ",_", "\"", "Invok", "e", "Command", "\"_", ",_", "\"", "Get", "Command", "String", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "IE", "xpl", "ore", "r", "Command", "\\u", "Methods_", "=_", "[_", "\"", "Get", "Tit", "le", "\"_", ",_", "\"", "Get", "Ico", "n", "\"_", ",_", "\"", "Get", "Tool", "Tip", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Get", "Canonical", "Name", "\"_", ",_", "\"", "Get", "State", "\"_", ",_", "\"", "Invok", "e", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Get", "Fla", "gs", "\"_", ",_", "\"", "Enum", "Sub", "Command", "s", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "IE", "xpl", "ore", "r", "Command", "Provider", "\\u", "Methods_", "=_", "[_", "\"", "Get", "Command", "\"_", ",_", "\"", "Get", "Command", "s", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "IO", "le", "Window", "\\u", "Methods_", "=_", "[_", "\"", "Get", "Window", "\"_", ",_", "\"", "Context", "Sensitiv", "e", "Help", "\"_", "]_", "#", " ", "XX", "X", " ", "-", " ", "this", " ", "shou", "ld", " ", "be", " ", "some", "where", " ", "in", " ", "win32", "com_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "IP", "ersi", "st", "\\u", "Methods_", "=_", "[_", "\"", "Get", "Class", "ID", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "IP", "ersi", "st", "Fold", "er", "\\u", "Methods_", "=_", "IP", "ersi", "st", "\\u", "Methods_", "+_", "[_", "\"", "Initializ", "e", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "IP", "ersi", "st", "Fold", "er2", "\\u", "Methods_", "=_", "IP", "ersi", "st", "Fold", "er", "\\u", "Methods_", "+_", "[_", "\"", "Get", "Cur", "Fold", "er", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "IS", "hell", "Ext", "Ini", "t", "\\u", "Methods_", "=_", "[_", "\"", "Initializ", "e", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "IS", "hell", "View", "\\u", "Methods_", "=_", "IO", "le", "Window", "\\u", "Methods_", "+_", "[_", "\"", "Translate", "Accelerat", "or", "\"_", ",_", "\"", "Enable", "Model", "ess", "\"_", ",_", "\"", "UI", "Activat", "e", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Refr", "esh", "\"_", ",_", "\"", "Creat", "e", "View", "Window", "\"_", ",_", "\"", "Destr", "oy", "View", "Window", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Get", "Curr", "ent", "Info", "\"_", ",_", "\"", "Add", "Proper", "ty", "She", "et", "Page", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Save", "View", "State", "\"_", ",_", "\"", "Select", "Item", "\"_", ",_", "\"", "Get", "Item", "Object", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "IS", "hell", "Fold", "er", "\\u", "Methods_", "=_", "[_", "\"", "Pars", "e", "Display", "Name", "\"_", ",_", "\"", "Enum", "Object", "s", "\"_", ",_", "\"", "Bind", "To", "Object", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Bind", "To", "Stor", "age", "\"_", ",_", "\"", "Compare", "ID", "s", "\"_", ",_", "\"", "Creat", "e", "View", "Object", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Get", "Attribute", "s", "Of", "\"_", ",_", "\"", "Get", "UI", "Object", "Of", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Get", "Display", "Name", "Of", "\"_", ",_", "\"", "Set", "Name", "Of", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "IS", "hell", "Fold", "er2", "\\u", "Methods_", "=_", "IS", "hell", "Fold", "er", "\\u", "Methods_", "+_", "[_", "\"", "Get", "Default", "Sear", "ch", "GUID", "\"_", ",_", "\"", "Enum", "Searche", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Get", "Default", "Colum", "n", "\"_", ",_", "\"", "Get", "Default", "Colum", "n", "State", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Get", "Det", "ail", "s", "Ex", "\"_", ",_", "\"", "Get", "Det", "ail", "s", "Of", "\"_", ",_", "\"", "Map", "Colum", "n", "To", "SCI", "D", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "enum", " ", "GET", "PROPERTY", "STORE", "FLAG", "S", ",", " ", "used", " ", "with", " ", "IS", "hell", "Item", "2", " ", "methods_", "\\u\\u\\uNL\\u\\u\\u_", "GPS", "\\u", "DEFAULT_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GPS", "\\u", "HANDLER", "PROPER", "TIES", "ONLY_", "=_", "0x1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GPS", "\\u", "READ", "WRITE_", "=_", "0x2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GPS", "\\u", "TEMP", "ORA", "RY_", "=_", "0x4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GPS", "\\u", "FAST", "PROPER", "TIES", "ONLY_", "=_", "0x8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GPS", "\\u", "OPENS", "LOW", "ITEM_", "=_", "0x10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GPS", "\\u", "DELAY", "CREATI", "ON_", "=_", "0x20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GPS", "\\u", "BES", "TE", "FF", "ORT", "_", "=_", "0x40_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GPS", "\\u", "MASK", "\\u", "VALID", "_", "=_", "0x7f", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Bind", " ", "context", " ", "parameter", " ", "names", ",", " ", "used", " ", "with", " ", "IB", "ind", "Ctx", "::", "Register", "Object", "Param_", "\\u\\u\\uNL\\u\\u\\u_", "STR", "\\u", "AV", "OID", "\\u", "DRI", "VE", "\\u", "RESTR", "ICT", "ION", "\\u", "POLICY", "_", "=_", "\"", "Av", "oid", " ", "Drive", " ", "Restriction", " ", "Polic", "y", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "BIND", "\\u", "DEL", "EGA", "TE", "\\u", "CREATE", "\\u", "OBJECT_", "=_", "\"", "Delegate", " ", "Object", " ", "Creat", "ion", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "BIND", "\\u", "FOLDER", "S", "\\u", "READ", "\\u", "ONLY_", "=_", "\"", "Folders", " ", "As", " ", "Read", " ", "On", "ly", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "BIND", "\\u", "FOLDER", "\\u", "ENUM", "\\u", "MODE_", "=_", "\"", "Fold", "er", " ", "Enum", " ", "Mode", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "BIND", "\\u", "FORCE", "\\u", "FOLDER", "\\u", "SHORT", "CUT", "\\u", "RESOL", "VE_", "=_", "\"", "Force", " ", "Fold", "er", " ", "Short", "cut", " ", "Resolv", "e", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "DON", "T", "\\u", "PARSE", "\\u", "RELAT", "IVE_", "=_", "\"", "Don", "'", "t", " ", "Pars", "e", " ", "Relative", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "DON", "T", "\\u", "RESOL", "VE", "\\u", "LINK_", "=_", "\"", "Don", "'", "t", " ", "Resolv", "e", " ", "Link", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "##", " ", "STR", "\\u", "ENUM", "\\u", "ITEM", "S", "\\u", "FLAGS_", "\\u\\u\\uNL\\u\\u\\u_", "STR", "\\u", "FILE", "\\u", "SYS", "\\u", "BIND", "\\u", "DATA_", "=_", "\"", "File", " ", "System", " ", "Bind", " ", "Data", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "GET", "\\u", "ASYN", "C", "\\u", "HANDLER", "_", "=_", "\"", "Get", "Async", "Handle", "r", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "GPS", "\\u", "BES", "TE", "FF", "ORT", "_", "=_", "\"", "GPS", "\\u", "BES", "TE", "FF", "ORT", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "GPS", "\\u", "DELAY", "CREATI", "ON_", "=_", "\"", "GPS", "\\u", "DELAY", "CREATI", "ON", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "GPS", "\\u", "FAST", "PROPER", "TIES", "ONLY_", "=_", "\"", "GPS", "\\u", "FAST", "PROPER", "TIES", "ONL", "Y", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "GPS", "\\u", "HANDLER", "PROPER", "TIES", "ONLY_", "=_", "\"", "GPS", "\\u", "HANDLER", "PROPER", "TIES", "ONL", "Y", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "GPS", "\\u", "NO", "\\u", "OP", "LOCK_", "=_", "\"", "GPS", "\\u", "NO", "\\u", "OP", "LOCK", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "GPS", "\\u", "OPENS", "LOW", "ITEM_", "=_", "\"", "GPS", "\\u", "OPENS", "LOW", "ITEM", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "IF", "IL", "TER", "\\u", "FORCE", "\\u", "TEXT", "\\u", "FILTER", "\\u", "FAL", "LB", "ACK_", "=_", "\"", "Al", "way", "s", " ", "bind", " ", "persiste", "nt", " ", "handler", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "IF", "IL", "TER", "\\u", "LOAD", "\\u", "DEFINE", "D", "\\u", "FILTER_", "=_", "\"", "On", "ly", " ", "bind", " ", "register", "ed", " ", "persiste", "nt", " ", "handler", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "INTERN", "AL", "\\u", "NAV", "IG", "ATE_", "=_", "\"", "Intern", "al", " ", "Navigat", "ion", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "INTERN", "ET", "FOLDER", "\\u", "PARSE", "\\u", "ONL", "Y", "\\u", "URL", "MON", "\\u", "BIND", "ABLE_", "=_", "\"", "Validate", " ", "URL", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "ITEM", "\\u", "CACHE", "\\u", "CONTEXT_", "=_", "\"", "Item", "Cache", "Context", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "NO", "\\u", "VALID", "ATE", "\\u", "FILE", "NAME", "\\u", "CHARS_", "=_", "\"", "No", "Validate", "File", "name", "Char", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "PARSE", "\\u", "ALLOW", "\\u", "INTERN", "ET", "\\u", "SHELL", "\\u", "FOLDER", "S_", "=_", "\"", "All", "ow", " ", "bindi", "ng", " ", "to", " ", "Intern", "et", " ", "shell", " ", "folder", " ", "handler", "s", " ", "and", " ", "negate", " ", "STR", "\\u", "PARSE", "\\u", "PREFER", "\\u", "WEB", "\\u", "BRO", "WS", "ING", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "PARSE", "\\u", "AND", "\\u", "CREATE", "\\u", "ITEM_", "=_", "\"", "Pars", "e", "And", "Creat", "e", "Item", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "PARSE", "\\u", "DON", "T", "\\u", "REQUIRE", "\\u", "VALID", "ATED", "\\u", "URLS_", "=_", "\"", "Do", " ", "not", " ", "require", " ", "validat", "ed", " ", "URL", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "PARSE", "\\u", "EXPL", "ICIT", "\\u", "ASSOC", "IAT", "ION", "\\u", "SUCCESS", "FU", "L_", "=_", "\"", "Exp", "licit", "Assoc", "iation", "Success", "ful", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "PARSE", "\\u", "PARTI", "AL", "\\u", "ID", "LIST_", "=_", "\"", "Pars", "e", "Origina", "l", "Item", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "PARSE", "\\u", "PREFER", "\\u", "FOLDER", "\\u", "BRO", "WS", "ING_", "=_", "\"", "Pars", "e", " ", "Prefe", "r", " ", "Fold", "er", " ", "Brows", "ing", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "PARSE", "\\u", "PREFER", "\\u", "WEB", "\\u", "BRO", "WS", "ING_", "=_", "\"", "Do", " ", "not", " ", "bind", " ", "to", " ", "Intern", "et", " ", "shell", " ", "folder", " ", "handler", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "PARSE", "\\u", "PROPERTY", "STORE", "_", "=_", "\"", "Delegate", "Name", "d", "Proper", "ties", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "PARSE", "\\u", "SHELL", "\\u", "PROTOCOL", "\\u", "TO", "\\u", "FILE", "\\u", "OBJECTS", "_", "=_", "\"", "Pars", "e", " ", "Shel", "l", " ", "Proto", "col", " ", "To", " ", "File", " ", "Object", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "PARSE", "\\u", "SHOW", "\\u", "NET", "\\u", "DIA", "GN", "OST", "ICS", "\\u", "UI_", "=_", "\"", "Show", " ", "network", " ", "diagnostics", " ", "UI", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "PARSE", "\\u", "SKIP", "\\u", "NET", "\\u", "CACHE_", "=_", "\"", "Ski", "p", " ", "Net", " ", "Reso", "urc", "e", " ", "Cache", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "PARSE", "\\u", "TRANSLAT", "E", "\\u", "ALIAS", "ES_", "=_", "\"", "Pars", "e", " ", "Translate", " ", "Aliase", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "PARSE", "\\u", "WITH", "\\u", "EXPL", "ICIT", "\\u", "ASSOC", "APP_", "=_", "\"", "Exp", "licit", "Assoc", "iation", "App", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "PARSE", "\\u", "WITH", "\\u", "EXPL", "ICIT", "\\u", "PROG", "ID_", "=_", "\"", "Exp", "licit", "Prog", "id", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "PARSE", "\\u", "WITH", "\\u", "PROPERTIES_", "=_", "\"", "Pars", "e", "With", "Proper", "ties", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "##", " ", "STR", "\\u", "PROPERTY", "BA", "G", "\\u", "PARAM_", "\\u\\u\\uNL\\u\\u\\u_", "STR", "\\u", "SKIP", "\\u", "BINDING", "\\u", "CLS", "ID_", "=_", "\"", "Ski", "p", " ", "Bind", "ing", " ", "CLS", "ID", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STR", "\\u", "TRACK", "\\u", "CLS", "ID_", "=_", "\"", "Track", " ", "the", " ", "CLS", "ID", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "KF", "\\u", "REDIRECT", "ION", "\\u", "CAPA", "BIL", "ITI", "ES", " ", "enum_", "\\u\\u\\uNL\\u\\u\\u_", "KF", "\\u", "REDIRECT", "ION", "\\u", "CAPA", "BIL", "ITI", "ES", "\\u", "ALLOW", "\\u", "ALL_", "=_", "0x000000", "FF_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KF", "\\u", "REDIRECT", "ION", "\\u", "CAPA", "BIL", "ITI", "ES", "\\u", "REDIRECT", "ABLE_", "=_", "0x0000000", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KF", "\\u", "REDIRECT", "ION", "\\u", "CAPA", "BIL", "ITI", "ES", "\\u", "DEN", "Y", "\\u", "ALL_", "=_", "0x000", "FFF", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KF", "\\u", "REDIRECT", "ION", "\\u", "CAPA", "BIL", "ITI", "ES", "\\u", "DEN", "Y", "\\u", "POLICY", "\\u", "REDIRECT", "ED_", "=_", "0x00000", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KF", "\\u", "REDIRECT", "ION", "\\u", "CAPA", "BIL", "ITI", "ES", "\\u", "DEN", "Y", "\\u", "POLICY", "_", "=_", "0x00000", "200_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KF", "\\u", "REDIRECT", "ION", "\\u", "CAPA", "BIL", "ITI", "ES", "\\u", "DEN", "Y", "\\u", "PERMISSION", "S_", "=_", "0x00000", "400_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "KF", "\\u", "REDIRECT", "\\u", "FLAG", "S", " ", "enum_", "\\u\\u\\uNL\\u\\u\\u_", "KF", "\\u", "REDIRECT", "\\u", "USER", "\\u", "EXC", "LUS", "IVE_", "=_", "0x0000000", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KF", "\\u", "REDIRECT", "\\u", "COPY", "\\u", "SOU", "RC", "E", "\\u", "DAC", "L_", "=_", "0x0000000", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KF", "\\u", "REDIRECT", "\\u", "OWNER", "\\u", "USER_", "=_", "0x0000000", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KF", "\\u", "REDIRECT", "\\u", "SET", "\\u", "OWNER", "\\u", "EXPL", "ICIT", "_", "=_", "0x0000000", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KF", "\\u", "REDIRECT", "\\u", "CHECK", "\\u", "ONLY_", "=_", "0x000000", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KF", "\\u", "REDIRECT", "\\u", "WITH", "\\u", "UI_", "=_", "0x000000", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KF", "\\u", "REDIRECT", "\\u", "UNP", "IN_", "=_", "0x000000", "40_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KF", "\\u", "REDIRECT", "\\u", "PIN_", "=_", "0x000000", "80_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KF", "\\u", "REDIRECT", "\\u", "COPY", "\\u", "CONTE", "NTS", "_", "=_", "0x00000", "200_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KF", "\\u", "REDIRECT", "\\u", "DEL", "\\u", "SOU", "RC", "E", "\\u", "CONTE", "NTS", "_", "=_", "0x00000", "400_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KF", "\\u", "REDIRECT", "\\u", "EXCLUDE", "\\u", "ALL", "\\u", "KNOWN", "\\u", "SUB", "FOLDER", "S_", "=_", "0x00000", "800_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "KF", "\\u", "CATEGORY", " ", "enum_", "\\u\\u\\uNL\\u\\u\\u_", "KF", "\\u", "CATEGORY", "\\u", "VIRTUAL", "_", "=_", "0x0000000", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KF", "\\u", "CATEGORY", "\\u", "FIXED", "_", "=_", "0x0000000", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KF", "\\u", "CATEGORY", "\\u", "COMMON", "_", "=_", "0x0000000", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KF", "\\u", "CATEGORY", "\\u", "PER", "USER_", "=_", "0x0000000", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "FFF", "P", "\\u", "MODE", " ", "enum_", "\\u\\u\\uNL\\u\\u\\u_", "FFF", "P", "\\u", "EX", "ACT", "MATCH_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FFF", "P", "\\u", "NEA", "REST", "PARENT", "MATCH_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "KF", "\\u", "FLAG", "\\u", "CREATE_", "=_", "0x0000", "8000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KF", "\\u", "FLAG", "\\u", "DON", "T", "\\u", "VERIFY", "_", "=_", "0x0000", "4000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KF", "\\u", "FLAG", "\\u", "DON", "T", "\\u", "UNE", "XP", "AND_", "=_", "0x0000", "2000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KF", "\\u", "FLAG", "\\u", "NO", "\\u", "ALIAS_", "=_", "0x0000", "1000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KF", "\\u", "FLAG", "\\u", "INIT", "_", "=_", "0x00000", "800_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KF", "\\u", "FLAG", "\\u", "DEF", "AUL", "T", "\\u", "PATH_", "=_", "0x00000", "400_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KF", "\\u", "FLAG", "\\u", "NOT", "\\u", "PARENT", "\\u", "RELAT", "IVE_", "=_", "0x00000", "200_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KF", "\\u", "FLAG", "\\u", "SIMPLE", "\\u", "ID", "LIST_", "=_", "0x00000", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "APP", "DOC", "LIST", "TYPE", ",", " ", "used", " ", "with", " ", "IA", "ppl", "ication", "Document", "List", "s", ".", "Get", "List_", "\\u\\u\\uNL\\u\\u\\u_", "AD", "LT", "\\u", "REC", "ENT_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AD", "LT", "\\u", "FREQ", "UE", "NT_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "KNOWN", "DEST", "CATEGORY", " ", "used", " ", "with", " ", "IC", "ust", "om", "Dest", "ination", "List", ".", "Append", "Kno", "wn", "Category_", "\\u\\u\\uNL\\u\\u\\u_", "KD", "C", "\\u", "FREQ", "UE", "NT_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KD", "C", "\\u", "REC", "ENT_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "LIBRARY", "FOLDER", "FILTER", " ", "used", " ", "with", " ", "IS", "hell", "Libr", "ary", ".", "Get", "Folders", "_", "\\u\\u\\uNL\\u\\u\\u_", "LF", "F", "\\u", "FORCE", "FILE", "SYSTEM", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "LF", "F", "\\u", "STOR", "AGE", "ITEMS_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "LF", "F", "\\u", "ALL", "ITEMS_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "DEF", "AUL", "TS", "AV", "EF", "OLD", "ERT", "YP", "E", " ", "used", " ", "with", " ", "IS", "hell", "Libr", "ary", ".", "Get", "/", "Set", "Default", "Save", "Folder_", "\\u\\u\\uNL\\u\\u\\u_", "DS", "FT", "\\u", "DETECT", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DS", "FT", "\\u", "PRIVATE", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DS", "FT", "\\u", "PUBLIC", "_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "LIBRARY", "OPTION", "FLAG", "S", " ", "used", " ", "with", " ", "IS", "hell", "Libr", "ary", ".", "Get", "/", "Set", "Options_", "\\u\\u\\uNL\\u\\u\\u_", "LO", "F", "\\u", "DEFAULT_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "LO", "F", "\\u", "PIN", "NED", "TON", "AVP", "AN", "E_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "LO", "F", "\\u", "MASK", "\\u", "ALL_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "LIBRARY", "SAVE", "FLAG", "S", " ", "Us", "ed", " ", "with", " ", "Py", "IS", "hell", "Libr", "ary", ".", "Save_", "\\u\\u\\uNL\\u\\u\\u_", "LS", "F", "\\u", "FAIL", "IF", "THER", "E_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "LS", "F", "\\u", "OVERRIDE", "EXIST", "ING_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "LS", "F", "\\u", "MAKE", "UNI", "QUE", "NAME_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "TRANSFER", "\\u", "SOU", "RC", "E", "\\u", "FLAG", "S", ",", " ", "used", " ", "with", " ", "IF", "ile", "Opera", "tion", "Progres", "s", "Sink_", "\\u\\u\\uNL\\u\\u\\u_", "TS", "F", "\\u", "NORMAL_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TS", "F", "\\u", "FAIL", "\\u", "EXIST", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TS", "F", "\\u", "RENA", "ME", "\\u", "EXIST", "_", "=_", "0x1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TS", "F", "\\u", "OVER", "WRITE", "\\u", "EXIST", "_", "=_", "0x2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TS", "F", "\\u", "ALLOW", "\\u", "DEC", "RY", "PTION", "_", "=_", "0x4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TS", "F", "\\u", "NO", "\\u", "SECURITY", "_", "=_", "0x8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TS", "F", "\\u", "COPY", "\\u", "CREATI", "ON", "\\u", "TIME_", "=_", "0x10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TS", "F", "\\u", "COPY", "\\u", "WRITE", "\\u", "TIME_", "=_", "0x20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TS", "F", "\\u", "USE", "\\u", "FULL", "\\u", "ACCESS", "_", "=_", "0x40_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TS", "F", "\\u", "DELET", "E", "\\u", "REC", "YC", "LE", "\\u", "IF", "\\u", "POS", "SIB", "LE_", "=_", "0x80_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TS", "F", "\\u", "COPY", "\\u", "HARD", "\\u", "LINK_", "=_", "0x100", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TS", "F", "\\u", "COPY", "\\u", "LOCAL", "IZED", "\\u", "NAME_", "=_", "0x200", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TS", "F", "\\u", "MOVE", "\\u", "AS", "\\u", "COPY", "\\u", "DELETE_", "=_", "0x400", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TS", "F", "\\u", "SUS", "PEND", "\\u", "SHELL", "EVENTS", "_", "=_", "0x800", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "TRANSFER", "\\u", "ADV", "ISE", "\\u", "STATE", ",", " ", "used", " ", "with", " ", "IT", "ransf", "er", "Adv", "ise", "Sink_", "\\u\\u\\uNL\\u\\u\\u_", "TS", "\\u", "NONE_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TS", "\\u", "PERF", "ORM", "ING_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TS", "\\u", "PREP", "ARI", "NG_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TS", "\\u", "INDE", "TERMINAT", "E_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Success", " ", "HRE", "SUL", "Ts", " ", "return", "ed", " ", "by", " ", "IT", "ransf", "er", "*", " ", "interface", " ", "operations_", "\\u\\u\\uNL\\u\\u\\u_", "COPY", "ENGINE", "\\u", "S", "\\u", "YES_", "=_", "0x002", "7000", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "S", "\\u", "NOT", "\\u", "HANDLE", "D_", "=_", "0x002", "7000", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "S", "\\u", "USER", "\\u", "RETRY", "_", "=_", "0x002", "7000", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "S", "\\u", "USER", "\\u", "IGNORE", "D_", "=_", "0x002", "7000", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "S", "\\u", "MERGE", "_", "=_", "0x002", "7000", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "S", "\\u", "DON", "T", "\\u", "PROCESS", "\\u", "CHILD", "REN", "_", "=_", "0x002", "7000", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "S", "\\u", "ALREADY", "\\u", "DONE_", "=_", "0x002", "7000", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "S", "\\u", "PENDING_", "=_", "0x002", "7000", "B_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "S", "\\u", "KEEP", "\\u", "BOTH_", "=_", "0x002", "7000", "C_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "S", "\\u", "CLOSE", "\\u", "PROGRAM", "_", "=_", "0x002", "7000", "D_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "S", "\\u", "COLL", "ISI", "ON", "RESOL", "VED", "_", "=_", "0x002", "7000", "E_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Error", " ", "HRE", "SUL", "TS_", "\\u\\u\\uNL\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "USER", "\\u", "CANCELLED", "_", "=_", "0x80", "270", "000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "CANCELLED", "_", "=_", "0x80", "270", "001_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "REQUIRE", "S", "\\u", "ELE", "VAT", "ION_", "=_", "0x80", "270", "002_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "SAM", "E", "\\u", "FILE_", "=_", "0x80", "270", "003", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "DIFF", "\\u", "DIR_", "=_", "0x80", "270", "004", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "MAN", "Y", "\\u", "SR", "C", "\\u", "1", "\\u", "DEST", "_", "=_", "0x80", "270", "005", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "DEST", "\\u", "SUBT", "REE", "_", "=_", "0x80", "270", "009", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "DEST", "\\u", "SAM", "E", "\\u", "TREE", "_", "=_", "0x80", "270", "00", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "FL", "D", "\\u", "IS", "\\u", "FILE", "\\u", "DEST", "_", "=_", "0x80", "270", "00", "B_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "FILE", "\\u", "IS", "\\u", "FL", "D", "\\u", "DEST", "_", "=_", "0x80", "270", "00", "C_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "FILE", "\\u", "TOO", "\\u", "LARGE", "_", "=_", "0x80", "270", "00", "D_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "REMO", "VA", "BL", "E", "\\u", "FULL", "_", "=_", "0x80", "270", "00", "E_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "DEST", "\\u", "IS", "\\u", "RO", "\\u", "CD_", "=_", "0x80", "270", "00", "F_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "DEST", "\\u", "IS", "\\u", "RW", "\\u", "CD_", "=_", "0x80", "270", "010_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "DEST", "\\u", "IS", "\\u", "R", "\\u", "CD_", "=_", "0x80", "270", "011", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "DEST", "\\u", "IS", "\\u", "RO", "\\u", "DVD", "_", "=_", "0x80", "270", "012", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "DEST", "\\u", "IS", "\\u", "RW", "\\u", "DVD", "_", "=_", "0x80", "270", "013", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "DEST", "\\u", "IS", "\\u", "R", "\\u", "DVD", "_", "=_", "0x80", "270", "014", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "SR", "C", "\\u", "IS", "\\u", "RO", "\\u", "CD_", "=_", "0x80", "270", "015", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "SR", "C", "\\u", "IS", "\\u", "RW", "\\u", "CD_", "=_", "0x80", "270", "016", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "SR", "C", "\\u", "IS", "\\u", "R", "\\u", "CD_", "=_", "0x80", "270", "017", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "SR", "C", "\\u", "IS", "\\u", "RO", "\\u", "DVD", "_", "=_", "0x80", "270", "018", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "SR", "C", "\\u", "IS", "\\u", "RW", "\\u", "DVD", "_", "=_", "0x80", "270", "019", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "SR", "C", "\\u", "IS", "\\u", "R", "\\u", "DVD", "_", "=_", "0x80", "270", "01", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "INVALID", "\\u", "FILE", "S", "\\u", "SRC_", "=_", "0x80", "270", "01", "B_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "INVALID", "\\u", "FILE", "S", "\\u", "DEST", "_", "=_", "0x80", "270", "01", "C_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "PATH", "\\u", "TOO", "\\u", "DE", "EP", "\\u", "SRC_", "=_", "0x80", "270", "01", "D_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "PATH", "\\u", "TOO", "\\u", "DE", "EP", "\\u", "DEST", "_", "=_", "0x80", "270", "01", "E_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "ROO", "T", "\\u", "DIR", "\\u", "SRC_", "=_", "0x80", "270", "01", "F_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "ROO", "T", "\\u", "DIR", "\\u", "DEST", "_", "=_", "0x80", "270", "020", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "ACCESS", "\\u", "DEN", "IED", "\\u", "SRC_", "=_", "0x80", "270", "021", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "ACCESS", "\\u", "DEN", "IED", "\\u", "DEST", "_", "=_", "0x80", "270", "022", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "PATH", "\\u", "NOT", "\\u", "FO", "UND", "\\u", "SRC_", "=_", "0x80", "270", "023", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "PATH", "\\u", "NOT", "\\u", "FO", "UND", "\\u", "DEST", "_", "=_", "0x80", "270", "024", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "NET", "\\u", "DISCONNECT", "\\u", "SRC_", "=_", "0x80", "270", "025", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "NET", "\\u", "DISCONNECT", "\\u", "DEST", "_", "=_", "0x80", "270", "026", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "SHAR", "ING", "\\u", "VIO", "LATI", "ON", "\\u", "SRC_", "=_", "0x80", "270", "027", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "SHAR", "ING", "\\u", "VIO", "LATI", "ON", "\\u", "DEST", "_", "=_", "0x80", "270", "028", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "ALREADY", "\\u", "EXIST", "S", "\\u", "NORMAL_", "=_", "0x80", "270", "029", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "ALREADY", "\\u", "EXIST", "S", "\\u", "READO", "NLY", "_", "=_", "0x80", "270", "02", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "ALREADY", "\\u", "EXIST", "S", "\\u", "SYSTEM", "_", "=_", "0x80", "270", "02", "B_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "ALREADY", "\\u", "EXIST", "S", "\\u", "FOLDER_", "=_", "0x80", "270", "02", "C_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "STRE", "AM", "\\u", "LOSS", "_", "=_", "0x80", "270", "02", "D_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "EA", "\\u", "LOSS", "_", "=_", "0x80", "270", "02", "E_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "PROPERTY", "\\u", "LOSS", "_", "=_", "0x80", "270", "02", "F_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "PROPER", "TIES", "\\u", "LOSS", "_", "=_", "0x80", "270", "030", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "ENCRYPT", "ION", "\\u", "LOSS", "_", "=_", "0x80", "270", "031", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "DISK", "\\u", "FULL", "_", "=_", "0x80", "270", "032", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "DISK", "\\u", "FULL", "\\u", "CLEAN", "_", "=_", "0x80", "270", "033", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "EA", "\\u", "NOT", "\\u", "SUPPORTED", "_", "=_", "0x80", "270", "034", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "CAN", "T", "\\u", "REAC", "H", "\\u", "SOURCE_", "=_", "0x80", "270", "035", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "REC", "YC", "LE", "\\u", "UNK", "NOW", "N", "\\u", "ERROR_", "=_", "0x80", "270", "035", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "REC", "YC", "LE", "\\u", "FORCE", "\\u", "NU", "KE", "_", "=_", "0x80", "270", "036", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "REC", "YC", "LE", "\\u", "SIZE", "\\u", "TOO", "\\u", "BIG", "_", "=_", "0x80", "270", "037", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "REC", "YC", "LE", "\\u", "PATH", "\\u", "TOO", "\\u", "LONG_", "=_", "0x80", "270", "038", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "REC", "YC", "LE", "\\u", "BIN", "\\u", "NOT", "\\u", "FOUND_", "=_", "0x80", "270", "03", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "NEW", "FILE", "\\u", "NAME", "\\u", "TOO", "\\u", "LONG_", "=_", "0x80", "270", "03", "B_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "NEW", "FOLDER", "\\u", "NAME", "\\u", "TOO", "\\u", "LONG_", "=_", "0x80", "270", "03", "C_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "DIR", "\\u", "NOT", "\\u", "EMPTY_", "=_", "0x80", "270", "03", "D_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "FA", "T", "\\u", "MAX", "\\u", "IN", "\\u", "ROOT_", "=_", "0x80", "270", "03", "E_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COPY", "ENGINE", "\\u", "E", "\\u", "ACCESS", "DEN", "IED", "\\u", "READO", "NLY", "_", "=_", "0x80", "270", "03", "F_", "\\u\\u\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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
dtroyer/python-openstackclient/openstackclient/tests/image/v2/test_image.py
[ { "content": " def test_image_set_tag_merge(self):\n old_image = copy.copy(image_fakes.IMAGE)\n old_image['tags'] = ['old1', 'new2']\n self.images_mock.get.return_value = self.model(**old_image)\n arglist = [\n '--tag', 'test-tag',\n image_fakes.image_name,\n ]\n verifylist = [\n ('tags', ['test-tag']),\n ('image', image_fakes.image_name),\n ]\n parsed_args = self.check_parser(self.cmd, arglist, verifylist)\n\n result = self.cmd.take_action(parsed_args)\n\n kwargs = {\n 'tags': ['old1', 'new2', 'test-tag'],\n }\n # ImageManager.update(image, **kwargs)\n a, k = self.images_mock.update.call_args\n self.assertEqual(image_fakes.image_id, a[0])\n self.assertTrue('tags' in k)\n self.assertEqual(set(kwargs['tags']), set(k['tags']))\n self.assertIsNone(result)", "metadata": "root.TestImageSet.test_image_set_tag_merge", "header": "['class', 'TestImageSet', '(', 'TestImage', ')', ':', '___EOS___']", "index": 1082 }, { "content": " def test_image_set_tag_merge_dupe(self):\n old_image = copy.copy(image_fakes.IMAGE)\n old_image['tags'] = ['old1', 'new2']\n self.images_mock.get.return_value = self.model(**old_image)\n arglist = [\n '--tag', 'old1',\n image_fakes.image_name,\n ]\n verifylist = [\n ('tags', ['old1']),\n ('image', image_fakes.image_name),\n ]\n parsed_args = self.check_parser(self.cmd, arglist, verifylist)\n\n result = self.cmd.take_action(parsed_args)\n\n kwargs = {\n 'tags': ['new2', 'old1'],\n }\n # ImageManager.update(image, **kwargs)\n a, k = self.images_mock.update.call_args\n self.assertEqual(image_fakes.image_id, a[0])\n self.assertTrue('tags' in k)\n self.assertEqual(set(kwargs['tags']), set(k['tags']))\n self.assertIsNone(result)", "metadata": "root.TestImageSet.test_image_set_tag_merge_dupe", "header": "['class', 'TestImageSet', '(', 'TestImage', ')', ':', '___EOS___']", "index": 1108 } ]
[ { "span": "self.assertTrue('tags' in k)", "start_line": 1104, "start_column": 8, "end_line": 1104, "end_column": 36 }, { "span": "self.assertTrue('tags' in k)", "start_line": 1130, "start_column": 8, "end_line": 1130, "end_column": 36 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Image", "Set_", "(_", "Test", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "image", "\\u", "set\\u", "tag", "\\u", "merge_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old", "\\u", "image_", "=_", "copy_", "._", "copy_", "(_", "image", "\\u", "fakes_", "._", "IMAGE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "\\u", "image_", "[_", "'", "tags", "'_", "]_", "=_", "[_", "'", "old", "1", "'_", ",_", "'", "new", "2", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "images", "\\u", "mock_", "._", "get_", "._", "return", "\\u", "value_", "=_", "self_", "._", "model_", "(_", "**_", "old", "\\u", "image_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arglist_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "tag", "'_", ",_", "'", "test", "-", "tag", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "image", "\\u", "fakes_", "._", "image", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "verifylist_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "tags", "'_", ",_", "[_", "'", "test", "-", "tag", "'_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "image", "'_", ",_", "image", "\\u", "fakes_", "._", "image", "\\u", "name_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parsed", "\\u", "args_", "=_", "self_", "._", "check", "\\u", "parser_", "(_", "self_", "._", "cmd_", ",_", "arglist_", ",_", "verifylist_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "self_", "._", "cmd_", "._", "take", "\\u", "action_", "(_", "parsed", "\\u", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "kwargs_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tags", "'_", ":_", "[_", "'", "old", "1", "'_", ",_", "'", "new", "2", "'_", ",_", "'", "test", "-", "tag", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Image", "Manager", ".", "update", "(", "image", ",", " ", "**", "kwarg", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "a_", ",_", "k_", "=_", "self_", "._", "images", "\\u", "mock_", "._", "update_", "._", "call", "\\u", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "image", "\\u", "fakes_", "._", "image", "\\u", "id_", ",_", "a_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "tags", "'_", "in_", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "set_", "(_", "kwargs_", "[_", "'", "tags", "'_", "]_", ")_", ",_", "set_", "(_", "k_", "[_", "'", "tags", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "None_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Image", "Set_", "(_", "Test", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "image", "\\u", "set\\u", "tag", "\\u", "merge", "\\u", "dupe", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old", "\\u", "image_", "=_", "copy_", "._", "copy_", "(_", "image", "\\u", "fakes_", "._", "IMAGE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "\\u", "image_", "[_", "'", "tags", "'_", "]_", "=_", "[_", "'", "old", "1", "'_", ",_", "'", "new", "2", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "images", "\\u", "mock_", "._", "get_", "._", "return", "\\u", "value_", "=_", "self_", "._", "model_", "(_", "**_", "old", "\\u", "image_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arglist_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "tag", "'_", ",_", "'", "old", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "image", "\\u", "fakes_", "._", "image", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "verifylist_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "tags", "'_", ",_", "[_", "'", "old", "1", "'_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "image", "'_", ",_", "image", "\\u", "fakes_", "._", "image", "\\u", "name_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parsed", "\\u", "args_", "=_", "self_", "._", "check", "\\u", "parser_", "(_", "self_", "._", "cmd_", ",_", "arglist_", ",_", "verifylist_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "self_", "._", "cmd_", "._", "take", "\\u", "action_", "(_", "parsed", "\\u", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "kwargs_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tags", "'_", ":_", "[_", "'", "new", "2", "'_", ",_", "'", "old", "1", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Image", "Manager", ".", "update", "(", "image", ",", " ", "**", "kwarg", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "a_", ",_", "k_", "=_", "self_", "._", "images", "\\u", "mock_", "._", "update_", "._", "call", "\\u", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "image", "\\u", "fakes_", "._", "image", "\\u", "id_", ",_", "a_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "tags", "'_", "in_", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "set_", "(_", "kwargs_", "[_", "'", "tags", "'_", "]_", ")_", ",_", "set_", "(_", "k_", "[_", "'", "tags", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "None_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
'import *' may pollute namespace
ardekantur/pyglet/experimental/mt_media/drivers/pulse/lib_pulseaudio.py
[ { "content": "'''Wrapper for pulse\n\nGenerated with:\ntools/genwrappers.py pulseaudio\n\nDo not modify this file.\n'''\n\n__docformat__ = 'restructuredtext'\n__version__ = '$Id: wrap.py 1694 2008-01-30 23:12:00Z Alex.Holkner $'\n\nimport ctypes\nfrom ctypes import *\n\nimport pyglet.lib\n\n_lib = pyglet.lib.load_library('pulse')\n\n_int_types = (c_int16, c_int32)\nif hasattr(ctypes, 'c_int64'):\n # Some builds of ctypes apparently do not have c_int64\n # defined; it's a pretty good bet that these builds do not\n # have 64-bit pointers.\n _int_types += (ctypes.c_int64,)\nfor t in _int_types:\n if sizeof(t) == sizeof(c_size_t):\n c_ptrdiff_t = t\n\n\n\n\nstruct_pa_mainloop_api._fields_ = [\n ('_opaque_struct', c_int)\n]\n\nstruct_pa_mainloop_api._fields_ = [\n ('_opaque_struct', c_int)\n]\n\npa_mainloop_api = struct_pa_mainloop_api \t# /usr/include/pulse/mainloop-api.h:51\nenum_pa_io_event_flags = c_int\nPA_IO_EVENT_NULL = 0\nPA_IO_EVENT_INPUT = 1\nPA_IO_EVENT_OUTPUT = 2\nPA_IO_EVENT_HANGUP = 4\nPA_IO_EVENT_ERROR = 8\npa_io_event_flags_t = enum_pa_io_event_flags \t# /usr/include/pulse/mainloop-api.h:60\nstruct_pa_io_event._fields_ = [\n ('_opaque_struct', c_int)\n]\n\nstruct_pa_io_event._fields_ = [\n ('_opaque_struct', c_int)\n]\n\npa_io_event = struct_pa_io_event \t# /usr/include/pulse/mainloop-api.h:63\npa_io_event_cb_t = CFUNCTYPE(None, POINTER(pa_mainloop_api), POINTER(pa_io_event), c_int, pa_io_event_flags_t, POINTER(None)) \t# /usr/include/pulse/mainloop-api.h:65\npa_io_event_destroy_cb_t = CFUNCTYPE(None, POINTER(pa_mainloop_api), POINTER(pa_io_event), POINTER(None)) \t# /usr/include/pulse/mainloop-api.h:67\nstruct_pa_time_event._fields_ = [\n ('_opaque_struct', c_int)\n]\n\nstruct_pa_time_event._fields_ = [\n ('_opaque_struct', c_int)\n]\n\npa_time_event = struct_pa_time_event \t# /usr/include/pulse/mainloop-api.h:70\nstruct_timeval._fields_ = [\n ('_opaque_struct', c_int)\n]\n\nstruct_timeval._fields_ = [\n ('_opaque_struct', c_int)\n]\n\npa_time_event_cb_t = CFUNCTYPE(None, POINTER(pa_mainloop_api), POINTER(pa_time_event), POINTER(struct_timeval), POINTER(None)) \t# /usr/include/pulse/mainloop-api.h:72\npa_time_event_destroy_cb_t = CFUNCTYPE(None, POINTER(pa_mainloop_api), POINTER(pa_time_event), POINTER(None)) \t# /usr/include/pulse/mainloop-api.h:74\nstruct_pa_defer_event._fields_ = [\n ('_opaque_struct', c_int)\n]\n\nstruct_pa_defer_event._fields_ = [\n ('_opaque_struct', c_int)\n]\n\npa_defer_event = struct_pa_defer_event \t# /usr/include/pulse/mainloop-api.h:77\npa_defer_event_cb_t = CFUNCTYPE(None, POINTER(pa_mainloop_api), POINTER(pa_defer_event), POINTER(None)) \t# /usr/include/pulse/mainloop-api.h:79\npa_defer_event_destroy_cb_t = CFUNCTYPE(None, POINTER(pa_mainloop_api), POINTER(pa_defer_event), POINTER(None)) \t# /usr/include/pulse/mainloop-api.h:81\n# /usr/include/pulse/mainloop-api.h:120\npa_mainloop_api_once = _lib.pa_mainloop_api_once\npa_mainloop_api_once.restype = None\npa_mainloop_api_once.argtypes = [POINTER(pa_mainloop_api), CFUNCTYPE(None, POINTER(pa_mainloop_api), POINTER(None)), POINTER(None)]\n\nPA_CHANNELS_MAX = 32 \t# /usr/include/pulse/sample.h:117\nPA_RATE_MAX = 192000 \t# /usr/include/pulse/sample.h:120\nenum_pa_sample_format = c_int\nPA_SAMPLE_U8 = 0\nPA_SAMPLE_ALAW = 1\nPA_SAMPLE_ULAW = 2\nPA_SAMPLE_S16LE = 3\nPA_SAMPLE_S16BE = 4\nPA_SAMPLE_FLOAT32LE = 5\nPA_SAMPLE_FLOAT32BE = 6\nPA_SAMPLE_S32LE = 7\nPA_SAMPLE_S32BE = 8\nPA_SAMPLE_MAX = 9\nPA_SAMPLE_INVALID = 10\npa_sample_format_t = enum_pa_sample_format \t# /usr/include/pulse/sample.h:135\nstruct_pa_sample_spec._fields_ = [\n ('format', pa_sample_format_t),\n ('rate', c_uint32),\n ('channels', c_uint8),\n]\n\npa_sample_spec = struct_pa_sample_spec \t# /usr/include/pulse/sample.h:173\npa_usec_t = c_uint64 \t# /usr/include/pulse/sample.h:176\n# /usr/include/pulse/sample.h:179\npa_bytes_per_second = _lib.pa_bytes_per_second\npa_bytes_per_second.restype = c_size_t\npa_bytes_per_second.argtypes = [POINTER(pa_sample_spec)]\n\n# /usr/include/pulse/sample.h:182\npa_frame_size = _lib.pa_frame_size\npa_frame_size.restype = c_size_t\npa_frame_size.argtypes = [POINTER(pa_sample_spec)]\n\n# /usr/include/pulse/sample.h:185\npa_sample_size = _lib.pa_sample_size\npa_sample_size.restype = c_size_t\npa_sample_size.argtypes = [POINTER(pa_sample_spec)]\n\n# /usr/include/pulse/sample.h:188\npa_bytes_to_usec = _lib.pa_bytes_to_usec\npa_bytes_to_usec.restype = pa_usec_t\npa_bytes_to_usec.argtypes = [c_uint64, POINTER(pa_sample_spec)]\n\n# /usr/include/pulse/sample.h:191\npa_usec_to_bytes = _lib.pa_usec_to_bytes\npa_usec_to_bytes.restype = c_size_t\npa_usec_to_bytes.argtypes = [pa_usec_t, POINTER(pa_sample_spec)]\n\n# /usr/include/pulse/sample.h:194\npa_sample_spec_valid = _lib.pa_sample_spec_valid\npa_sample_spec_valid.restype = c_int\npa_sample_spec_valid.argtypes = [POINTER(pa_sample_spec)]\n\n# /usr/include/pulse/sample.h:197\npa_sample_spec_equal = _lib.pa_sample_spec_equal\npa_sample_spec_equal.restype = c_int\npa_sample_spec_equal.argtypes = [POINTER(pa_sample_spec), POINTER(pa_sample_spec)]\n\n# /usr/include/pulse/sample.h:200\npa_sample_format_to_string = _lib.pa_sample_format_to_string\npa_sample_format_to_string.restype = c_char_p\npa_sample_format_to_string.argtypes = [pa_sample_format_t]\n\n# /usr/include/pulse/sample.h:203\npa_parse_sample_format = _lib.pa_parse_sample_format\npa_parse_sample_format.restype = pa_sample_format_t\npa_parse_sample_format.argtypes = [c_char_p]\n\nPA_SAMPLE_SPEC_SNPRINT_MAX = 32 \t# /usr/include/pulse/sample.h:206\n# /usr/include/pulse/sample.h:209\npa_sample_spec_snprint = _lib.pa_sample_spec_snprint\npa_sample_spec_snprint.restype = c_char_p\npa_sample_spec_snprint.argtypes = [c_char_p, c_size_t, POINTER(pa_sample_spec)]\n\n# /usr/include/pulse/sample.h:212\npa_bytes_snprint = _lib.pa_bytes_snprint\npa_bytes_snprint.restype = c_char_p\npa_bytes_snprint.argtypes = [c_char_p, c_size_t, c_uint]\n\nenum_pa_context_state = c_int\nPA_CONTEXT_UNCONNECTED = 0\nPA_CONTEXT_CONNECTING = 1\nPA_CONTEXT_AUTHORIZING = 2\nPA_CONTEXT_SETTING_NAME = 3\nPA_CONTEXT_READY = 4\nPA_CONTEXT_FAILED = 5\nPA_CONTEXT_TERMINATED = 6\npa_context_state_t = enum_pa_context_state \t# /usr/include/pulse/def.h:49\nenum_pa_stream_state = c_int\nPA_STREAM_UNCONNECTED = 0\nPA_STREAM_CREATING = 1\nPA_STREAM_READY = 2\nPA_STREAM_FAILED = 3\nPA_STREAM_TERMINATED = 4\npa_stream_state_t = enum_pa_stream_state \t# /usr/include/pulse/def.h:58\nenum_pa_operation_state = c_int\nPA_OPERATION_RUNNING = 0\nPA_OPERATION_DONE = 1\nPA_OPERATION_CANCELED = 2\npa_operation_state_t = enum_pa_operation_state \t# /usr/include/pulse/def.h:65\nenum_pa_context_flags = c_int\nPA_CONTEXT_NOAUTOSPAWN = 1\npa_context_flags_t = enum_pa_context_flags \t# /usr/include/pulse/def.h:73\nenum_pa_stream_direction = c_int\nPA_STREAM_NODIRECTION = 0\nPA_STREAM_PLAYBACK = 1\nPA_STREAM_RECORD = 2\nPA_STREAM_UPLOAD = 3\npa_stream_direction_t = enum_pa_stream_direction \t# /usr/include/pulse/def.h:81\nenum_pa_stream_flags = c_int\nPA_STREAM_START_CORKED = 1\nPA_STREAM_INTERPOLATE_TIMING = 2\nPA_STREAM_NOT_MONOTONOUS = 4\nPA_STREAM_AUTO_TIMING_UPDATE = 8\nPA_STREAM_NO_REMAP_CHANNELS = 16\nPA_STREAM_NO_REMIX_CHANNELS = 32\nPA_STREAM_FIX_FORMAT = 64\nPA_STREAM_FIX_RATE = 128\nPA_STREAM_FIX_CHANNELS = 256\nPA_STREAM_DONT_MOVE = 512\nPA_STREAM_VARIABLE_RATE = 1024\npa_stream_flags_t = enum_pa_stream_flags \t# /usr/include/pulse/def.h:212\nstruct_pa_buffer_attr._fields_ = [\n ('maxlength', c_uint32),\n ('tlength', c_uint32),\n ('prebuf', c_uint32),\n ('minreq', c_uint32),\n ('fragsize', c_uint32),\n]\n\npa_buffer_attr = struct_pa_buffer_attr \t# /usr/include/pulse/def.h:221\nenum_pa_subscription_mask = c_int\nPA_SUBSCRIPTION_MASK_NULL = 0\nPA_SUBSCRIPTION_MASK_SINK = 1\nPA_SUBSCRIPTION_MASK_SOURCE = 2\nPA_SUBSCRIPTION_MASK_SINK_INPUT = 4\nPA_SUBSCRIPTION_MASK_SOURCE_OUTPUT = 8\nPA_SUBSCRIPTION_MASK_MODULE = 16\nPA_SUBSCRIPTION_MASK_CLIENT = 32\nPA_SUBSCRIPTION_MASK_SAMPLE_CACHE = 64\nPA_SUBSCRIPTION_MASK_SERVER = 128\nPA_SUBSCRIPTION_MASK_AUTOLOAD = 256\nPA_SUBSCRIPTION_MASK_ALL = 511\npa_subscription_mask_t = enum_pa_subscription_mask \t# /usr/include/pulse/def.h:261\nenum_pa_subscription_event_type = c_int\nPA_SUBSCRIPTION_EVENT_SINK = 0\nPA_SUBSCRIPTION_EVENT_SOURCE = 1\nPA_SUBSCRIPTION_EVENT_SINK_INPUT = 2\nPA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT = 3\nPA_SUBSCRIPTION_EVENT_MODULE = 4\nPA_SUBSCRIPTION_EVENT_CLIENT = 5\nPA_SUBSCRIPTION_EVENT_SAMPLE_CACHE = 6\nPA_SUBSCRIPTION_EVENT_SERVER = 7\nPA_SUBSCRIPTION_EVENT_AUTOLOAD = 8\nPA_SUBSCRIPTION_EVENT_FACILITY_MASK = 15\nPA_SUBSCRIPTION_EVENT_NEW = 0\nPA_SUBSCRIPTION_EVENT_CHANGE = 16\nPA_SUBSCRIPTION_EVENT_REMOVE = 32\nPA_SUBSCRIPTION_EVENT_TYPE_MASK = 1632\npa_subscription_event_type_t = enum_pa_subscription_event_type \t# /usr/include/pulse/def.h:280\nstruct_timeval._fields_ = [\n # XXX HACK struct timeval wasn't picked up by wraptypes\n #('_opaque_struct', c_int)\n ('tv_sec', c_long),\n ('tv_usec', c_long),\n]\n\nstruct_pa_timing_info._fields_ = [\n ('timestamp', struct_timeval),\n ('synchronized_clocks', c_int),\n ('sink_usec', pa_usec_t),\n ('source_usec', pa_usec_t),\n ('transport_usec', pa_usec_t),\n ('playing', c_int),\n ('write_index_corrupt', c_int),\n ('write_index', c_int64),\n ('read_index_corrupt', c_int),\n ('read_index', c_int64),\n]\n\npa_timing_info = struct_pa_timing_info \t# /usr/include/pulse/def.h:347\nstruct_pa_spawn_api._fields_ = [\n ('prefork', POINTER(CFUNCTYPE(None))),\n ('postfork', POINTER(CFUNCTYPE(None))),\n ('atfork', POINTER(CFUNCTYPE(None))),\n]\n\npa_spawn_api = struct_pa_spawn_api \t# /usr/include/pulse/def.h:366\nenum_pa_seek_mode = c_int\nPA_SEEK_RELATIVE = 0\nPA_SEEK_ABSOLUTE = 1\nPA_SEEK_RELATIVE_ON_READ = 2\nPA_SEEK_RELATIVE_END = 3\npa_seek_mode_t = enum_pa_seek_mode \t# /usr/include/pulse/def.h:374\nenum_pa_sink_flags = c_int\nPA_SINK_HW_VOLUME_CTRL = 1\nPA_SINK_LATENCY = 2\nPA_SINK_HARDWARE = 4\nPA_SINK_NETWORK = 8\npa_sink_flags_t = enum_pa_sink_flags \t# /usr/include/pulse/def.h:382\nenum_pa_source_flags = c_int\nPA_SOURCE_HW_VOLUME_CTRL = 1\nPA_SOURCE_LATENCY = 2\nPA_SOURCE_HARDWARE = 4\nPA_SOURCE_NETWORK = 8\npa_source_flags_t = enum_pa_source_flags \t# /usr/include/pulse/def.h:390\npa_free_cb_t = CFUNCTYPE(None, POINTER(None)) \t# /usr/include/pulse/def.h:393\nstruct_pa_operation._fields_ = [\n ('_opaque_struct', c_int)\n]\n\nstruct_pa_operation._fields_ = [\n ('_opaque_struct', c_int)\n]\n\npa_operation = struct_pa_operation \t# /usr/include/pulse/operation.h:36\n# /usr/include/pulse/operation.h:39\npa_operation_ref = _lib.pa_operation_ref\npa_operation_ref.restype = POINTER(pa_operation)\npa_operation_ref.argtypes = [POINTER(pa_operation)]\n\n# /usr/include/pulse/operation.h:42\npa_operation_unref = _lib.pa_operation_unref\npa_operation_unref.restype = None\npa_operation_unref.argtypes = [POINTER(pa_operation)]\n\n# /usr/include/pulse/operation.h:45\npa_operation_cancel = _lib.pa_operation_cancel\npa_operation_cancel.restype = None\npa_operation_cancel.argtypes = [POINTER(pa_operation)]\n\n# /usr/include/pulse/operation.h:48\npa_operation_get_state = _lib.pa_operation_get_state\npa_operation_get_state.restype = pa_operation_state_t\npa_operation_get_state.argtypes = [POINTER(pa_operation)]\n\nstruct_pa_context._fields_ = [\n ('_opaque_struct', c_int)\n]\n\nstruct_pa_context._fields_ = [\n ('_opaque_struct', c_int)\n]\n\npa_context = struct_pa_context \t# /usr/include/pulse/context.h:160\npa_context_notify_cb_t = CFUNCTYPE(None, POINTER(pa_context), POINTER(None)) \t# /usr/include/pulse/context.h:163\npa_context_success_cb_t = CFUNCTYPE(None, POINTER(pa_context), c_int, POINTER(None)) \t# /usr/include/pulse/context.h:166\n# /usr/include/pulse/context.h:170\npa_context_new = _lib.pa_context_new\npa_context_new.restype = POINTER(pa_context)\npa_context_new.argtypes = [POINTER(pa_mainloop_api), c_char_p]\n\n# /usr/include/pulse/context.h:173\npa_context_unref = _lib.pa_context_unref\npa_context_unref.restype = None\npa_context_unref.argtypes = [POINTER(pa_context)]\n\n# /usr/include/pulse/context.h:176\npa_context_ref = _lib.pa_context_ref\npa_context_ref.restype = POINTER(pa_context)\npa_context_ref.argtypes = [POINTER(pa_context)]\n\n# /usr/include/pulse/context.h:179\npa_context_set_state_callback = _lib.pa_context_set_state_callback\npa_context_set_state_callback.restype = None\npa_context_set_state_callback.argtypes = [POINTER(pa_context), pa_context_notify_cb_t, POINTER(None)]\n\n# /usr/include/pulse/context.h:182\npa_context_errno = _lib.pa_context_errno\npa_context_errno.restype = c_int\npa_context_errno.argtypes = [POINTER(pa_context)]\n\n# /usr/include/pulse/context.h:185\npa_context_is_pending = _lib.pa_context_is_pending\npa_context_is_pending.restype = c_int\npa_context_is_pending.argtypes = [POINTER(pa_context)]\n\n# /usr/include/pulse/context.h:188\npa_context_get_state = _lib.pa_context_get_state\npa_context_get_state.restype = pa_context_state_t\npa_context_get_state.argtypes = [POINTER(pa_context)]\n\n# /usr/include/pulse/context.h:197\npa_context_connect = _lib.pa_context_connect\npa_context_connect.restype = c_int\npa_context_connect.argtypes = [POINTER(pa_context), c_char_p, pa_context_flags_t, POINTER(pa_spawn_api)]\n\n# /usr/include/pulse/context.h:200\npa_context_disconnect = _lib.pa_context_disconnect\npa_context_disconnect.restype = None\npa_context_disconnect.argtypes = [POINTER(pa_context)]\n\n# /usr/include/pulse/context.h:203\npa_context_drain = _lib.pa_context_drain\npa_context_drain.restype = POINTER(pa_operation)\npa_context_drain.argtypes = [POINTER(pa_context), pa_context_notify_cb_t, POINTER(None)]\n\n# /usr/include/pulse/context.h:208\npa_context_exit_daemon = _lib.pa_context_exit_daemon\npa_context_exit_daemon.restype = POINTER(pa_operation)\npa_context_exit_daemon.argtypes = [POINTER(pa_context), pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/context.h:211\npa_context_set_default_sink = _lib.pa_context_set_default_sink\npa_context_set_default_sink.restype = POINTER(pa_operation)\npa_context_set_default_sink.argtypes = [POINTER(pa_context), c_char_p, pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/context.h:214\npa_context_set_default_source = _lib.pa_context_set_default_source\npa_context_set_default_source.restype = POINTER(pa_operation)\npa_context_set_default_source.argtypes = [POINTER(pa_context), c_char_p, pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/context.h:217\npa_context_is_local = _lib.pa_context_is_local\npa_context_is_local.restype = c_int\npa_context_is_local.argtypes = [POINTER(pa_context)]\n\n# /usr/include/pulse/context.h:220\npa_context_set_name = _lib.pa_context_set_name\npa_context_set_name.restype = POINTER(pa_operation)\npa_context_set_name.argtypes = [POINTER(pa_context), c_char_p, pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/context.h:223\npa_context_get_server = _lib.pa_context_get_server\npa_context_get_server.restype = c_char_p\npa_context_get_server.argtypes = [POINTER(pa_context)]\n\n# /usr/include/pulse/context.h:226\npa_context_get_protocol_version = _lib.pa_context_get_protocol_version\npa_context_get_protocol_version.restype = c_uint32\npa_context_get_protocol_version.argtypes = [POINTER(pa_context)]\n\n# /usr/include/pulse/context.h:229\npa_context_get_server_protocol_version = _lib.pa_context_get_server_protocol_version\npa_context_get_server_protocol_version.restype = c_uint32\npa_context_get_server_protocol_version.argtypes = [POINTER(pa_context)]\n\nenum_pa_channel_position = c_int\nPA_CHANNEL_POSITION_INVALID = 0\nPA_CHANNEL_POSITION_MONO = 0\nPA_CHANNEL_POSITION_LEFT = 1\nPA_CHANNEL_POSITION_RIGHT = 2\nPA_CHANNEL_POSITION_CENTER = 3\nPA_CHANNEL_POSITION_FRONT_LEFT = 0\nPA_CHANNEL_POSITION_FRONT_RIGHT = 0\nPA_CHANNEL_POSITION_FRONT_CENTER = 0\nPA_CHANNEL_POSITION_REAR_CENTER = 1\nPA_CHANNEL_POSITION_REAR_LEFT = 2\nPA_CHANNEL_POSITION_REAR_RIGHT = 3\nPA_CHANNEL_POSITION_LFE = 4\nPA_CHANNEL_POSITION_SUBWOOFER = 0\nPA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER = 1\nPA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER = 2\nPA_CHANNEL_POSITION_SIDE_LEFT = 3\nPA_CHANNEL_POSITION_SIDE_RIGHT = 4\nPA_CHANNEL_POSITION_AUX0 = 5\nPA_CHANNEL_POSITION_AUX1 = 6\nPA_CHANNEL_POSITION_AUX2 = 7\nPA_CHANNEL_POSITION_AUX3 = 8\nPA_CHANNEL_POSITION_AUX4 = 9\nPA_CHANNEL_POSITION_AUX5 = 10\nPA_CHANNEL_POSITION_AUX6 = 11\nPA_CHANNEL_POSITION_AUX7 = 12\nPA_CHANNEL_POSITION_AUX8 = 13\nPA_CHANNEL_POSITION_AUX9 = 14\nPA_CHANNEL_POSITION_AUX10 = 15\nPA_CHANNEL_POSITION_AUX11 = 16\nPA_CHANNEL_POSITION_AUX12 = 17\nPA_CHANNEL_POSITION_AUX13 = 18\nPA_CHANNEL_POSITION_AUX14 = 19\nPA_CHANNEL_POSITION_AUX15 = 20\nPA_CHANNEL_POSITION_AUX16 = 21\nPA_CHANNEL_POSITION_AUX17 = 22\nPA_CHANNEL_POSITION_AUX18 = 23\nPA_CHANNEL_POSITION_AUX19 = 24\nPA_CHANNEL_POSITION_AUX20 = 25\nPA_CHANNEL_POSITION_AUX21 = 26\nPA_CHANNEL_POSITION_AUX22 = 27\nPA_CHANNEL_POSITION_AUX23 = 28\nPA_CHANNEL_POSITION_AUX24 = 29\nPA_CHANNEL_POSITION_AUX25 = 30\nPA_CHANNEL_POSITION_AUX26 = 31\nPA_CHANNEL_POSITION_AUX27 = 32\nPA_CHANNEL_POSITION_AUX28 = 33\nPA_CHANNEL_POSITION_AUX29 = 34\nPA_CHANNEL_POSITION_AUX30 = 35\nPA_CHANNEL_POSITION_AUX31 = 36\nPA_CHANNEL_POSITION_TOP_CENTER = 37\nPA_CHANNEL_POSITION_TOP_FRONT_LEFT = 38\nPA_CHANNEL_POSITION_TOP_FRONT_RIGHT = 39\nPA_CHANNEL_POSITION_TOP_FRONT_CENTER = 40\nPA_CHANNEL_POSITION_TOP_REAR_LEFT = 41\nPA_CHANNEL_POSITION_TOP_REAR_RIGHT = 42\nPA_CHANNEL_POSITION_TOP_REAR_CENTER = 43\nPA_CHANNEL_POSITION_MAX = 44\npa_channel_position_t = enum_pa_channel_position \t# /usr/include/pulse/channelmap.h:140\nenum_pa_channel_map_def = c_int\nPA_CHANNEL_MAP_AIFF = 0\nPA_CHANNEL_MAP_ALSA = 1\nPA_CHANNEL_MAP_AUX = 2\nPA_CHANNEL_MAP_WAVEEX = 3\nPA_CHANNEL_MAP_OSS = 4\nPA_CHANNEL_MAP_DEFAULT = 0\npa_channel_map_def_t = enum_pa_channel_map_def \t# /usr/include/pulse/channelmap.h:151\nstruct_pa_channel_map._fields_ = [\n ('channels', c_uint8),\n ('map', pa_channel_position_t * 32),\n]\n\npa_channel_map = struct_pa_channel_map \t# /usr/include/pulse/channelmap.h:159\n# /usr/include/pulse/channelmap.h:162\npa_channel_map_init = _lib.pa_channel_map_init\npa_channel_map_init.restype = POINTER(pa_channel_map)\npa_channel_map_init.argtypes = [POINTER(pa_channel_map)]\n\n# /usr/include/pulse/channelmap.h:165\npa_channel_map_init_mono = _lib.pa_channel_map_init_mono\npa_channel_map_init_mono.restype = POINTER(pa_channel_map)\npa_channel_map_init_mono.argtypes = [POINTER(pa_channel_map)]\n\n# /usr/include/pulse/channelmap.h:168\npa_channel_map_init_stereo = _lib.pa_channel_map_init_stereo\npa_channel_map_init_stereo.restype = POINTER(pa_channel_map)\npa_channel_map_init_stereo.argtypes = [POINTER(pa_channel_map)]\n\n# /usr/include/pulse/channelmap.h:172\npa_channel_map_init_auto = _lib.pa_channel_map_init_auto\npa_channel_map_init_auto.restype = POINTER(pa_channel_map)\npa_channel_map_init_auto.argtypes = [POINTER(pa_channel_map), c_uint, pa_channel_map_def_t]\n\n# /usr/include/pulse/channelmap.h:175\npa_channel_position_to_string = _lib.pa_channel_position_to_string\npa_channel_position_to_string.restype = c_char_p\npa_channel_position_to_string.argtypes = [pa_channel_position_t]\n\n# /usr/include/pulse/channelmap.h:178\npa_channel_position_to_pretty_string = _lib.pa_channel_position_to_pretty_string\npa_channel_position_to_pretty_string.restype = c_char_p\npa_channel_position_to_pretty_string.argtypes = [pa_channel_position_t]\n\nPA_CHANNEL_MAP_SNPRINT_MAX = 336 \t# /usr/include/pulse/channelmap.h:181\n# /usr/include/pulse/channelmap.h:184\npa_channel_map_snprint = _lib.pa_channel_map_snprint\npa_channel_map_snprint.restype = c_char_p\npa_channel_map_snprint.argtypes = [c_char_p, c_size_t, POINTER(pa_channel_map)]\n\n# /usr/include/pulse/channelmap.h:187\npa_channel_map_parse = _lib.pa_channel_map_parse\npa_channel_map_parse.restype = POINTER(pa_channel_map)\npa_channel_map_parse.argtypes = [POINTER(pa_channel_map), c_char_p]\n\n# /usr/include/pulse/channelmap.h:190\npa_channel_map_equal = _lib.pa_channel_map_equal\npa_channel_map_equal.restype = c_int\npa_channel_map_equal.argtypes = [POINTER(pa_channel_map), POINTER(pa_channel_map)]\n\n# /usr/include/pulse/channelmap.h:193\npa_channel_map_valid = _lib.pa_channel_map_valid\npa_channel_map_valid.restype = c_int\npa_channel_map_valid.argtypes = [POINTER(pa_channel_map)]\n\npa_volume_t = c_uint32 \t# /usr/include/pulse/volume.h:101\nPA_VOLUME_NORM = 65536 \t# /usr/include/pulse/volume.h:104\nPA_VOLUME_MUTED = 0 \t# /usr/include/pulse/volume.h:107\nstruct_pa_cvolume._fields_ = [\n ('channels', c_uint8),\n ('values', pa_volume_t * 32),\n]\n\npa_cvolume = struct_pa_cvolume \t# /usr/include/pulse/volume.h:113\n# /usr/include/pulse/volume.h:116\npa_cvolume_equal = _lib.pa_cvolume_equal\npa_cvolume_equal.restype = c_int\npa_cvolume_equal.argtypes = [POINTER(pa_cvolume), POINTER(pa_cvolume)]\n\n# /usr/include/pulse/volume.h:125\npa_cvolume_set = _lib.pa_cvolume_set\npa_cvolume_set.restype = POINTER(pa_cvolume)\npa_cvolume_set.argtypes = [POINTER(pa_cvolume), c_uint, pa_volume_t]\n\nPA_CVOLUME_SNPRINT_MAX = 64 \t# /usr/include/pulse/volume.h:128\n# /usr/include/pulse/volume.h:131\npa_cvolume_snprint = _lib.pa_cvolume_snprint\npa_cvolume_snprint.restype = c_char_p\npa_cvolume_snprint.argtypes = [c_char_p, c_size_t, POINTER(pa_cvolume)]\n\n# /usr/include/pulse/volume.h:134\npa_cvolume_avg = _lib.pa_cvolume_avg\npa_cvolume_avg.restype = pa_volume_t\npa_cvolume_avg.argtypes = [POINTER(pa_cvolume)]\n\n# /usr/include/pulse/volume.h:137\npa_cvolume_valid = _lib.pa_cvolume_valid\npa_cvolume_valid.restype = c_int\npa_cvolume_valid.argtypes = [POINTER(pa_cvolume)]\n\n# /usr/include/pulse/volume.h:140\npa_cvolume_channels_equal_to = _lib.pa_cvolume_channels_equal_to\npa_cvolume_channels_equal_to.restype = c_int\npa_cvolume_channels_equal_to.argtypes = [POINTER(pa_cvolume), pa_volume_t]\n\n# /usr/include/pulse/volume.h:149\npa_sw_volume_multiply = _lib.pa_sw_volume_multiply\npa_sw_volume_multiply.restype = pa_volume_t\npa_sw_volume_multiply.argtypes = [pa_volume_t, pa_volume_t]\n\n# /usr/include/pulse/volume.h:152\npa_sw_cvolume_multiply = _lib.pa_sw_cvolume_multiply\npa_sw_cvolume_multiply.restype = POINTER(pa_cvolume)\npa_sw_cvolume_multiply.argtypes = [POINTER(pa_cvolume), POINTER(pa_cvolume), POINTER(pa_cvolume)]\n\n# /usr/include/pulse/volume.h:155\npa_sw_volume_from_dB = _lib.pa_sw_volume_from_dB\npa_sw_volume_from_dB.restype = pa_volume_t\npa_sw_volume_from_dB.argtypes = [c_double]\n\n# /usr/include/pulse/volume.h:158\npa_sw_volume_to_dB = _lib.pa_sw_volume_to_dB\npa_sw_volume_to_dB.restype = c_double\npa_sw_volume_to_dB.argtypes = [pa_volume_t]\n\n# /usr/include/pulse/volume.h:161\npa_sw_volume_from_linear = _lib.pa_sw_volume_from_linear\npa_sw_volume_from_linear.restype = pa_volume_t\npa_sw_volume_from_linear.argtypes = [c_double]\n\n# /usr/include/pulse/volume.h:164\npa_sw_volume_to_linear = _lib.pa_sw_volume_to_linear\npa_sw_volume_to_linear.restype = c_double\npa_sw_volume_to_linear.argtypes = [pa_volume_t]\n\nPA_DECIBEL_MININFTY = -200 \t# /usr/include/pulse/volume.h:170\nstruct_pa_stream._fields_ = [\n ('_opaque_struct', c_int)\n]\n\nstruct_pa_stream._fields_ = [\n ('_opaque_struct', c_int)\n]\n\npa_stream = struct_pa_stream \t# /usr/include/pulse/stream.h:268\npa_stream_success_cb_t = CFUNCTYPE(None, POINTER(pa_stream), c_int, POINTER(None)) \t# /usr/include/pulse/stream.h:271\npa_stream_request_cb_t = CFUNCTYPE(None, POINTER(pa_stream), c_size_t, POINTER(None)) \t# /usr/include/pulse/stream.h:274\npa_stream_notify_cb_t = CFUNCTYPE(None, POINTER(pa_stream), POINTER(None)) \t# /usr/include/pulse/stream.h:277\n# /usr/include/pulse/stream.h:280\npa_stream_new = _lib.pa_stream_new\npa_stream_new.restype = POINTER(pa_stream)\npa_stream_new.argtypes = [POINTER(pa_context), c_char_p, POINTER(pa_sample_spec), POINTER(pa_channel_map)]\n\n# /usr/include/pulse/stream.h:287\npa_stream_unref = _lib.pa_stream_unref\npa_stream_unref.restype = None\npa_stream_unref.argtypes = [POINTER(pa_stream)]\n\n# /usr/include/pulse/stream.h:290\npa_stream_ref = _lib.pa_stream_ref\npa_stream_ref.restype = POINTER(pa_stream)\npa_stream_ref.argtypes = [POINTER(pa_stream)]\n\n# /usr/include/pulse/stream.h:293\npa_stream_get_state = _lib.pa_stream_get_state\npa_stream_get_state.restype = pa_stream_state_t\npa_stream_get_state.argtypes = [POINTER(pa_stream)]\n\n# /usr/include/pulse/stream.h:296\npa_stream_get_context = _lib.pa_stream_get_context\npa_stream_get_context.restype = POINTER(pa_context)\npa_stream_get_context.argtypes = [POINTER(pa_stream)]\n\n# /usr/include/pulse/stream.h:302\npa_stream_get_index = _lib.pa_stream_get_index\npa_stream_get_index.restype = c_uint32\npa_stream_get_index.argtypes = [POINTER(pa_stream)]\n\n# /usr/include/pulse/stream.h:312\npa_stream_get_device_index = _lib.pa_stream_get_device_index\npa_stream_get_device_index.restype = c_uint32\npa_stream_get_device_index.argtypes = [POINTER(pa_stream)]\n\n# /usr/include/pulse/stream.h:322\npa_stream_get_device_name = _lib.pa_stream_get_device_name\npa_stream_get_device_name.restype = c_char_p\npa_stream_get_device_name.argtypes = [POINTER(pa_stream)]\n\n# /usr/include/pulse/stream.h:328\npa_stream_is_suspended = _lib.pa_stream_is_suspended\npa_stream_is_suspended.restype = c_int\npa_stream_is_suspended.argtypes = [POINTER(pa_stream)]\n\n# /usr/include/pulse/stream.h:331\npa_stream_connect_playback = _lib.pa_stream_connect_playback\npa_stream_connect_playback.restype = c_int\npa_stream_connect_playback.argtypes = [POINTER(pa_stream), c_char_p, POINTER(pa_buffer_attr), pa_stream_flags_t, POINTER(pa_cvolume), POINTER(pa_stream)]\n\n# /usr/include/pulse/stream.h:340\npa_stream_connect_record = _lib.pa_stream_connect_record\npa_stream_connect_record.restype = c_int\npa_stream_connect_record.argtypes = [POINTER(pa_stream), c_char_p, POINTER(pa_buffer_attr), pa_stream_flags_t]\n\n# /usr/include/pulse/stream.h:347\npa_stream_disconnect = _lib.pa_stream_disconnect\npa_stream_disconnect.restype = c_int\npa_stream_disconnect.argtypes = [POINTER(pa_stream)]\n\n# /usr/include/pulse/stream.h:356\npa_stream_write = _lib.pa_stream_write\npa_stream_write.restype = c_int\npa_stream_write.argtypes = [POINTER(pa_stream), POINTER(None), c_size_t, pa_free_cb_t, c_int64, pa_seek_mode_t]\n\n# /usr/include/pulse/stream.h:369\npa_stream_peek = _lib.pa_stream_peek\npa_stream_peek.restype = c_int\npa_stream_peek.argtypes = [POINTER(pa_stream), POINTER(POINTER(None)), POINTER(c_size_t)]\n\n# /usr/include/pulse/stream.h:376\npa_stream_drop = _lib.pa_stream_drop\npa_stream_drop.restype = c_int\npa_stream_drop.argtypes = [POINTER(pa_stream)]\n\n# /usr/include/pulse/stream.h:379\npa_stream_writable_size = _lib.pa_stream_writable_size\npa_stream_writable_size.restype = c_size_t\npa_stream_writable_size.argtypes = [POINTER(pa_stream)]\n\n# /usr/include/pulse/stream.h:382\npa_stream_readable_size = _lib.pa_stream_readable_size\npa_stream_readable_size.restype = c_size_t\npa_stream_readable_size.argtypes = [POINTER(pa_stream)]\n\n# /usr/include/pulse/stream.h:385\npa_stream_drain = _lib.pa_stream_drain\npa_stream_drain.restype = POINTER(pa_operation)\npa_stream_drain.argtypes = [POINTER(pa_stream), pa_stream_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/stream.h:391\npa_stream_update_timing_info = _lib.pa_stream_update_timing_info\npa_stream_update_timing_info.restype = POINTER(pa_operation)\npa_stream_update_timing_info.argtypes = [POINTER(pa_stream), pa_stream_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/stream.h:394\npa_stream_set_state_callback = _lib.pa_stream_set_state_callback\npa_stream_set_state_callback.restype = None\npa_stream_set_state_callback.argtypes = [POINTER(pa_stream), pa_stream_notify_cb_t, POINTER(None)]\n\n# /usr/include/pulse/stream.h:398\npa_stream_set_write_callback = _lib.pa_stream_set_write_callback\npa_stream_set_write_callback.restype = None\npa_stream_set_write_callback.argtypes = [POINTER(pa_stream), pa_stream_request_cb_t, POINTER(None)]\n\n# /usr/include/pulse/stream.h:402\npa_stream_set_read_callback = _lib.pa_stream_set_read_callback\npa_stream_set_read_callback.restype = None\npa_stream_set_read_callback.argtypes = [POINTER(pa_stream), pa_stream_request_cb_t, POINTER(None)]\n\n# /usr/include/pulse/stream.h:405\npa_stream_set_overflow_callback = _lib.pa_stream_set_overflow_callback\npa_stream_set_overflow_callback.restype = None\npa_stream_set_overflow_callback.argtypes = [POINTER(pa_stream), pa_stream_notify_cb_t, POINTER(None)]\n\n# /usr/include/pulse/stream.h:408\npa_stream_set_underflow_callback = _lib.pa_stream_set_underflow_callback\npa_stream_set_underflow_callback.restype = None\npa_stream_set_underflow_callback.argtypes = [POINTER(pa_stream), pa_stream_notify_cb_t, POINTER(None)]\n\n# /usr/include/pulse/stream.h:413\npa_stream_set_latency_update_callback = _lib.pa_stream_set_latency_update_callback\npa_stream_set_latency_update_callback.restype = None\npa_stream_set_latency_update_callback.argtypes = [POINTER(pa_stream), pa_stream_notify_cb_t, POINTER(None)]\n\n# /usr/include/pulse/stream.h:420\npa_stream_set_moved_callback = _lib.pa_stream_set_moved_callback\npa_stream_set_moved_callback.restype = None\npa_stream_set_moved_callback.argtypes = [POINTER(pa_stream), pa_stream_notify_cb_t, POINTER(None)]\n\n# /usr/include/pulse/stream.h:430\npa_stream_set_suspended_callback = _lib.pa_stream_set_suspended_callback\npa_stream_set_suspended_callback.restype = None\npa_stream_set_suspended_callback.argtypes = [POINTER(pa_stream), pa_stream_notify_cb_t, POINTER(None)]\n\n# /usr/include/pulse/stream.h:433\npa_stream_cork = _lib.pa_stream_cork\npa_stream_cork.restype = POINTER(pa_operation)\npa_stream_cork.argtypes = [POINTER(pa_stream), c_int, pa_stream_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/stream.h:438\npa_stream_flush = _lib.pa_stream_flush\npa_stream_flush.restype = POINTER(pa_operation)\npa_stream_flush.argtypes = [POINTER(pa_stream), pa_stream_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/stream.h:442\npa_stream_prebuf = _lib.pa_stream_prebuf\npa_stream_prebuf.restype = POINTER(pa_operation)\npa_stream_prebuf.argtypes = [POINTER(pa_stream), pa_stream_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/stream.h:447\npa_stream_trigger = _lib.pa_stream_trigger\npa_stream_trigger.restype = POINTER(pa_operation)\npa_stream_trigger.argtypes = [POINTER(pa_stream), pa_stream_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/stream.h:450\npa_stream_set_name = _lib.pa_stream_set_name\npa_stream_set_name.restype = POINTER(pa_operation)\npa_stream_set_name.argtypes = [POINTER(pa_stream), c_char_p, pa_stream_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/stream.h:467\npa_stream_get_time = _lib.pa_stream_get_time\npa_stream_get_time.restype = c_int\npa_stream_get_time.argtypes = [POINTER(pa_stream), POINTER(pa_usec_t)]\n\n# /usr/include/pulse/stream.h:473\npa_stream_get_latency = _lib.pa_stream_get_latency\npa_stream_get_latency.restype = c_int\npa_stream_get_latency.argtypes = [POINTER(pa_stream), POINTER(pa_usec_t), POINTER(c_int)]\n\n# /usr/include/pulse/stream.h:485\npa_stream_get_timing_info = _lib.pa_stream_get_timing_info\npa_stream_get_timing_info.restype = POINTER(pa_timing_info)\npa_stream_get_timing_info.argtypes = [POINTER(pa_stream)]\n\n# /usr/include/pulse/stream.h:488\npa_stream_get_sample_spec = _lib.pa_stream_get_sample_spec\npa_stream_get_sample_spec.restype = POINTER(pa_sample_spec)\npa_stream_get_sample_spec.argtypes = [POINTER(pa_stream)]\n\n# /usr/include/pulse/stream.h:491\npa_stream_get_channel_map = _lib.pa_stream_get_channel_map\npa_stream_get_channel_map.restype = POINTER(pa_channel_map)\npa_stream_get_channel_map.argtypes = [POINTER(pa_stream)]\n\n# /usr/include/pulse/stream.h:496\npa_stream_get_buffer_attr = _lib.pa_stream_get_buffer_attr\npa_stream_get_buffer_attr.restype = POINTER(pa_buffer_attr)\npa_stream_get_buffer_attr.argtypes = [POINTER(pa_stream)]\n\n# /usr/include/pulse/stream.h:504\npa_stream_set_buffer_attr = _lib.pa_stream_set_buffer_attr\npa_stream_set_buffer_attr.restype = POINTER(pa_operation)\npa_stream_set_buffer_attr.argtypes = [POINTER(pa_stream), POINTER(pa_buffer_attr), pa_stream_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/stream.h:511\npa_stream_update_sample_rate = _lib.pa_stream_update_sample_rate\npa_stream_update_sample_rate.restype = POINTER(pa_operation)\npa_stream_update_sample_rate.argtypes = [POINTER(pa_stream), c_uint32, pa_stream_success_cb_t, POINTER(None)]\n\nstruct_pa_sink_info._fields_ = [\n ('name', c_char_p),\n ('index', c_uint32),\n ('description', c_char_p),\n ('sample_spec', pa_sample_spec),\n ('channel_map', pa_channel_map),\n ('owner_module', c_uint32),\n ('volume', pa_cvolume),\n ('mute', c_int),\n ('monitor_source', c_uint32),\n ('monitor_source_name', c_char_p),\n ('latency', pa_usec_t),\n ('driver', c_char_p),\n ('flags', pa_sink_flags_t),\n]\n\npa_sink_info = struct_pa_sink_info \t# /usr/include/pulse/introspect.h:224\npa_sink_info_cb_t = CFUNCTYPE(None, POINTER(pa_context), POINTER(pa_sink_info), c_int, POINTER(None)) \t# /usr/include/pulse/introspect.h:227\n# /usr/include/pulse/introspect.h:230\npa_context_get_sink_info_by_name = _lib.pa_context_get_sink_info_by_name\npa_context_get_sink_info_by_name.restype = POINTER(pa_operation)\npa_context_get_sink_info_by_name.argtypes = [POINTER(pa_context), c_char_p, pa_sink_info_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:233\npa_context_get_sink_info_by_index = _lib.pa_context_get_sink_info_by_index\npa_context_get_sink_info_by_index.restype = POINTER(pa_operation)\npa_context_get_sink_info_by_index.argtypes = [POINTER(pa_context), c_uint32, pa_sink_info_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:236\npa_context_get_sink_info_list = _lib.pa_context_get_sink_info_list\npa_context_get_sink_info_list.restype = POINTER(pa_operation)\npa_context_get_sink_info_list.argtypes = [POINTER(pa_context), pa_sink_info_cb_t, POINTER(None)]\n\nstruct_pa_source_info._fields_ = [\n ('name', c_char_p),\n ('index', c_uint32),\n ('description', c_char_p),\n ('sample_spec', pa_sample_spec),\n ('channel_map', pa_channel_map),\n ('owner_module', c_uint32),\n ('volume', pa_cvolume),\n ('mute', c_int),\n ('monitor_of_sink', c_uint32),\n ('monitor_of_sink_name', c_char_p),\n ('latency', pa_usec_t),\n ('driver', c_char_p),\n ('flags', pa_source_flags_t),\n]\n\npa_source_info = struct_pa_source_info \t# /usr/include/pulse/introspect.h:253\npa_source_info_cb_t = CFUNCTYPE(None, POINTER(pa_context), POINTER(pa_source_info), c_int, POINTER(None)) \t# /usr/include/pulse/introspect.h:256\n# /usr/include/pulse/introspect.h:259\npa_context_get_source_info_by_name = _lib.pa_context_get_source_info_by_name\npa_context_get_source_info_by_name.restype = POINTER(pa_operation)\npa_context_get_source_info_by_name.argtypes = [POINTER(pa_context), c_char_p, pa_source_info_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:262\npa_context_get_source_info_by_index = _lib.pa_context_get_source_info_by_index\npa_context_get_source_info_by_index.restype = POINTER(pa_operation)\npa_context_get_source_info_by_index.argtypes = [POINTER(pa_context), c_uint32, pa_source_info_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:265\npa_context_get_source_info_list = _lib.pa_context_get_source_info_list\npa_context_get_source_info_list.restype = POINTER(pa_operation)\npa_context_get_source_info_list.argtypes = [POINTER(pa_context), pa_source_info_cb_t, POINTER(None)]\n\nstruct_pa_server_info._fields_ = [\n ('user_name', c_char_p),\n ('host_name', c_char_p),\n ('server_version', c_char_p),\n ('server_name', c_char_p),\n ('sample_spec', pa_sample_spec),\n ('default_sink_name', c_char_p),\n ('default_source_name', c_char_p),\n ('cookie', c_uint32),\n]\n\npa_server_info = struct_pa_server_info \t# /usr/include/pulse/introspect.h:277\npa_server_info_cb_t = CFUNCTYPE(None, POINTER(pa_context), POINTER(pa_server_info), POINTER(None)) \t# /usr/include/pulse/introspect.h:280\n# /usr/include/pulse/introspect.h:283\npa_context_get_server_info = _lib.pa_context_get_server_info\npa_context_get_server_info.restype = POINTER(pa_operation)\npa_context_get_server_info.argtypes = [POINTER(pa_context), pa_server_info_cb_t, POINTER(None)]\n\nstruct_pa_module_info._fields_ = [\n ('index', c_uint32),\n ('name', c_char_p),\n ('argument', c_char_p),\n ('n_used', c_uint32),\n ('auto_unload', c_int),\n]\n\npa_module_info = struct_pa_module_info \t# /usr/include/pulse/introspect.h:292\npa_module_info_cb_t = CFUNCTYPE(None, POINTER(pa_context), POINTER(pa_module_info), c_int, POINTER(None)) \t# /usr/include/pulse/introspect.h:295\n# /usr/include/pulse/introspect.h:298\npa_context_get_module_info = _lib.pa_context_get_module_info\npa_context_get_module_info.restype = POINTER(pa_operation)\npa_context_get_module_info.argtypes = [POINTER(pa_context), c_uint32, pa_module_info_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:301\npa_context_get_module_info_list = _lib.pa_context_get_module_info_list\npa_context_get_module_info_list.restype = POINTER(pa_operation)\npa_context_get_module_info_list.argtypes = [POINTER(pa_context), pa_module_info_cb_t, POINTER(None)]\n\nstruct_pa_client_info._fields_ = [\n ('index', c_uint32),\n ('name', c_char_p),\n ('owner_module', c_uint32),\n ('driver', c_char_p),\n]\n\npa_client_info = struct_pa_client_info \t# /usr/include/pulse/introspect.h:309\npa_client_info_cb_t = CFUNCTYPE(None, POINTER(pa_context), POINTER(pa_client_info), c_int, POINTER(None)) \t# /usr/include/pulse/introspect.h:312\n# /usr/include/pulse/introspect.h:315\npa_context_get_client_info = _lib.pa_context_get_client_info\npa_context_get_client_info.restype = POINTER(pa_operation)\npa_context_get_client_info.argtypes = [POINTER(pa_context), c_uint32, pa_client_info_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:318\npa_context_get_client_info_list = _lib.pa_context_get_client_info_list\npa_context_get_client_info_list.restype = POINTER(pa_operation)\npa_context_get_client_info_list.argtypes = [POINTER(pa_context), pa_client_info_cb_t, POINTER(None)]\n\nstruct_pa_sink_input_info._fields_ = [\n ('index', c_uint32),\n ('name', c_char_p),\n ('owner_module', c_uint32),\n ('client', c_uint32),\n ('sink', c_uint32),\n ('sample_spec', pa_sample_spec),\n ('channel_map', pa_channel_map),\n ('volume', pa_cvolume),\n ('buffer_usec', pa_usec_t),\n ('sink_usec', pa_usec_t),\n ('resample_method', c_char_p),\n ('driver', c_char_p),\n ('mute', c_int),\n]\n\npa_sink_input_info = struct_pa_sink_input_info \t# /usr/include/pulse/introspect.h:335\npa_sink_input_info_cb_t = CFUNCTYPE(None, POINTER(pa_context), POINTER(pa_sink_input_info), c_int, POINTER(None)) \t# /usr/include/pulse/introspect.h:338\n# /usr/include/pulse/introspect.h:341\npa_context_get_sink_input_info = _lib.pa_context_get_sink_input_info\npa_context_get_sink_input_info.restype = POINTER(pa_operation)\npa_context_get_sink_input_info.argtypes = [POINTER(pa_context), c_uint32, pa_sink_input_info_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:344\npa_context_get_sink_input_info_list = _lib.pa_context_get_sink_input_info_list\npa_context_get_sink_input_info_list.restype = POINTER(pa_operation)\npa_context_get_sink_input_info_list.argtypes = [POINTER(pa_context), pa_sink_input_info_cb_t, POINTER(None)]\n\nstruct_pa_source_output_info._fields_ = [\n ('index', c_uint32),\n ('name', c_char_p),\n ('owner_module', c_uint32),\n ('client', c_uint32),\n ('source', c_uint32),\n ('sample_spec', pa_sample_spec),\n ('channel_map', pa_channel_map),\n ('buffer_usec', pa_usec_t),\n ('source_usec', pa_usec_t),\n ('resample_method', c_char_p),\n ('driver', c_char_p),\n]\n\npa_source_output_info = struct_pa_source_output_info \t# /usr/include/pulse/introspect.h:359\npa_source_output_info_cb_t = CFUNCTYPE(None, POINTER(pa_context), POINTER(pa_source_output_info), c_int, POINTER(None)) \t# /usr/include/pulse/introspect.h:362\n# /usr/include/pulse/introspect.h:365\npa_context_get_source_output_info = _lib.pa_context_get_source_output_info\npa_context_get_source_output_info.restype = POINTER(pa_operation)\npa_context_get_source_output_info.argtypes = [POINTER(pa_context), c_uint32, pa_source_output_info_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:368\npa_context_get_source_output_info_list = _lib.pa_context_get_source_output_info_list\npa_context_get_source_output_info_list.restype = POINTER(pa_operation)\npa_context_get_source_output_info_list.argtypes = [POINTER(pa_context), pa_source_output_info_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:371\npa_context_set_sink_volume_by_index = _lib.pa_context_set_sink_volume_by_index\npa_context_set_sink_volume_by_index.restype = POINTER(pa_operation)\npa_context_set_sink_volume_by_index.argtypes = [POINTER(pa_context), c_uint32, POINTER(pa_cvolume), pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:374\npa_context_set_sink_volume_by_name = _lib.pa_context_set_sink_volume_by_name\npa_context_set_sink_volume_by_name.restype = POINTER(pa_operation)\npa_context_set_sink_volume_by_name.argtypes = [POINTER(pa_context), c_char_p, POINTER(pa_cvolume), pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:377\npa_context_set_sink_mute_by_index = _lib.pa_context_set_sink_mute_by_index\npa_context_set_sink_mute_by_index.restype = POINTER(pa_operation)\npa_context_set_sink_mute_by_index.argtypes = [POINTER(pa_context), c_uint32, c_int, pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:380\npa_context_set_sink_mute_by_name = _lib.pa_context_set_sink_mute_by_name\npa_context_set_sink_mute_by_name.restype = POINTER(pa_operation)\npa_context_set_sink_mute_by_name.argtypes = [POINTER(pa_context), c_char_p, c_int, pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:383\npa_context_set_sink_input_volume = _lib.pa_context_set_sink_input_volume\npa_context_set_sink_input_volume.restype = POINTER(pa_operation)\npa_context_set_sink_input_volume.argtypes = [POINTER(pa_context), c_uint32, POINTER(pa_cvolume), pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:386\npa_context_set_sink_input_mute = _lib.pa_context_set_sink_input_mute\npa_context_set_sink_input_mute.restype = POINTER(pa_operation)\npa_context_set_sink_input_mute.argtypes = [POINTER(pa_context), c_uint32, c_int, pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:389\npa_context_set_source_volume_by_index = _lib.pa_context_set_source_volume_by_index\npa_context_set_source_volume_by_index.restype = POINTER(pa_operation)\npa_context_set_source_volume_by_index.argtypes = [POINTER(pa_context), c_uint32, POINTER(pa_cvolume), pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:392\npa_context_set_source_volume_by_name = _lib.pa_context_set_source_volume_by_name\npa_context_set_source_volume_by_name.restype = POINTER(pa_operation)\npa_context_set_source_volume_by_name.argtypes = [POINTER(pa_context), c_char_p, POINTER(pa_cvolume), pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:395\npa_context_set_source_mute_by_index = _lib.pa_context_set_source_mute_by_index\npa_context_set_source_mute_by_index.restype = POINTER(pa_operation)\npa_context_set_source_mute_by_index.argtypes = [POINTER(pa_context), c_uint32, c_int, pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:398\npa_context_set_source_mute_by_name = _lib.pa_context_set_source_mute_by_name\npa_context_set_source_mute_by_name.restype = POINTER(pa_operation)\npa_context_set_source_mute_by_name.argtypes = [POINTER(pa_context), c_char_p, c_int, pa_context_success_cb_t, POINTER(None)]\n\nstruct_pa_stat_info._fields_ = [\n ('memblock_total', c_uint32),\n ('memblock_total_size', c_uint32),\n ('memblock_allocated', c_uint32),\n ('memblock_allocated_size', c_uint32),\n ('scache_size', c_uint32),\n]\n\npa_stat_info = struct_pa_stat_info \t# /usr/include/pulse/introspect.h:407\npa_stat_info_cb_t = CFUNCTYPE(None, POINTER(pa_context), POINTER(pa_stat_info), POINTER(None)) \t# /usr/include/pulse/introspect.h:410\n# /usr/include/pulse/introspect.h:413\npa_context_stat = _lib.pa_context_stat\npa_context_stat.restype = POINTER(pa_operation)\npa_context_stat.argtypes = [POINTER(pa_context), pa_stat_info_cb_t, POINTER(None)]\n\nstruct_pa_sample_info._fields_ = [\n ('index', c_uint32),\n ('name', c_char_p),\n ('volume', pa_cvolume),\n ('sample_spec', pa_sample_spec),\n ('channel_map', pa_channel_map),\n ('duration', pa_usec_t),\n ('bytes', c_uint32),\n ('lazy', c_int),\n ('filename', c_char_p),\n]\n\npa_sample_info = struct_pa_sample_info \t# /usr/include/pulse/introspect.h:426\npa_sample_info_cb_t = CFUNCTYPE(None, POINTER(pa_context), POINTER(pa_sample_info), c_int, POINTER(None)) \t# /usr/include/pulse/introspect.h:429\n# /usr/include/pulse/introspect.h:432\npa_context_get_sample_info_by_name = _lib.pa_context_get_sample_info_by_name\npa_context_get_sample_info_by_name.restype = POINTER(pa_operation)\npa_context_get_sample_info_by_name.argtypes = [POINTER(pa_context), c_char_p, pa_sample_info_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:435\npa_context_get_sample_info_by_index = _lib.pa_context_get_sample_info_by_index\npa_context_get_sample_info_by_index.restype = POINTER(pa_operation)\npa_context_get_sample_info_by_index.argtypes = [POINTER(pa_context), c_uint32, pa_sample_info_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:438\npa_context_get_sample_info_list = _lib.pa_context_get_sample_info_list\npa_context_get_sample_info_list.restype = POINTER(pa_operation)\npa_context_get_sample_info_list.argtypes = [POINTER(pa_context), pa_sample_info_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:441\npa_context_kill_client = _lib.pa_context_kill_client\npa_context_kill_client.restype = POINTER(pa_operation)\npa_context_kill_client.argtypes = [POINTER(pa_context), c_uint32, pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:444\npa_context_kill_sink_input = _lib.pa_context_kill_sink_input\npa_context_kill_sink_input.restype = POINTER(pa_operation)\npa_context_kill_sink_input.argtypes = [POINTER(pa_context), c_uint32, pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:447\npa_context_kill_source_output = _lib.pa_context_kill_source_output\npa_context_kill_source_output.restype = POINTER(pa_operation)\npa_context_kill_source_output.argtypes = [POINTER(pa_context), c_uint32, pa_context_success_cb_t, POINTER(None)]\n\npa_context_index_cb_t = CFUNCTYPE(None, POINTER(pa_context), c_uint32, POINTER(None)) \t# /usr/include/pulse/introspect.h:450\n# /usr/include/pulse/introspect.h:453\npa_context_load_module = _lib.pa_context_load_module\npa_context_load_module.restype = POINTER(pa_operation)\npa_context_load_module.argtypes = [POINTER(pa_context), c_char_p, c_char_p, pa_context_index_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:456\npa_context_unload_module = _lib.pa_context_unload_module\npa_context_unload_module.restype = POINTER(pa_operation)\npa_context_unload_module.argtypes = [POINTER(pa_context), c_uint32, pa_context_success_cb_t, POINTER(None)]\n\nenum_pa_autoload_type = c_int\nPA_AUTOLOAD_SINK = 0\nPA_AUTOLOAD_SOURCE = 1\npa_autoload_type_t = enum_pa_autoload_type \t# /usr/include/pulse/introspect.h:462\nstruct_pa_autoload_info._fields_ = [\n ('index', c_uint32),\n ('name', c_char_p),\n ('type', pa_autoload_type_t),\n ('module', c_char_p),\n ('argument', c_char_p),\n]\n\npa_autoload_info = struct_pa_autoload_info \t# /usr/include/pulse/introspect.h:471\npa_autoload_info_cb_t = CFUNCTYPE(None, POINTER(pa_context), POINTER(pa_autoload_info), c_int, POINTER(None)) \t# /usr/include/pulse/introspect.h:474\n# /usr/include/pulse/introspect.h:477\npa_context_get_autoload_info_by_name = _lib.pa_context_get_autoload_info_by_name\npa_context_get_autoload_info_by_name.restype = POINTER(pa_operation)\npa_context_get_autoload_info_by_name.argtypes = [POINTER(pa_context), c_char_p, pa_autoload_type_t, pa_autoload_info_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:480\npa_context_get_autoload_info_by_index = _lib.pa_context_get_autoload_info_by_index\npa_context_get_autoload_info_by_index.restype = POINTER(pa_operation)\npa_context_get_autoload_info_by_index.argtypes = [POINTER(pa_context), c_uint32, pa_autoload_info_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:483\npa_context_get_autoload_info_list = _lib.pa_context_get_autoload_info_list\npa_context_get_autoload_info_list.restype = POINTER(pa_operation)\npa_context_get_autoload_info_list.argtypes = [POINTER(pa_context), pa_autoload_info_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:486\npa_context_add_autoload = _lib.pa_context_add_autoload\npa_context_add_autoload.restype = POINTER(pa_operation)\npa_context_add_autoload.argtypes = [POINTER(pa_context), c_char_p, pa_autoload_type_t, c_char_p, c_char_p, pa_context_index_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:489\npa_context_remove_autoload_by_name = _lib.pa_context_remove_autoload_by_name\npa_context_remove_autoload_by_name.restype = POINTER(pa_operation)\npa_context_remove_autoload_by_name.argtypes = [POINTER(pa_context), c_char_p, pa_autoload_type_t, pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:492\npa_context_remove_autoload_by_index = _lib.pa_context_remove_autoload_by_index\npa_context_remove_autoload_by_index.restype = POINTER(pa_operation)\npa_context_remove_autoload_by_index.argtypes = [POINTER(pa_context), c_uint32, pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:495\npa_context_move_sink_input_by_name = _lib.pa_context_move_sink_input_by_name\npa_context_move_sink_input_by_name.restype = POINTER(pa_operation)\npa_context_move_sink_input_by_name.argtypes = [POINTER(pa_context), c_uint32, c_char_p, pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:498\npa_context_move_sink_input_by_index = _lib.pa_context_move_sink_input_by_index\npa_context_move_sink_input_by_index.restype = POINTER(pa_operation)\npa_context_move_sink_input_by_index.argtypes = [POINTER(pa_context), c_uint32, c_uint32, pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:501\npa_context_move_source_output_by_name = _lib.pa_context_move_source_output_by_name\npa_context_move_source_output_by_name.restype = POINTER(pa_operation)\npa_context_move_source_output_by_name.argtypes = [POINTER(pa_context), c_uint32, c_char_p, pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:504\npa_context_move_source_output_by_index = _lib.pa_context_move_source_output_by_index\npa_context_move_source_output_by_index.restype = POINTER(pa_operation)\npa_context_move_source_output_by_index.argtypes = [POINTER(pa_context), c_uint32, c_uint32, pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:507\npa_context_suspend_sink_by_name = _lib.pa_context_suspend_sink_by_name\npa_context_suspend_sink_by_name.restype = POINTER(pa_operation)\npa_context_suspend_sink_by_name.argtypes = [POINTER(pa_context), c_char_p, c_int, pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:510\npa_context_suspend_sink_by_index = _lib.pa_context_suspend_sink_by_index\npa_context_suspend_sink_by_index.restype = POINTER(pa_operation)\npa_context_suspend_sink_by_index.argtypes = [POINTER(pa_context), c_uint32, c_int, pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:513\npa_context_suspend_source_by_name = _lib.pa_context_suspend_source_by_name\npa_context_suspend_source_by_name.restype = POINTER(pa_operation)\npa_context_suspend_source_by_name.argtypes = [POINTER(pa_context), c_char_p, c_int, pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/introspect.h:516\npa_context_suspend_source_by_index = _lib.pa_context_suspend_source_by_index\npa_context_suspend_source_by_index.restype = POINTER(pa_operation)\npa_context_suspend_source_by_index.argtypes = [POINTER(pa_context), c_uint32, c_int, pa_context_success_cb_t, POINTER(None)]\n\npa_context_subscribe_cb_t = CFUNCTYPE(None, POINTER(pa_context), pa_subscription_event_type_t, c_uint32, POINTER(None)) \t# /usr/include/pulse/subscribe.h:54\n# /usr/include/pulse/subscribe.h:57\npa_context_subscribe = _lib.pa_context_subscribe\npa_context_subscribe.restype = POINTER(pa_operation)\npa_context_subscribe.argtypes = [POINTER(pa_context), pa_subscription_mask_t, pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/subscribe.h:60\npa_context_set_subscribe_callback = _lib.pa_context_set_subscribe_callback\npa_context_set_subscribe_callback.restype = None\npa_context_set_subscribe_callback.argtypes = [POINTER(pa_context), pa_context_subscribe_cb_t, POINTER(None)]\n\n# /usr/include/pulse/scache.h:83\npa_stream_connect_upload = _lib.pa_stream_connect_upload\npa_stream_connect_upload.restype = c_int\npa_stream_connect_upload.argtypes = [POINTER(pa_stream), c_size_t]\n\n# /usr/include/pulse/scache.h:87\npa_stream_finish_upload = _lib.pa_stream_finish_upload\npa_stream_finish_upload.restype = c_int\npa_stream_finish_upload.argtypes = [POINTER(pa_stream)]\n\n# /usr/include/pulse/scache.h:90\npa_context_play_sample = _lib.pa_context_play_sample\npa_context_play_sample.restype = POINTER(pa_operation)\npa_context_play_sample.argtypes = [POINTER(pa_context), c_char_p, c_char_p, pa_volume_t, pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/scache.h:99\npa_context_remove_sample = _lib.pa_context_remove_sample\npa_context_remove_sample.restype = POINTER(pa_operation)\npa_context_remove_sample.argtypes = [POINTER(pa_context), c_char_p, pa_context_success_cb_t, POINTER(None)]\n\n# /usr/include/pulse/version.h:43\npa_get_library_version = _lib.pa_get_library_version\npa_get_library_version.restype = c_char_p\npa_get_library_version.argtypes = []\n\nPA_API_VERSION = 11 \t# /usr/include/pulse/version.h:48\nPA_PROTOCOL_VERSION = 12 \t# /usr/include/pulse/version.h:52\n# /usr/include/pulse/error.h:37\npa_strerror = _lib.pa_strerror\npa_strerror.restype = c_char_p\npa_strerror.argtypes = [c_int]\n\n# /usr/include/pulse/xmalloc.h:40\npa_xmalloc = _lib.pa_xmalloc\npa_xmalloc.restype = POINTER(c_void)\npa_xmalloc.argtypes = [c_size_t]\n\n# /usr/include/pulse/xmalloc.h:43\npa_xmalloc0 = _lib.pa_xmalloc0\npa_xmalloc0.restype = POINTER(c_void)\npa_xmalloc0.argtypes = [c_size_t]\n\n# /usr/include/pulse/xmalloc.h:46\npa_xrealloc = _lib.pa_xrealloc\npa_xrealloc.restype = POINTER(c_void)\npa_xrealloc.argtypes = [POINTER(None), c_size_t]\n\n# /usr/include/pulse/xmalloc.h:49\npa_xfree = _lib.pa_xfree\npa_xfree.restype = None\npa_xfree.argtypes = [POINTER(None)]\n\n# /usr/include/pulse/xmalloc.h:52\npa_xstrdup = _lib.pa_xstrdup\npa_xstrdup.restype = c_char_p\npa_xstrdup.argtypes = [c_char_p]\n\n# /usr/include/pulse/xmalloc.h:55\npa_xstrndup = _lib.pa_xstrndup\npa_xstrndup.restype = c_char_p\npa_xstrndup.argtypes = [c_char_p, c_size_t]\n\n# /usr/include/pulse/xmalloc.h:58\npa_xmemdup = _lib.pa_xmemdup\npa_xmemdup.restype = POINTER(c_void)\npa_xmemdup.argtypes = [POINTER(None), c_size_t]\n\n# /usr/include/pulse/utf8.h:37\npa_utf8_valid = _lib.pa_utf8_valid\npa_utf8_valid.restype = c_char_p\npa_utf8_valid.argtypes = [c_char_p]\n\n# /usr/include/pulse/utf8.h:40\npa_utf8_filter = _lib.pa_utf8_filter\npa_utf8_filter.restype = c_char_p\npa_utf8_filter.argtypes = [c_char_p]\n\n# /usr/include/pulse/utf8.h:43\npa_utf8_to_locale = _lib.pa_utf8_to_locale\npa_utf8_to_locale.restype = c_char_p\npa_utf8_to_locale.argtypes = [c_char_p]\n\n# /usr/include/pulse/utf8.h:46\npa_locale_to_utf8 = _lib.pa_locale_to_utf8\npa_locale_to_utf8.restype = c_char_p\npa_locale_to_utf8.argtypes = [c_char_p]\n\nstruct_pa_threaded_mainloop._fields_ = [\n ('_opaque_struct', c_int)\n]\n\nstruct_pa_threaded_mainloop._fields_ = [\n ('_opaque_struct', c_int)\n]\n\npa_threaded_mainloop = struct_pa_threaded_mainloop \t# /usr/include/pulse/thread-mainloop.h:242\n# /usr/include/pulse/thread-mainloop.h:247\npa_threaded_mainloop_new = _lib.pa_threaded_mainloop_new\npa_threaded_mainloop_new.restype = POINTER(pa_threaded_mainloop)\npa_threaded_mainloop_new.argtypes = []\n\n# /usr/include/pulse/thread-mainloop.h:252\npa_threaded_mainloop_free = _lib.pa_threaded_mainloop_free\npa_threaded_mainloop_free.restype = None\npa_threaded_mainloop_free.argtypes = [POINTER(pa_threaded_mainloop)]\n\n# /usr/include/pulse/thread-mainloop.h:255\npa_threaded_mainloop_start = _lib.pa_threaded_mainloop_start\npa_threaded_mainloop_start.restype = c_int\npa_threaded_mainloop_start.argtypes = [POINTER(pa_threaded_mainloop)]\n\n# /usr/include/pulse/thread-mainloop.h:259\npa_threaded_mainloop_stop = _lib.pa_threaded_mainloop_stop\npa_threaded_mainloop_stop.restype = None\npa_threaded_mainloop_stop.argtypes = [POINTER(pa_threaded_mainloop)]\n\n# /usr/include/pulse/thread-mainloop.h:267\npa_threaded_mainloop_lock = _lib.pa_threaded_mainloop_lock\npa_threaded_mainloop_lock.restype = None\npa_threaded_mainloop_lock.argtypes = [POINTER(pa_threaded_mainloop)]\n\n# /usr/include/pulse/thread-mainloop.h:270\npa_threaded_mainloop_unlock = _lib.pa_threaded_mainloop_unlock\npa_threaded_mainloop_unlock.restype = None\npa_threaded_mainloop_unlock.argtypes = [POINTER(pa_threaded_mainloop)]\n\n# /usr/include/pulse/thread-mainloop.h:279\npa_threaded_mainloop_wait = _lib.pa_threaded_mainloop_wait\npa_threaded_mainloop_wait.restype = None\npa_threaded_mainloop_wait.argtypes = [POINTER(pa_threaded_mainloop)]\n\n# /usr/include/pulse/thread-mainloop.h:286\npa_threaded_mainloop_signal = _lib.pa_threaded_mainloop_signal\npa_threaded_mainloop_signal.restype = None\npa_threaded_mainloop_signal.argtypes = [POINTER(pa_threaded_mainloop), c_int]\n\n# /usr/include/pulse/thread-mainloop.h:292\npa_threaded_mainloop_accept = _lib.pa_threaded_mainloop_accept\npa_threaded_mainloop_accept.restype = None\npa_threaded_mainloop_accept.argtypes = [POINTER(pa_threaded_mainloop)]\n\n# /usr/include/pulse/thread-mainloop.h:295\npa_threaded_mainloop_get_retval = _lib.pa_threaded_mainloop_get_retval\npa_threaded_mainloop_get_retval.restype = c_int\npa_threaded_mainloop_get_retval.argtypes = [POINTER(pa_threaded_mainloop)]\n\n# /usr/include/pulse/thread-mainloop.h:298\npa_threaded_mainloop_get_api = _lib.pa_threaded_mainloop_get_api\npa_threaded_mainloop_get_api.restype = POINTER(pa_mainloop_api)\npa_threaded_mainloop_get_api.argtypes = [POINTER(pa_threaded_mainloop)]\n\n# /usr/include/pulse/thread-mainloop.h:301\npa_threaded_mainloop_in_thread = _lib.pa_threaded_mainloop_in_thread\npa_threaded_mainloop_in_thread.restype = c_int\npa_threaded_mainloop_in_thread.argtypes = [POINTER(pa_threaded_mainloop)]\n\nstruct_pa_mainloop._fields_ = [\n ('_opaque_struct', c_int)\n]\n\nstruct_pa_mainloop._fields_ = [\n ('_opaque_struct', c_int)\n]\n\npa_mainloop = struct_pa_mainloop \t# /usr/include/pulse/mainloop.h:79\n# /usr/include/pulse/mainloop.h:82\npa_mainloop_new = _lib.pa_mainloop_new\npa_mainloop_new.restype = POINTER(pa_mainloop)\npa_mainloop_new.argtypes = []\n\n# /usr/include/pulse/mainloop.h:85\npa_mainloop_free = _lib.pa_mainloop_free\npa_mainloop_free.restype = None\npa_mainloop_free.argtypes = [POINTER(pa_mainloop)]\n\n# /usr/include/pulse/mainloop.h:90\npa_mainloop_prepare = _lib.pa_mainloop_prepare\npa_mainloop_prepare.restype = c_int\npa_mainloop_prepare.argtypes = [POINTER(pa_mainloop), c_int]\n\n# /usr/include/pulse/mainloop.h:93\npa_mainloop_poll = _lib.pa_mainloop_poll\npa_mainloop_poll.restype = c_int\npa_mainloop_poll.argtypes = [POINTER(pa_mainloop)]\n\n# /usr/include/pulse/mainloop.h:97\npa_mainloop_dispatch = _lib.pa_mainloop_dispatch\npa_mainloop_dispatch.restype = c_int\npa_mainloop_dispatch.argtypes = [POINTER(pa_mainloop)]\n\n# /usr/include/pulse/mainloop.h:100\npa_mainloop_get_retval = _lib.pa_mainloop_get_retval\npa_mainloop_get_retval.restype = c_int\npa_mainloop_get_retval.argtypes = [POINTER(pa_mainloop)]\n\n# /usr/include/pulse/mainloop.h:108\npa_mainloop_iterate = _lib.pa_mainloop_iterate\npa_mainloop_iterate.restype = c_int\npa_mainloop_iterate.argtypes = [POINTER(pa_mainloop), c_int, POINTER(c_int)]\n\n# /usr/include/pulse/mainloop.h:111\npa_mainloop_run = _lib.pa_mainloop_run\npa_mainloop_run.restype = c_int\npa_mainloop_run.argtypes = [POINTER(pa_mainloop), POINTER(c_int)]\n\n# /usr/include/pulse/mainloop.h:114\npa_mainloop_get_api = _lib.pa_mainloop_get_api\npa_mainloop_get_api.restype = POINTER(pa_mainloop_api)\npa_mainloop_get_api.argtypes = [POINTER(pa_mainloop)]\n\n# /usr/include/pulse/mainloop.h:117\npa_mainloop_quit = _lib.pa_mainloop_quit\npa_mainloop_quit.restype = None\npa_mainloop_quit.argtypes = [POINTER(pa_mainloop), c_int]\n\n# /usr/include/pulse/mainloop.h:120\npa_mainloop_wakeup = _lib.pa_mainloop_wakeup\npa_mainloop_wakeup.restype = None\npa_mainloop_wakeup.argtypes = [POINTER(pa_mainloop)]\n\nstruct_pollfd._fields_ = [\n ('_opaque_struct', c_int)\n]\n\nstruct_pollfd._fields_ = [\n ('_opaque_struct', c_int)\n]\n\npa_poll_func = CFUNCTYPE(c_int, POINTER(struct_pollfd), c_ulong, c_int, POINTER(None)) \t# /usr/include/pulse/mainloop.h:123\n# /usr/include/pulse/mainloop.h:126\npa_mainloop_set_poll_func = _lib.pa_mainloop_set_poll_func\npa_mainloop_set_poll_func.restype = None\npa_mainloop_set_poll_func.argtypes = [POINTER(pa_mainloop), pa_poll_func, POINTER(None)]\n\n# /usr/include/pulse/mainloop-signal.h:43\npa_signal_init = _lib.pa_signal_init\npa_signal_init.restype = c_int\npa_signal_init.argtypes = [POINTER(pa_mainloop_api)]\n\n# /usr/include/pulse/mainloop-signal.h:46\npa_signal_done = _lib.pa_signal_done\npa_signal_done.restype = None\npa_signal_done.argtypes = []\n\nstruct_pa_signal_event._fields_ = [\n ('_opaque_struct', c_int)\n]\n\nstruct_pa_signal_event._fields_ = [\n ('_opaque_struct', c_int)\n]\n\npa_signal_event = struct_pa_signal_event \t# /usr/include/pulse/mainloop-signal.h:49\n# /usr/include/pulse/mainloop-signal.h:52\npa_signal_new = _lib.pa_signal_new\npa_signal_new.restype = POINTER(pa_signal_event)\npa_signal_new.argtypes = [c_int, CFUNCTYPE(None, POINTER(pa_mainloop_api), POINTER(pa_signal_event), c_int, POINTER(None)), POINTER(None)]\n\n# /usr/include/pulse/mainloop-signal.h:55\npa_signal_free = _lib.pa_signal_free\npa_signal_free.restype = None\npa_signal_free.argtypes = [POINTER(pa_signal_event)]\n\n# /usr/include/pulse/mainloop-signal.h:58\npa_signal_set_destroy = _lib.pa_signal_set_destroy\npa_signal_set_destroy.restype = None\npa_signal_set_destroy.argtypes = [POINTER(pa_signal_event), CFUNCTYPE(None, POINTER(pa_mainloop_api), POINTER(pa_signal_event), POINTER(None))]\n\n# /usr/include/pulse/util.h:38\npa_get_user_name = _lib.pa_get_user_name\npa_get_user_name.restype = c_char_p\npa_get_user_name.argtypes = [c_char_p, c_size_t]\n\n# /usr/include/pulse/util.h:41\npa_get_host_name = _lib.pa_get_host_name\npa_get_host_name.restype = c_char_p\npa_get_host_name.argtypes = [c_char_p, c_size_t]\n\n# /usr/include/pulse/util.h:44\npa_get_fqdn = _lib.pa_get_fqdn\npa_get_fqdn.restype = c_char_p\npa_get_fqdn.argtypes = [c_char_p, c_size_t]\n\n# /usr/include/pulse/util.h:47\npa_get_home_dir = _lib.pa_get_home_dir\npa_get_home_dir.restype = c_char_p\npa_get_home_dir.argtypes = [c_char_p, c_size_t]\n\n# /usr/include/pulse/util.h:51\npa_get_binary_name = _lib.pa_get_binary_name\npa_get_binary_name.restype = c_char_p\npa_get_binary_name.argtypes = [c_char_p, c_size_t]\n\n# /usr/include/pulse/util.h:55\npa_path_get_filename = _lib.pa_path_get_filename\npa_path_get_filename.restype = c_char_p\npa_path_get_filename.argtypes = [c_char_p]\n\n# /usr/include/pulse/util.h:58\npa_msleep = _lib.pa_msleep\npa_msleep.restype = c_int\npa_msleep.argtypes = [c_ulong]\n\nPA_MSEC_PER_SEC = 1000 \t# /usr/include/pulse/timeval.h:36\nPA_USEC_PER_SEC = 1000000 \t# /usr/include/pulse/timeval.h:37\nPA_NSEC_PER_SEC = 1000000000 \t# /usr/include/pulse/timeval.h:38\nPA_USEC_PER_MSEC = 1000 \t# /usr/include/pulse/timeval.h:39\nstruct_timeval._fields_ = [\n ('_opaque_struct', c_int)\n]\n\nstruct_timeval._fields_ = [\n ('_opaque_struct', c_int)\n]\n\n# /usr/include/pulse/timeval.h:44\npa_gettimeofday = _lib.pa_gettimeofday\npa_gettimeofday.restype = POINTER(struct_timeval)\npa_gettimeofday.argtypes = [POINTER(struct_timeval)]\n\nstruct_timeval._fields_ = [\n ('_opaque_struct', c_int)\n]\n\nstruct_timeval._fields_ = [\n ('_opaque_struct', c_int)\n]\n\n# /usr/include/pulse/timeval.h:48\npa_timeval_diff = _lib.pa_timeval_diff\npa_timeval_diff.restype = pa_usec_t\npa_timeval_diff.argtypes = [POINTER(struct_timeval), POINTER(struct_timeval)]\n\nstruct_timeval._fields_ = [\n ('_opaque_struct', c_int)\n]\n\nstruct_timeval._fields_ = [\n ('_opaque_struct', c_int)\n]\n\n# /usr/include/pulse/timeval.h:51\npa_timeval_cmp = _lib.pa_timeval_cmp\npa_timeval_cmp.restype = c_int\npa_timeval_cmp.argtypes = [POINTER(struct_timeval), POINTER(struct_timeval)]\n\nstruct_timeval._fields_ = [\n ('_opaque_struct', c_int)\n]\n\n# /usr/include/pulse/timeval.h:54\npa_timeval_age = _lib.pa_timeval_age\npa_timeval_age.restype = pa_usec_t\npa_timeval_age.argtypes = [POINTER(struct_timeval)]\n\nstruct_timeval._fields_ = [\n ('_opaque_struct', c_int)\n]\n\nstruct_timeval._fields_ = [\n ('_opaque_struct', c_int)\n]\n\n# /usr/include/pulse/timeval.h:57\npa_timeval_add = _lib.pa_timeval_add\npa_timeval_add.restype = POINTER(struct_timeval)\npa_timeval_add.argtypes = [POINTER(struct_timeval), pa_usec_t]\n\nstruct_timeval._fields_ = [\n ('_opaque_struct', c_int)\n]\n\nstruct_timeval._fields_ = [\n ('_opaque_struct', c_int)\n]\n\n# /usr/include/pulse/timeval.h:60\npa_timeval_store = _lib.pa_timeval_store\npa_timeval_store.restype = POINTER(struct_timeval)\npa_timeval_store.argtypes = [POINTER(struct_timeval), pa_usec_t]\n\nstruct_timeval._fields_ = [\n ('_opaque_struct', c_int)\n]\n\n# /usr/include/pulse/timeval.h:63\npa_timeval_load = _lib.pa_timeval_load\npa_timeval_load.restype = pa_usec_t\npa_timeval_load.argtypes = [POINTER(struct_timeval)]\n\n\n__all__ = ['pa_mainloop_api', 'pa_io_event_flags_t', 'PA_IO_EVENT_NULL',\n'PA_IO_EVENT_INPUT', 'PA_IO_EVENT_OUTPUT', 'PA_IO_EVENT_HANGUP',\n'PA_IO_EVENT_ERROR', 'pa_io_event', 'pa_io_event_cb_t',\n'pa_io_event_destroy_cb_t', 'pa_time_event', 'pa_time_event_cb_t',\n'pa_time_event_destroy_cb_t', 'pa_defer_event', 'pa_defer_event_cb_t',\n'pa_defer_event_destroy_cb_t', 'pa_mainloop_api_once', 'PA_CHANNELS_MAX',\n'PA_RATE_MAX', 'pa_sample_format_t', 'PA_SAMPLE_U8', 'PA_SAMPLE_ALAW',\n'PA_SAMPLE_ULAW', 'PA_SAMPLE_S16LE', 'PA_SAMPLE_S16BE', 'PA_SAMPLE_FLOAT32LE',\n'PA_SAMPLE_FLOAT32BE', 'PA_SAMPLE_S32LE', 'PA_SAMPLE_S32BE', 'PA_SAMPLE_MAX',\n'PA_SAMPLE_INVALID', 'pa_sample_spec', 'pa_usec_t', 'pa_bytes_per_second',\n'pa_frame_size', 'pa_sample_size', 'pa_bytes_to_usec', 'pa_usec_to_bytes',\n'pa_sample_spec_valid', 'pa_sample_spec_equal', 'pa_sample_format_to_string',\n'pa_parse_sample_format', 'PA_SAMPLE_SPEC_SNPRINT_MAX',\n'pa_sample_spec_snprint', 'pa_bytes_snprint', 'pa_context_state_t',\n'PA_CONTEXT_UNCONNECTED', 'PA_CONTEXT_CONNECTING', 'PA_CONTEXT_AUTHORIZING',\n'PA_CONTEXT_SETTING_NAME', 'PA_CONTEXT_READY', 'PA_CONTEXT_FAILED',\n'PA_CONTEXT_TERMINATED', 'pa_stream_state_t', 'PA_STREAM_UNCONNECTED',\n'PA_STREAM_CREATING', 'PA_STREAM_READY', 'PA_STREAM_FAILED',\n'PA_STREAM_TERMINATED', 'pa_operation_state_t', 'PA_OPERATION_RUNNING',\n'PA_OPERATION_DONE', 'PA_OPERATION_CANCELED', 'pa_context_flags_t',\n'PA_CONTEXT_NOAUTOSPAWN', 'pa_stream_direction_t', 'PA_STREAM_NODIRECTION',\n'PA_STREAM_PLAYBACK', 'PA_STREAM_RECORD', 'PA_STREAM_UPLOAD',\n'pa_stream_flags_t', 'PA_STREAM_START_CORKED', 'PA_STREAM_INTERPOLATE_TIMING',\n'PA_STREAM_NOT_MONOTONOUS', 'PA_STREAM_AUTO_TIMING_UPDATE',\n'PA_STREAM_NO_REMAP_CHANNELS', 'PA_STREAM_NO_REMIX_CHANNELS',\n'PA_STREAM_FIX_FORMAT', 'PA_STREAM_FIX_RATE', 'PA_STREAM_FIX_CHANNELS',\n'PA_STREAM_DONT_MOVE', 'PA_STREAM_VARIABLE_RATE', 'pa_buffer_attr',\n'pa_subscription_mask_t', 'PA_SUBSCRIPTION_MASK_NULL',\n'PA_SUBSCRIPTION_MASK_SINK', 'PA_SUBSCRIPTION_MASK_SOURCE',\n'PA_SUBSCRIPTION_MASK_SINK_INPUT', 'PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT',\n'PA_SUBSCRIPTION_MASK_MODULE', 'PA_SUBSCRIPTION_MASK_CLIENT',\n'PA_SUBSCRIPTION_MASK_SAMPLE_CACHE', 'PA_SUBSCRIPTION_MASK_SERVER',\n'PA_SUBSCRIPTION_MASK_AUTOLOAD', 'PA_SUBSCRIPTION_MASK_ALL',\n'pa_subscription_event_type_t', 'PA_SUBSCRIPTION_EVENT_SINK',\n'PA_SUBSCRIPTION_EVENT_SOURCE', 'PA_SUBSCRIPTION_EVENT_SINK_INPUT',\n'PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT', 'PA_SUBSCRIPTION_EVENT_MODULE',\n'PA_SUBSCRIPTION_EVENT_CLIENT', 'PA_SUBSCRIPTION_EVENT_SAMPLE_CACHE',\n'PA_SUBSCRIPTION_EVENT_SERVER', 'PA_SUBSCRIPTION_EVENT_AUTOLOAD',\n'PA_SUBSCRIPTION_EVENT_FACILITY_MASK', 'PA_SUBSCRIPTION_EVENT_NEW',\n'PA_SUBSCRIPTION_EVENT_CHANGE', 'PA_SUBSCRIPTION_EVENT_REMOVE',\n'PA_SUBSCRIPTION_EVENT_TYPE_MASK', 'pa_timing_info', 'pa_spawn_api',\n'pa_seek_mode_t', 'PA_SEEK_RELATIVE', 'PA_SEEK_ABSOLUTE',\n'PA_SEEK_RELATIVE_ON_READ', 'PA_SEEK_RELATIVE_END', 'pa_sink_flags_t',\n'PA_SINK_HW_VOLUME_CTRL', 'PA_SINK_LATENCY', 'PA_SINK_HARDWARE',\n'PA_SINK_NETWORK', 'pa_source_flags_t', 'PA_SOURCE_HW_VOLUME_CTRL',\n'PA_SOURCE_LATENCY', 'PA_SOURCE_HARDWARE', 'PA_SOURCE_NETWORK',\n'pa_free_cb_t', 'pa_operation', 'pa_operation_ref', 'pa_operation_unref',\n'pa_operation_cancel', 'pa_operation_get_state', 'pa_context',\n'pa_context_notify_cb_t', 'pa_context_success_cb_t', 'pa_context_new',\n'pa_context_unref', 'pa_context_ref', 'pa_context_set_state_callback',\n'pa_context_errno', 'pa_context_is_pending', 'pa_context_get_state',\n'pa_context_connect', 'pa_context_disconnect', 'pa_context_drain',\n'pa_context_exit_daemon', 'pa_context_set_default_sink',\n'pa_context_set_default_source', 'pa_context_is_local', 'pa_context_set_name',\n'pa_context_get_server', 'pa_context_get_protocol_version',\n'pa_context_get_server_protocol_version', 'pa_channel_position_t',\n'PA_CHANNEL_POSITION_INVALID', 'PA_CHANNEL_POSITION_MONO',\n'PA_CHANNEL_POSITION_LEFT', 'PA_CHANNEL_POSITION_RIGHT',\n'PA_CHANNEL_POSITION_CENTER', 'PA_CHANNEL_POSITION_FRONT_LEFT',\n'PA_CHANNEL_POSITION_FRONT_RIGHT', 'PA_CHANNEL_POSITION_FRONT_CENTER',\n'PA_CHANNEL_POSITION_REAR_CENTER', 'PA_CHANNEL_POSITION_REAR_LEFT',\n'PA_CHANNEL_POSITION_REAR_RIGHT', 'PA_CHANNEL_POSITION_LFE',\n'PA_CHANNEL_POSITION_SUBWOOFER', 'PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER',\n'PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER', 'PA_CHANNEL_POSITION_SIDE_LEFT',\n'PA_CHANNEL_POSITION_SIDE_RIGHT', 'PA_CHANNEL_POSITION_AUX0',\n'PA_CHANNEL_POSITION_AUX1', 'PA_CHANNEL_POSITION_AUX2',\n'PA_CHANNEL_POSITION_AUX3', 'PA_CHANNEL_POSITION_AUX4',\n'PA_CHANNEL_POSITION_AUX5', 'PA_CHANNEL_POSITION_AUX6',\n'PA_CHANNEL_POSITION_AUX7', 'PA_CHANNEL_POSITION_AUX8',\n'PA_CHANNEL_POSITION_AUX9', 'PA_CHANNEL_POSITION_AUX10',\n'PA_CHANNEL_POSITION_AUX11', 'PA_CHANNEL_POSITION_AUX12',\n'PA_CHANNEL_POSITION_AUX13', 'PA_CHANNEL_POSITION_AUX14',\n'PA_CHANNEL_POSITION_AUX15', 'PA_CHANNEL_POSITION_AUX16',\n'PA_CHANNEL_POSITION_AUX17', 'PA_CHANNEL_POSITION_AUX18',\n'PA_CHANNEL_POSITION_AUX19', 'PA_CHANNEL_POSITION_AUX20',\n'PA_CHANNEL_POSITION_AUX21', 'PA_CHANNEL_POSITION_AUX22',\n'PA_CHANNEL_POSITION_AUX23', 'PA_CHANNEL_POSITION_AUX24',\n'PA_CHANNEL_POSITION_AUX25', 'PA_CHANNEL_POSITION_AUX26',\n'PA_CHANNEL_POSITION_AUX27', 'PA_CHANNEL_POSITION_AUX28',\n'PA_CHANNEL_POSITION_AUX29', 'PA_CHANNEL_POSITION_AUX30',\n'PA_CHANNEL_POSITION_AUX31', 'PA_CHANNEL_POSITION_TOP_CENTER',\n'PA_CHANNEL_POSITION_TOP_FRONT_LEFT', 'PA_CHANNEL_POSITION_TOP_FRONT_RIGHT',\n'PA_CHANNEL_POSITION_TOP_FRONT_CENTER', 'PA_CHANNEL_POSITION_TOP_REAR_LEFT',\n'PA_CHANNEL_POSITION_TOP_REAR_RIGHT', 'PA_CHANNEL_POSITION_TOP_REAR_CENTER',\n'PA_CHANNEL_POSITION_MAX', 'pa_channel_map_def_t', 'PA_CHANNEL_MAP_AIFF',\n'PA_CHANNEL_MAP_ALSA', 'PA_CHANNEL_MAP_AUX', 'PA_CHANNEL_MAP_WAVEEX',\n'PA_CHANNEL_MAP_OSS', 'PA_CHANNEL_MAP_DEFAULT', 'pa_channel_map',\n'pa_channel_map_init', 'pa_channel_map_init_mono',\n'pa_channel_map_init_stereo', 'pa_channel_map_init_auto',\n'pa_channel_position_to_string', 'pa_channel_position_to_pretty_string',\n'PA_CHANNEL_MAP_SNPRINT_MAX', 'pa_channel_map_snprint',\n'pa_channel_map_parse', 'pa_channel_map_equal', 'pa_channel_map_valid',\n'pa_volume_t', 'PA_VOLUME_NORM', 'PA_VOLUME_MUTED', 'pa_cvolume',\n'pa_cvolume_equal', 'pa_cvolume_set', 'PA_CVOLUME_SNPRINT_MAX',\n'pa_cvolume_snprint', 'pa_cvolume_avg', 'pa_cvolume_valid',\n'pa_cvolume_channels_equal_to', 'pa_sw_volume_multiply',\n'pa_sw_cvolume_multiply', 'pa_sw_volume_from_dB', 'pa_sw_volume_to_dB',\n'pa_sw_volume_from_linear', 'pa_sw_volume_to_linear', 'PA_DECIBEL_MININFTY',\n'pa_stream', 'pa_stream_success_cb_t', 'pa_stream_request_cb_t',\n'pa_stream_notify_cb_t', 'pa_stream_new', 'pa_stream_unref', 'pa_stream_ref',\n'pa_stream_get_state', 'pa_stream_get_context', 'pa_stream_get_index',\n'pa_stream_get_device_index', 'pa_stream_get_device_name',\n'pa_stream_is_suspended', 'pa_stream_connect_playback',\n'pa_stream_connect_record', 'pa_stream_disconnect', 'pa_stream_write',\n'pa_stream_peek', 'pa_stream_drop', 'pa_stream_writable_size',\n'pa_stream_readable_size', 'pa_stream_drain', 'pa_stream_update_timing_info',\n'pa_stream_set_state_callback', 'pa_stream_set_write_callback',\n'pa_stream_set_read_callback', 'pa_stream_set_overflow_callback',\n'pa_stream_set_underflow_callback', 'pa_stream_set_latency_update_callback',\n'pa_stream_set_moved_callback', 'pa_stream_set_suspended_callback',\n'pa_stream_cork', 'pa_stream_flush', 'pa_stream_prebuf', 'pa_stream_trigger',\n'pa_stream_set_name', 'pa_stream_get_time', 'pa_stream_get_latency',\n'pa_stream_get_timing_info', 'pa_stream_get_sample_spec',\n'pa_stream_get_channel_map', 'pa_stream_get_buffer_attr',\n'pa_stream_set_buffer_attr', 'pa_stream_update_sample_rate', 'pa_sink_info',\n'pa_sink_info_cb_t', 'pa_context_get_sink_info_by_name',\n'pa_context_get_sink_info_by_index', 'pa_context_get_sink_info_list',\n'pa_source_info', 'pa_source_info_cb_t', 'pa_context_get_source_info_by_name',\n'pa_context_get_source_info_by_index', 'pa_context_get_source_info_list',\n'pa_server_info', 'pa_server_info_cb_t', 'pa_context_get_server_info',\n'pa_module_info', 'pa_module_info_cb_t', 'pa_context_get_module_info',\n'pa_context_get_module_info_list', 'pa_client_info', 'pa_client_info_cb_t',\n'pa_context_get_client_info', 'pa_context_get_client_info_list',\n'pa_sink_input_info', 'pa_sink_input_info_cb_t',\n'pa_context_get_sink_input_info', 'pa_context_get_sink_input_info_list',\n'pa_source_output_info', 'pa_source_output_info_cb_t',\n'pa_context_get_source_output_info', 'pa_context_get_source_output_info_list',\n'pa_context_set_sink_volume_by_index', 'pa_context_set_sink_volume_by_name',\n'pa_context_set_sink_mute_by_index', 'pa_context_set_sink_mute_by_name',\n'pa_context_set_sink_input_volume', 'pa_context_set_sink_input_mute',\n'pa_context_set_source_volume_by_index',\n'pa_context_set_source_volume_by_name', 'pa_context_set_source_mute_by_index',\n'pa_context_set_source_mute_by_name', 'pa_stat_info', 'pa_stat_info_cb_t',\n'pa_context_stat', 'pa_sample_info', 'pa_sample_info_cb_t',\n'pa_context_get_sample_info_by_name', 'pa_context_get_sample_info_by_index',\n'pa_context_get_sample_info_list', 'pa_context_kill_client',\n'pa_context_kill_sink_input', 'pa_context_kill_source_output',\n'pa_context_index_cb_t', 'pa_context_load_module', 'pa_context_unload_module',\n'pa_autoload_type_t', 'PA_AUTOLOAD_SINK', 'PA_AUTOLOAD_SOURCE',\n'pa_autoload_info', 'pa_autoload_info_cb_t',\n'pa_context_get_autoload_info_by_name',\n'pa_context_get_autoload_info_by_index', 'pa_context_get_autoload_info_list',\n'pa_context_add_autoload', 'pa_context_remove_autoload_by_name',\n'pa_context_remove_autoload_by_index', 'pa_context_move_sink_input_by_name',\n'pa_context_move_sink_input_by_index',\n'pa_context_move_source_output_by_name',\n'pa_context_move_source_output_by_index', 'pa_context_suspend_sink_by_name',\n'pa_context_suspend_sink_by_index', 'pa_context_suspend_source_by_name',\n'pa_context_suspend_source_by_index', 'pa_context_subscribe_cb_t',\n'pa_context_subscribe', 'pa_context_set_subscribe_callback',\n'pa_stream_connect_upload', 'pa_stream_finish_upload',\n'pa_context_play_sample', 'pa_context_remove_sample',\n'pa_get_library_version', 'PA_API_VERSION', 'PA_PROTOCOL_VERSION',\n'pa_strerror', 'pa_xmalloc', 'pa_xmalloc0', 'pa_xrealloc', 'pa_xfree',\n'pa_xstrdup', 'pa_xstrndup', 'pa_xmemdup', 'pa_utf8_valid', 'pa_utf8_filter',\n'pa_utf8_to_locale', 'pa_locale_to_utf8', 'pa_threaded_mainloop',\n'pa_threaded_mainloop_new', 'pa_threaded_mainloop_free',\n'pa_threaded_mainloop_start', 'pa_threaded_mainloop_stop',\n'pa_threaded_mainloop_lock', 'pa_threaded_mainloop_unlock',\n'pa_threaded_mainloop_wait', 'pa_threaded_mainloop_signal',\n'pa_threaded_mainloop_accept', 'pa_threaded_mainloop_get_retval',\n'pa_threaded_mainloop_get_api', 'pa_threaded_mainloop_in_thread',\n'pa_mainloop', 'pa_mainloop_new', 'pa_mainloop_free', 'pa_mainloop_prepare',\n'pa_mainloop_poll', 'pa_mainloop_dispatch', 'pa_mainloop_get_retval',\n'pa_mainloop_iterate', 'pa_mainloop_run', 'pa_mainloop_get_api',\n'pa_mainloop_quit', 'pa_mainloop_wakeup', 'pa_poll_func',\n'pa_mainloop_set_poll_func', 'pa_signal_init', 'pa_signal_done',\n'pa_signal_event', 'pa_signal_new', 'pa_signal_free', 'pa_signal_set_destroy',\n'pa_get_user_name', 'pa_get_host_name', 'pa_get_fqdn', 'pa_get_home_dir',\n'pa_get_binary_name', 'pa_path_get_filename', 'pa_msleep', 'PA_MSEC_PER_SEC',\n'PA_USEC_PER_SEC', 'PA_NSEC_PER_SEC', 'PA_USEC_PER_MSEC', 'pa_gettimeofday',\n'pa_timeval_diff', 'pa_timeval_cmp', 'pa_timeval_age', 'pa_timeval_add',\n'pa_timeval_store', 'pa_timeval_load']\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from ctypes import *", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 20 } ]
[]
1
true
[ "[CLS]_", "'", "import", " ", "*'_", "may", "_", "poll", "ute", "_", "namespace_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "'''", "Wrapper", " ", "for", " ", "pulse", "\\", "10", ";", "\\", "10", ";", "Generate", "d", " ", "with", ":", "\\", "10", ";", "tool", "s", "/", "gen", "wrapp", "ers", ".", "py", " ", "pulse", "audio", "\\", "10", ";", "\\", "10", ";", "Do", " ", "not", " ", "modif", "y", " ", "this", " ", "file", ".", "\\", "10", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "docformat", "\\u\\u_", "=_", "'", "restructur", "edt", "ext", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "version\\u\\u_", "=_", "'$", "Id", ":", " ", "wrap", ".", "py", " ", "169", "4", " ", "2008", "-0", "1", "-", "30", " ", "23", ":", "1", "2", ":", "00", "Z", " ", "Alex", ".", "Hol", "kne", "r", " ", "$'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "ctypes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ctypes_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "pyglet_", "._", "lib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "lib_", "=_", "pyglet_", "._", "lib_", "._", "load", "\\u", "library_", "(_", "'", "pulse", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "int\\u", "types_", "=_", "(_", "c\\u", "int16_", ",_", "c\\u", "int32_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "ctypes_", ",_", "'", "c\\u", "int", "64", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Some", " ", "builds", " ", "of", " ", "ctype", "s", " ", "appare", "ntl", "y", " ", "do", " ", "not", " ", "have", " ", "c\\u", "int64_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "defin", "ed", ";", " ", "it", "'", "s", " ", "a", " ", "pretty", " ", "good", " ", "bet", " ", "tha", "t", " ", "these", " ", "builds", " ", "do", " ", "not_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "have", " ", "64", "-", "bit", " ", "pointers", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "int\\u", "types_", "+=_", "(_", "ctypes_", "._", "c\\u", "int64_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "t_", "in_", "\\u", "int\\u", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "sizeof_", "(_", "t_", ")_", "==_", "sizeof_", "(_", "c\\u", "size", "\\u", "t_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c\\u", "ptr", "diff", "\\u", "t_", "=_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "mainl", "oop", "\\u", "api_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "mainl", "oop", "\\u", "api_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "api_", "=_", "struct", "\\u", "pa", "\\u", "mainl", "oop", "\\u", "api_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", "-", "api", ".", "h", ":", "51_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "enum", "\\u", "pa", "\\u", "io", "\\u", "event", "\\u", "flags_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "IO", "\\u", "EVENT", "\\u", "NULL_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "IO", "\\u", "EVENT", "\\u", "INPUT_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "IO", "\\u", "EVENT", "\\u", "OUTPUT_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "IO", "\\u", "EVENT", "\\u", "HAN", "GU", "P_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "IO", "\\u", "EVENT", "\\u", "ERROR_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "io", "\\u", "event", "\\u", "flags", "\\u", "t_", "=_", "enum", "\\u", "pa", "\\u", "io", "\\u", "event", "\\u", "flags_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", "-", "api", ".", "h", ":", "60_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "io", "\\u", "event_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "io", "\\u", "event_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "io", "\\u", "event_", "=_", "struct", "\\u", "pa", "\\u", "io", "\\u", "event_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", "-", "api", ".", "h", ":", "63_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "io", "\\u", "event", "\\u", "cb", "\\u", "t_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "mainl", "oop", "\\u", "api_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "io", "\\u", "event_", ")_", ",_", "c\\u", "int_", ",_", "pa", "\\u", "io", "\\u", "event", "\\u", "flags", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", "-", "api", ".", "h", ":", "65_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "io", "\\u", "event", "\\u", "destroy", "\\u", "cb", "\\u", "t_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "mainl", "oop", "\\u", "api_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "io", "\\u", "event_", ")_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", "-", "api", ".", "h", ":", "67_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "time", "\\u", "event_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "time", "\\u", "event_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "time", "\\u", "event_", "=_", "struct", "\\u", "pa", "\\u", "time", "\\u", "event_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", "-", "api", ".", "h", ":", "70_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "time", "val_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "time", "val_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "time", "\\u", "event", "\\u", "cb", "\\u", "t_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "mainl", "oop", "\\u", "api_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "time", "\\u", "event_", ")_", ",_", "POINTER_", "(_", "struct", "\\u", "time", "val_", ")_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", "-", "api", ".", "h", ":", "72_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "time", "\\u", "event", "\\u", "destroy", "\\u", "cb", "\\u", "t_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "mainl", "oop", "\\u", "api_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "time", "\\u", "event_", ")_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", "-", "api", ".", "h", ":", "74_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "defer", "\\u", "event_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "defer", "\\u", "event_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "defer", "\\u", "event_", "=_", "struct", "\\u", "pa", "\\u", "defer", "\\u", "event_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", "-", "api", ".", "h", ":", "77_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "defer", "\\u", "event", "\\u", "cb", "\\u", "t_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "mainl", "oop", "\\u", "api_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "defer", "\\u", "event_", ")_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", "-", "api", ".", "h", ":", "79_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "defer", "\\u", "event", "\\u", "destroy", "\\u", "cb", "\\u", "t_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "mainl", "oop", "\\u", "api_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "defer", "\\u", "event_", ")_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", "-", "api", ".", "h", ":", "81_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", "-", "api", ".", "h", ":", "120_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "api", "\\u", "once_", "=_", "\\u", "lib_", "._", "pa", "\\u", "mainl", "oop", "\\u", "api", "\\u", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "api", "\\u", "once_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "api", "\\u", "once_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "mainl", "oop", "\\u", "api_", ")_", ",_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "mainl", "oop", "\\u", "api_", ")_", ",_", "POINTER_", "(_", "None_", ")_", ")_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "PA", "\\u", "CHANNELS", "\\u", "MAX_", "=_", "32_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "sample", ".", "h", ":", "117_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "RAT", "E", "\\u", "MAX_", "=_", "1920", "00_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "sample", ".", "h", ":", "120_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "enum", "\\u", "pa", "\\u", "sample", "\\u", "format_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SAMPLE", "\\u", "U", "8_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SAMPLE", "\\u", "AL", "AW", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SAMPLE", "\\u", "ULA", "W_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SAMPLE", "\\u", "S1", "6", "LE_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SAMPLE", "\\u", "S1", "6", "BE_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SAMPLE", "\\u", "FLOAT", "32", "LE_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SAMPLE", "\\u", "FLOAT", "32", "BE_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SAMPLE", "\\u", "S", "32", "LE_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SAMPLE", "\\u", "S", "32", "BE_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SAMPLE", "\\u", "MAX_", "=_", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SAMPLE", "\\u", "INVALID", "_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sample", "\\u", "format\\u", "t_", "=_", "enum", "\\u", "pa", "\\u", "sample", "\\u", "format_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "sample", ".", "h", ":", "135_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "sample", "\\u", "spec_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "format", "'_", ",_", "pa", "\\u", "sample", "\\u", "format\\u", "t_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "rate", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "channel", "s", "'_", ",_", "c\\u", "uint8_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "sample", "\\u", "spec_", "=_", "struct", "\\u", "pa", "\\u", "sample", "\\u", "spec_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "sample", ".", "h", ":", "173_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "usec", "\\u", "t_", "=_", "c\\u", "uint64_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "sample", ".", "h", ":", "176_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "sample", ".", "h", ":", "179_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "bytes", "\\u", "per", "\\u", "second_", "=_", "\\u", "lib_", "._", "pa", "\\u", "bytes", "\\u", "per", "\\u", "second_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "bytes", "\\u", "per", "\\u", "second_", "._", "restype_", "=_", "c\\u", "size", "\\u", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "bytes", "\\u", "per", "\\u", "second_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "sample", "\\u", "spec_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "sample", ".", "h", ":", "182_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "frame", "\\u", "size_", "=_", "\\u", "lib_", "._", "pa", "\\u", "frame", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "frame", "\\u", "size_", "._", "restype_", "=_", "c\\u", "size", "\\u", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "frame", "\\u", "size_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "sample", "\\u", "spec_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "sample", ".", "h", ":", "185_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "sample", "\\u", "size_", "=_", "\\u", "lib_", "._", "pa", "\\u", "sample", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sample", "\\u", "size_", "._", "restype_", "=_", "c\\u", "size", "\\u", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sample", "\\u", "size_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "sample", "\\u", "spec_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "sample", ".", "h", ":", "188_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "bytes", "\\u", "to", "\\u", "usec", "_", "=_", "\\u", "lib_", "._", "pa", "\\u", "bytes", "\\u", "to", "\\u", "usec", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "bytes", "\\u", "to", "\\u", "usec", "_", "._", "restype_", "=_", "pa", "\\u", "usec", "\\u", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "bytes", "\\u", "to", "\\u", "usec", "_", "._", "argtypes_", "=_", "[_", "c\\u", "uint64_", ",_", "POINTER_", "(_", "pa", "\\u", "sample", "\\u", "spec_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "sample", ".", "h", ":", "191_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "usec", "\\u", "to", "\\u", "bytes_", "=_", "\\u", "lib_", "._", "pa", "\\u", "usec", "\\u", "to", "\\u", "bytes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "usec", "\\u", "to", "\\u", "bytes_", "._", "restype_", "=_", "c\\u", "size", "\\u", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "usec", "\\u", "to", "\\u", "bytes_", "._", "argtypes_", "=_", "[_", "pa", "\\u", "usec", "\\u", "t_", ",_", "POINTER_", "(_", "pa", "\\u", "sample", "\\u", "spec_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "sample", ".", "h", ":", "194_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "sample", "\\u", "spec", "\\u", "valid_", "=_", "\\u", "lib_", "._", "pa", "\\u", "sample", "\\u", "spec", "\\u", "valid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sample", "\\u", "spec", "\\u", "valid_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sample", "\\u", "spec", "\\u", "valid_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "sample", "\\u", "spec_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "sample", ".", "h", ":", "197_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "sample", "\\u", "spec", "\\u", "equal_", "=_", "\\u", "lib_", "._", "pa", "\\u", "sample", "\\u", "spec", "\\u", "equal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sample", "\\u", "spec", "\\u", "equal_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sample", "\\u", "spec", "\\u", "equal_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "sample", "\\u", "spec_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "sample", "\\u", "spec_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "sample", ".", "h", ":", "200_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "sample", "\\u", "format\\u", "to", "\\u", "string_", "=_", "\\u", "lib_", "._", "pa", "\\u", "sample", "\\u", "format\\u", "to", "\\u", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sample", "\\u", "format\\u", "to", "\\u", "string_", "._", "restype_", "=_", "c\\u", "char", "\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sample", "\\u", "format\\u", "to", "\\u", "string_", "._", "argtypes_", "=_", "[_", "pa", "\\u", "sample", "\\u", "format\\u", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "sample", ".", "h", ":", "203_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "parse", "\\u", "sample", "\\u", "format_", "=_", "\\u", "lib_", "._", "pa", "\\u", "parse", "\\u", "sample", "\\u", "format_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "parse", "\\u", "sample", "\\u", "format_", "._", "restype_", "=_", "pa", "\\u", "sample", "\\u", "format\\u", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "parse", "\\u", "sample", "\\u", "format_", "._", "argtypes_", "=_", "[_", "c\\u", "char", "\\u", "p_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "PA", "\\u", "SAMPLE", "\\u", "SPEC", "\\u", "SN", "PRINT", "\\u", "MAX_", "=_", "32_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "sample", ".", "h", ":", "206_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "sample", ".", "h", ":", "209_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "sample", "\\u", "spec", "\\u", "snp", "rint_", "=_", "\\u", "lib_", "._", "pa", "\\u", "sample", "\\u", "spec", "\\u", "snp", "rint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sample", "\\u", "spec", "\\u", "snp", "rint_", "._", "restype_", "=_", "c\\u", "char", "\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sample", "\\u", "spec", "\\u", "snp", "rint_", "._", "argtypes_", "=_", "[_", "c\\u", "char", "\\u", "p_", ",_", "c\\u", "size", "\\u", "t_", ",_", "POINTER_", "(_", "pa", "\\u", "sample", "\\u", "spec_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "sample", ".", "h", ":", "212_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "bytes", "\\u", "snp", "rint_", "=_", "\\u", "lib_", "._", "pa", "\\u", "bytes", "\\u", "snp", "rint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "bytes", "\\u", "snp", "rint_", "._", "restype_", "=_", "c\\u", "char", "\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "bytes", "\\u", "snp", "rint_", "._", "argtypes_", "=_", "[_", "c\\u", "char", "\\u", "p_", ",_", "c\\u", "size", "\\u", "t_", ",_", "c\\u", "uint_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "enum", "\\u", "pa", "\\u", "context", "\\u", "state_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CONTE", "XT", "\\u", "UNC", "ON", "NE", "CT", "ED_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CONTE", "XT", "\\u", "CONNECT", "ING_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CONTE", "XT", "\\u", "AUTHORI", "ZI", "NG_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CONTE", "XT", "\\u", "SETTING", "\\u", "NAME_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CONTE", "XT", "\\u", "READY", "_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CONTE", "XT", "\\u", "FAILED_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CONTE", "XT", "\\u", "TERMINAT", "ED_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "state", "\\u", "t_", "=_", "enum", "\\u", "pa", "\\u", "context", "\\u", "state_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "def", ".", "h", ":", "49_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "enum", "\\u", "pa", "\\u", "stream", "\\u", "state_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "STRE", "AM", "\\u", "UNC", "ON", "NE", "CT", "ED_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "STRE", "AM", "\\u", "CREATI", "NG_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "STRE", "AM", "\\u", "READY", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "STRE", "AM", "\\u", "FAILED_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "STRE", "AM", "\\u", "TERMINAT", "ED_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "state", "\\u", "t_", "=_", "enum", "\\u", "pa", "\\u", "stream", "\\u", "state_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "def", ".", "h", ":", "58_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "enum", "\\u", "pa", "\\u", "operati", "on", "\\u", "state_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "OPERATION", "\\u", "RUNNING_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "OPERATION", "\\u", "DONE_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "OPERATION", "\\u", "CANCEL", "ED_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "operati", "on", "\\u", "state", "\\u", "t_", "=_", "enum", "\\u", "pa", "\\u", "operati", "on", "\\u", "state_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "def", ".", "h", ":", "65_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "enum", "\\u", "pa", "\\u", "context", "\\u", "flags_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CONTE", "XT", "\\u", "NO", "AUTOS", "PA", "WN", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "flags", "\\u", "t_", "=_", "enum", "\\u", "pa", "\\u", "context", "\\u", "flags_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "def", ".", "h", ":", "73_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "enum", "\\u", "pa", "\\u", "stream", "\\u", "direction_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "STRE", "AM", "\\u", "NOD", "IRE", "CTION", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "STRE", "AM", "\\u", "PLAY", "BACK_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "STRE", "AM", "\\u", "RECORD", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "STRE", "AM", "\\u", "UPLOAD", "_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "direction", "\\u", "t_", "=_", "enum", "\\u", "pa", "\\u", "stream", "\\u", "direction_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "def", ".", "h", ":", "81_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "enum", "\\u", "pa", "\\u", "stream", "\\u", "flags_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "STRE", "AM", "\\u", "START", "\\u", "COR", "KE", "D_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "STRE", "AM", "\\u", "INTER", "POL", "ATE", "\\u", "TI", "MIN", "G_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "STRE", "AM", "\\u", "NOT", "\\u", "MON", "OT", "ON", "OUS", "_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "STRE", "AM", "\\u", "AUTO", "\\u", "TI", "MIN", "G", "\\u", "UPDATE_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "STRE", "AM", "\\u", "NO", "\\u", "REM", "AP", "\\u", "CHANNELS", "_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "STRE", "AM", "\\u", "NO", "\\u", "REM", "IX", "\\u", "CHANNELS", "_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "STRE", "AM", "\\u", "FIX", "\\u", "FORMAT_", "=_", "64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "STRE", "AM", "\\u", "FIX", "\\u", "RATE_", "=_", "128_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "STRE", "AM", "\\u", "FIX", "\\u", "CHANNELS", "_", "=_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "STRE", "AM", "\\u", "DON", "T", "\\u", "MOVE", "_", "=_", "512_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "STRE", "AM", "\\u", "VARIABLE", "\\u", "RATE_", "=_", "1024_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "flags", "\\u", "t_", "=_", "enum", "\\u", "pa", "\\u", "stream", "\\u", "flags_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "def", ".", "h", ":", "212_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "buffer", "\\u", "attr_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "maxlength", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "tle", "ngt", "h", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "pre", "buf", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "min", "req", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "frags", "ize", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "buffer", "\\u", "attr_", "=_", "struct", "\\u", "pa", "\\u", "buffer", "\\u", "attr_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "def", ".", "h", ":", "221_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "enum", "\\u", "pa", "\\u", "subscript", "ion", "\\u", "mask_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "MASK", "\\u", "NULL_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "MASK", "\\u", "SIN", "K_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "MASK", "\\u", "SOURCE_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "MASK", "\\u", "SIN", "K", "\\u", "INPUT_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "MASK", "\\u", "SOU", "RC", "E", "\\u", "OUTPUT_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "MASK", "\\u", "MODULE_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "MASK", "\\u", "CLIENT_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "MASK", "\\u", "SAMPLE", "\\u", "CACHE_", "=_", "64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "MASK", "\\u", "SERVER_", "=_", "128_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "MASK", "\\u", "AUTO", "LOAD", "_", "=_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "MASK", "\\u", "ALL_", "=_", "511", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "subscript", "ion", "\\u", "mask", "\\u", "t_", "=_", "enum", "\\u", "pa", "\\u", "subscript", "ion", "\\u", "mask_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "def", ".", "h", ":", "261_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "enum", "\\u", "pa", "\\u", "subscript", "ion", "\\u", "event", "\\u", "type_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "SIN", "K_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "SOURCE_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "SIN", "K", "\\u", "INPUT_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "SOU", "RC", "E", "\\u", "OUTPUT_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "MODULE_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "CLIENT_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "SAMPLE", "\\u", "CACHE_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "SERVER_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "AUTO", "LOAD", "_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "FAC", "ILI", "TY", "\\u", "MASK_", "=_", "15_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "NEW_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "CHANGE", "_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "REMOVE", "_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "TYPE", "\\u", "MASK_", "=_", "163", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "subscript", "ion", "\\u", "event", "\\u", "type", "\\u", "t_", "=_", "enum", "\\u", "pa", "\\u", "subscript", "ion", "\\u", "event", "\\u", "type_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "def", ".", "h", ":", "280_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "time", "val_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", " ", "HA", "CK", " ", "struct", " ", "time", "val", " ", "was", "n", "'", "t", " ", "picked", " ", "up", " ", "by", " ", "wrap", "types_", "\\u\\u\\uNL\\u\\u\\u_", "#(", "'\\u", "opaque", "\\u", "struct", "',", " ", "c\\u", "int", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "tv", "\\u", "sec", "'_", ",_", "c\\u", "long_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "tv", "\\u", "usec", "'_", ",_", "c\\u", "long_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "tim", "ing", "\\u", "info_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "timestamp", "'_", ",_", "struct", "\\u", "time", "val_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "synchronized", "\\u", "clock", "s", "'_", ",_", "c\\u", "int_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "sink", "\\u", "usec", "'_", ",_", "pa", "\\u", "usec", "\\u", "t_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "source", "\\u", "usec", "'_", ",_", "pa", "\\u", "usec", "\\u", "t_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "transport", "\\u", "usec", "'_", ",_", "pa", "\\u", "usec", "\\u", "t_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "play", "ing", "'_", ",_", "c\\u", "int_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "write", "\\u", "index", "\\u", "corrupt", "'_", ",_", "c\\u", "int_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "write", "\\u", "index", "'_", ",_", "c\\u", "int64_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "read", "\\u", "index", "\\u", "corrupt", "'_", ",_", "c\\u", "int_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "read", "\\u", "index", "'_", ",_", "c\\u", "int64_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "tim", "ing", "\\u", "info_", "=_", "struct", "\\u", "pa", "\\u", "tim", "ing", "\\u", "info_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "def", ".", "h", ":", "347", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "spawn", "\\u", "api_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "pref", "ork", "'_", ",_", "POINTER_", "(_", "CFUNCTYPE_", "(_", "None_", ")_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "post", "fork", "'_", ",_", "POINTER_", "(_", "CFUNCTYPE_", "(_", "None_", ")_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "at", "fork", "'_", ",_", "POINTER_", "(_", "CFUNCTYPE_", "(_", "None_", ")_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "spawn", "\\u", "api_", "=_", "struct", "\\u", "pa", "\\u", "spawn", "\\u", "api_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "def", ".", "h", ":", "366", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "enum", "\\u", "pa", "\\u", "seek", "\\u", "mode_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SEE", "K", "\\u", "RELAT", "IVE_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SEE", "K", "\\u", "ABS", "OLUT", "E_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SEE", "K", "\\u", "RELAT", "IV", "E", "\\u", "ON", "\\u", "READ_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SEE", "K", "\\u", "RELAT", "IV", "E", "\\u", "END_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "seek", "\\u", "mode", "\\u", "t_", "=_", "enum", "\\u", "pa", "\\u", "seek", "\\u", "mode_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "def", ".", "h", ":", "374", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "enum", "\\u", "pa", "\\u", "sink", "\\u", "flags_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SIN", "K", "\\u", "HW", "\\u", "VOLUM", "E", "\\u", "CTR", "L_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SIN", "K", "\\u", "LATE", "NCY", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SIN", "K", "\\u", "HARD", "WARE", "_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SIN", "K", "\\u", "NETWORK_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sink", "\\u", "flags", "\\u", "t_", "=_", "enum", "\\u", "pa", "\\u", "sink", "\\u", "flags_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "def", ".", "h", ":", "382", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "enum", "\\u", "pa", "\\u", "source", "\\u", "flags_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SOU", "RC", "E", "\\u", "HW", "\\u", "VOLUM", "E", "\\u", "CTR", "L_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SOU", "RC", "E", "\\u", "LATE", "NCY", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SOU", "RC", "E", "\\u", "HARD", "WARE", "_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "SOU", "RC", "E", "\\u", "NETWORK_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "source", "\\u", "flags", "\\u", "t_", "=_", "enum", "\\u", "pa", "\\u", "source", "\\u", "flags_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "def", ".", "h", ":", "390", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "free", "\\u", "cb", "\\u", "t_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "def", ".", "h", ":", "393", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "operation_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "operation_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "operation_", "=_", "struct", "\\u", "pa", "\\u", "operation_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "operati", "on", ".", "h", ":", "36_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "operati", "on", ".", "h", ":", "39_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "operati", "on", "\\u", "ref_", "=_", "\\u", "lib_", "._", "pa", "\\u", "operati", "on", "\\u", "ref_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "operati", "on", "\\u", "ref_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "operati", "on", "\\u", "ref_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "operati", "on", ".", "h", ":", "42_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "operati", "on", "\\u", "unre", "f_", "=_", "\\u", "lib_", "._", "pa", "\\u", "operati", "on", "\\u", "unre", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "operati", "on", "\\u", "unre", "f_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "operati", "on", "\\u", "unre", "f_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "operati", "on", ".", "h", ":", "45_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "operati", "on", "\\u", "cancel_", "=_", "\\u", "lib_", "._", "pa", "\\u", "operati", "on", "\\u", "cancel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "operati", "on", "\\u", "cancel_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "operati", "on", "\\u", "cancel_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "operati", "on", ".", "h", ":", "48_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "operati", "on", "\\u", "get", "\\u", "state_", "=_", "\\u", "lib_", "._", "pa", "\\u", "operati", "on", "\\u", "get", "\\u", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "operati", "on", "\\u", "get", "\\u", "state_", "._", "restype_", "=_", "pa", "\\u", "operati", "on", "\\u", "state", "\\u", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "operati", "on", "\\u", "get", "\\u", "state_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "context_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "context_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context_", "=_", "struct", "\\u", "pa", "\\u", "context_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "context", ".", "h", ":", "160_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "notif", "y", "\\u", "cb", "\\u", "t_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "context", ".", "h", ":", "163_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "int_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "context", ".", "h", ":", "166_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "context", ".", "h", ":", "170_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "new_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "new_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "new_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "new_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "mainl", "oop", "\\u", "api_", ")_", ",_", "c\\u", "char", "\\u", "p_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "context", ".", "h", ":", "173_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "unre", "f_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "unre", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "unre", "f_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "unre", "f_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "context", ".", "h", ":", "176_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "ref_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "ref_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "ref_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "ref_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "context", ".", "h", ":", "179_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "state", "\\u", "callback_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "set\\u", "state", "\\u", "callback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "state", "\\u", "callback_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "state", "\\u", "callback_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "pa", "\\u", "context", "\\u", "notif", "y", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "context", ".", "h", ":", "182_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "errno_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "errno_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "errno_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "errno_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "context", ".", "h", ":", "185_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "is", "\\u", "pending_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "is", "\\u", "pending_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "is", "\\u", "pending_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "is", "\\u", "pending_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "context", ".", "h", ":", "188_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "state_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "get", "\\u", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "state_", "._", "restype_", "=_", "pa", "\\u", "context", "\\u", "state", "\\u", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "state_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "context", ".", "h", ":", "197_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "connect_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "connect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "connect_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "connect_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "char", "\\u", "p_", ",_", "pa", "\\u", "context", "\\u", "flags", "\\u", "t_", ",_", "POINTER_", "(_", "pa", "\\u", "spawn", "\\u", "api_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "context", ".", "h", ":", "200_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "disconnect_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "disconnect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "disconnect_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "disconnect_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "context", ".", "h", ":", "203_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "drain", "_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "drain", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "drain", "_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "drain", "_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "pa", "\\u", "context", "\\u", "notif", "y", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "context", ".", "h", ":", "208_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "exit", "\\u", "daemon_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "exit", "\\u", "daemon_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "exit", "\\u", "daemon_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "exit", "\\u", "daemon_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "context", ".", "h", ":", "211_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "default", "\\u", "sink_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "set\\u", "default", "\\u", "sink_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "default", "\\u", "sink_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "default", "\\u", "sink_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "char", "\\u", "p_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "context", ".", "h", ":", "214_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "default", "\\u", "source_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "set\\u", "default", "\\u", "source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "default", "\\u", "source_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "default", "\\u", "source_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "char", "\\u", "p_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "context", ".", "h", ":", "217_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "is", "\\u", "local_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "is", "\\u", "local_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "is", "\\u", "local_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "is", "\\u", "local_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "context", ".", "h", ":", "220_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "name_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "set\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "name_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "name_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "char", "\\u", "p_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "context", ".", "h", ":", "223_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "server_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "get", "\\u", "server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "server_", "._", "restype_", "=_", "c\\u", "char", "\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "server_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "context", ".", "h", ":", "226_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "protoc", "ol", "\\u", "version_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "get", "\\u", "protoc", "ol", "\\u", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "protoc", "ol", "\\u", "version_", "._", "restype_", "=_", "c\\u", "uint32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "protoc", "ol", "\\u", "version_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "context", ".", "h", ":", "229_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "server", "\\u", "protoc", "ol", "\\u", "version_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "get", "\\u", "server", "\\u", "protoc", "ol", "\\u", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "server", "\\u", "protoc", "ol", "\\u", "version_", "._", "restype_", "=_", "c\\u", "uint32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "server", "\\u", "protoc", "ol", "\\u", "version_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "enum", "\\u", "pa", "\\u", "channel", "\\u", "position_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "INVALID", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "MON", "O_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "LEFT_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "RIGHT_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "CENTER_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "FRONT", "\\u", "LEFT_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "FRONT", "\\u", "RIGHT_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "FRONT", "\\u", "CENTER_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "REA", "R", "\\u", "CENTER_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "REA", "R", "\\u", "LEFT_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "REA", "R", "\\u", "RIGHT_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "LF", "E_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "SUB", "WO", "OF", "ER_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "FRONT", "\\u", "LEF", "T", "\\u", "OF", "\\u", "CENTER_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "FRONT", "\\u", "RIG", "HT", "\\u", "OF", "\\u", "CENTER_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "SIDE", "\\u", "LEFT_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "SIDE", "\\u", "RIGHT_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "0_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "1_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "2_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "3_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "4_", "=_", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "5_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "6_", "=_", "11_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "7_", "=_", "12_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "8_", "=_", "13_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "9_", "=_", "14_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "10_", "=_", "15_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "11_", "=_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "12_", "=_", "17_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "13_", "=_", "18_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "14_", "=_", "19_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "15_", "=_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "16_", "=_", "21_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "17_", "=_", "22_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "18_", "=_", "23_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "19_", "=_", "24_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "20_", "=_", "25_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "21_", "=_", "26_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "22_", "=_", "27_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "23_", "=_", "28_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "24_", "=_", "29_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "25_", "=_", "30_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "26_", "=_", "31_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "27_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "28_", "=_", "33_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "29_", "=_", "34_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "30_", "=_", "35_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "31_", "=_", "36_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "TOP", "\\u", "CENTER_", "=_", "37_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "TOP", "\\u", "FRONT", "\\u", "LEFT_", "=_", "38_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "TOP", "\\u", "FRONT", "\\u", "RIGHT_", "=_", "39_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "TOP", "\\u", "FRONT", "\\u", "CENTER_", "=_", "40_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "TOP", "\\u", "REA", "R", "\\u", "LEFT_", "=_", "41_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "TOP", "\\u", "REA", "R", "\\u", "RIGHT_", "=_", "42_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "TOP", "\\u", "REA", "R", "\\u", "CENTER_", "=_", "43_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "MAX_", "=_", "44_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "position", "\\u", "t_", "=_", "enum", "\\u", "pa", "\\u", "channel", "\\u", "position_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "channel", "map", ".", "h", ":", "140_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "enum", "\\u", "pa", "\\u", "channel", "\\u", "map", "\\u", "def_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "MAP", "\\u", "AI", "FF_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "MAP", "\\u", "ALS", "A_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "MAP", "\\u", "AUX", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "MAP", "\\u", "WAVE", "EX_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "MAP", "\\u", "OSS", "_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "MAP", "\\u", "DEFAULT_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map", "\\u", "def", "\\u", "t_", "=_", "enum", "\\u", "pa", "\\u", "channel", "\\u", "map", "\\u", "def_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "channel", "map", ".", "h", ":", "151_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "channel", "\\u", "map_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "channel", "s", "'_", ",_", "c\\u", "uint8_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "map", "'_", ",_", "pa", "\\u", "channel", "\\u", "position", "\\u", "t_", "*_", "32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map_", "=_", "struct", "\\u", "pa", "\\u", "channel", "\\u", "map_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "channel", "map", ".", "h", ":", "159_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "channel", "map", ".", "h", ":", "162_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map", "\\u", "init_", "=_", "\\u", "lib_", "._", "pa", "\\u", "channel", "\\u", "map", "\\u", "init_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map", "\\u", "init_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "channel", "\\u", "map_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map", "\\u", "init_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "channel", "\\u", "map_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "channel", "map", ".", "h", ":", "165_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map", "\\u", "init", "\\u", "mono", "_", "=_", "\\u", "lib_", "._", "pa", "\\u", "channel", "\\u", "map", "\\u", "init", "\\u", "mono", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map", "\\u", "init", "\\u", "mono", "_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "channel", "\\u", "map_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map", "\\u", "init", "\\u", "mono", "_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "channel", "\\u", "map_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "channel", "map", ".", "h", ":", "168_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map", "\\u", "init", "\\u", "stereo", "_", "=_", "\\u", "lib_", "._", "pa", "\\u", "channel", "\\u", "map", "\\u", "init", "\\u", "stereo", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map", "\\u", "init", "\\u", "stereo", "_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "channel", "\\u", "map_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map", "\\u", "init", "\\u", "stereo", "_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "channel", "\\u", "map_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "channel", "map", ".", "h", ":", "172_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map", "\\u", "init", "\\u", "auto_", "=_", "\\u", "lib_", "._", "pa", "\\u", "channel", "\\u", "map", "\\u", "init", "\\u", "auto_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map", "\\u", "init", "\\u", "auto_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "channel", "\\u", "map_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map", "\\u", "init", "\\u", "auto_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "channel", "\\u", "map_", ")_", ",_", "c\\u", "uint_", ",_", "pa", "\\u", "channel", "\\u", "map", "\\u", "def", "\\u", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "channel", "map", ".", "h", ":", "175_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "position", "\\u", "to", "\\u", "string_", "=_", "\\u", "lib_", "._", "pa", "\\u", "channel", "\\u", "position", "\\u", "to", "\\u", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "position", "\\u", "to", "\\u", "string_", "._", "restype_", "=_", "c\\u", "char", "\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "position", "\\u", "to", "\\u", "string_", "._", "argtypes_", "=_", "[_", "pa", "\\u", "channel", "\\u", "position", "\\u", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "channel", "map", ".", "h", ":", "178_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "position", "\\u", "to", "\\u", "pretty", "\\u", "string_", "=_", "\\u", "lib_", "._", "pa", "\\u", "channel", "\\u", "position", "\\u", "to", "\\u", "pretty", "\\u", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "position", "\\u", "to", "\\u", "pretty", "\\u", "string_", "._", "restype_", "=_", "c\\u", "char", "\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "position", "\\u", "to", "\\u", "pretty", "\\u", "string_", "._", "argtypes_", "=_", "[_", "pa", "\\u", "channel", "\\u", "position", "\\u", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "PA", "\\u", "CHAN", "NEL", "\\u", "MAP", "\\u", "SN", "PRINT", "\\u", "MAX_", "=_", "336", "_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "channel", "map", ".", "h", ":", "181_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "channel", "map", ".", "h", ":", "184_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map", "\\u", "snp", "rint_", "=_", "\\u", "lib_", "._", "pa", "\\u", "channel", "\\u", "map", "\\u", "snp", "rint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map", "\\u", "snp", "rint_", "._", "restype_", "=_", "c\\u", "char", "\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map", "\\u", "snp", "rint_", "._", "argtypes_", "=_", "[_", "c\\u", "char", "\\u", "p_", ",_", "c\\u", "size", "\\u", "t_", ",_", "POINTER_", "(_", "pa", "\\u", "channel", "\\u", "map_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "channel", "map", ".", "h", ":", "187_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map", "\\u", "parse_", "=_", "\\u", "lib_", "._", "pa", "\\u", "channel", "\\u", "map", "\\u", "parse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map", "\\u", "parse_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "channel", "\\u", "map_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map", "\\u", "parse_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "channel", "\\u", "map_", ")_", ",_", "c\\u", "char", "\\u", "p_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "channel", "map", ".", "h", ":", "190_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map", "\\u", "equal_", "=_", "\\u", "lib_", "._", "pa", "\\u", "channel", "\\u", "map", "\\u", "equal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map", "\\u", "equal_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map", "\\u", "equal_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "channel", "\\u", "map_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "channel", "\\u", "map_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "channel", "map", ".", "h", ":", "193_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map", "\\u", "valid_", "=_", "\\u", "lib_", "._", "pa", "\\u", "channel", "\\u", "map", "\\u", "valid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map", "\\u", "valid_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "channel", "\\u", "map", "\\u", "valid_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "channel", "\\u", "map_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "volume", "\\u", "t_", "=_", "c\\u", "uint32_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "volume", ".", "h", ":", "101_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "VOLUM", "E", "\\u", "NORM_", "=_", "65536_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "volume", ".", "h", ":", "104_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "VOLUM", "E", "\\u", "MUT", "ED_", "=_", "0_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "volume", ".", "h", ":", "107_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "cv", "olume", "_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "channel", "s", "'_", ",_", "c\\u", "uint8_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "values", "'_", ",_", "pa", "\\u", "volume", "\\u", "t_", "*_", "32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "cv", "olume", "_", "=_", "struct", "\\u", "pa", "\\u", "cv", "olume", "_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "volume", ".", "h", ":", "113_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "volume", ".", "h", ":", "116_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "cv", "olume", "\\u", "equal_", "=_", "\\u", "lib_", "._", "pa", "\\u", "cv", "olume", "\\u", "equal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "cv", "olume", "\\u", "equal_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "cv", "olume", "\\u", "equal_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "cv", "olume", "_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "cv", "olume", "_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "volume", ".", "h", ":", "125_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "cv", "olume", "\\u", "set_", "=_", "\\u", "lib_", "._", "pa", "\\u", "cv", "olume", "\\u", "set_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "cv", "olume", "\\u", "set_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "cv", "olume", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "cv", "olume", "\\u", "set_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "cv", "olume", "_", ")_", ",_", "c\\u", "uint_", ",_", "pa", "\\u", "volume", "\\u", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "PA", "\\u", "CV", "OL", "UM", "E", "\\u", "SN", "PRINT", "\\u", "MAX_", "=_", "64_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "volume", ".", "h", ":", "128_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "volume", ".", "h", ":", "131_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "cv", "olume", "\\u", "snp", "rint_", "=_", "\\u", "lib_", "._", "pa", "\\u", "cv", "olume", "\\u", "snp", "rint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "cv", "olume", "\\u", "snp", "rint_", "._", "restype_", "=_", "c\\u", "char", "\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "cv", "olume", "\\u", "snp", "rint_", "._", "argtypes_", "=_", "[_", "c\\u", "char", "\\u", "p_", ",_", "c\\u", "size", "\\u", "t_", ",_", "POINTER_", "(_", "pa", "\\u", "cv", "olume", "_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "volume", ".", "h", ":", "134_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "cv", "olume", "\\u", "avg_", "=_", "\\u", "lib_", "._", "pa", "\\u", "cv", "olume", "\\u", "avg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "cv", "olume", "\\u", "avg_", "._", "restype_", "=_", "pa", "\\u", "volume", "\\u", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "cv", "olume", "\\u", "avg_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "cv", "olume", "_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "volume", ".", "h", ":", "137_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "cv", "olume", "\\u", "valid_", "=_", "\\u", "lib_", "._", "pa", "\\u", "cv", "olume", "\\u", "valid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "cv", "olume", "\\u", "valid_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "cv", "olume", "\\u", "valid_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "cv", "olume", "_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "volume", ".", "h", ":", "140_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "cv", "olume", "\\u", "channel", "s", "\\u", "equal", "\\u", "to_", "=_", "\\u", "lib_", "._", "pa", "\\u", "cv", "olume", "\\u", "channel", "s", "\\u", "equal", "\\u", "to_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "cv", "olume", "\\u", "channel", "s", "\\u", "equal", "\\u", "to_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "cv", "olume", "\\u", "channel", "s", "\\u", "equal", "\\u", "to_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "cv", "olume", "_", ")_", ",_", "pa", "\\u", "volume", "\\u", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "volume", ".", "h", ":", "149_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "sw", "\\u", "volume", "\\u", "multiply_", "=_", "\\u", "lib_", "._", "pa", "\\u", "sw", "\\u", "volume", "\\u", "multiply_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sw", "\\u", "volume", "\\u", "multiply_", "._", "restype_", "=_", "pa", "\\u", "volume", "\\u", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sw", "\\u", "volume", "\\u", "multiply_", "._", "argtypes_", "=_", "[_", "pa", "\\u", "volume", "\\u", "t_", ",_", "pa", "\\u", "volume", "\\u", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "volume", ".", "h", ":", "152_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "sw", "\\u", "cv", "olume", "\\u", "multiply_", "=_", "\\u", "lib_", "._", "pa", "\\u", "sw", "\\u", "cv", "olume", "\\u", "multiply_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sw", "\\u", "cv", "olume", "\\u", "multiply_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "cv", "olume", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sw", "\\u", "cv", "olume", "\\u", "multiply_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "cv", "olume", "_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "cv", "olume", "_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "cv", "olume", "_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "volume", ".", "h", ":", "155_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "sw", "\\u", "volume", "\\u", "from", "\\u", "d", "B_", "=_", "\\u", "lib_", "._", "pa", "\\u", "sw", "\\u", "volume", "\\u", "from", "\\u", "d", "B_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sw", "\\u", "volume", "\\u", "from", "\\u", "d", "B_", "._", "restype_", "=_", "pa", "\\u", "volume", "\\u", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sw", "\\u", "volume", "\\u", "from", "\\u", "d", "B_", "._", "argtypes_", "=_", "[_", "c\\u", "double_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "volume", ".", "h", ":", "158_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "sw", "\\u", "volume", "\\u", "to", "\\u", "d", "B_", "=_", "\\u", "lib_", "._", "pa", "\\u", "sw", "\\u", "volume", "\\u", "to", "\\u", "d", "B_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sw", "\\u", "volume", "\\u", "to", "\\u", "d", "B_", "._", "restype_", "=_", "c\\u", "double_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sw", "\\u", "volume", "\\u", "to", "\\u", "d", "B_", "._", "argtypes_", "=_", "[_", "pa", "\\u", "volume", "\\u", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "volume", ".", "h", ":", "161_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "sw", "\\u", "volume", "\\u", "from", "\\u", "linear_", "=_", "\\u", "lib_", "._", "pa", "\\u", "sw", "\\u", "volume", "\\u", "from", "\\u", "linear_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sw", "\\u", "volume", "\\u", "from", "\\u", "linear_", "._", "restype_", "=_", "pa", "\\u", "volume", "\\u", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sw", "\\u", "volume", "\\u", "from", "\\u", "linear_", "._", "argtypes_", "=_", "[_", "c\\u", "double_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "volume", ".", "h", ":", "164_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "sw", "\\u", "volume", "\\u", "to", "\\u", "linear_", "=_", "\\u", "lib_", "._", "pa", "\\u", "sw", "\\u", "volume", "\\u", "to", "\\u", "linear_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sw", "\\u", "volume", "\\u", "to", "\\u", "linear_", "._", "restype_", "=_", "c\\u", "double_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sw", "\\u", "volume", "\\u", "to", "\\u", "linear_", "._", "argtypes_", "=_", "[_", "pa", "\\u", "volume", "\\u", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "PA", "\\u", "DEC", "IB", "EL", "\\u", "MINI", "NF", "TY_", "=_", "-_", "200_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "volume", ".", "h", ":", "170_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "stream_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "stream_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream_", "=_", "struct", "\\u", "pa", "\\u", "stream_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "268", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "success", "\\u", "cb", "\\u", "t_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "c\\u", "int_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "271", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "request", "\\u", "cb", "\\u", "t_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "c\\u", "size", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "274", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "notif", "y", "\\u", "cb", "\\u", "t_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "277", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "280_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "new_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "new_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "new_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "new_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "char", "\\u", "p_", ",_", "POINTER_", "(_", "pa", "\\u", "sample", "\\u", "spec_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "channel", "\\u", "map_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "287", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "unre", "f_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "unre", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "unre", "f_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "unre", "f_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "290_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "ref_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "ref_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "ref_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "ref_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "293", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "state_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "get", "\\u", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "state_", "._", "restype_", "=_", "pa", "\\u", "stream", "\\u", "state", "\\u", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "state_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "296", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "context_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "get", "\\u", "context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "context_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "context_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "302_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "index_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "get", "\\u", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "index_", "._", "restype_", "=_", "c\\u", "uint32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "index_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "312_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "device", "\\u", "index_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "get", "\\u", "device", "\\u", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "device", "\\u", "index_", "._", "restype_", "=_", "c\\u", "uint32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "device", "\\u", "index_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "322", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "device", "\\u", "name_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "get", "\\u", "device", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "device", "\\u", "name_", "._", "restype_", "=_", "c\\u", "char", "\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "device", "\\u", "name_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "328", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "is", "\\u", "suspended", "_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "is", "\\u", "suspended", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "is", "\\u", "suspended", "_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "is", "\\u", "suspended", "_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "331", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "connect", "\\u", "playback", "_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "connect", "\\u", "playback", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "connect", "\\u", "playback", "_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "connect", "\\u", "playback", "_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "c\\u", "char", "\\u", "p_", ",_", "POINTER_", "(_", "pa", "\\u", "buffer", "\\u", "attr_", ")_", ",_", "pa", "\\u", "stream", "\\u", "flags", "\\u", "t_", ",_", "POINTER_", "(_", "pa", "\\u", "cv", "olume", "_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "340_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "connect", "\\u", "record_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "connect", "\\u", "record_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "connect", "\\u", "record_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "connect", "\\u", "record_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "c\\u", "char", "\\u", "p_", ",_", "POINTER_", "(_", "pa", "\\u", "buffer", "\\u", "attr_", ")_", ",_", "pa", "\\u", "stream", "\\u", "flags", "\\u", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "347", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "disconnect_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "disconnect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "disconnect_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "disconnect_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "356", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "write_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "write_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "write_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "write_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "POINTER_", "(_", "None_", ")_", ",_", "c\\u", "size", "\\u", "t_", ",_", "pa", "\\u", "free", "\\u", "cb", "\\u", "t_", ",_", "c\\u", "int64_", ",_", "pa", "\\u", "seek", "\\u", "mode", "\\u", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "369", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "peek_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "peek_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "peek_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "peek_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "POINTER_", "(_", "POINTER_", "(_", "None_", ")_", ")_", ",_", "POINTER_", "(_", "c\\u", "size", "\\u", "t_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "376", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "drop_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "drop_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "drop_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "drop_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "379", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "writ", "able", "\\u", "size_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "writ", "able", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "writ", "able", "\\u", "size_", "._", "restype_", "=_", "c\\u", "size", "\\u", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "writ", "able", "\\u", "size_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "382", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "reada", "ble", "\\u", "size_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "reada", "ble", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "reada", "ble", "\\u", "size_", "._", "restype_", "=_", "c\\u", "size", "\\u", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "reada", "ble", "\\u", "size_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "385", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "drain", "_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "drain", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "drain", "_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "drain", "_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "pa", "\\u", "stream", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "391", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "update", "\\u", "tim", "ing", "\\u", "info_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "update", "\\u", "tim", "ing", "\\u", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "update", "\\u", "tim", "ing", "\\u", "info_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "update", "\\u", "tim", "ing", "\\u", "info_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "pa", "\\u", "stream", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "394", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "state", "\\u", "callback_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "set\\u", "state", "\\u", "callback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "state", "\\u", "callback_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "state", "\\u", "callback_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "pa", "\\u", "stream", "\\u", "notif", "y", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "398", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "write", "\\u", "callback_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "set\\u", "write", "\\u", "callback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "write", "\\u", "callback_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "write", "\\u", "callback_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "pa", "\\u", "stream", "\\u", "request", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "402", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "read", "\\u", "callback_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "set\\u", "read", "\\u", "callback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "read", "\\u", "callback_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "read", "\\u", "callback_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "pa", "\\u", "stream", "\\u", "request", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "405_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "overflow", "\\u", "callback_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "set\\u", "overflow", "\\u", "callback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "overflow", "\\u", "callback_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "overflow", "\\u", "callback_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "pa", "\\u", "stream", "\\u", "notif", "y", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "408", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "under", "flow", "\\u", "callback_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "set\\u", "under", "flow", "\\u", "callback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "under", "flow", "\\u", "callback_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "under", "flow", "\\u", "callback_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "pa", "\\u", "stream", "\\u", "notif", "y", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "413_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "latenc", "y", "\\u", "update", "\\u", "callback_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "set\\u", "latenc", "y", "\\u", "update", "\\u", "callback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "latenc", "y", "\\u", "update", "\\u", "callback_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "latenc", "y", "\\u", "update", "\\u", "callback_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "pa", "\\u", "stream", "\\u", "notif", "y", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "420_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "moved", "\\u", "callback_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "set\\u", "moved", "\\u", "callback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "moved", "\\u", "callback_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "moved", "\\u", "callback_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "pa", "\\u", "stream", "\\u", "notif", "y", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "430", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "suspended", "\\u", "callback_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "set\\u", "suspended", "\\u", "callback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "suspended", "\\u", "callback_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "suspended", "\\u", "callback_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "pa", "\\u", "stream", "\\u", "notif", "y", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "433", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "cor", "k_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "cor", "k_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "cor", "k_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "cor", "k_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "c\\u", "int_", ",_", "pa", "\\u", "stream", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "438", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "flush_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "flush_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "flush_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "flush_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "pa", "\\u", "stream", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "442", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "pre", "buf_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "pre", "buf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "pre", "buf_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "pre", "buf_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "pa", "\\u", "stream", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "447", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "trigger_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "trigger_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "trigger_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "trigger_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "pa", "\\u", "stream", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "450_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "name_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "set\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "name_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "name_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "c\\u", "char", "\\u", "p_", ",_", "pa", "\\u", "stream", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "467", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "time_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "get", "\\u", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "time_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "time_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "usec", "\\u", "t_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "473", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "latency_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "get", "\\u", "latency_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "latency_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "latency_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "usec", "\\u", "t_", ")_", ",_", "POINTER_", "(_", "c\\u", "int_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "485", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "tim", "ing", "\\u", "info_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "get", "\\u", "tim", "ing", "\\u", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "tim", "ing", "\\u", "info_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "tim", "ing", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "tim", "ing", "\\u", "info_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "488", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "sample", "\\u", "spec_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "get", "\\u", "sample", "\\u", "spec_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "sample", "\\u", "spec_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "sample", "\\u", "spec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "sample", "\\u", "spec_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "491", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "channel", "\\u", "map_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "get", "\\u", "channel", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "channel", "\\u", "map_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "channel", "\\u", "map_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "channel", "\\u", "map_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "496", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "buffer", "\\u", "attr_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "get", "\\u", "buffer", "\\u", "attr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "buffer", "\\u", "attr_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "buffer", "\\u", "attr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "get", "\\u", "buffer", "\\u", "attr_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "504_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "buffer", "\\u", "attr_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "set\\u", "buffer", "\\u", "attr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "buffer", "\\u", "attr_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "set\\u", "buffer", "\\u", "attr_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "buffer", "\\u", "attr_", ")_", ",_", "pa", "\\u", "stream", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "stream", ".", "h", ":", "511", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "update", "\\u", "sample", "\\u", "rate_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "update", "\\u", "sample", "\\u", "rate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "update", "\\u", "sample", "\\u", "rate_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "update", "\\u", "sample", "\\u", "rate_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "c\\u", "uint32_", ",_", "pa", "\\u", "stream", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "sink", "\\u", "info_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "name", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "index", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "description", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "sample", "\\u", "spec", "'_", ",_", "pa", "\\u", "sample", "\\u", "spec_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "channel", "\\u", "map", "'_", ",_", "pa", "\\u", "channel", "\\u", "map_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "owner", "\\u", "module", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "volume", "'_", ",_", "pa", "\\u", "cv", "olume", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "mute", "'_", ",_", "c\\u", "int_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "monit", "or", "\\u", "source", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "monit", "or", "\\u", "source", "\\u", "name", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "latenc", "y", "'_", ",_", "pa", "\\u", "usec", "\\u", "t_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "driver", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "flags", "'_", ",_", "pa", "\\u", "sink", "\\u", "flags", "\\u", "t_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "sink", "\\u", "info_", "=_", "struct", "\\u", "pa", "\\u", "sink", "\\u", "info_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "224_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sink", "\\u", "info", "\\u", "cb", "\\u", "t_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "sink", "\\u", "info_", ")_", ",_", "c\\u", "int_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "227_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "230_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "sink", "\\u", "info", "\\u", "by", "\\u", "name_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "get", "\\u", "sink", "\\u", "info", "\\u", "by", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "sink", "\\u", "info", "\\u", "by", "\\u", "name_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "sink", "\\u", "info", "\\u", "by", "\\u", "name_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "char", "\\u", "p_", ",_", "pa", "\\u", "sink", "\\u", "info", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "233_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "sink", "\\u", "info", "\\u", "by", "\\u", "index_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "get", "\\u", "sink", "\\u", "info", "\\u", "by", "\\u", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "sink", "\\u", "info", "\\u", "by", "\\u", "index_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "sink", "\\u", "info", "\\u", "by", "\\u", "index_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "pa", "\\u", "sink", "\\u", "info", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "236_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "sink", "\\u", "info", "\\u", "list_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "get", "\\u", "sink", "\\u", "info", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "sink", "\\u", "info", "\\u", "list_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "sink", "\\u", "info", "\\u", "list_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "pa", "\\u", "sink", "\\u", "info", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "source", "\\u", "info_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "name", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "index", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "description", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "sample", "\\u", "spec", "'_", ",_", "pa", "\\u", "sample", "\\u", "spec_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "channel", "\\u", "map", "'_", ",_", "pa", "\\u", "channel", "\\u", "map_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "owner", "\\u", "module", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "volume", "'_", ",_", "pa", "\\u", "cv", "olume", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "mute", "'_", ",_", "c\\u", "int_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "monit", "or", "\\u", "of", "\\u", "sink", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "monit", "or", "\\u", "of", "\\u", "sink", "\\u", "name", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "latenc", "y", "'_", ",_", "pa", "\\u", "usec", "\\u", "t_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "driver", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "flags", "'_", ",_", "pa", "\\u", "source", "\\u", "flags", "\\u", "t_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "source", "\\u", "info_", "=_", "struct", "\\u", "pa", "\\u", "source", "\\u", "info_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "253_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "source", "\\u", "info", "\\u", "cb", "\\u", "t_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "source", "\\u", "info_", ")_", ",_", "c\\u", "int_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "259_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "source", "\\u", "info", "\\u", "by", "\\u", "name_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "get", "\\u", "source", "\\u", "info", "\\u", "by", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "source", "\\u", "info", "\\u", "by", "\\u", "name_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "source", "\\u", "info", "\\u", "by", "\\u", "name_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "char", "\\u", "p_", ",_", "pa", "\\u", "source", "\\u", "info", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "262", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "source", "\\u", "info", "\\u", "by", "\\u", "index_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "get", "\\u", "source", "\\u", "info", "\\u", "by", "\\u", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "source", "\\u", "info", "\\u", "by", "\\u", "index_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "source", "\\u", "info", "\\u", "by", "\\u", "index_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "pa", "\\u", "source", "\\u", "info", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "265_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "source", "\\u", "info", "\\u", "list_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "get", "\\u", "source", "\\u", "info", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "source", "\\u", "info", "\\u", "list_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "source", "\\u", "info", "\\u", "list_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "pa", "\\u", "source", "\\u", "info", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "server", "\\u", "info_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "user", "\\u", "name", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "host", "\\u", "name", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "server", "\\u", "version", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "server", "\\u", "name", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "sample", "\\u", "spec", "'_", ",_", "pa", "\\u", "sample", "\\u", "spec_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "default", "\\u", "sink", "\\u", "name", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "default", "\\u", "source", "\\u", "name", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "cookie", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "server", "\\u", "info_", "=_", "struct", "\\u", "pa", "\\u", "server", "\\u", "info_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "277", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "server", "\\u", "info", "\\u", "cb", "\\u", "t_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "server", "\\u", "info_", ")_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "280_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "283", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "server", "\\u", "info_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "get", "\\u", "server", "\\u", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "server", "\\u", "info_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "server", "\\u", "info_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "pa", "\\u", "server", "\\u", "info", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "module", "\\u", "info_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "index", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "name", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "argu", "ment", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "n", "\\u", "used", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "auto", "\\u", "unload", "'_", ",_", "c\\u", "int_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "module", "\\u", "info_", "=_", "struct", "\\u", "pa", "\\u", "module", "\\u", "info_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "292", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "module", "\\u", "info", "\\u", "cb", "\\u", "t_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "module", "\\u", "info_", ")_", ",_", "c\\u", "int_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "295", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "298", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "module", "\\u", "info_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "get", "\\u", "module", "\\u", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "module", "\\u", "info_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "module", "\\u", "info_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "pa", "\\u", "module", "\\u", "info", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "301_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "module", "\\u", "info", "\\u", "list_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "get", "\\u", "module", "\\u", "info", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "module", "\\u", "info", "\\u", "list_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "module", "\\u", "info", "\\u", "list_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "pa", "\\u", "module", "\\u", "info", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "client", "\\u", "info_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "index", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "name", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "owner", "\\u", "module", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "driver", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "client", "\\u", "info_", "=_", "struct", "\\u", "pa", "\\u", "client", "\\u", "info_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "309", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "client", "\\u", "info", "\\u", "cb", "\\u", "t_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "client", "\\u", "info_", ")_", ",_", "c\\u", "int_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "312_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "315", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "client", "\\u", "info_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "get", "\\u", "client", "\\u", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "client", "\\u", "info_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "client", "\\u", "info_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "pa", "\\u", "client", "\\u", "info", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "318", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "client", "\\u", "info", "\\u", "list_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "get", "\\u", "client", "\\u", "info", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "client", "\\u", "info", "\\u", "list_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "client", "\\u", "info", "\\u", "list_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "pa", "\\u", "client", "\\u", "info", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "sink", "\\u", "input", "\\u", "info_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "index", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "name", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "owner", "\\u", "module", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "client", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "sink", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "sample", "\\u", "spec", "'_", ",_", "pa", "\\u", "sample", "\\u", "spec_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "channel", "\\u", "map", "'_", ",_", "pa", "\\u", "channel", "\\u", "map_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "volume", "'_", ",_", "pa", "\\u", "cv", "olume", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "buffer", "\\u", "usec", "'_", ",_", "pa", "\\u", "usec", "\\u", "t_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "sink", "\\u", "usec", "'_", ",_", "pa", "\\u", "usec", "\\u", "t_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "resample", "\\u", "method", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "driver", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "mute", "'_", ",_", "c\\u", "int_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "sink", "\\u", "input", "\\u", "info_", "=_", "struct", "\\u", "pa", "\\u", "sink", "\\u", "input", "\\u", "info_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "335", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sink", "\\u", "input", "\\u", "info", "\\u", "cb", "\\u", "t_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "sink", "\\u", "input", "\\u", "info_", ")_", ",_", "c\\u", "int_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "338", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "341", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "sink", "\\u", "input", "\\u", "info_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "get", "\\u", "sink", "\\u", "input", "\\u", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "sink", "\\u", "input", "\\u", "info_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "sink", "\\u", "input", "\\u", "info_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "pa", "\\u", "sink", "\\u", "input", "\\u", "info", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "344", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "sink", "\\u", "input", "\\u", "info", "\\u", "list_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "get", "\\u", "sink", "\\u", "input", "\\u", "info", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "sink", "\\u", "input", "\\u", "info", "\\u", "list_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "sink", "\\u", "input", "\\u", "info", "\\u", "list_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "pa", "\\u", "sink", "\\u", "input", "\\u", "info", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "source", "\\u", "output", "\\u", "info_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "index", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "name", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "owner", "\\u", "module", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "client", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "source", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "sample", "\\u", "spec", "'_", ",_", "pa", "\\u", "sample", "\\u", "spec_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "channel", "\\u", "map", "'_", ",_", "pa", "\\u", "channel", "\\u", "map_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "buffer", "\\u", "usec", "'_", ",_", "pa", "\\u", "usec", "\\u", "t_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "source", "\\u", "usec", "'_", ",_", "pa", "\\u", "usec", "\\u", "t_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "resample", "\\u", "method", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "driver", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "source", "\\u", "output", "\\u", "info_", "=_", "struct", "\\u", "pa", "\\u", "source", "\\u", "output", "\\u", "info_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "359", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "source", "\\u", "output", "\\u", "info", "\\u", "cb", "\\u", "t_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "source", "\\u", "output", "\\u", "info_", ")_", ",_", "c\\u", "int_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "362", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "365_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "source", "\\u", "output", "\\u", "info_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "get", "\\u", "source", "\\u", "output", "\\u", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "source", "\\u", "output", "\\u", "info_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "source", "\\u", "output", "\\u", "info_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "pa", "\\u", "source", "\\u", "output", "\\u", "info", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "368", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "source", "\\u", "output", "\\u", "info", "\\u", "list_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "get", "\\u", "source", "\\u", "output", "\\u", "info", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "source", "\\u", "output", "\\u", "info", "\\u", "list_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "source", "\\u", "output", "\\u", "info", "\\u", "list_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "pa", "\\u", "source", "\\u", "output", "\\u", "info", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "371", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "volume", "\\u", "by", "\\u", "index_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "volume", "\\u", "by", "\\u", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "volume", "\\u", "by", "\\u", "index_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "volume", "\\u", "by", "\\u", "index_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "POINTER_", "(_", "pa", "\\u", "cv", "olume", "_", ")_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "374", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "volume", "\\u", "by", "\\u", "name_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "volume", "\\u", "by", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "volume", "\\u", "by", "\\u", "name_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "volume", "\\u", "by", "\\u", "name_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "char", "\\u", "p_", ",_", "POINTER_", "(_", "pa", "\\u", "cv", "olume", "_", ")_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "377", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "mute", "\\u", "by", "\\u", "index_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "mute", "\\u", "by", "\\u", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "mute", "\\u", "by", "\\u", "index_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "mute", "\\u", "by", "\\u", "index_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "c\\u", "int_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "380", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "mute", "\\u", "by", "\\u", "name_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "mute", "\\u", "by", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "mute", "\\u", "by", "\\u", "name_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "mute", "\\u", "by", "\\u", "name_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "char", "\\u", "p_", ",_", "c\\u", "int_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "383", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "input", "\\u", "volume_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "input", "\\u", "volume_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "input", "\\u", "volume_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "input", "\\u", "volume_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "POINTER_", "(_", "pa", "\\u", "cv", "olume", "_", ")_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "386", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "input", "\\u", "mute_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "input", "\\u", "mute_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "input", "\\u", "mute_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "input", "\\u", "mute_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "c\\u", "int_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "389", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "source", "\\u", "volume", "\\u", "by", "\\u", "index_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "set\\u", "source", "\\u", "volume", "\\u", "by", "\\u", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "source", "\\u", "volume", "\\u", "by", "\\u", "index_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "source", "\\u", "volume", "\\u", "by", "\\u", "index_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "POINTER_", "(_", "pa", "\\u", "cv", "olume", "_", ")_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "392", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "source", "\\u", "volume", "\\u", "by", "\\u", "name_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "set\\u", "source", "\\u", "volume", "\\u", "by", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "source", "\\u", "volume", "\\u", "by", "\\u", "name_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "source", "\\u", "volume", "\\u", "by", "\\u", "name_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "char", "\\u", "p_", ",_", "POINTER_", "(_", "pa", "\\u", "cv", "olume", "_", ")_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "395", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "source", "\\u", "mute", "\\u", "by", "\\u", "index_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "set\\u", "source", "\\u", "mute", "\\u", "by", "\\u", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "source", "\\u", "mute", "\\u", "by", "\\u", "index_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "source", "\\u", "mute", "\\u", "by", "\\u", "index_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "c\\u", "int_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "398", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "source", "\\u", "mute", "\\u", "by", "\\u", "name_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "set\\u", "source", "\\u", "mute", "\\u", "by", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "source", "\\u", "mute", "\\u", "by", "\\u", "name_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "source", "\\u", "mute", "\\u", "by", "\\u", "name_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "char", "\\u", "p_", ",_", "c\\u", "int_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "stat", "\\u", "info_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "memb", "lock", "\\u", "total", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "memb", "lock", "\\u", "total", "\\u", "size", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "memb", "lock", "\\u", "allocated", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "memb", "lock", "\\u", "allocated", "\\u", "size", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "sca", "che", "\\u", "size", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stat", "\\u", "info_", "=_", "struct", "\\u", "pa", "\\u", "stat", "\\u", "info_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "407", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stat", "\\u", "info", "\\u", "cb", "\\u", "t_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "stat", "\\u", "info_", ")_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "410", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "413_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "stat_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "stat_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "stat_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "stat_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "pa", "\\u", "stat", "\\u", "info", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "sample", "\\u", "info_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "index", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "name", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "volume", "'_", ",_", "pa", "\\u", "cv", "olume", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "sample", "\\u", "spec", "'_", ",_", "pa", "\\u", "sample", "\\u", "spec_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "channel", "\\u", "map", "'_", ",_", "pa", "\\u", "channel", "\\u", "map_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "duration", "'_", ",_", "pa", "\\u", "usec", "\\u", "t_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "bytes", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "lazy", "'_", ",_", "c\\u", "int_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "filename", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "sample", "\\u", "info_", "=_", "struct", "\\u", "pa", "\\u", "sample", "\\u", "info_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "426", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "sample", "\\u", "info", "\\u", "cb", "\\u", "t_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "sample", "\\u", "info_", ")_", ",_", "c\\u", "int_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "429", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "432", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "sample", "\\u", "info", "\\u", "by", "\\u", "name_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "get", "\\u", "sample", "\\u", "info", "\\u", "by", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "sample", "\\u", "info", "\\u", "by", "\\u", "name_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "sample", "\\u", "info", "\\u", "by", "\\u", "name_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "char", "\\u", "p_", ",_", "pa", "\\u", "sample", "\\u", "info", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "435", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "sample", "\\u", "info", "\\u", "by", "\\u", "index_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "get", "\\u", "sample", "\\u", "info", "\\u", "by", "\\u", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "sample", "\\u", "info", "\\u", "by", "\\u", "index_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "sample", "\\u", "info", "\\u", "by", "\\u", "index_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "pa", "\\u", "sample", "\\u", "info", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "438", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "sample", "\\u", "info", "\\u", "list_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "get", "\\u", "sample", "\\u", "info", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "sample", "\\u", "info", "\\u", "list_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "sample", "\\u", "info", "\\u", "list_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "pa", "\\u", "sample", "\\u", "info", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "441", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "kill", "\\u", "client_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "kill", "\\u", "client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "kill", "\\u", "client_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "kill", "\\u", "client_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "444_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "kill", "\\u", "sink", "\\u", "input_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "kill", "\\u", "sink", "\\u", "input_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "kill", "\\u", "sink", "\\u", "input_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "kill", "\\u", "sink", "\\u", "input_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "447", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "kill", "\\u", "source", "\\u", "output_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "kill", "\\u", "source", "\\u", "output_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "kill", "\\u", "source", "\\u", "output_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "kill", "\\u", "source", "\\u", "output_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "index", "\\u", "cb", "\\u", "t_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "450_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "453", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "load", "\\u", "module_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "load", "\\u", "module_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "load", "\\u", "module_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "load", "\\u", "module_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "char", "\\u", "p_", ",_", "c\\u", "char", "\\u", "p_", ",_", "pa", "\\u", "context", "\\u", "index", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "456_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "unload", "\\u", "module_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "unload", "\\u", "module_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "unload", "\\u", "module_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "unload", "\\u", "module_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "enum", "\\u", "pa", "\\u", "autoload", "\\u", "type_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "AUTO", "LOAD", "\\u", "SIN", "K_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "AUTO", "LOAD", "\\u", "SOURCE_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "autoload", "\\u", "type", "\\u", "t_", "=_", "enum", "\\u", "pa", "\\u", "autoload", "\\u", "type_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "462", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "autoload", "\\u", "info_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "index", "'_", ",_", "c\\u", "uint32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "name", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "type", "'_", ",_", "pa", "\\u", "autoload", "\\u", "type", "\\u", "t_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "module", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "argu", "ment", "'_", ",_", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "autoload", "\\u", "info_", "=_", "struct", "\\u", "pa", "\\u", "autoload", "\\u", "info_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "471", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "autoload", "\\u", "info", "\\u", "cb", "\\u", "t_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "autoload", "\\u", "info_", ")_", ",_", "c\\u", "int_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "474", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "477", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "autoload", "\\u", "info", "\\u", "by", "\\u", "name_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "get", "\\u", "autoload", "\\u", "info", "\\u", "by", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "autoload", "\\u", "info", "\\u", "by", "\\u", "name_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "autoload", "\\u", "info", "\\u", "by", "\\u", "name_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "char", "\\u", "p_", ",_", "pa", "\\u", "autoload", "\\u", "type", "\\u", "t_", ",_", "pa", "\\u", "autoload", "\\u", "info", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "480_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "autoload", "\\u", "info", "\\u", "by", "\\u", "index_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "get", "\\u", "autoload", "\\u", "info", "\\u", "by", "\\u", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "autoload", "\\u", "info", "\\u", "by", "\\u", "index_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "autoload", "\\u", "info", "\\u", "by", "\\u", "index_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "pa", "\\u", "autoload", "\\u", "info", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "483", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "autoload", "\\u", "info", "\\u", "list_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "get", "\\u", "autoload", "\\u", "info", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "autoload", "\\u", "info", "\\u", "list_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "get", "\\u", "autoload", "\\u", "info", "\\u", "list_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "pa", "\\u", "autoload", "\\u", "info", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "486", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "add", "\\u", "autoload", "_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "add", "\\u", "autoload", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "add", "\\u", "autoload", "_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "add", "\\u", "autoload", "_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "char", "\\u", "p_", ",_", "pa", "\\u", "autoload", "\\u", "type", "\\u", "t_", ",_", "c\\u", "char", "\\u", "p_", ",_", "c\\u", "char", "\\u", "p_", ",_", "pa", "\\u", "context", "\\u", "index", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "489", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "remove", "\\u", "autoload", "\\u", "by", "\\u", "name_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "remove", "\\u", "autoload", "\\u", "by", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "remove", "\\u", "autoload", "\\u", "by", "\\u", "name_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "remove", "\\u", "autoload", "\\u", "by", "\\u", "name_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "char", "\\u", "p_", ",_", "pa", "\\u", "autoload", "\\u", "type", "\\u", "t_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "492", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "remove", "\\u", "autoload", "\\u", "by", "\\u", "index_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "remove", "\\u", "autoload", "\\u", "by", "\\u", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "remove", "\\u", "autoload", "\\u", "by", "\\u", "index_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "remove", "\\u", "autoload", "\\u", "by", "\\u", "index_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "495", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "move", "\\u", "sink", "\\u", "input", "\\u", "by", "\\u", "name_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "move", "\\u", "sink", "\\u", "input", "\\u", "by", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "move", "\\u", "sink", "\\u", "input", "\\u", "by", "\\u", "name_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "move", "\\u", "sink", "\\u", "input", "\\u", "by", "\\u", "name_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "c\\u", "char", "\\u", "p_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "498", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "move", "\\u", "sink", "\\u", "input", "\\u", "by", "\\u", "index_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "move", "\\u", "sink", "\\u", "input", "\\u", "by", "\\u", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "move", "\\u", "sink", "\\u", "input", "\\u", "by", "\\u", "index_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "move", "\\u", "sink", "\\u", "input", "\\u", "by", "\\u", "index_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "c\\u", "uint32_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "501_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "move", "\\u", "source", "\\u", "output", "\\u", "by", "\\u", "name_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "move", "\\u", "source", "\\u", "output", "\\u", "by", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "move", "\\u", "source", "\\u", "output", "\\u", "by", "\\u", "name_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "move", "\\u", "source", "\\u", "output", "\\u", "by", "\\u", "name_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "c\\u", "char", "\\u", "p_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "504_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "move", "\\u", "source", "\\u", "output", "\\u", "by", "\\u", "index_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "move", "\\u", "source", "\\u", "output", "\\u", "by", "\\u", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "move", "\\u", "source", "\\u", "output", "\\u", "by", "\\u", "index_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "move", "\\u", "source", "\\u", "output", "\\u", "by", "\\u", "index_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "c\\u", "uint32_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "507", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "suspend", "\\u", "sink", "\\u", "by", "\\u", "name_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "suspend", "\\u", "sink", "\\u", "by", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "suspend", "\\u", "sink", "\\u", "by", "\\u", "name_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "suspend", "\\u", "sink", "\\u", "by", "\\u", "name_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "char", "\\u", "p_", ",_", "c\\u", "int_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "510", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "suspend", "\\u", "sink", "\\u", "by", "\\u", "index_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "suspend", "\\u", "sink", "\\u", "by", "\\u", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "suspend", "\\u", "sink", "\\u", "by", "\\u", "index_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "suspend", "\\u", "sink", "\\u", "by", "\\u", "index_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "c\\u", "int_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "513", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "suspend", "\\u", "source", "\\u", "by", "\\u", "name_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "suspend", "\\u", "source", "\\u", "by", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "suspend", "\\u", "source", "\\u", "by", "\\u", "name_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "suspend", "\\u", "source", "\\u", "by", "\\u", "name_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "char", "\\u", "p_", ",_", "c\\u", "int_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "introspect", ".", "h", ":", "516", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "suspend", "\\u", "source", "\\u", "by", "\\u", "index_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "suspend", "\\u", "source", "\\u", "by", "\\u", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "suspend", "\\u", "source", "\\u", "by", "\\u", "index_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "suspend", "\\u", "source", "\\u", "by", "\\u", "index_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "uint32_", ",_", "c\\u", "int_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "subscribe", "\\u", "cb", "\\u", "t_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "pa", "\\u", "subscript", "ion", "\\u", "event", "\\u", "type", "\\u", "t_", ",_", "c\\u", "uint32_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "subscribe", ".", "h", ":", "54_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "subscribe", ".", "h", ":", "57_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "subscribe_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "subscribe_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "subscribe_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "subscribe_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "pa", "\\u", "subscript", "ion", "\\u", "mask", "\\u", "t_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "subscribe", ".", "h", ":", "60_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "subscribe", "\\u", "callback_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "set\\u", "subscribe", "\\u", "callback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "subscribe", "\\u", "callback_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "set\\u", "subscribe", "\\u", "callback_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "pa", "\\u", "context", "\\u", "subscribe", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "sca", "che", ".", "h", ":", "83_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "connect", "\\u", "upload_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "connect", "\\u", "upload_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "connect", "\\u", "upload_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "connect", "\\u", "upload_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", ",_", "c\\u", "size", "\\u", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "sca", "che", ".", "h", ":", "87_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "finish", "\\u", "upload_", "=_", "\\u", "lib_", "._", "pa", "\\u", "stream", "\\u", "finish", "\\u", "upload_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "finish", "\\u", "upload_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "stream", "\\u", "finish", "\\u", "upload_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "stream_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "sca", "che", ".", "h", ":", "90_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "play", "\\u", "sample_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "play", "\\u", "sample_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "play", "\\u", "sample_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "play", "\\u", "sample_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "char", "\\u", "p_", ",_", "c\\u", "char", "\\u", "p_", ",_", "pa", "\\u", "volume", "\\u", "t_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "sca", "che", ".", "h", ":", "99_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "context", "\\u", "remove", "\\u", "sample_", "=_", "\\u", "lib_", "._", "pa", "\\u", "context", "\\u", "remove", "\\u", "sample_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "remove", "\\u", "sample_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "operation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "context", "\\u", "remove", "\\u", "sample_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "context_", ")_", ",_", "c\\u", "char", "\\u", "p_", ",_", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "version", ".", "h", ":", "43_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "get", "\\u", "librar", "y", "\\u", "version_", "=_", "\\u", "lib_", "._", "pa", "\\u", "get", "\\u", "librar", "y", "\\u", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "get", "\\u", "librar", "y", "\\u", "version_", "._", "restype_", "=_", "c\\u", "char", "\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "get", "\\u", "librar", "y", "\\u", "version_", "._", "argtypes_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "PA", "\\u", "API", "\\u", "VERSION_", "=_", "11_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "version", ".", "h", ":", "48_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "PROTOCOL", "\\u", "VERSION_", "=_", "12_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "version", ".", "h", ":", "52_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "error", ".", "h", ":", "37_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "strerror_", "=_", "\\u", "lib_", "._", "pa", "\\u", "strerror_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "strerror_", "._", "restype_", "=_", "c\\u", "char", "\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "strerror_", "._", "argtypes_", "=_", "[_", "c\\u", "int_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "xma", "lloc", ".", "h", ":", "40_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "xma", "lloc", "_", "=_", "\\u", "lib_", "._", "pa", "\\u", "xma", "lloc", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "xma", "lloc", "_", "._", "restype_", "=_", "POINTER_", "(_", "c\\u", "void_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "xma", "lloc", "_", "._", "argtypes_", "=_", "[_", "c\\u", "size", "\\u", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "xma", "lloc", ".", "h", ":", "43_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "xma", "lloc", "0_", "=_", "\\u", "lib_", "._", "pa", "\\u", "xma", "lloc", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "xma", "lloc", "0_", "._", "restype_", "=_", "POINTER_", "(_", "c\\u", "void_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "xma", "lloc", "0_", "._", "argtypes_", "=_", "[_", "c\\u", "size", "\\u", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "xma", "lloc", ".", "h", ":", "46_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "xre", "alloc_", "=_", "\\u", "lib_", "._", "pa", "\\u", "xre", "alloc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "xre", "alloc_", "._", "restype_", "=_", "POINTER_", "(_", "c\\u", "void_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "xre", "alloc_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "None_", ")_", ",_", "c\\u", "size", "\\u", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "xma", "lloc", ".", "h", ":", "49_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "xf", "ree_", "=_", "\\u", "lib_", "._", "pa", "\\u", "xf", "ree_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "xf", "ree_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "xf", "ree_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "xma", "lloc", ".", "h", ":", "52_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "xst", "rd", "up_", "=_", "\\u", "lib_", "._", "pa", "\\u", "xst", "rd", "up_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "xst", "rd", "up_", "._", "restype_", "=_", "c\\u", "char", "\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "xst", "rd", "up_", "._", "argtypes_", "=_", "[_", "c\\u", "char", "\\u", "p_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "xma", "lloc", ".", "h", ":", "55_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "xst", "rnd", "up_", "=_", "\\u", "lib_", "._", "pa", "\\u", "xst", "rnd", "up_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "xst", "rnd", "up_", "._", "restype_", "=_", "c\\u", "char", "\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "xst", "rnd", "up_", "._", "argtypes_", "=_", "[_", "c\\u", "char", "\\u", "p_", ",_", "c\\u", "size", "\\u", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "xma", "lloc", ".", "h", ":", "58_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "xm", "em", "dup_", "=_", "\\u", "lib_", "._", "pa", "\\u", "xm", "em", "dup_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "xm", "em", "dup_", "._", "restype_", "=_", "POINTER_", "(_", "c\\u", "void_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "xm", "em", "dup_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "None_", ")_", ",_", "c\\u", "size", "\\u", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "utf", "8", ".", "h", ":", "37_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "utf", "8", "\\u", "valid_", "=_", "\\u", "lib_", "._", "pa", "\\u", "utf", "8", "\\u", "valid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "utf", "8", "\\u", "valid_", "._", "restype_", "=_", "c\\u", "char", "\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "utf", "8", "\\u", "valid_", "._", "argtypes_", "=_", "[_", "c\\u", "char", "\\u", "p_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "utf", "8", ".", "h", ":", "40_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "utf", "8", "\\u", "filter_", "=_", "\\u", "lib_", "._", "pa", "\\u", "utf", "8", "\\u", "filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "utf", "8", "\\u", "filter_", "._", "restype_", "=_", "c\\u", "char", "\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "utf", "8", "\\u", "filter_", "._", "argtypes_", "=_", "[_", "c\\u", "char", "\\u", "p_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "utf", "8", ".", "h", ":", "43_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "utf", "8", "\\u", "to", "\\u", "locale_", "=_", "\\u", "lib_", "._", "pa", "\\u", "utf", "8", "\\u", "to", "\\u", "locale_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "utf", "8", "\\u", "to", "\\u", "locale_", "._", "restype_", "=_", "c\\u", "char", "\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "utf", "8", "\\u", "to", "\\u", "locale_", "._", "argtypes_", "=_", "[_", "c\\u", "char", "\\u", "p_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "utf", "8", ".", "h", ":", "46_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "locale", "\\u", "to", "\\u", "utf8_", "=_", "\\u", "lib_", "._", "pa", "\\u", "locale", "\\u", "to", "\\u", "utf8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "locale", "\\u", "to", "\\u", "utf8_", "._", "restype_", "=_", "c\\u", "char", "\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "locale", "\\u", "to", "\\u", "utf8_", "._", "argtypes_", "=_", "[_", "c\\u", "char", "\\u", "p_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "threaded", "\\u", "mainloop_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "threaded", "\\u", "mainloop_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainloop_", "=_", "struct", "\\u", "pa", "\\u", "threaded", "\\u", "mainloop_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "thread", "-", "mainl", "oop", ".", "h", ":", "242_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "thread", "-", "mainl", "oop", ".", "h", ":", "247_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "new_", "=_", "\\u", "lib_", "._", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "new_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "new_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "threaded", "\\u", "mainloop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "new_", "._", "argtypes_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "thread", "-", "mainl", "oop", ".", "h", ":", "252_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "free_", "=_", "\\u", "lib_", "._", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "free_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "free_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "free_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "threaded", "\\u", "mainloop_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "thread", "-", "mainl", "oop", ".", "h", ":", "255_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "start_", "=_", "\\u", "lib_", "._", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "start_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "start_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "threaded", "\\u", "mainloop_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "thread", "-", "mainl", "oop", ".", "h", ":", "259_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "stop_", "=_", "\\u", "lib_", "._", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "stop_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "stop_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "stop_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "threaded", "\\u", "mainloop_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "thread", "-", "mainl", "oop", ".", "h", ":", "267", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "lock_", "=_", "\\u", "lib_", "._", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "lock_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "lock_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "lock_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "threaded", "\\u", "mainloop_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "thread", "-", "mainl", "oop", ".", "h", ":", "270_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "unlock_", "=_", "\\u", "lib_", "._", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "unlock_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "unlock_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "unlock_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "threaded", "\\u", "mainloop_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "thread", "-", "mainl", "oop", ".", "h", ":", "279", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "wait_", "=_", "\\u", "lib_", "._", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "wait_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "wait_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "wait_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "threaded", "\\u", "mainloop_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "thread", "-", "mainl", "oop", ".", "h", ":", "286", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "signal_", "=_", "\\u", "lib_", "._", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "signal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "signal_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "signal_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "threaded", "\\u", "mainloop_", ")_", ",_", "c\\u", "int_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "thread", "-", "mainl", "oop", ".", "h", ":", "292", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "accept_", "=_", "\\u", "lib_", "._", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "accept_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "accept_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "accept_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "threaded", "\\u", "mainloop_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "thread", "-", "mainl", "oop", ".", "h", ":", "295", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "get", "\\u", "retval_", "=_", "\\u", "lib_", "._", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "get", "\\u", "retval_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "get", "\\u", "retval_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "get", "\\u", "retval_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "threaded", "\\u", "mainloop_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "thread", "-", "mainl", "oop", ".", "h", ":", "298", "_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "get", "\\u", "api_", "=_", "\\u", "lib_", "._", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "get", "\\u", "api_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "get", "\\u", "api_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "mainl", "oop", "\\u", "api_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "get", "\\u", "api_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "threaded", "\\u", "mainloop_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "thread", "-", "mainl", "oop", ".", "h", ":", "301_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "in", "\\u", "thread_", "=_", "\\u", "lib_", "._", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "in", "\\u", "thread_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "in", "\\u", "thread_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "in", "\\u", "thread_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "threaded", "\\u", "mainloop_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "mainloop_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "mainloop_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "mainloop_", "=_", "struct", "\\u", "pa", "\\u", "mainloop_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", ".", "h", ":", "79_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", ".", "h", ":", "82_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "new_", "=_", "\\u", "lib_", "._", "pa", "\\u", "mainl", "oop", "\\u", "new_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "new_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "mainloop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "new_", "._", "argtypes_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", ".", "h", ":", "85_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "free_", "=_", "\\u", "lib_", "._", "pa", "\\u", "mainl", "oop", "\\u", "free_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "free_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "free_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "mainloop_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", ".", "h", ":", "90_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "prepare_", "=_", "\\u", "lib_", "._", "pa", "\\u", "mainl", "oop", "\\u", "prepare_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "prepare_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "prepare_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "mainloop_", ")_", ",_", "c\\u", "int_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", ".", "h", ":", "93_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "poll_", "=_", "\\u", "lib_", "._", "pa", "\\u", "mainl", "oop", "\\u", "poll_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "poll_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "poll_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "mainloop_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", ".", "h", ":", "97_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "dispatch_", "=_", "\\u", "lib_", "._", "pa", "\\u", "mainl", "oop", "\\u", "dispatch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "dispatch_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "dispatch_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "mainloop_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", ".", "h", ":", "100_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "get", "\\u", "retval_", "=_", "\\u", "lib_", "._", "pa", "\\u", "mainl", "oop", "\\u", "get", "\\u", "retval_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "get", "\\u", "retval_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "get", "\\u", "retval_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "mainloop_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", ".", "h", ":", "108_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "iterate_", "=_", "\\u", "lib_", "._", "pa", "\\u", "mainl", "oop", "\\u", "iterate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "iterate_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "iterate_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "mainloop_", ")_", ",_", "c\\u", "int_", ",_", "POINTER_", "(_", "c\\u", "int_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", ".", "h", ":", "111_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "run_", "=_", "\\u", "lib_", "._", "pa", "\\u", "mainl", "oop", "\\u", "run_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "run_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "run_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "mainloop_", ")_", ",_", "POINTER_", "(_", "c\\u", "int_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", ".", "h", ":", "114_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "get", "\\u", "api_", "=_", "\\u", "lib_", "._", "pa", "\\u", "mainl", "oop", "\\u", "get", "\\u", "api_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "get", "\\u", "api_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "mainl", "oop", "\\u", "api_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "get", "\\u", "api_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "mainloop_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", ".", "h", ":", "117_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "quit_", "=_", "\\u", "lib_", "._", "pa", "\\u", "mainl", "oop", "\\u", "quit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "quit_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "quit_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "mainloop_", ")_", ",_", "c\\u", "int_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", ".", "h", ":", "120_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "wake", "up_", "=_", "\\u", "lib_", "._", "pa", "\\u", "mainl", "oop", "\\u", "wake", "up_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "wake", "up_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "wake", "up_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "mainloop_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "poll", "fd_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "poll", "fd_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "poll", "\\u", "func_", "=_", "CFUNCTYPE_", "(_", "c\\u", "int_", ",_", "POINTER_", "(_", "struct", "\\u", "poll", "fd_", ")_", ",_", "c\\u", "ulong_", ",_", "c\\u", "int_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", ".", "h", ":", "123_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", ".", "h", ":", "126_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "set\\u", "poll", "\\u", "func_", "=_", "\\u", "lib_", "._", "pa", "\\u", "mainl", "oop", "\\u", "set\\u", "poll", "\\u", "func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "set\\u", "poll", "\\u", "func_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "mainl", "oop", "\\u", "set\\u", "poll", "\\u", "func_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "mainloop_", ")_", ",_", "pa", "\\u", "poll", "\\u", "func_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", "-", "signal", ".", "h", ":", "43_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "signal", "\\u", "init_", "=_", "\\u", "lib_", "._", "pa", "\\u", "signal", "\\u", "init_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "signal", "\\u", "init_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "signal", "\\u", "init_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "mainl", "oop", "\\u", "api_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", "-", "signal", ".", "h", ":", "46_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "signal", "\\u", "done_", "=_", "\\u", "lib_", "._", "pa", "\\u", "signal", "\\u", "done_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "signal", "\\u", "done_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "signal", "\\u", "done_", "._", "argtypes_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "signal", "\\u", "event_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "pa", "\\u", "signal", "\\u", "event_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "signal", "\\u", "event_", "=_", "struct", "\\u", "pa", "\\u", "signal", "\\u", "event_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", "-", "signal", ".", "h", ":", "49_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", "-", "signal", ".", "h", ":", "52_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "signal", "\\u", "new_", "=_", "\\u", "lib_", "._", "pa", "\\u", "signal", "\\u", "new_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "signal", "\\u", "new_", "._", "restype_", "=_", "POINTER_", "(_", "pa", "\\u", "signal", "\\u", "event_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "signal", "\\u", "new_", "._", "argtypes_", "=_", "[_", "c\\u", "int_", ",_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "mainl", "oop", "\\u", "api_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "signal", "\\u", "event_", ")_", ",_", "c\\u", "int_", ",_", "POINTER_", "(_", "None_", ")_", ")_", ",_", "POINTER_", "(_", "None_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", "-", "signal", ".", "h", ":", "55_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "signal", "\\u", "free_", "=_", "\\u", "lib_", "._", "pa", "\\u", "signal", "\\u", "free_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "signal", "\\u", "free_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "signal", "\\u", "free_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "signal", "\\u", "event_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "mainl", "oop", "-", "signal", ".", "h", ":", "58_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "signal", "\\u", "set\\u", "destroy_", "=_", "\\u", "lib_", "._", "pa", "\\u", "signal", "\\u", "set\\u", "destroy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "signal", "\\u", "set\\u", "destroy_", "._", "restype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "signal", "\\u", "set\\u", "destroy_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "pa", "\\u", "signal", "\\u", "event_", ")_", ",_", "CFUNCTYPE_", "(_", "None_", ",_", "POINTER_", "(_", "pa", "\\u", "mainl", "oop", "\\u", "api_", ")_", ",_", "POINTER_", "(_", "pa", "\\u", "signal", "\\u", "event_", ")_", ",_", "POINTER_", "(_", "None_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "util", ".", "h", ":", "38_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "get", "\\u", "user", "\\u", "name_", "=_", "\\u", "lib_", "._", "pa", "\\u", "get", "\\u", "user", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "get", "\\u", "user", "\\u", "name_", "._", "restype_", "=_", "c\\u", "char", "\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "get", "\\u", "user", "\\u", "name_", "._", "argtypes_", "=_", "[_", "c\\u", "char", "\\u", "p_", ",_", "c\\u", "size", "\\u", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "util", ".", "h", ":", "41_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "get", "\\u", "host", "\\u", "name_", "=_", "\\u", "lib_", "._", "pa", "\\u", "get", "\\u", "host", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "get", "\\u", "host", "\\u", "name_", "._", "restype_", "=_", "c\\u", "char", "\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "get", "\\u", "host", "\\u", "name_", "._", "argtypes_", "=_", "[_", "c\\u", "char", "\\u", "p_", ",_", "c\\u", "size", "\\u", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "util", ".", "h", ":", "44_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "get", "\\u", "fqdn_", "=_", "\\u", "lib_", "._", "pa", "\\u", "get", "\\u", "fqdn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "get", "\\u", "fqdn_", "._", "restype_", "=_", "c\\u", "char", "\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "get", "\\u", "fqdn_", "._", "argtypes_", "=_", "[_", "c\\u", "char", "\\u", "p_", ",_", "c\\u", "size", "\\u", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "util", ".", "h", ":", "47_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "get", "\\u", "home", "\\u", "dir_", "=_", "\\u", "lib_", "._", "pa", "\\u", "get", "\\u", "home", "\\u", "dir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "get", "\\u", "home", "\\u", "dir_", "._", "restype_", "=_", "c\\u", "char", "\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "get", "\\u", "home", "\\u", "dir_", "._", "argtypes_", "=_", "[_", "c\\u", "char", "\\u", "p_", ",_", "c\\u", "size", "\\u", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "util", ".", "h", ":", "51_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "get", "\\u", "binar", "y", "\\u", "name_", "=_", "\\u", "lib_", "._", "pa", "\\u", "get", "\\u", "binar", "y", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "get", "\\u", "binar", "y", "\\u", "name_", "._", "restype_", "=_", "c\\u", "char", "\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "get", "\\u", "binar", "y", "\\u", "name_", "._", "argtypes_", "=_", "[_", "c\\u", "char", "\\u", "p_", ",_", "c\\u", "size", "\\u", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "util", ".", "h", ":", "55_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "path", "\\u", "get", "\\u", "filename_", "=_", "\\u", "lib_", "._", "pa", "\\u", "path", "\\u", "get", "\\u", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "path", "\\u", "get", "\\u", "filename_", "._", "restype_", "=_", "c\\u", "char", "\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "path", "\\u", "get", "\\u", "filename_", "._", "argtypes_", "=_", "[_", "c\\u", "char", "\\u", "p_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "util", ".", "h", ":", "58_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "ms", "lee", "p_", "=_", "\\u", "lib_", "._", "pa", "\\u", "ms", "lee", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "ms", "lee", "p_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "ms", "lee", "p_", "._", "argtypes_", "=_", "[_", "c\\u", "ulong_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "PA", "\\u", "MSE", "C", "\\u", "PER", "\\u", "SEC", "_", "=_", "1000_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "time", "val", ".", "h", ":", "36_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "USE", "C", "\\u", "PER", "\\u", "SEC", "_", "=_", "1000000_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "time", "val", ".", "h", ":", "37_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "NSE", "C", "\\u", "PER", "\\u", "SEC", "_", "=_", "1000000000", "_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "time", "val", ".", "h", ":", "38_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PA", "\\u", "USE", "C", "\\u", "PER", "\\u", "MSE", "C_", "=_", "1000_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "time", "val", ".", "h", ":", "39_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "time", "val_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "time", "val_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "time", "val", ".", "h", ":", "44_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "getti", "meo", "fda", "y_", "=_", "\\u", "lib_", "._", "pa", "\\u", "getti", "meo", "fda", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "getti", "meo", "fda", "y_", "._", "restype_", "=_", "POINTER_", "(_", "struct", "\\u", "time", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "getti", "meo", "fda", "y_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "struct", "\\u", "time", "val_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "time", "val_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "time", "val_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "time", "val", ".", "h", ":", "48_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "time", "val", "\\u", "diff_", "=_", "\\u", "lib_", "._", "pa", "\\u", "time", "val", "\\u", "diff_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "time", "val", "\\u", "diff_", "._", "restype_", "=_", "pa", "\\u", "usec", "\\u", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "time", "val", "\\u", "diff_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "struct", "\\u", "time", "val_", ")_", ",_", "POINTER_", "(_", "struct", "\\u", "time", "val_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "time", "val_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "time", "val_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "time", "val", ".", "h", ":", "51_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "time", "val", "\\u", "cmp_", "=_", "\\u", "lib_", "._", "pa", "\\u", "time", "val", "\\u", "cmp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "time", "val", "\\u", "cmp_", "._", "restype_", "=_", "c\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "time", "val", "\\u", "cmp_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "struct", "\\u", "time", "val_", ")_", ",_", "POINTER_", "(_", "struct", "\\u", "time", "val_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "time", "val_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "time", "val", ".", "h", ":", "54_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "time", "val", "\\u", "age_", "=_", "\\u", "lib_", "._", "pa", "\\u", "time", "val", "\\u", "age_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "time", "val", "\\u", "age_", "._", "restype_", "=_", "pa", "\\u", "usec", "\\u", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "time", "val", "\\u", "age_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "struct", "\\u", "time", "val_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "time", "val_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "time", "val_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "time", "val", ".", "h", ":", "57_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "time", "val", "\\u", "add_", "=_", "\\u", "lib_", "._", "pa", "\\u", "time", "val", "\\u", "add_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "time", "val", "\\u", "add_", "._", "restype_", "=_", "POINTER_", "(_", "struct", "\\u", "time", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "time", "val", "\\u", "add_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "struct", "\\u", "time", "val_", ")_", ",_", "pa", "\\u", "usec", "\\u", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "time", "val_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "time", "val_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "time", "val", ".", "h", ":", "60_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "time", "val", "\\u", "store_", "=_", "\\u", "lib_", "._", "pa", "\\u", "time", "val", "\\u", "store_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "time", "val", "\\u", "store_", "._", "restype_", "=_", "POINTER_", "(_", "struct", "\\u", "time", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "time", "val", "\\u", "store_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "struct", "\\u", "time", "val_", ")_", ",_", "pa", "\\u", "usec", "\\u", "t_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "struct", "\\u", "time", "val_", "._", "\\u", "fields\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\\u", "opaque", "\\u", "struct", "'_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "/", "usr", "/", "include", "/", "pulse", "/", "time", "val", ".", "h", ":", "63_", "\\u\\u\\uNL\\u\\u\\u_", "pa", "\\u", "time", "val", "\\u", "load_", "=_", "\\u", "lib_", "._", "pa", "\\u", "time", "val", "\\u", "load_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "time", "val", "\\u", "load_", "._", "restype_", "=_", "pa", "\\u", "usec", "\\u", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pa", "\\u", "time", "val", "\\u", "load_", "._", "argtypes_", "=_", "[_", "POINTER_", "(_", "struct", "\\u", "time", "val_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "all\\u\\u_", "=_", "[_", "'", "pa", "\\u", "mainl", "oop", "\\u", "api", "'_", ",_", "'", "pa", "\\u", "io", "\\u", "event", "\\u", "flags", "\\u", "t", "'_", ",_", "'", "PA", "\\u", "IO", "\\u", "EVENT", "\\u", "NULL", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "IO", "\\u", "EVENT", "\\u", "INPUT", "'_", ",_", "'", "PA", "\\u", "IO", "\\u", "EVENT", "\\u", "OUTPU", "T", "'_", ",_", "'", "PA", "\\u", "IO", "\\u", "EVENT", "\\u", "HAN", "GU", "P", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "IO", "\\u", "EVENT", "\\u", "ERROR", "'_", ",_", "'", "pa", "\\u", "io", "\\u", "event", "'_", ",_", "'", "pa", "\\u", "io", "\\u", "event", "\\u", "cb", "\\u", "t", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "io", "\\u", "event", "\\u", "destroy", "\\u", "cb", "\\u", "t", "'_", ",_", "'", "pa", "\\u", "time", "\\u", "event", "'_", ",_", "'", "pa", "\\u", "time", "\\u", "event", "\\u", "cb", "\\u", "t", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "time", "\\u", "event", "\\u", "destroy", "\\u", "cb", "\\u", "t", "'_", ",_", "'", "pa", "\\u", "defer", "\\u", "event", "'_", ",_", "'", "pa", "\\u", "defer", "\\u", "event", "\\u", "cb", "\\u", "t", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "defer", "\\u", "event", "\\u", "destroy", "\\u", "cb", "\\u", "t", "'_", ",_", "'", "pa", "\\u", "mainl", "oop", "\\u", "api", "\\u", "onc", "e", "'_", ",_", "'", "PA", "\\u", "CHANNELS", "\\u", "MAX", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "RAT", "E", "\\u", "MAX", "'_", ",_", "'", "pa", "\\u", "sample", "\\u", "format\\u", "t", "'_", ",_", "'", "PA", "\\u", "SAMPLE", "\\u", "U", "8", "'_", ",_", "'", "PA", "\\u", "SAMPLE", "\\u", "AL", "AW", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "SAMPLE", "\\u", "ULA", "W", "'_", ",_", "'", "PA", "\\u", "SAMPLE", "\\u", "S1", "6", "LE", "'_", ",_", "'", "PA", "\\u", "SAMPLE", "\\u", "S1", "6", "BE", "'_", ",_", "'", "PA", "\\u", "SAMPLE", "\\u", "FLOAT", "32", "LE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "SAMPLE", "\\u", "FLOAT", "32", "BE", "'_", ",_", "'", "PA", "\\u", "SAMPLE", "\\u", "S", "32", "LE", "'_", ",_", "'", "PA", "\\u", "SAMPLE", "\\u", "S", "32", "BE", "'_", ",_", "'", "PA", "\\u", "SAMPLE", "\\u", "MAX", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "SAMPLE", "\\u", "INVALID", "'_", ",_", "'", "pa", "\\u", "sample", "\\u", "spec", "'_", ",_", "'", "pa", "\\u", "usec", "\\u", "t", "'_", ",_", "'", "pa", "\\u", "bytes", "\\u", "per", "\\u", "second", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "frame", "\\u", "size", "'_", ",_", "'", "pa", "\\u", "sample", "\\u", "size", "'_", ",_", "'", "pa", "\\u", "bytes", "\\u", "to", "\\u", "usec", "'_", ",_", "'", "pa", "\\u", "usec", "\\u", "to", "\\u", "bytes", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "sample", "\\u", "spec", "\\u", "valid", "'_", ",_", "'", "pa", "\\u", "sample", "\\u", "spec", "\\u", "equal", "'_", ",_", "'", "pa", "\\u", "sample", "\\u", "format\\u", "to", "\\u", "string", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "parse", "\\u", "sample", "\\u", "format", "'_", ",_", "'", "PA", "\\u", "SAMPLE", "\\u", "SPEC", "\\u", "SN", "PRINT", "\\u", "MAX", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "sample", "\\u", "spec", "\\u", "snp", "rint", "'_", ",_", "'", "pa", "\\u", "bytes", "\\u", "snp", "rint", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "state", "\\u", "t", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CONTE", "XT", "\\u", "UNC", "ON", "NE", "CT", "ED", "'_", ",_", "'", "PA", "\\u", "CONTE", "XT", "\\u", "CONNECT", "ING", "'_", ",_", "'", "PA", "\\u", "CONTE", "XT", "\\u", "AUTHORI", "ZI", "NG", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CONTE", "XT", "\\u", "SETTING", "\\u", "NAME", "'_", ",_", "'", "PA", "\\u", "CONTE", "XT", "\\u", "READY", "'_", ",_", "'", "PA", "\\u", "CONTE", "XT", "\\u", "FAIL", "ED", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CONTE", "XT", "\\u", "TERMINAT", "ED", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "state", "\\u", "t", "'_", ",_", "'", "PA", "\\u", "STRE", "AM", "\\u", "UNC", "ON", "NE", "CT", "ED", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "STRE", "AM", "\\u", "CREATI", "NG", "'_", ",_", "'", "PA", "\\u", "STRE", "AM", "\\u", "READY", "'_", ",_", "'", "PA", "\\u", "STRE", "AM", "\\u", "FAIL", "ED", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "STRE", "AM", "\\u", "TERMINAT", "ED", "'_", ",_", "'", "pa", "\\u", "operati", "on", "\\u", "state", "\\u", "t", "'_", ",_", "'", "PA", "\\u", "OPERATION", "\\u", "RUNN", "ING", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "OPERATION", "\\u", "DON", "E", "'_", ",_", "'", "PA", "\\u", "OPERATION", "\\u", "CANCEL", "ED", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "flags", "\\u", "t", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CONTE", "XT", "\\u", "NO", "AUTOS", "PA", "WN", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "direction", "\\u", "t", "'_", ",_", "'", "PA", "\\u", "STRE", "AM", "\\u", "NOD", "IRE", "CTION", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "STRE", "AM", "\\u", "PLAY", "BACK", "'_", ",_", "'", "PA", "\\u", "STRE", "AM", "\\u", "RECORD", "'_", ",_", "'", "PA", "\\u", "STRE", "AM", "\\u", "UPLOAD", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "stream", "\\u", "flags", "\\u", "t", "'_", ",_", "'", "PA", "\\u", "STRE", "AM", "\\u", "START", "\\u", "COR", "KE", "D", "'_", ",_", "'", "PA", "\\u", "STRE", "AM", "\\u", "INTER", "POL", "ATE", "\\u", "TI", "MIN", "G", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "STRE", "AM", "\\u", "NOT", "\\u", "MON", "OT", "ON", "OUS", "'_", ",_", "'", "PA", "\\u", "STRE", "AM", "\\u", "AUTO", "\\u", "TI", "MIN", "G", "\\u", "UPDATE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "STRE", "AM", "\\u", "NO", "\\u", "REM", "AP", "\\u", "CHANNELS", "'_", ",_", "'", "PA", "\\u", "STRE", "AM", "\\u", "NO", "\\u", "REM", "IX", "\\u", "CHANNELS", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "STRE", "AM", "\\u", "FIX", "\\u", "FORMAT", "'_", ",_", "'", "PA", "\\u", "STRE", "AM", "\\u", "FIX", "\\u", "RAT", "E", "'_", ",_", "'", "PA", "\\u", "STRE", "AM", "\\u", "FIX", "\\u", "CHANNELS", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "STRE", "AM", "\\u", "DON", "T", "\\u", "MOVE", "'_", ",_", "'", "PA", "\\u", "STRE", "AM", "\\u", "VARIABLE", "\\u", "RAT", "E", "'_", ",_", "'", "pa", "\\u", "buffer", "\\u", "attr", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "subscript", "ion", "\\u", "mask", "\\u", "t", "'_", ",_", "'", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "MASK", "\\u", "NULL", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "MASK", "\\u", "SIN", "K", "'_", ",_", "'", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "MASK", "\\u", "SOU", "RC", "E", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "MASK", "\\u", "SIN", "K", "\\u", "INPUT", "'_", ",_", "'", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "MASK", "\\u", "SOU", "RC", "E", "\\u", "OUTPU", "T", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "MASK", "\\u", "MODUL", "E", "'_", ",_", "'", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "MASK", "\\u", "CLIENT", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "MASK", "\\u", "SAMPLE", "\\u", "CACHE", "'_", ",_", "'", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "MASK", "\\u", "SERVER", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "MASK", "\\u", "AUTO", "LOAD", "'_", ",_", "'", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "MASK", "\\u", "ALL", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "subscript", "ion", "\\u", "event", "\\u", "type", "\\u", "t", "'_", ",_", "'", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "SIN", "K", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "SOU", "RC", "E", "'_", ",_", "'", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "SIN", "K", "\\u", "INPUT", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "SOU", "RC", "E", "\\u", "OUTPU", "T", "'_", ",_", "'", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "MODUL", "E", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "CLIENT", "'_", ",_", "'", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "SAMPLE", "\\u", "CACHE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "SERVER", "'_", ",_", "'", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "AUTO", "LOAD", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "FAC", "ILI", "TY", "\\u", "MASK", "'_", ",_", "'", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "NEW", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "CHANGE", "'_", ",_", "'", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "REMOVE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "SUBSCRI", "PTION", "\\u", "EVENT", "\\u", "TYPE", "\\u", "MASK", "'_", ",_", "'", "pa", "\\u", "tim", "ing", "\\u", "info", "'_", ",_", "'", "pa", "\\u", "spawn", "\\u", "api", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "seek", "\\u", "mode", "\\u", "t", "'_", ",_", "'", "PA", "\\u", "SEE", "K", "\\u", "RELAT", "IV", "E", "'_", ",_", "'", "PA", "\\u", "SEE", "K", "\\u", "ABS", "OLUT", "E", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "SEE", "K", "\\u", "RELAT", "IV", "E", "\\u", "ON", "\\u", "READ", "'_", ",_", "'", "PA", "\\u", "SEE", "K", "\\u", "RELAT", "IV", "E", "\\u", "END", "'_", ",_", "'", "pa", "\\u", "sink", "\\u", "flags", "\\u", "t", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "SIN", "K", "\\u", "HW", "\\u", "VOLUM", "E", "\\u", "CTR", "L", "'_", ",_", "'", "PA", "\\u", "SIN", "K", "\\u", "LATE", "NCY", "'_", ",_", "'", "PA", "\\u", "SIN", "K", "\\u", "HARD", "WARE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "SIN", "K", "\\u", "NET", "WORK", "'_", ",_", "'", "pa", "\\u", "source", "\\u", "flags", "\\u", "t", "'_", ",_", "'", "PA", "\\u", "SOU", "RC", "E", "\\u", "HW", "\\u", "VOLUM", "E", "\\u", "CTR", "L", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "SOU", "RC", "E", "\\u", "LATE", "NCY", "'_", ",_", "'", "PA", "\\u", "SOU", "RC", "E", "\\u", "HARD", "WARE", "'_", ",_", "'", "PA", "\\u", "SOU", "RC", "E", "\\u", "NET", "WORK", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "free", "\\u", "cb", "\\u", "t", "'_", ",_", "'", "pa", "\\u", "operati", "on", "'_", ",_", "'", "pa", "\\u", "operati", "on", "\\u", "ref", "'_", ",_", "'", "pa", "\\u", "operati", "on", "\\u", "unre", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "operati", "on", "\\u", "cancel", "'_", ",_", "'", "pa", "\\u", "operati", "on", "\\u", "get", "\\u", "state", "'_", ",_", "'", "pa", "\\u", "context", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "notif", "y", "\\u", "cb", "\\u", "t", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "success", "\\u", "cb", "\\u", "t", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "new", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "unre", "f", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "ref", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "set\\u", "state", "\\u", "callback", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "errno", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "is", "\\u", "pend", "ing", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "get", "\\u", "state", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "connect", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "discon", "nect", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "drain", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "exit", "\\u", "daemon", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "set\\u", "default", "\\u", "sink", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "set\\u", "default", "\\u", "source", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "is", "\\u", "local", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "set\\u", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "get", "\\u", "server", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "get", "\\u", "protoc", "ol", "\\u", "version", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "get", "\\u", "server", "\\u", "protoc", "ol", "\\u", "version", "'_", ",_", "'", "pa", "\\u", "channel", "\\u", "position", "\\u", "t", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "INVALID", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "MON", "O", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "LEF", "T", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "RIG", "HT", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "CENTER", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "FRONT", "\\u", "LEF", "T", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "FRONT", "\\u", "RIG", "HT", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "FRONT", "\\u", "CENTER", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "REA", "R", "\\u", "CENTER", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "REA", "R", "\\u", "LEF", "T", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "REA", "R", "\\u", "RIG", "HT", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "LF", "E", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "SUB", "WO", "OF", "ER", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "FRONT", "\\u", "LEF", "T", "\\u", "OF", "\\u", "CENTER", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "FRONT", "\\u", "RIG", "HT", "\\u", "OF", "\\u", "CENTER", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "SIDE", "\\u", "LEF", "T", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "SIDE", "\\u", "RIG", "HT", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "1", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "3", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "5", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "7", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "9", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "10", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "11", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "1", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "13", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "14", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "15", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "16", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "1", "7", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "1", "8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "1", "9", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "20", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "21", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "2", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "23", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "24", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "25", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "2", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "2", "7", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "2", "8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "2", "9", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "30", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "AUX", "3", "1", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "TOP", "\\u", "CENTER", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "TOP", "\\u", "FRONT", "\\u", "LEF", "T", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "TOP", "\\u", "FRONT", "\\u", "RIG", "HT", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "TOP", "\\u", "FRONT", "\\u", "CENTER", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "TOP", "\\u", "REA", "R", "\\u", "LEF", "T", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "TOP", "\\u", "REA", "R", "\\u", "RIG", "HT", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "TOP", "\\u", "REA", "R", "\\u", "CENTER", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "POSITION", "\\u", "MAX", "'_", ",_", "'", "pa", "\\u", "channel", "\\u", "map", "\\u", "def", "\\u", "t", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "MAP", "\\u", "AI", "FF", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "MAP", "\\u", "ALS", "A", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "MAP", "\\u", "AUX", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "MAP", "\\u", "WAVE", "EX", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "MAP", "\\u", "OSS", "'_", ",_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "MAP", "\\u", "DEF", "AUL", "T", "'_", ",_", "'", "pa", "\\u", "channel", "\\u", "map", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "channel", "\\u", "map", "\\u", "init", "'_", ",_", "'", "pa", "\\u", "channel", "\\u", "map", "\\u", "init", "\\u", "mono", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "channel", "\\u", "map", "\\u", "init", "\\u", "stereo", "'_", ",_", "'", "pa", "\\u", "channel", "\\u", "map", "\\u", "init", "\\u", "auto", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "channel", "\\u", "position", "\\u", "to", "\\u", "string", "'_", ",_", "'", "pa", "\\u", "channel", "\\u", "position", "\\u", "to", "\\u", "pretty", "\\u", "string", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "CHAN", "NEL", "\\u", "MAP", "\\u", "SN", "PRINT", "\\u", "MAX", "'_", ",_", "'", "pa", "\\u", "channel", "\\u", "map", "\\u", "snp", "rint", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "channel", "\\u", "map", "\\u", "parse", "'_", ",_", "'", "pa", "\\u", "channel", "\\u", "map", "\\u", "equal", "'_", ",_", "'", "pa", "\\u", "channel", "\\u", "map", "\\u", "valid", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "volume", "\\u", "t", "'_", ",_", "'", "PA", "\\u", "VOLUM", "E", "\\u", "NORM", "'_", ",_", "'", "PA", "\\u", "VOLUM", "E", "\\u", "MUT", "ED", "'_", ",_", "'", "pa", "\\u", "cv", "olume", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "cv", "olume", "\\u", "equal", "'_", ",_", "'", "pa", "\\u", "cv", "olume", "\\u", "set", "'_", ",_", "'", "PA", "\\u", "CV", "OL", "UM", "E", "\\u", "SN", "PRINT", "\\u", "MAX", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "cv", "olume", "\\u", "snp", "rint", "'_", ",_", "'", "pa", "\\u", "cv", "olume", "\\u", "avg", "'_", ",_", "'", "pa", "\\u", "cv", "olume", "\\u", "valid", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "cv", "olume", "\\u", "channel", "s", "\\u", "equal", "\\u", "to", "'_", ",_", "'", "pa", "\\u", "sw", "\\u", "volume", "\\u", "multipl", "y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "sw", "\\u", "cv", "olume", "\\u", "multipl", "y", "'_", ",_", "'", "pa", "\\u", "sw", "\\u", "volume", "\\u", "from", "\\u", "d", "B", "'_", ",_", "'", "pa", "\\u", "sw", "\\u", "volume", "\\u", "to", "\\u", "d", "B", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "sw", "\\u", "volume", "\\u", "from", "\\u", "linear", "'_", ",_", "'", "pa", "\\u", "sw", "\\u", "volume", "\\u", "to", "\\u", "linear", "'_", ",_", "'", "PA", "\\u", "DEC", "IB", "EL", "\\u", "MINI", "NF", "TY", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "stream", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "success", "\\u", "cb", "\\u", "t", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "request", "\\u", "cb", "\\u", "t", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "stream", "\\u", "notif", "y", "\\u", "cb", "\\u", "t", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "new", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "unre", "f", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "ref", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "stream", "\\u", "get", "\\u", "state", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "get", "\\u", "context", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "get", "\\u", "index", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "stream", "\\u", "get", "\\u", "device", "\\u", "index", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "get", "\\u", "device", "\\u", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "stream", "\\u", "is", "\\u", "suspended", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "connect", "\\u", "playback", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "stream", "\\u", "connect", "\\u", "record", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "discon", "nect", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "write", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "stream", "\\u", "peek", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "drop", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "writ", "able", "\\u", "size", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "stream", "\\u", "reada", "ble", "\\u", "size", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "drain", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "update", "\\u", "tim", "ing", "\\u", "info", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "stream", "\\u", "set\\u", "state", "\\u", "callback", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "set\\u", "write", "\\u", "callback", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "stream", "\\u", "set\\u", "read", "\\u", "callback", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "set\\u", "overflow", "\\u", "callback", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "stream", "\\u", "set\\u", "under", "flow", "\\u", "callback", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "set\\u", "latenc", "y", "\\u", "update", "\\u", "callback", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "stream", "\\u", "set\\u", "moved", "\\u", "callback", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "set\\u", "suspended", "\\u", "callback", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "stream", "\\u", "cor", "k", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "flush", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "pre", "buf", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "trigger", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "stream", "\\u", "set\\u", "name", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "get", "\\u", "time", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "get", "\\u", "latenc", "y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "stream", "\\u", "get", "\\u", "tim", "ing", "\\u", "info", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "get", "\\u", "sample", "\\u", "spec", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "stream", "\\u", "get", "\\u", "channel", "\\u", "map", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "get", "\\u", "buffer", "\\u", "attr", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "stream", "\\u", "set\\u", "buffer", "\\u", "attr", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "update", "\\u", "sample", "\\u", "rate", "'_", ",_", "'", "pa", "\\u", "sink", "\\u", "info", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "sink", "\\u", "info", "\\u", "cb", "\\u", "t", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "get", "\\u", "sink", "\\u", "info", "\\u", "by", "\\u", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "get", "\\u", "sink", "\\u", "info", "\\u", "by", "\\u", "index", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "get", "\\u", "sink", "\\u", "info", "\\u", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "source", "\\u", "info", "'_", ",_", "'", "pa", "\\u", "source", "\\u", "info", "\\u", "cb", "\\u", "t", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "get", "\\u", "source", "\\u", "info", "\\u", "by", "\\u", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "get", "\\u", "source", "\\u", "info", "\\u", "by", "\\u", "index", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "get", "\\u", "source", "\\u", "info", "\\u", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "server", "\\u", "info", "'_", ",_", "'", "pa", "\\u", "server", "\\u", "info", "\\u", "cb", "\\u", "t", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "get", "\\u", "server", "\\u", "info", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "module", "\\u", "info", "'_", ",_", "'", "pa", "\\u", "module", "\\u", "info", "\\u", "cb", "\\u", "t", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "get", "\\u", "module", "\\u", "info", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "get", "\\u", "module", "\\u", "info", "\\u", "list", "'_", ",_", "'", "pa", "\\u", "client", "\\u", "info", "'_", ",_", "'", "pa", "\\u", "client", "\\u", "info", "\\u", "cb", "\\u", "t", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "get", "\\u", "client", "\\u", "info", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "get", "\\u", "client", "\\u", "info", "\\u", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "sink", "\\u", "input", "\\u", "info", "'_", ",_", "'", "pa", "\\u", "sink", "\\u", "input", "\\u", "info", "\\u", "cb", "\\u", "t", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "get", "\\u", "sink", "\\u", "input", "\\u", "info", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "get", "\\u", "sink", "\\u", "input", "\\u", "info", "\\u", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "source", "\\u", "output", "\\u", "info", "'_", ",_", "'", "pa", "\\u", "source", "\\u", "output", "\\u", "info", "\\u", "cb", "\\u", "t", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "get", "\\u", "source", "\\u", "output", "\\u", "info", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "get", "\\u", "source", "\\u", "output", "\\u", "info", "\\u", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "volume", "\\u", "by", "\\u", "index", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "volume", "\\u", "by", "\\u", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "mute", "\\u", "by", "\\u", "index", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "mute", "\\u", "by", "\\u", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "input", "\\u", "volume", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "set\\u", "sink", "\\u", "input", "\\u", "mute", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "set\\u", "source", "\\u", "volume", "\\u", "by", "\\u", "index", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "set\\u", "source", "\\u", "volume", "\\u", "by", "\\u", "name", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "set\\u", "source", "\\u", "mute", "\\u", "by", "\\u", "index", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "set\\u", "source", "\\u", "mute", "\\u", "by", "\\u", "name", "'_", ",_", "'", "pa", "\\u", "stat", "\\u", "info", "'_", ",_", "'", "pa", "\\u", "stat", "\\u", "info", "\\u", "cb", "\\u", "t", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "stat", "'_", ",_", "'", "pa", "\\u", "sample", "\\u", "info", "'_", ",_", "'", "pa", "\\u", "sample", "\\u", "info", "\\u", "cb", "\\u", "t", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "get", "\\u", "sample", "\\u", "info", "\\u", "by", "\\u", "name", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "get", "\\u", "sample", "\\u", "info", "\\u", "by", "\\u", "index", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "get", "\\u", "sample", "\\u", "info", "\\u", "list", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "kill", "\\u", "client", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "kill", "\\u", "sink", "\\u", "input", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "kill", "\\u", "source", "\\u", "output", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "index", "\\u", "cb", "\\u", "t", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "load", "\\u", "module", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "unload", "\\u", "module", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "autoload", "\\u", "type", "\\u", "t", "'_", ",_", "'", "PA", "\\u", "AUTO", "LOAD", "\\u", "SIN", "K", "'_", ",_", "'", "PA", "\\u", "AUTO", "LOAD", "\\u", "SOU", "RC", "E", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "autoload", "\\u", "info", "'_", ",_", "'", "pa", "\\u", "autoload", "\\u", "info", "\\u", "cb", "\\u", "t", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "get", "\\u", "autoload", "\\u", "info", "\\u", "by", "\\u", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "get", "\\u", "autoload", "\\u", "info", "\\u", "by", "\\u", "index", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "get", "\\u", "autoload", "\\u", "info", "\\u", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "add", "\\u", "autoload", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "remove", "\\u", "autoload", "\\u", "by", "\\u", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "remove", "\\u", "autoload", "\\u", "by", "\\u", "index", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "move", "\\u", "sink", "\\u", "input", "\\u", "by", "\\u", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "move", "\\u", "sink", "\\u", "input", "\\u", "by", "\\u", "index", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "move", "\\u", "source", "\\u", "output", "\\u", "by", "\\u", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "move", "\\u", "source", "\\u", "output", "\\u", "by", "\\u", "index", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "suspend", "\\u", "sink", "\\u", "by", "\\u", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "suspend", "\\u", "sink", "\\u", "by", "\\u", "index", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "suspend", "\\u", "source", "\\u", "by", "\\u", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "suspend", "\\u", "source", "\\u", "by", "\\u", "index", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "subscribe", "\\u", "cb", "\\u", "t", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "subscribe", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "set\\u", "subscribe", "\\u", "callback", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "stream", "\\u", "connect", "\\u", "upload", "'_", ",_", "'", "pa", "\\u", "stream", "\\u", "finish", "\\u", "upload", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "context", "\\u", "play", "\\u", "sample", "'_", ",_", "'", "pa", "\\u", "context", "\\u", "remove", "\\u", "sample", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "get", "\\u", "librar", "y", "\\u", "version", "'_", ",_", "'", "PA", "\\u", "API", "\\u", "VERSI", "ON", "'_", ",_", "'", "PA", "\\u", "PROTOCOL", "\\u", "VERSI", "ON", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "stre", "rror", "'_", ",_", "'", "pa", "\\u", "xma", "lloc", "'_", ",_", "'", "pa", "\\u", "xma", "lloc", "0", "'_", ",_", "'", "pa", "\\u", "xre", "allo", "c", "'_", ",_", "'", "pa", "\\u", "xf", "ree", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "xst", "rd", "up", "'_", ",_", "'", "pa", "\\u", "xst", "rnd", "up", "'_", ",_", "'", "pa", "\\u", "xm", "em", "dup", "'_", ",_", "'", "pa", "\\u", "utf", "8", "\\u", "valid", "'_", ",_", "'", "pa", "\\u", "utf", "8", "\\u", "filter", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "utf", "8", "\\u", "to", "\\u", "locale", "'_", ",_", "'", "pa", "\\u", "locale", "\\u", "to", "\\u", "utf", "8", "'_", ",_", "'", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "new", "'_", ",_", "'", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "free", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "start", "'_", ",_", "'", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "stop", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "lock", "'_", ",_", "'", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "unlock", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "wait", "'_", ",_", "'", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "signal", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "accept", "'_", ",_", "'", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "get", "\\u", "ret", "val", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "get", "\\u", "api", "'_", ",_", "'", "pa", "\\u", "threaded", "\\u", "mainl", "oop", "\\u", "in", "\\u", "thread", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "mainl", "oop", "'_", ",_", "'", "pa", "\\u", "mainl", "oop", "\\u", "new", "'_", ",_", "'", "pa", "\\u", "mainl", "oop", "\\u", "free", "'_", ",_", "'", "pa", "\\u", "mainl", "oop", "\\u", "prepar", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "mainl", "oop", "\\u", "poll", "'_", ",_", "'", "pa", "\\u", "mainl", "oop", "\\u", "dispatch", "'_", ",_", "'", "pa", "\\u", "mainl", "oop", "\\u", "get", "\\u", "ret", "val", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "mainl", "oop", "\\u", "iterate", "'_", ",_", "'", "pa", "\\u", "mainl", "oop", "\\u", "run", "'_", ",_", "'", "pa", "\\u", "mainl", "oop", "\\u", "get", "\\u", "api", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "mainl", "oop", "\\u", "quit", "'_", ",_", "'", "pa", "\\u", "mainl", "oop", "\\u", "wake", "up", "'_", ",_", "'", "pa", "\\u", "poll", "\\u", "func", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "mainl", "oop", "\\u", "set\\u", "poll", "\\u", "func", "'_", ",_", "'", "pa", "\\u", "signal", "\\u", "init", "'_", ",_", "'", "pa", "\\u", "signal", "\\u", "don", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "signal", "\\u", "event", "'_", ",_", "'", "pa", "\\u", "signal", "\\u", "new", "'_", ",_", "'", "pa", "\\u", "signal", "\\u", "free", "'_", ",_", "'", "pa", "\\u", "signal", "\\u", "set\\u", "destroy", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "get", "\\u", "user", "\\u", "name", "'_", ",_", "'", "pa", "\\u", "get", "\\u", "host", "\\u", "name", "'_", ",_", "'", "pa", "\\u", "get", "\\u", "fq", "dn", "'_", ",_", "'", "pa", "\\u", "get", "\\u", "home", "\\u", "dir", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "get", "\\u", "binar", "y", "\\u", "name", "'_", ",_", "'", "pa", "\\u", "path", "\\u", "get", "\\u", "filename", "'_", ",_", "'", "pa", "\\u", "ms", "lee", "p", "'_", ",_", "'", "PA", "\\u", "MSE", "C", "\\u", "PER", "\\u", "SEC", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PA", "\\u", "USE", "C", "\\u", "PER", "\\u", "SEC", "'_", ",_", "'", "PA", "\\u", "NSE", "C", "\\u", "PER", "\\u", "SEC", "'_", ",_", "'", "PA", "\\u", "USE", "C", "\\u", "PER", "\\u", "MSE", "C", "'_", ",_", "'", "pa", "\\u", "getti", "meo", "fda", "y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "time", "val", "\\u", "diff", "'_", ",_", "'", "pa", "\\u", "time", "val", "\\u", "cmp", "'_", ",_", "'", "pa", "\\u", "time", "val", "\\u", "age", "'_", ",_", "'", "pa", "\\u", "time", "val", "\\u", "add", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pa", "\\u", "time", "val", "\\u", "store", "'_", ",_", "'", "pa", "\\u", "time", "val", "\\u", "load", "'_", "]_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
zrong/wpcmd/wpcmd/__init__.py
[ { "content": "#########################################\n# __init__.py\n#\n# Author zrong(zengrong.net)\n# Creation 2014-11-18\n# Modification 2015-11-22\n#########################################\n\nimport sys\nimport os\nimport logging\nimport importlib\nimport argparse\n\n__all__ = ['util', 'new', 'show', 'update']\n__version__ = '0.2.0'\n\ntry:\n import rookout\nexcept ImportError:\n sys.path.insert(0, os.getenv('rookout'))\n\nfrom rookout import slog, add_log_handler\nfrom wpcmd.base import (Conf, TermCache)\n\nadd_log_handler(slog,\n handler=logging.StreamHandler(sys.stdout),\n debug=logging.DEBUG)\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class WPError(Exception):\n pass", "metadata": "root.WPError", "header": "['module', '___EOS___']", "index": 29 }, { "content": "def check_args(argv=None):\n parser = argparse.ArgumentParser(prog='wpcmd')\n parser.add_argument('-v', '--version', action='store_true',\n help='Show version of wpcmd.')\n subParsers = parser.add_subparsers(dest='sub_name', help='sub-commands')\n\n put = subParsers.add_parser('util', \n help='Some utils.')\n put.add_argument('-r', '--readme', action='store_true', \n help='Build README.md.')\n put.add_argument('-u', '--url', action='store_true', \n help='Rewrite url.')\n put.add_argument('-c', '--category', action='store_true', \n help='Rewrite category.')\n put.add_argument('-d', '--dirname', type=str, default='post',\n choices = ['post', 'page', 'draft', 'all'],\n help='Rewrite articles by type. The value is [post|page|draft|all].')\n put.add_argument('-a', '--analytic', action='store_true',\n help='Analytic the articles.')\n put.add_argument('--check-posts', action='store_true',\n help='Check articles.')\n put.add_argument('--check-mds', action='store_true',\n help='Check markdown files.')\n put.add_argument('-q', '--query', nargs='*',\n help='The options for query.')\n\n pn = subParsers.add_parser('new', \n help='Create some new content.')\n pn.add_argument('-t', '--type', type=str,\n choices=['post', 'page', 'tag', 'category'],\n help='Create a new content in wordpress.')\n pn.add_argument('-q', '--query', nargs='*',\n help='The options for query.')\n\n ps = subParsers.add_parser('show', \n help='Show wordpress contents.')\n ps.add_argument('-t', '--type', type=str,\n choices=['post', 'page', 'draft',\n 'option','tax','term',\n 'category','tag',\n 'medialib', 'mediaitem'],\n default='option',\n help='Content type of wordpress.')\n ps.add_argument('-n', '--number', type=int,\n default=10,\n help='The amount for GetPosts.')\n ps.add_argument('-o', '--orderby',\n choices=['post_modified', 'post_id'],\n default='post_id',\n help='To sort the result-set by one column.')\n ps.add_argument('-d', '--order',\n choices=['ASC', 'DESC'],\n default='DESC',\n help='To sort the records in a descending or a ascending order.')\n ps.add_argument('-q', '--query', nargs='*',\n help='The options for query.')\n\n pu = subParsers.add_parser('update', \n help='Update wordpress contents.')\n pu.add_argument('-t', '--type', type=str,\n choices=['post', 'page', 'draft', 'option', 'tag', 'category'],\n default='post',\n help='Content type of wordpress.')\n pu.add_argument('-q', '--query', nargs='*',\n help='The options for query.')\n pu.add_argument('-o', '--output', type=str,\n help='Write output text to a file.')\n\n # Add site argument to new/update/show.\n for subp in (pn, ps, pu, put):\n subp.add_argument('-s', '--site', type=str, default='site',\n help='Set the site section in ini config files. Default value is \"site\".')\n\n args = parser.parse_args(args=argv)\n if args.sub_name:\n return args, subParsers.choices[args.sub_name]\n if args.version:\n slog.info(__version__)\n return None, None\n parser.print_help()\n return None, None", "metadata": "root.check_args", "header": "['module', '___EOS___']", "index": 32 }, { "content": "def main():\n homedir = os.path.expanduser('~')\n workdir = os.path.join(homedir, 'blog')\n conffile = os.path.join(homedir, Conf.INI_FILE)\n\n gconf = Conf(conffile)\n if not gconf.init(workdir):\n exit(1)\n\n gargs, subParser = check_args()\n if gargs:\n gconf.init_cache(gargs.site)\n modname = __package__ + '.' + gargs.sub_name\n mod = importlib.import_module(modname)\n mod.build(gconf, gconf.cache, gargs, subParser)", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 114 } ]
[ { "span": "import rookout", "start_line": 18, "start_column": 4, "end_line": 18, "end_column": 18 }, { "span": "from wpcmd.base import (Conf, TermCache)", "start_line": 23, "start_column": 0, "end_line": 23, "end_column": 40 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\\u\\u", "init", "\\u\\u", ".", "py_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Author", " ", "zr", "ong", "(", "zen", "gro", "ng", ".", "net", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "ion", " ", "2014", "-1", "1", "-1", "8_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Modifica", "tion", " ", "201", "5", "-1", "1", "-", "22_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "importlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "argparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "all\\u\\u_", "=_", "[_", "'", "util", "'_", ",_", "'", "new", "'_", ",_", "'", "show", "'_", ",_", "'", "update", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "version\\u\\u_", "=_", "'", "0.", "2.0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "roo", "ko", "ut_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "path_", "._", "insert_", "(_", "0_", ",_", "os_", "._", "getenv_", "(_", "'", "roo", "ko", "ut", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "roo", "ko", "ut_", "import_", "slo", "g_", ",_", "add", "\\u", "log", "\\u", "handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "wp", "cmd_", "._", "base_", "import_", "(_", "Conf_", ",_", "Term", "Cache_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "add", "\\u", "log", "\\u", "handler_", "(_", "slo", "g_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "handler_", "=_", "logging_", "._", "Stream", "Handler_", "(_", "sys_", "._", "stdout_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "debug_", "=_", "logging_", "._", "DEBUG_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "WP", "Error_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check", "\\u", "args_", "(_", "argv_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "=_", "argparse_", "._", "Arg", "ument", "Parser_", "(_", "prog_", "=_", "'", "wp", "cmd", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "v", "'_", ",_", "'--", "version", "'_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Show", " ", "version", " ", "of", " ", "wp", "cmd", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub", "Parser", "s_", "=_", "parser_", "._", "add", "\\u", "subparsers_", "(_", "dest_", "=_", "'", "sub\\u", "name", "'_", ",_", "help_", "=_", "'", "sub", "-", "command", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "put_", "=_", "sub", "Parser", "s_", "._", "add", "\\u", "parser_", "(_", "'", "util", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Some", " ", "util", "s", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "put_", "._", "add", "\\u", "argument_", "(_", "'-", "r", "'_", ",_", "'--", "readme", "'_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Build", " ", "READ", "ME", ".", "md", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "put_", "._", "add", "\\u", "argument_", "(_", "'-", "u", "'_", ",_", "'--", "url", "'_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Rewrite", " ", "url", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "put_", "._", "add", "\\u", "argument_", "(_", "'-", "c", "'_", ",_", "'--", "category", "'_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Rewrite", " ", "category", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "put_", "._", "add", "\\u", "argument_", "(_", "'-", "d", "'_", ",_", "'--", "dir", "name", "'_", ",_", "type_", "=_", "str_", ",_", "default_", "=_", "'", "post", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "choices_", "=_", "[_", "'", "post", "'_", ",_", "'", "page", "'_", ",_", "'", "draft", "'_", ",_", "'", "all", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Rewrite", " ", "article", "s", " ", "by", " ", "type", ".", " ", "The", " ", "value", " ", "is", " ", "[", "post", "|", "page", "|", "draft", "|", "all", "].", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "put_", "._", "add", "\\u", "argument_", "(_", "'-", "a", "'_", ",_", "'--", "analytic", "'_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Analy", "tic", " ", "the", " ", "article", "s", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "put_", "._", "add", "\\u", "argument_", "(_", "'--", "check", "-", "posts", "'_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Check", " ", "article", "s", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "put_", "._", "add", "\\u", "argument_", "(_", "'--", "check", "-", "mds", "'_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Check", " ", "mark", "down", " ", "files", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "put_", "._", "add", "\\u", "argument_", "(_", "'-", "q", "'_", ",_", "'--", "query", "'_", ",_", "nargs_", "=_", "'*'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "The", " ", "options", " ", "for", " ", "query", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pn_", "=_", "sub", "Parser", "s_", "._", "add", "\\u", "parser_", "(_", "'", "new", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Creat", "e", " ", "some", " ", "new", " ", "content", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pn_", "._", "add", "\\u", "argument_", "(_", "'-", "t", "'_", ",_", "'--", "type", "'_", ",_", "type_", "=_", "str_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "choices_", "=_", "[_", "'", "post", "'_", ",_", "'", "page", "'_", ",_", "'", "tag", "'_", ",_", "'", "category", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Creat", "e", " ", "a", " ", "new", " ", "content", " ", "in", " ", "wordpress", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pn_", "._", "add", "\\u", "argument_", "(_", "'-", "q", "'_", ",_", "'--", "query", "'_", ",_", "nargs_", "=_", "'*'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "The", " ", "options", " ", "for", " ", "query", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ps_", "=_", "sub", "Parser", "s_", "._", "add", "\\u", "parser_", "(_", "'", "show", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Show", " ", "wordpress", " ", "content", "s", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ps_", "._", "add", "\\u", "argument_", "(_", "'-", "t", "'_", ",_", "'--", "type", "'_", ",_", "type_", "=_", "str_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "choices_", "=_", "[_", "'", "post", "'_", ",_", "'", "page", "'_", ",_", "'", "draft", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "option", "'_", ",_", "'", "tax", "'_", ",_", "'", "term", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "category", "'_", ",_", "'", "tag", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "media", "lib", "'_", ",_", "'", "media", "item", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "'", "option", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Conten", "t", " ", "type", " ", "of", " ", "wordpress", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ps_", "._", "add", "\\u", "argument_", "(_", "'-", "n", "'_", ",_", "'--", "number", "'_", ",_", "type_", "=_", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "10_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "The", " ", "amo", "unt", " ", "for", " ", "Get", "Posts", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ps_", "._", "add", "\\u", "argument_", "(_", "'-", "o", "'_", ",_", "'--", "orderb", "y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "choices_", "=_", "[_", "'", "post", "\\u", "modifi", "ed", "'_", ",_", "'", "post", "\\u", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "'", "post", "\\u", "id", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "To", " ", "sort", " ", "the", " ", "result", "-", "set", " ", "by", " ", "one", " ", "column", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ps_", "._", "add", "\\u", "argument_", "(_", "'-", "d", "'_", ",_", "'--", "order", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "choices_", "=_", "[_", "'", "ASC", "'_", ",_", "'", "DESC", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "'", "DESC", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "To", " ", "sort", " ", "the", " ", "record", "s", " ", "in", " ", "a", " ", "descend", "ing", " ", "or", " ", "a", " ", "ascen", "ding", " ", "order", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ps_", "._", "add", "\\u", "argument_", "(_", "'-", "q", "'_", ",_", "'--", "query", "'_", ",_", "nargs_", "=_", "'*'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "The", " ", "options", " ", "for", " ", "query", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pu_", "=_", "sub", "Parser", "s_", "._", "add", "\\u", "parser_", "(_", "'", "update", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Update", " ", "wordpress", " ", "content", "s", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pu_", "._", "add", "\\u", "argument_", "(_", "'-", "t", "'_", ",_", "'--", "type", "'_", ",_", "type_", "=_", "str_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "choices_", "=_", "[_", "'", "post", "'_", ",_", "'", "page", "'_", ",_", "'", "draft", "'_", ",_", "'", "option", "'_", ",_", "'", "tag", "'_", ",_", "'", "category", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "'", "post", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Conten", "t", " ", "type", " ", "of", " ", "wordpress", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pu_", "._", "add", "\\u", "argument_", "(_", "'-", "q", "'_", ",_", "'--", "query", "'_", ",_", "nargs_", "=_", "'*'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "The", " ", "options", " ", "for", " ", "query", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pu_", "._", "add", "\\u", "argument_", "(_", "'-", "o", "'_", ",_", "'--", "output", "'_", ",_", "type_", "=_", "str_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Write", " ", "output", " ", "text", " ", "to", " ", "a", " ", "file", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "site", " ", "argu", "ment", " ", "to", " ", "new", "/", "update", "/", "show", "._", "\\u\\u\\uNL\\u\\u\\u_", "for_", "subp", "_", "in_", "(_", "pn_", ",_", "ps_", ",_", "pu_", ",_", "put_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subp", "_", "._", "add", "\\u", "argument_", "(_", "'-", "s", "'_", ",_", "'--", "site", "'_", ",_", "type_", "=_", "str_", ",_", "default_", "=_", "'", "site", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Set", " ", "the", " ", "site", " ", "section", " ", "in", " ", "ini", " ", "config", " ", "files", ".", " ", "Default", " ", "value", " ", "is", " ", "\"", "site", "\".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "args_", "=_", "parser_", "._", "parse", "\\u", "args_", "(_", "args_", "=_", "argv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "args_", "._", "sub\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "args_", ",_", "sub", "Parser", "s_", "._", "choices_", "[_", "args_", "._", "sub\\u", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "._", "version_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "slo", "g_", "._", "info_", "(_", "\\u\\u", "version\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", ",_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "parser_", "._", "print", "\\u", "help_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", ",_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "homedir_", "=_", "os_", "._", "path_", "._", "expanduser_", "(_", "'~'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "workdir_", "=_", "os_", "._", "path_", "._", "join_", "(_", "homedir_", ",_", "'", "blog", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf", "file_", "=_", "os_", "._", "path_", "._", "join_", "(_", "homedir_", ",_", "Conf_", "._", "INI", "\\u", "FILE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gconf", "_", "=_", "Conf_", "(_", "conf", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "gconf", "_", "._", "init_", "(_", "workdir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "gar", "gs_", ",_", "sub", "Parser_", "=_", "check", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "gar", "gs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gconf", "_", "._", "init", "\\u", "cache_", "(_", "gar", "gs_", "._", "site_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "modname_", "=_", "\\u\\u", "package", "\\u\\u_", "+_", "'.'_", "+_", "gar", "gs_", "._", "sub\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mod_", "=_", "importlib_", "._", "import", "\\u", "module_", "(_", "modname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mod_", "._", "build_", "(_", "gconf", "_", ",_", "gconf", "_", "._", "cache_", ",_", "gar", "gs_", ",_", "sub", "Parser_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
zlorf/django-synchro/synchro/__init__.py
[ { "content": "# flake8: noqa\nfrom signals import DisableSynchroLog, disable_synchro_log\nfrom utility import NaturalManager, reset_synchro\nfrom management.commands.synchronize import call_synchronize\n\ndefault_app_config = 'synchro.apps.SynchroConfig'\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from signals import DisableSynchroLog, disable_synchro_log", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 58 }, { "span": "from utility import NaturalManager, reset_synchro", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 49 }, { "span": "from management.commands.synchronize import call_synchronize", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 60 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "flake", "8", ":", " ", "no", "qa_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "signals_", "import_", "Disa", "ble", "Synchro", "Log_", ",_", "disable", "\\u", "sync", "hro", "\\u", "log_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "utility_", "import_", "Nat", "ural", "Manager_", ",_", "reset", "\\u", "sync", "hro", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "management_", "._", "commands_", "._", "synchronize", "_", "import_", "call", "\\u", "synchronize", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "app", "\\u", "config_", "=_", "'", "sync", "hro", ".", "apps", ".", "Synchro", "Config", "'_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
openstack-infra/shade/shade/tests/functional/test_identity.py
[ { "content": " def test_list_role_assignments(self):\n if self.identity_version in ('2', '2.0'):\n self.skipTest(\"Identity service does not support role assignments\")\n assignments = self.cloud.list_role_assignments()\n self.assertIsInstance(assignments, list)\n self.assertTrue(len(assignments) > 0)", "metadata": "root.TestIdentity.test_list_role_assignments", "header": "['class', 'TestIdentity', '(', 'base', '.', 'BaseFunctionalTestCase', ')', ':', '___EOS___']", "index": 128 }, { "content": " def test_list_role_assignments_v2(self):\n user = self.cloud.get_user('demo')\n project = self.cloud.get_project('demo')\n assignments = self.cloud.list_role_assignments(\n filters={'user': user['id'], 'project': project['id']})\n self.assertIsInstance(assignments, list)\n self.assertTrue(len(assignments) > 0)", "metadata": "root.TestIdentity.test_list_role_assignments_v2", "header": "['class', 'TestIdentity', '(', 'base', '.', 'BaseFunctionalTestCase', ')', ':', '___EOS___']", "index": 135 }, { "content": " def test_grant_revoke_role_user_project(self):\n user_name = self.user_prefix + '_user_project'\n user_email = '[email protected]'\n role_name = self.role_prefix + '_grant_user_project'\n role = self.cloud.create_role(role_name)\n user = self._create_user(name=user_name,\n email=user_email,\n default_project='demo')\n self.assertTrue(self.cloud.grant_role(\n role_name, user=user['id'], project='demo', wait=True))\n assignments = self.cloud.list_role_assignments({\n 'role': role['id'],\n 'user': user['id'],\n 'project': self.cloud.get_project('demo')['id']\n })\n self.assertIsInstance(assignments, list)\n self.assertTrue(len(assignments) == 1)\n self.assertTrue(self.cloud.revoke_role(\n role_name, user=user['id'], project='demo', wait=True))\n assignments = self.cloud.list_role_assignments({\n 'role': role['id'],\n 'user': user['id'],\n 'project': self.cloud.get_project('demo')['id']\n })\n self.assertIsInstance(assignments, list)\n self.assertTrue(len(assignments) == 0)", "metadata": "root.TestIdentity.test_grant_revoke_role_user_project", "header": "['class', 'TestIdentity', '(', 'base', '.', 'BaseFunctionalTestCase', ')', ':', '___EOS___']", "index": 143 }, { "content": " def test_grant_revoke_role_group_project(self):\n if self.identity_version in ('2', '2.0'):\n self.skipTest(\"Identity service does not support group\")\n role_name = self.role_prefix + '_grant_group_project'\n role = self.cloud.create_role(role_name)\n group_name = self.group_prefix + '_group_project'\n group = self.cloud.create_group(name=group_name,\n description='test group',\n domain='default')\n self.assertTrue(self.cloud.grant_role(\n role_name, group=group['id'], project='demo'))\n assignments = self.cloud.list_role_assignments({\n 'role': role['id'],\n 'group': group['id'],\n 'project': self.cloud.get_project('demo')['id']\n })\n self.assertIsInstance(assignments, list)\n self.assertTrue(len(assignments) == 1)\n self.assertTrue(self.cloud.revoke_role(\n role_name, group=group['id'], project='demo'))\n assignments = self.cloud.list_role_assignments({\n 'role': role['id'],\n 'group': group['id'],\n 'project': self.cloud.get_project('demo')['id']\n })\n self.assertIsInstance(assignments, list)\n self.assertTrue(len(assignments) == 0)", "metadata": "root.TestIdentity.test_grant_revoke_role_group_project", "header": "['class', 'TestIdentity', '(', 'base', '.', 'BaseFunctionalTestCase', ')', ':', '___EOS___']", "index": 170 }, { "content": " def test_grant_revoke_role_user_domain(self):\n if self.identity_version in ('2', '2.0'):\n self.skipTest(\"Identity service does not support domain\")\n role_name = self.role_prefix + '_grant_user_domain'\n role = self.cloud.create_role(role_name)\n user_name = self.user_prefix + '_user_domain'\n user_email = '[email protected]'\n user = self._create_user(name=user_name,\n email=user_email,\n default_project='demo')\n self.assertTrue(self.cloud.grant_role(\n role_name, user=user['id'], domain='default'))\n assignments = self.cloud.list_role_assignments({\n 'role': role['id'],\n 'user': user['id'],\n 'domain': self.cloud.get_domain('default')['id']\n })\n self.assertIsInstance(assignments, list)\n self.assertTrue(len(assignments) == 1)\n self.assertTrue(self.cloud.revoke_role(\n role_name, user=user['id'], domain='default'))\n assignments = self.cloud.list_role_assignments({\n 'role': role['id'],\n 'user': user['id'],\n 'domain': self.cloud.get_domain('default')['id']\n })\n self.assertIsInstance(assignments, list)\n self.assertTrue(len(assignments) == 0)", "metadata": "root.TestIdentity.test_grant_revoke_role_user_domain", "header": "['class', 'TestIdentity', '(', 'base', '.', 'BaseFunctionalTestCase', ')', ':', '___EOS___']", "index": 198 }, { "content": " def test_grant_revoke_role_group_domain(self):\n if self.identity_version in ('2', '2.0'):\n self.skipTest(\"Identity service does not support domain or group\")\n role_name = self.role_prefix + '_grant_group_domain'\n role = self.cloud.create_role(role_name)\n group_name = self.group_prefix + '_group_domain'\n group = self.cloud.create_group(name=group_name,\n description='test group',\n domain='default')\n self.assertTrue(self.cloud.grant_role(\n role_name, group=group['id'], domain='default'))\n assignments = self.cloud.list_role_assignments({\n 'role': role['id'],\n 'group': group['id'],\n 'domain': self.cloud.get_domain('default')['id']\n })\n self.assertIsInstance(assignments, list)\n self.assertTrue(len(assignments) == 1)\n self.assertTrue(self.cloud.revoke_role(\n role_name, group=group['id'], domain='default'))\n assignments = self.cloud.list_role_assignments({\n 'role': role['id'],\n 'group': group['id'],\n 'domain': self.cloud.get_domain('default')['id']\n })\n self.assertIsInstance(assignments, list)\n self.assertTrue(len(assignments) == 0)", "metadata": "root.TestIdentity.test_grant_revoke_role_group_domain", "header": "['class', 'TestIdentity', '(', 'base', '.', 'BaseFunctionalTestCase', ')', ':', '___EOS___']", "index": 227 } ]
[ { "span": "self.assertTrue(len(assignments) > 0)", "start_line": 133, "start_column": 8, "end_line": 133, "end_column": 45 }, { "span": "self.assertTrue(len(assignments) > 0)", "start_line": 141, "start_column": 8, "end_line": 141, "end_column": 45 }, { "span": "self.assertTrue(len(assignments) == 1)", "start_line": 159, "start_column": 8, "end_line": 159, "end_column": 46 }, { "span": "self.assertTrue(len(assignments) == 0)", "start_line": 168, "start_column": 8, "end_line": 168, "end_column": 46 }, { "span": "self.assertTrue(len(assignments) == 1)", "start_line": 187, "start_column": 8, "end_line": 187, "end_column": 46 }, { "span": "self.assertTrue(len(assignments) == 0)", "start_line": 196, "start_column": 8, "end_line": 196, "end_column": 46 }, { "span": "self.assertTrue(len(assignments) == 1)", "start_line": 216, "start_column": 8, "end_line": 216, "end_column": 46 }, { "span": "self.assertTrue(len(assignments) == 0)", "start_line": 225, "start_column": 8, "end_line": 225, "end_column": 46 }, { "span": "self.assertTrue(len(assignments) == 1)", "start_line": 244, "start_column": 8, "end_line": 244, "end_column": 46 }, { "span": "self.assertTrue(len(assignments) == 0)", "start_line": 253, "start_column": 8, "end_line": 253, "end_column": 46 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Identity_", "(_", "base_", "._", "Base", "Function", "al", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "list", "\\u", "role", "\\u", "assignments_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "identi", "ty", "\\u", "version_", "in_", "(_", "'", "2", "'_", ",_", "'", "2.0", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "skip", "Test_", "(_", "\"", "Ident", "it", "y", " ", "service", " ", "doe", "s", " ", "not", " ", "support", " ", "role", " ", "assign", "ment", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assignments_", "=_", "self_", "._", "cloud_", "._", "list", "\\u", "role", "\\u", "assignments_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "assignments_", ",_", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "assignments_", ")_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Identity_", "(_", "base_", "._", "Base", "Function", "al", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "list", "\\u", "role", "\\u", "assign", "ment", "s", "\\u", "v2_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user_", "=_", "self_", "._", "cloud_", "._", "get", "\\u", "user_", "(_", "'", "demo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "project_", "=_", "self_", "._", "cloud_", "._", "get", "\\u", "project_", "(_", "'", "demo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assignments_", "=_", "self_", "._", "cloud_", "._", "list", "\\u", "role", "\\u", "assignments_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "filters_", "=_", "{_", "'", "user", "'_", ":_", "user_", "[_", "'", "id", "'_", "]_", ",_", "'", "project", "'_", ":_", "project_", "[_", "'", "id", "'_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "assignments_", ",_", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "assignments_", ")_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Identity_", "(_", "base_", "._", "Base", "Function", "al", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "grant", "\\u", "revoke", "\\u", "role", "\\u", "user", "\\u", "project_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "name_", "=_", "self_", "._", "user", "\\u", "prefix_", "+_", "'\\u", "user", "\\u", "project", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "email_", "=_", "'", "nob", "ody", "@", "now", "here", ".", "com", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "role", "\\u", "name_", "=_", "self_", "._", "role", "\\u", "prefix_", "+_", "'\\u", "grant", "\\u", "user", "\\u", "project", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "role_", "=_", "self_", "._", "cloud_", "._", "create", "\\u", "role_", "(_", "role", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "=_", "self_", "._", "\\u", "create", "\\u", "user_", "(_", "name_", "=_", "user", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "email_", "=_", "user", "\\u", "email_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "project_", "=_", "'", "demo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "cloud_", "._", "grant", "\\u", "role_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "role", "\\u", "name_", ",_", "user_", "=_", "user_", "[_", "'", "id", "'_", "]_", ",_", "project_", "=_", "'", "demo", "'_", ",_", "wait_", "=_", "True_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assignments_", "=_", "self_", "._", "cloud_", "._", "list", "\\u", "role", "\\u", "assignments_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "role", "'_", ":_", "role_", "[_", "'", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "'_", ":_", "user_", "[_", "'", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "project", "'_", ":_", "self_", "._", "cloud_", "._", "get", "\\u", "project_", "(_", "'", "demo", "'_", ")_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "assignments_", ",_", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "assignments_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "cloud_", "._", "revoke", "\\u", "role_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "role", "\\u", "name_", ",_", "user_", "=_", "user_", "[_", "'", "id", "'_", "]_", ",_", "project_", "=_", "'", "demo", "'_", ",_", "wait_", "=_", "True_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assignments_", "=_", "self_", "._", "cloud_", "._", "list", "\\u", "role", "\\u", "assignments_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "role", "'_", ":_", "role_", "[_", "'", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "'_", ":_", "user_", "[_", "'", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "project", "'_", ":_", "self_", "._", "cloud_", "._", "get", "\\u", "project_", "(_", "'", "demo", "'_", ")_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "assignments_", ",_", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "assignments_", ")_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Identity_", "(_", "base_", "._", "Base", "Function", "al", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "grant", "\\u", "revoke", "\\u", "role", "\\u", "group", "\\u", "project_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "identi", "ty", "\\u", "version_", "in_", "(_", "'", "2", "'_", ",_", "'", "2.0", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "skip", "Test_", "(_", "\"", "Ident", "it", "y", " ", "service", " ", "doe", "s", " ", "not", " ", "support", " ", "group", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "role", "\\u", "name_", "=_", "self_", "._", "role", "\\u", "prefix_", "+_", "'\\u", "grant", "\\u", "group", "\\u", "project", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "role_", "=_", "self_", "._", "cloud_", "._", "create", "\\u", "role_", "(_", "role", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "group", "\\u", "name_", "=_", "self_", "._", "group", "\\u", "prefix_", "+_", "'\\u", "group", "\\u", "project", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "group_", "=_", "self_", "._", "cloud_", "._", "create", "\\u", "group_", "(_", "name_", "=_", "group", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "'", "test", " ", "group", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "domain_", "=_", "'", "default", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "cloud_", "._", "grant", "\\u", "role_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "role", "\\u", "name_", ",_", "group_", "=_", "group_", "[_", "'", "id", "'_", "]_", ",_", "project_", "=_", "'", "demo", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assignments_", "=_", "self_", "._", "cloud_", "._", "list", "\\u", "role", "\\u", "assignments_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "role", "'_", ":_", "role_", "[_", "'", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "'_", ":_", "group_", "[_", "'", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "project", "'_", ":_", "self_", "._", "cloud_", "._", "get", "\\u", "project_", "(_", "'", "demo", "'_", ")_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "assignments_", ",_", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "assignments_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "cloud_", "._", "revoke", "\\u", "role_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "role", "\\u", "name_", ",_", "group_", "=_", "group_", "[_", "'", "id", "'_", "]_", ",_", "project_", "=_", "'", "demo", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assignments_", "=_", "self_", "._", "cloud_", "._", "list", "\\u", "role", "\\u", "assignments_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "role", "'_", ":_", "role_", "[_", "'", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "'_", ":_", "group_", "[_", "'", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "project", "'_", ":_", "self_", "._", "cloud_", "._", "get", "\\u", "project_", "(_", "'", "demo", "'_", ")_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "assignments_", ",_", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "assignments_", ")_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Identity_", "(_", "base_", "._", "Base", "Function", "al", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "grant", "\\u", "revoke", "\\u", "role", "\\u", "user", "\\u", "domain_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "identi", "ty", "\\u", "version_", "in_", "(_", "'", "2", "'_", ",_", "'", "2.0", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "skip", "Test_", "(_", "\"", "Ident", "it", "y", " ", "service", " ", "doe", "s", " ", "not", " ", "support", " ", "domain", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "role", "\\u", "name_", "=_", "self_", "._", "role", "\\u", "prefix_", "+_", "'\\u", "grant", "\\u", "user", "\\u", "domain", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "role_", "=_", "self_", "._", "cloud_", "._", "create", "\\u", "role_", "(_", "role", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "name_", "=_", "self_", "._", "user", "\\u", "prefix_", "+_", "'\\u", "user", "\\u", "domain", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "email_", "=_", "'", "nob", "ody", "@", "now", "here", ".", "com", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "=_", "self_", "._", "\\u", "create", "\\u", "user_", "(_", "name_", "=_", "user", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "email_", "=_", "user", "\\u", "email_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "project_", "=_", "'", "demo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "cloud_", "._", "grant", "\\u", "role_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "role", "\\u", "name_", ",_", "user_", "=_", "user_", "[_", "'", "id", "'_", "]_", ",_", "domain_", "=_", "'", "default", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assignments_", "=_", "self_", "._", "cloud_", "._", "list", "\\u", "role", "\\u", "assignments_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "role", "'_", ":_", "role_", "[_", "'", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "'_", ":_", "user_", "[_", "'", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "domain", "'_", ":_", "self_", "._", "cloud_", "._", "get", "\\u", "domain_", "(_", "'", "default", "'_", ")_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "assignments_", ",_", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "assignments_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "cloud_", "._", "revoke", "\\u", "role_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "role", "\\u", "name_", ",_", "user_", "=_", "user_", "[_", "'", "id", "'_", "]_", ",_", "domain_", "=_", "'", "default", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assignments_", "=_", "self_", "._", "cloud_", "._", "list", "\\u", "role", "\\u", "assignments_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "role", "'_", ":_", "role_", "[_", "'", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "'_", ":_", "user_", "[_", "'", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "domain", "'_", ":_", "self_", "._", "cloud_", "._", "get", "\\u", "domain_", "(_", "'", "default", "'_", ")_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "assignments_", ",_", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "assignments_", ")_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Identity_", "(_", "base_", "._", "Base", "Function", "al", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "grant", "\\u", "revoke", "\\u", "role", "\\u", "group", "\\u", "domain_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "identi", "ty", "\\u", "version_", "in_", "(_", "'", "2", "'_", ",_", "'", "2.0", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "skip", "Test_", "(_", "\"", "Ident", "it", "y", " ", "service", " ", "doe", "s", " ", "not", " ", "support", " ", "domain", " ", "or", " ", "group", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "role", "\\u", "name_", "=_", "self_", "._", "role", "\\u", "prefix_", "+_", "'\\u", "grant", "\\u", "group", "\\u", "domain", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "role_", "=_", "self_", "._", "cloud_", "._", "create", "\\u", "role_", "(_", "role", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "group", "\\u", "name_", "=_", "self_", "._", "group", "\\u", "prefix_", "+_", "'\\u", "group", "\\u", "domain", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "group_", "=_", "self_", "._", "cloud_", "._", "create", "\\u", "group_", "(_", "name_", "=_", "group", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "'", "test", " ", "group", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "domain_", "=_", "'", "default", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "cloud_", "._", "grant", "\\u", "role_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "role", "\\u", "name_", ",_", "group_", "=_", "group_", "[_", "'", "id", "'_", "]_", ",_", "domain_", "=_", "'", "default", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assignments_", "=_", "self_", "._", "cloud_", "._", "list", "\\u", "role", "\\u", "assignments_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "role", "'_", ":_", "role_", "[_", "'", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "'_", ":_", "group_", "[_", "'", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "domain", "'_", ":_", "self_", "._", "cloud_", "._", "get", "\\u", "domain_", "(_", "'", "default", "'_", ")_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "assignments_", ",_", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "assignments_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "cloud_", "._", "revoke", "\\u", "role_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "role", "\\u", "name_", ",_", "group_", "=_", "group_", "[_", "'", "id", "'_", "]_", ",_", "domain_", "=_", "'", "default", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assignments_", "=_", "self_", "._", "cloud_", "._", "list", "\\u", "role", "\\u", "assignments_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "role", "'_", ":_", "role_", "[_", "'", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "'_", ":_", "group_", "[_", "'", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "domain", "'_", ":_", "self_", "._", "cloud_", "._", "get", "\\u", "domain_", "(_", "'", "default", "'_", ")_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "assignments_", ",_", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "assignments_", ")_", "==_", "0_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
Except block handles 'BaseException'
mozilla/inventory/api_v2/keyvalue_handler.py
[ { "content": "from piston.handler import BaseHandler, rc\nfrom systems.models import System, SystemRack,SystemStatus,NetworkAdapter,KeyValue\nfrom truth.models import Truth, KeyValue as TruthKeyValue\nfrom dhcp.DHCP import DHCP as DHCPInterface\nfrom dhcp.models import DHCP\nfrom MacroExpansion import MacroExpansion\nfrom KeyValueTree import KeyValueTree\nimport re\ntry:\n import json\nexcept:\n from django.utils import simplejson as json\nfrom django.test.client import Client\n\nfrom MozInvAuthorization.KeyValueACL import KeyValueACL \n\nfrom settings import API_ACCESS\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": " def create(self, request, key_value_id=None):\n if 'system_id' in request.POST:\n post_key = request.POST.get('key')\n post_value = request.POST.get('value')\n system_id = request.POST.get('system_id')\n n = KeyValue()\n system = System.objects.get(id=system_id)\n if re.search('^nic\\.(\\d+)\\.ipv4_address', str(post_key).strip() ):\n try:\n acl = KeyValueACL(request)\n acl.check_ip_not_exist_other_system(system, post_value)\n except Exception, e:\n resp = rc.FORBIDDEN\n resp.write(e)\n return resp\n try:\n n.obj = system\n if 'key' in request.POST:\n n.key = request.POST['key']\n if 'value' in request.POST:\n n.value = request.POST['value']\n n.save()\n resp = rc.ALL_OK\n resp.write('json = {\"id\":%i}' % (n.id))\n except:\n resp = rc.NOT_FOUND\n resp.write('Unable to Create Key/Value Pair')\n return resp\n elif 'truth_name' in request.POST:\n n = TruthKeyValue()\n truth = Truth.objects.get(name=request.POST['truth_name'])\n n.truth = truth\n if 'key' in request.POST:\n n.key = request.POST['key']\n if 'value' in request.POST:\n n.value = request.POST['value']\n try:\n n.save()\n resp = rc.ALL_OK\n resp.write('json = {\"id\":%i}' % (n.id))\n except:\n resp = rc.NOT_FOUND\n resp.write('Unable to Create Key/Value Pair')\n return resp\n else:\n resp = rc.NOT_FOUND\n resp.write('system_id or truth_name required')", "metadata": "root.KeyValueHandler.create", "header": "['class', 'KeyValueHandler', '(', 'BaseHandler', ')', ':', '___EOS___']", "index": 20 }, { "content": " def update(self, request, key_value_id=None):\n ###TODO This whole method is not functioning correctly. Just for version 2. Not getting the system_id or truth_id from the poster firefox plugin\n if 'system_id' in request.POST:\n n = None\n found = False\n post_key = request.POST.get('key')\n post_value = request.POST.get('value')\n system_id = request.POST.get('system_id')\n key_validated, validation_error_string = self.validate(post_key, post_value) \n if re.search('^nic\\.(\\d+)\\.ipv4_address', str(post_key).strip() ):\n try:\n acl = KeyValueACL(request)\n system = System.objects.get(id=system_id)\n acl.check_ip_not_exist_other_system(system, post_value)\n except Exception, e:\n resp = rc.FORBIDDEN\n resp.write(e)\n return resp\n if key_validated is False:\n resp = rc.FORBIDDEN\n resp.write('Validation Failed for %s %s' % (request.POST['key'], validation_error_string) )\n return resp\n\n try:\n n = KeyValue.objects.get(id=key_value_id,key=request.POST['key'])\n system = System.objects.get(id=request.POST['system_id'])\n found = True\n except Exception, e:\n #print e\n found = False\n\n if found is False:\n try:\n system = System.objects.get(id=request.POST['system_id'])\n n = KeyValue.objects.get(obj=system,key=request.POST['key'])\n found = True\n except:\n found = False\n\n if found is False:\n resp = rc.NOT_FOUND\n resp.write('Neither system_id or truth_id found')\n return resp\n\n if n is not None:\n n.obj = system\n if 'value' in request.POST and n is not None:\n n.value = request.POST['value']\n if n is not None:\n try:\n n.save()\n resp = rc.ALL_OK\n resp.write('json = {\"id\":%i}' % (n.id))\n except:\n resp = rc.NOT_FOUND\n resp.write('Unable to Create Key/Value Pair')\n return resp\n elif 'truth_id' in request.POST or 'truth_id' in request.PUT:\n try:\n truth = Truth.objects.get(name=key_value_id)\n n = TruthKeyValue.objects.get(truth=truth,key=request.POST['key'])\n if 'value' in request.POST:\n n.value = request.POST['value']\n except:\n pass\n try:\n n.save()\n resp = rc.ALL_OK\n resp.write('json = {\"id\":%i}' % (n.id))\n except Exception, e:\n resp = rc.NOT_FOUND\n resp.write('Unable to Update Key/Value Pair %s' % e)\n return resp\n else:\n resp = rc.NOT_FOUND\n resp.write('Neither system_id or truth_id found')\n return resp", "metadata": "root.KeyValueHandler.update", "header": "['class', 'KeyValueHandler', '(', 'BaseHandler', ')', ':', '___EOS___']", "index": 158 }, { "content": " def read(self, request, key_value_id=None):\n #if keystore get var is set return the whole keystore\n if 'keystore' in request.GET:\n #if key get var is set return the keystore based on the existance of this key\n if 'key' in request.GET:\n base = KeyValue.objects.filter(key=request.GET['keystore']).filter(keyvalue_set__contains=request.GET['key'])\n tmp_list = []\n for row in base:\n matches = re.match(\"\\$\\{(.*)\\}\", row.value)\n if matches is not None:\n m = MacroExpansion(matches.group(1))\n row.value = m.output()\n for r in base:\n key_name = 'host:%s:%s' % (r.obj.hostname, r.key)\n tmp_list[key_name] = r.value\n if 'key' not in request.GET:\n tree = KeyValueTree(request.GET['keystore']).final\n return tree\n elif 'key_type' in request.GET:\n key_type = request.GET['key_type']\n tmp_list = []\n if key_type == 'dhcp_scopes':\n #Get keystores from truth that have dhcp.is_scope = True\n base = TruthKeyValue.objects.filter(key='dhcp.is_scope',value='True')\n #Iterate through the list and get all of the key/value pairs\n for row in base:\n keyvalue = TruthKeyValue.objects.filter(truth=row.truth)\n tmp_dict = {}\n for kv in keyvalue:\n tmp_dict[kv.key] = kv.value\n tmp_list.append(tmp_dict)\n return tmp_list\n\n if key_type == 'system_by_reverse_dns_zone':\n\n #Get keystores from truth that have dhcp.is_scope = True\n keyvalue_pairs = KeyValue.objects.filter(key__contains='reverse_dns_zone',value=request.GET['zone']).filter(key__startswith='nic.')\n #Iterate through the list and get all of the key/value pairs\n tmp_list = []\n for row in keyvalue_pairs:\n keyvalue = KeyValue.objects.filter(obj=row.obj)\n tmp_dict = {}\n for kv in keyvalue:\n tmp_dict[kv.key] = kv.value\n tmp_dict['hostname'] = row.obj.hostname\n appendable = True\n for the_items in tmp_list:\n if 'hostname' not in the_items:\n appendable = True\n elif the_items['hostname'] == row.obj.hostname:\n appendable = False\n if appendable is True:\n tmp_list.append(tmp_dict)\n #tmp_list = list(set(tmp_list))\n return tmp_list\n if key_type == 'system_by_scope':\n #Get keystores from truth that have dhcp.is_scope = True\n keyvalue_pairs = KeyValue.objects.filter(key__contains='dhcp_scope',value=request.GET['scope']).filter(key__startswith='nic.')\n #Iterate through the list and get all of the key/value pairs\n tmp_list = []\n for row in keyvalue_pairs:\n keyvalue = KeyValue.objects.filter(obj=row.obj)\n tmp_dict = {}\n for kv in keyvalue:\n tmp_dict[kv.key] = kv.value\n tmp_dict['hostname'] = row.obj.hostname\n appendable = True\n for the_items in tmp_list:\n if 'hostname' not in the_items:\n appendable = True\n elif the_items['hostname'] == row.obj.hostname:\n appendable = False\n if appendable is True:\n tmp_list.append(tmp_dict)\n #tmp_list = list(set(tmp_list))\n return tmp_list\n if key_type == 'adapters_by_system':\n #Get keystores from truth that have dhcp.is_scope = True\n system = None\n try:\n system = System.objects.get(hostname=request.GET['system'])\n except:\n system = None\n if not system:\n try:\n system = System.objects.get(id=request.GET['system'])\n except:\n system = None\n if not system:\n resp = rc.NOT_FOUND\n resp.write('json = {\"error_message\":\"Unable to find system\"}')\n return resp\n\n keyvalue_pairs = KeyValue.objects.filter(key__startswith='nic.').filter(obj=system).order_by('key')\n #Iterate through the list and get all of the key/value pairs\n tmp_dict = {}\n adapter_ids = []\n final_list = []\n for kv in keyvalue_pairs:\n tmp_dict[kv.key] = kv.value\n for k in tmp_dict.iterkeys():\n matches = re.match('nic\\.(\\d+).*',k)\n if matches.group is not None:\n if matches.group(1) not in adapter_ids:\n adapter_ids.append(matches.group(1))\n adapter_ids.sort()\n for a in adapter_ids:\n adapter_name = ''\n mac_address = ''\n dhcp_hostname = ''\n dhcp_scope = ''\n dhcp_filename = ''\n ipv4_address = ''\n dhcp_domain_name_servers = ''\n option_hostname = \"\"\n if 'nic.%s.ipv4_address.0' % a in tmp_dict:\n ipv4_address = tmp_dict['nic.%s.ipv4_address.0' % a]\n if 'nic.%s.name.0' % a in tmp_dict:\n adapter_name = tmp_dict['nic.%s.name.0' % a]\n if 'nic.%s.mac_address.0' % a in tmp_dict:\n mac_address = tmp_dict['nic.%s.mac_address.0' % a]\n if 'nic.%s.option_hostname.0' % a in tmp_dict:\n option_hostname = tmp_dict['nic.%s.option_hostname.0' % a]\n if 'nic.%s.dhcp_scope.0' % a in tmp_dict:\n dhcp_scope = tmp_dict['nic.%s.dhcp_scope.0' % a]\n if 'nic.%s.dhcp_filename.0' % a in tmp_dict:\n dhcp_filename = tmp_dict['nic.%s.dhcp_filename.0' % a]\n if 'nic.%s.dhcp_domain_name_servers.0' % a in tmp_dict:\n dhcp_domain_name_servers = tmp_dict['nic.%s.dhcp_domain_name_servers.0' % a]\n try:\n final_list.append({\n 'system_hostname':system.hostname,\n 'ipv4_address':ipv4_address,\n 'adapter_name':adapter_name,\n 'mac_address':mac_address,\n 'option_hostname':option_hostname,\n 'dhcp_scope':dhcp_scope,\n 'dhcp_filename':dhcp_filename,\n 'dhcp_domain_name_servers':dhcp_domain_name_servers,\n }\n )\n except Exception, e:\n pass\n #tmp_list.append(tmp_dict)\n return final_list\n if key_type == 'adapters_by_system_and_zone':\n #Get keystores from truth that have dhcp.is_scope = True\n zone = request.GET['zone']\n system = System.objects.get(hostname=request.GET['system'])\n keyvalue_pairs = KeyValue.objects.filter(key__startswith='nic.').filter(obj=system).order_by('key')\n #Iterate through the list and get all of the key/value pairs\n tmp_dict = {}\n adapter_ids = []\n final_list = []\n for kv in keyvalue_pairs:\n tmp_dict[kv.key] = kv.value\n for k in tmp_dict.iterkeys():\n matches = re.match('nic\\.(\\d+).*',k)\n if matches.group is not None:\n dhcp_scope_match = 'nic.%s.reverse_dns_zone.0' % matches.group(1)\n if matches.group(1) not in adapter_ids and dhcp_scope_match in tmp_dict and tmp_dict[dhcp_scope_match] == zone:\n #if matches.group(1) not in adapter_ids and 'nic.%s.dhcp_scope.0' % matches.group(1) in tmp_dict and tmp_dict['nic.%s.dhcp_scope.0' % matches.group(1)] == dhcp_scope:\n adapter_ids.append(matches.group(1))\n adapter_ids.sort()\n for a in adapter_ids:\n adapter_name = ''\n mac_address = ''\n dhcp_hostname = ''\n dhcp_filename = ''\n dhcp_domain_name = ''\n ipv4_address = ''\n if 'nic.%s.ipv4_address.0' % a in tmp_dict:\n ipv4_address = tmp_dict['nic.%s.ipv4_address.0' % a]\n if 'nic.%s.name.0' % a in tmp_dict:\n adapter_name = tmp_dict['nic.%s.name.0' % a]\n if 'nic.%s.mac_address.0' % a in tmp_dict:\n mac_address = tmp_dict['nic.%s.mac_address.0' % a]\n if 'nic.%s.dhcp_hostname.0' % a in tmp_dict:\n dhcp_hostname = tmp_dict['nic.%s.dhcp_hostname.0' % a]\n if 'nic.%s.dhcp_filename.0' % a in tmp_dict:\n dhcp_filename = tmp_dict['nic.%s.dhcp_filename.0' % a]\n if 'nic.%s.dhcp_domain_name.0' % a in tmp_dict:\n dhcp_domain_name = tmp_dict['nic.%s.dhcp_domain_name.0' % a]\n final_list.append({'system_hostname':system.hostname, 'ipv4_address':ipv4_address})\n #tmp_list.append(tmp_dict)\n return final_list\n if 'key_type' in request.GET and request.GET['key_type'] == 'key_by_system':\n try:\n hostname = request.GET.get('hostname')\n key = request.GET.get('key')\n system = System.objects.get(hostname=hostname)\n objects = KeyValue.objects.filter(key=key, obj=system)\n tmp = []\n for obj in objects:\n tmp.append({'key': obj.key, 'value': obj.value})\n resp = rc.ALL_OK\n resp.write(\"json = {'data': %s}\" % json.dumps(tmp))\n except:\n resp = rc.NOT_FOUND\n resp.write('json = {\"error_message\":\"Unable to find Key or system\"}')\n\n return resp\n if key_type == 'adapters_by_system_and_scope':\n #Get keystores from truth that have dhcp.is_scope = True\n dhcp_scope = request.GET['dhcp_scope']\n system = System.objects.get(hostname=request.GET['system'])\n keyvalue_pairs = KeyValue.objects.filter(key__startswith='nic.').filter(obj=system).order_by('key')\n #Iterate through the list and get all of the key/value pairs\n tmp_dict = {}\n adapter_ids = []\n final_list = []\n for kv in keyvalue_pairs:\n tmp_dict[kv.key] = kv.value\n for k in tmp_dict.iterkeys():\n matches = re.match('nic\\.(\\d+).*',k)\n if matches.group is not None:\n dhcp_scope_match = 'nic.%s.dhcp_scope.0' % matches.group(1)\n ip_address_match = 'nic.%s.ipv4_address.0' % matches.group(1)\n if matches.group(1) not in adapter_ids and ip_address_match in tmp_dict and dhcp_scope_match in tmp_dict and tmp_dict[dhcp_scope_match] == dhcp_scope:\n #if matches.group(1) not in adapter_ids and 'nic.%s.dhcp_scope.0' % matches.group(1) in tmp_dict and tmp_dict['nic.%s.dhcp_scope.0' % matches.group(1)] == dhcp_scope:\n adapter_ids.append(matches.group(1))\n adapter_ids.sort()\n for a in adapter_ids:\n adapter_name = ''\n mac_address = ''\n dhcp_hostname = ''\n dhcp_filename = ''\n dhcp_domain_name = ''\n ipv4_address = ''\n dhcp_domain_name_servers = ''\n if 'nic.%s.ipv4_address.0' % a in tmp_dict:\n ipv4_address = tmp_dict['nic.%s.ipv4_address.0' % a]\n if 'nic.%s.name.0' % a in tmp_dict:\n adapter_name = tmp_dict['nic.%s.name.0' % a]\n if 'nic.%s.mac_address.0' % a in tmp_dict:\n mac_address = tmp_dict['nic.%s.mac_address.0' % a]\n if 'nic.%s.dhcp_hostname.0' % a in tmp_dict and 'nic.%s.option_hostname.0' % a not in tmp_dict:\n dhcp_hostname = tmp_dict['nic.%s.dhcp_hostname.0' % a]\n if 'nic.%s.option_hostname.0' % a in tmp_dict:\n dhcp_hostname = tmp_dict['nic.%s.option_hostname.0' % a]\n if 'nic.%s.dhcp_filename.0' % a in tmp_dict:\n dhcp_filename = tmp_dict['nic.%s.dhcp_filename.0' % a]\n if 'nic.%s.dhcp_domain_name.0' % a in tmp_dict:\n dhcp_domain_name = tmp_dict['nic.%s.dhcp_domain_name.0' % a]\n if 'nic.%s.dhcp_domain_name_servers.0' % a in tmp_dict:\n dhcp_domain_name_servers = tmp_dict['nic.%s.dhcp_domain_name_servers.0' % a]\n final_list.append({'system_hostname':system.hostname, 'ipv4_address':ipv4_address, 'adapter_name':adapter_name, 'mac_address':mac_address, 'option_hostname': dhcp_hostname, 'dhcp_hostname':dhcp_hostname, 'dhcp_filename':dhcp_filename, 'dhcp_domain_name':dhcp_domain_name, 'dhcp_domain_name_servers':dhcp_domain_name_servers})\n #tmp_list.append(tmp_dict)\n return final_list\n elif 'key' in request.GET and request.GET['key'] > '':\n tmp_list = {}\n try:\n base = KeyValue.objects.filter(key=request.GET['key'])\n for row in base:\n matches = re.match(\"\\$\\{(.*)\\}\", row.value)\n if matches is not None:\n m = MacroExpansion(matches.group(1))\n row.value = m.output()\n for r in base:\n key_name = 'host:%s:%s' % (r.obj.hostname, r.key)\n tmp_list[key_name] = r.value\n except Exception, e:\n pass\n try:\n base = TruthKeyValue.objects.filter(key=request.GET['key'])\n for row in base:\n matches = re.match(\"\\$\\{(.*)\\}\", row.value)\n if matches is not None:\n m = MacroExpansion(matches.group(1))\n row.value = m.output()\n for r in base:\n key_name = 'truth:%s:%s' % (r.truth.name, r.key)\n tmp_list[key_name] = r.value\n except Exception, e:\n pass\n\n return tmp_list\n elif 'value' in request.GET:\n tmp_list = {}\n try:\n base = KeyValue.objects.filter(value=request.GET['value'])\n for row in base:\n matches = re.match(\"\\$\\{(.*)\\}\", row.value)\n if matches is not None:\n m = MacroExpansion(matches.group(1))\n row.value = m.output()\n for r in base:\n key_name = 'host:%s:%s' % (r.obj.hostname, r.key)\n tmp_list[key_name] = r.value\n except Exception, e:\n pass\n try:\n base = TruthKeyValue.objects.filter(value=request.GET['value'])\n for row in base:\n matches = re.match(\"\\$\\{(.*)\\}\", row.value)\n if matches is not None:\n m = MacroExpansion(matches.group(1))\n row.value = m.output()\n for r in base:\n key_name = 'truth:%s:%s' % (r.truth.name, r.key)\n tmp_list[key_name] = r.value\n except Exception, e:\n pass\n\n return tmp_list", "metadata": "root.KeyValueHandler.read", "header": "['class', 'KeyValueHandler', '(', 'BaseHandler', ')', ':', '___EOS___']", "index": 236 }, { "content": " def delete(self, request, key_value_id=None):\n if 'key_type' in request.GET and request.GET['key_type'] == 'delete_all_network_adapters':\n #Get keystores from truth that have dhcp.is_scope = True\n try:\n system_hostname = request.GET['system_hostname']\n system = System.objects.get(hostname=system_hostname)\n KeyValue.objects.filter(key__startswith='nic', obj=system).delete()\n resp = rc.ALL_OK\n resp.write('json = {\"id\":\"0\"}')\n except:\n resp = rc.NOT_FOUND\n resp.write('json = {\"error_message\":\"Unable to Delete}')\n\n return resp\n if 'key_type' in request.GET and request.GET['key_type'] == 'delete_network_adapter':\n #Get keystores from truth that have dhcp.is_scope = True\n try:\n adapter_number = request.GET['adapter_number']\n system_hostname = request.GET['system_hostname']\n system = System.objects.get(hostname=system_hostname)\n KeyValue.objects.filter(key__startswith='nic.%s' % adapter_number, obj=system).delete()\n #KeyValue.objects.filter(key__startswith='nic.0', system=system).delete()\n resp = rc.ALL_OK\n resp.write('json = {\"id\":\"14\"}')\n except:\n resp = rc.NOT_FOUND\n resp.write('json = {\"error_message\":\"Unable to Delete}')\n\n return resp\n if 'key_type' in request.GET and request.GET['key_type'] == 'delete_key_by_system':\n try:\n system_hostname = request.GET.get('system')\n key = request.GET.get('key')\n system = System.objects.get(hostname=system_hostname)\n KeyValue.objects.filter(key=key, obj=system).delete()\n resp = rc.ALL_OK\n resp.write('json = {\"id\":\"14\"}')\n except:\n resp = rc.NOT_FOUND\n resp.write('json = {\"error_message\":\"Unable to Delete}')\n\n return resp\n if 'key_type' not in request.GET:\n if 'system_id' in request.GET:\n try:\n n = KeyValue.objects.get(id=key_value_id)\n n.delete()\n resp = rc.ALL_OK\n resp.write('json = {\"id\":\"%s\"}' % str(key_value_id))\n except:\n resp = rc.NOT_FOUND\n return resp\n if 'truth_id' in request.GET:\n try:\n n = TruthKeyValue.objects.get(id=key_value_id)\n n.delete()\n resp = rc.ALL_OK\n resp.write('json = {\"id\":\"%s\"}' % str(key_value_id))\n except:\n resp = rc.NOT_FOUND\n return resp\n \n resp = rc.ALL_OK\n resp.write('json = {\"id\":\"1\"}')\n return resp", "metadata": "root.KeyValueHandler.delete", "header": "['class', 'KeyValueHandler', '(', 'BaseHandler', ')', ':', '___EOS___']", "index": 542 } ]
[ { "span": "except:", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 7 }, { "span": "except:", "start_line": 44, "start_column": 12, "end_line": 44, "end_column": 19 }, { "span": "except:", "start_line": 60, "start_column": 12, "end_line": 60, "end_column": 19 }, { "span": "except:", "start_line": 194, "start_column": 16, "end_line": 194, "end_column": 23 }, { "span": "except:", "start_line": 211, "start_column": 16, "end_line": 211, "end_column": 23 }, { "span": "except:", "start_line": 221, "start_column": 12, "end_line": 221, "end_column": 19 }, { "span": "except:", "start_line": 317, "start_column": 16, "end_line": 317, "end_column": 23 }, { "span": "except:", "start_line": 322, "start_column": 20, "end_line": 322, "end_column": 27 }, { "span": "except:", "start_line": 433, "start_column": 16, "end_line": 433, "end_column": 23 }, { "span": "except:", "start_line": 551, "start_column": 12, "end_line": 551, "end_column": 19 }, { "span": "except:", "start_line": 566, "start_column": 12, "end_line": 566, "end_column": 19 }, { "span": "except:", "start_line": 579, "start_column": 12, "end_line": 579, "end_column": 19 }, { "span": "except:", "start_line": 591, "start_column": 16, "end_line": 591, "end_column": 23 }, { "span": "except:", "start_line": 600, "start_column": 16, "end_line": 600, "end_column": 23 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "pis", "ton_", "._", "handler_", "import_", "Base", "Handler_", ",_", "rc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "systems_", "._", "models_", "import_", "System_", ",_", "System", "Rack", "_", ",_", "System", "Status_", ",_", "Network", "Adapter_", ",_", "Key", "Value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "truth_", "._", "models_", "import_", "Tru", "th_", ",_", "Key", "Value_", "as_", "Tru", "th", "Key", "Value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "dhcp_", "._", "DHC", "P_", "import_", "DHC", "P_", "as_", "DHC", "PI", "nter", "face_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "dhcp_", "._", "models_", "import_", "DHC", "P_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Macro", "Expa", "nsion", "_", "import_", "Macro", "Expa", "nsion", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Key", "Value", "Tree_", "import_", "Key", "Value", "Tree_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "django_", "._", "utils_", "import_", "simplejson_", "as_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "django_", "._", "test_", "._", "client_", "import_", "Client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "Mo", "z", "Inv", "Authorization_", "._", "Key", "Value", "ACL", "_", "import_", "Key", "Value", "ACL", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "settings_", "import_", "API", "\\u", "ACCESS", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "class_", "Key", "Value", "Handler_", "(_", "Base", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "create_", "(_", "self_", ",_", "request_", ",_", "key", "\\u", "value", "\\u", "id_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "system", "\\u", "id", "'_", "in_", "request_", "._", "POST_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "post", "\\u", "key_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "'", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post", "\\u", "value_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "'", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system", "\\u", "id_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "'", "system", "\\u", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "=_", "Key", "Value_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system_", "=_", "System_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "system", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "re_", "._", "search_", "(_", "'", "^", "nic", "\\\\.(", "\\\\", "d", "+)\\\\", ".", "ipv", "4", "\\u", "address", "'_", ",_", "str_", "(_", "post", "\\u", "key_", ")_", "._", "strip_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "acl_", "=_", "Key", "Value", "ACL", "_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "acl_", "._", "check", "\\u", "ip", "\\u", "not", "\\u", "exist", "\\u", "other", "\\u", "system_", "(_", "system_", ",_", "post", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "resp_", "=_", "rc_", "._", "FORB", "IDD", "EN_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "._", "obj_", "=_", "system_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "key", "'_", "in_", "request_", "._", "POST_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "n_", "._", "key_", "=_", "request_", "._", "POST_", "[_", "'", "key", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "value", "'_", "in_", "request_", "._", "POST_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "n_", "._", "value_", "=_", "request_", "._", "POST_", "[_", "'", "value", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "n_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "rc_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "id", "\":", "%", "i", "}'_", "%_", "(_", "n_", "._", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "Una", "ble", " ", "to", " ", "Creat", "e", " ", "Key", "/", "Value", " ", "Pair", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'", "truth", "\\u", "name", "'_", "in_", "request_", "._", "POST_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "Tru", "th", "Key", "Value_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "truth_", "=_", "Tru", "th_", "._", "objects_", "._", "get_", "(_", "name_", "=_", "request_", "._", "POST_", "[_", "'", "truth", "\\u", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "._", "truth_", "=_", "truth_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "key", "'_", "in_", "request_", "._", "POST_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "._", "key_", "=_", "request_", "._", "POST_", "[_", "'", "key", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "value", "'_", "in_", "request_", "._", "POST_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "._", "value_", "=_", "request_", "._", "POST_", "[_", "'", "value", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "rc_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "id", "\":", "%", "i", "}'_", "%_", "(_", "n_", "._", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "Una", "ble", " ", "to", " ", "Creat", "e", " ", "Key", "/", "Value", " ", "Pair", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "system", "\\u", "id", " ", "or", " ", "truth", "\\u", "name", " ", "require", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Key", "Value", "Handler_", "(_", "Base", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update_", "(_", "self_", ",_", "request_", ",_", "key", "\\u", "value", "\\u", "id_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "###", "TOD", "O", " ", "Thi", "s", " ", "whole", " ", "method", " ", "is", " ", "not", " ", "function", "ing", " ", "correct", "ly", ".", " ", "Ju", "st", " ", "for", " ", "version", " ", "2", ".", " ", "Not", " ", "getti", "ng", " ", "the", " ", "system", "\\u", "id", " ", "or", " ", "truth", "\\u", "id", " ", "from", " ", "the", " ", "poster", " ", "firefox", " ", "plugin_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "system", "\\u", "id", "'_", "in_", "request_", "._", "POST_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "found_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post", "\\u", "key_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "'", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post", "\\u", "value_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "'", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system", "\\u", "id_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "'", "system", "\\u", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key", "\\u", "validated_", ",_", "validation", "\\u", "error", "\\u", "string_", "=_", "self_", "._", "validate_", "(_", "post", "\\u", "key_", ",_", "post", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "re_", "._", "search_", "(_", "'", "^", "nic", "\\\\.(", "\\\\", "d", "+)\\\\", ".", "ipv", "4", "\\u", "address", "'_", ",_", "str_", "(_", "post", "\\u", "key_", ")_", "._", "strip_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "acl_", "=_", "Key", "Value", "ACL", "_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system_", "=_", "System_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "system", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "acl_", "._", "check", "\\u", "ip", "\\u", "not", "\\u", "exist", "\\u", "other", "\\u", "system_", "(_", "system_", ",_", "post", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "resp_", "=_", "rc_", "._", "FORB", "IDD", "EN_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "key", "\\u", "validated_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "rc_", "._", "FORB", "IDD", "EN_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "Validat", "ion", " ", "Fail", "ed", " ", "for", " ", "%", "s", " ", "%", "s", "'_", "%_", "(_", "request_", "._", "POST_", "[_", "'", "key", "'_", "]_", ",_", "validation", "\\u", "error", "\\u", "string_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "Key", "Value_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "key", "\\u", "value", "\\u", "id_", ",_", "key_", "=_", "request_", "._", "POST_", "[_", "'", "key", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system_", "=_", "System_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "request_", "._", "POST_", "[_", "'", "system", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "found_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "e_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "found_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "found_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "system_", "=_", "System_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "request_", "._", "POST_", "[_", "'", "system", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "=_", "Key", "Value_", "._", "objects_", "._", "get_", "(_", "obj_", "=_", "system_", ",_", "key_", "=_", "request_", "._", "POST_", "[_", "'", "key", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "found_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "found_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "found_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "Nei", "ther", " ", "system", "\\u", "id", " ", "or", " ", "truth", "\\u", "id", " ", "found", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "n_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "._", "obj_", "=_", "system_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "value", "'_", "in_", "request_", "._", "POST_", "and_", "n_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "._", "value_", "=_", "request_", "._", "POST_", "[_", "'", "value", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "n_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "n_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "rc_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "id", "\":", "%", "i", "}'_", "%_", "(_", "n_", "._", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "Una", "ble", " ", "to", " ", "Creat", "e", " ", "Key", "/", "Value", " ", "Pair", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'", "truth", "\\u", "id", "'_", "in_", "request_", "._", "POST_", "or_", "'", "truth", "\\u", "id", "'_", "in_", "request_", "._", "PUT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "truth_", "=_", "Tru", "th_", "._", "objects_", "._", "get_", "(_", "name_", "=_", "key", "\\u", "value", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "=_", "Tru", "th", "Key", "Value_", "._", "objects_", "._", "get_", "(_", "truth_", "=_", "truth_", ",_", "key_", "=_", "request_", "._", "POST_", "[_", "'", "key", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "value", "'_", "in_", "request_", "._", "POST_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "n_", "._", "value_", "=_", "request_", "._", "POST_", "[_", "'", "value", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "rc_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "id", "\":", "%", "i", "}'_", "%_", "(_", "n_", "._", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "Una", "ble", " ", "to", " ", "Update", " ", "Key", "/", "Value", " ", "Pair", " ", "%", "s", "'_", "%_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "Nei", "ther", " ", "system", "\\u", "id", " ", "or", " ", "truth", "\\u", "id", " ", "found", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Key", "Value", "Handler_", "(_", "Base", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read_", "(_", "self_", ",_", "request_", ",_", "key", "\\u", "value", "\\u", "id_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "keystore", " ", "get", " ", "var", " ", "is", " ", "set", " ", "return", " ", "the", " ", "whole", " ", "keystore", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "keystore", "'_", "in_", "request_", "._", "GET_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "key", " ", "get", " ", "var", " ", "is", " ", "set", " ", "return", " ", "the", " ", "keystore", " ", "based", " ", "on", " ", "the", " ", "exist", "anc", "e", " ", "of", " ", "this", " ", "key_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "key", "'_", "in_", "request_", "._", "GET_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "base_", "=_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key_", "=_", "request_", "._", "GET_", "[_", "'", "keystore", "'_", "]_", ")_", "._", "filter_", "(_", "keyval", "ue", "\\u", "set\\u", "\\u", "contains_", "=_", "request_", "._", "GET_", "[_", "'", "key", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "base_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "matches_", "=_", "re_", "._", "match_", "(_", "\"\\\\", "$", "\\\\{", "(.*)", "\\\\}", "\"_", ",_", "row_", "._", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "matches_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "m_", "=_", "Macro", "Expa", "nsion", "_", "(_", "matches_", "._", "group_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row_", "._", "value_", "=_", "m_", "._", "output_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "r_", "in_", "base_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "key", "\\u", "name_", "=_", "'", "host", ":", "%", "s", ":", "%", "s", "'_", "%_", "(_", "r_", "._", "obj_", "._", "hostname_", ",_", "r_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "list_", "[_", "key", "\\u", "name_", "]_", "=_", "r_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "key", "'_", "not_", "in_", "request_", "._", "GET_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tree_", "=_", "Key", "Value", "Tree_", "(_", "request_", "._", "GET_", "[_", "'", "keystore", "'_", "]_", ")_", "._", "final_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "tree_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'", "key", "\\u", "type", "'_", "in_", "request_", "._", "GET_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key", "\\u", "type_", "=_", "request_", "._", "GET_", "[_", "'", "key", "\\u", "type", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "key", "\\u", "type_", "==_", "'", "dhcp", "\\u", "scope", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Get", " ", "keystore", "s", " ", "from", " ", "truth", " ", "tha", "t", " ", "have", " ", "dhcp", ".", "is", "\\u", "scope", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "base_", "=_", "Tru", "th", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key_", "=_", "'", "dhcp", ".", "is", "\\u", "scope", "'_", ",_", "value_", "=_", "'", "Tru", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Iterat", "e", " ", "through", " ", "the", " ", "list", " ", "and", " ", "get", " ", "all", " ", "of", " ", "the", " ", "key", "/", "value", " ", "pairs_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "row_", "in_", "base_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "keyval", "ue_", "=_", "Tru", "th", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "truth_", "=_", "row_", "._", "truth_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "kv_", "in_", "keyval", "ue_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "tmp", "\\u", "dict_", "[_", "kv_", "._", "key_", "]_", "=_", "kv_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tmp", "\\u", "list_", "._", "append_", "(_", "tmp", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "tmp", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "key", "\\u", "type_", "==_", "'", "system", "\\u", "by", "\\u", "reverse", "\\u", "dns", "\\u", "zone", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Get", " ", "keystore", "s", " ", "from", " ", "truth", " ", "tha", "t", " ", "have", " ", "dhcp", ".", "is", "\\u", "scope", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keyval", "ue", "\\u", "pairs_", "=_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key", "\\u\\u", "contains_", "=_", "'", "reverse", "\\u", "dns", "\\u", "zone", "'_", ",_", "value_", "=_", "request_", "._", "GET_", "[_", "'", "zone", "'_", "]_", ")_", "._", "filter_", "(_", "key", "\\u\\u", "startswith_", "=_", "'", "nic", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Iterat", "e", " ", "through", " ", "the", " ", "list", " ", "and", " ", "get", " ", "all", " ", "of", " ", "the", " ", "key", "/", "value", " ", "pairs_", "\\u\\u\\uNL\\u\\u\\u_", "tmp", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "keyval", "ue", "\\u", "pairs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "keyval", "ue_", "=_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "obj_", "=_", "row_", "._", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "kv_", "in_", "keyval", "ue_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "tmp", "\\u", "dict_", "[_", "kv_", "._", "key_", "]_", "=_", "kv_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tmp", "\\u", "dict_", "[_", "'", "host", "name", "'_", "]_", "=_", "row_", "._", "obj_", "._", "hostname_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "append", "able_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "the", "\\u", "items_", "in_", "tmp", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "'", "host", "name", "'_", "not_", "in_", "the", "\\u", "items_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "append", "able_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "the", "\\u", "items_", "[_", "'", "host", "name", "'_", "]_", "==_", "row_", "._", "obj_", "._", "hostname_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "append", "able_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "append", "able_", "is_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "tmp", "\\u", "list_", "._", "append_", "(_", "tmp", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "tmp", "\\u", "list", " ", "=", " ", "list", "(", "set", "(", "tmp", "\\u", "list", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "tmp", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "key", "\\u", "type_", "==_", "'", "system", "\\u", "by", "\\u", "scope", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Get", " ", "keystore", "s", " ", "from", " ", "truth", " ", "tha", "t", " ", "have", " ", "dhcp", ".", "is", "\\u", "scope", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keyval", "ue", "\\u", "pairs_", "=_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key", "\\u\\u", "contains_", "=_", "'", "dhcp", "\\u", "scope", "'_", ",_", "value_", "=_", "request_", "._", "GET_", "[_", "'", "scope", "'_", "]_", ")_", "._", "filter_", "(_", "key", "\\u\\u", "startswith_", "=_", "'", "nic", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Iterat", "e", " ", "through", " ", "the", " ", "list", " ", "and", " ", "get", " ", "all", " ", "of", " ", "the", " ", "key", "/", "value", " ", "pairs_", "\\u\\u\\uNL\\u\\u\\u_", "tmp", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "keyval", "ue", "\\u", "pairs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "keyval", "ue_", "=_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "obj_", "=_", "row_", "._", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "kv_", "in_", "keyval", "ue_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "tmp", "\\u", "dict_", "[_", "kv_", "._", "key_", "]_", "=_", "kv_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tmp", "\\u", "dict_", "[_", "'", "host", "name", "'_", "]_", "=_", "row_", "._", "obj_", "._", "hostname_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "append", "able_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "the", "\\u", "items_", "in_", "tmp", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "'", "host", "name", "'_", "not_", "in_", "the", "\\u", "items_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "append", "able_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "the", "\\u", "items_", "[_", "'", "host", "name", "'_", "]_", "==_", "row_", "._", "obj_", "._", "hostname_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "append", "able_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "append", "able_", "is_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "tmp", "\\u", "list_", "._", "append_", "(_", "tmp", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "tmp", "\\u", "list", " ", "=", " ", "list", "(", "set", "(", "tmp", "\\u", "list", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "tmp", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "key", "\\u", "type_", "==_", "'", "adapter", "s", "\\u", "by", "\\u", "system", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Get", " ", "keystore", "s", " ", "from", " ", "truth", " ", "tha", "t", " ", "have", " ", "dhcp", ".", "is", "\\u", "scope", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "system_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "system_", "=_", "System_", "._", "objects_", "._", "get_", "(_", "hostname_", "=_", "request_", "._", "GET_", "[_", "'", "system", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "system_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "system_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "system_", "=_", "System_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "request_", "._", "GET_", "[_", "'", "system", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "system_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "system_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "error", "\\u", "message", "\":\"", "Una", "ble", " ", "to", " ", "find", " ", "system", "\"}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "keyval", "ue", "\\u", "pairs_", "=_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key", "\\u\\u", "startswith_", "=_", "'", "nic", ".'_", ")_", "._", "filter_", "(_", "obj_", "=_", "system_", ")_", "._", "order", "\\u", "by_", "(_", "'", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Iterat", "e", " ", "through", " ", "the", " ", "list", " ", "and", " ", "get", " ", "all", " ", "of", " ", "the", " ", "key", "/", "value", " ", "pairs_", "\\u\\u\\uNL\\u\\u\\u_", "tmp", "\\u", "dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "adapter", "\\u", "ids_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "final", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "kv_", "in_", "keyval", "ue", "\\u", "pairs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "tmp", "\\u", "dict_", "[_", "kv_", "._", "key_", "]_", "=_", "kv_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "k_", "in_", "tmp", "\\u", "dict_", "._", "iterkeys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "matches_", "=_", "re_", "._", "match_", "(_", "'", "nic", "\\\\.(", "\\\\", "d", "+)", ".*'_", ",_", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "matches_", "._", "group_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "matches_", "._", "group_", "(_", "1_", ")_", "not_", "in_", "adapter", "\\u", "ids_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "adapter", "\\u", "ids_", "._", "append_", "(_", "matches_", "._", "group_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "adapter", "\\u", "ids_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "a_", "in_", "adapter", "\\u", "ids_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "adapter", "\\u", "name_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mac", "\\u", "address_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dhcp", "\\u", "hostname_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dhcp", "\\u", "scope_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dhcp", "\\u", "filename_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ipv", "4", "\\u", "address_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dhcp", "\\u", "domain", "\\u", "name", "\\u", "servers_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "option", "\\u", "hostname_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "ipv", "4", "\\u", "address", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "ipv", "4", "\\u", "address_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "ipv", "4", "\\u", "address", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "name", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "adapter", "\\u", "name_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "name", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "mac", "\\u", "address", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "mac", "\\u", "address_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "mac", "\\u", "address", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "option", "\\u", "host", "name", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "option", "\\u", "hostname_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "option", "\\u", "host", "name", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "scope", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "scope_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "scope", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "filename", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "filename_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "filename", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "domain", "\\u", "name", "\\u", "server", "s", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "domain", "\\u", "name", "\\u", "servers_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "domain", "\\u", "name", "\\u", "server", "s", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "final", "\\u", "list_", "._", "append_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "system", "\\u", "host", "name", "'_", ":_", "system_", "._", "hostname_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ipv", "4", "\\u", "address", "'_", ":_", "ipv", "4", "\\u", "address_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "adapter", "\\u", "name", "'_", ":_", "adapter", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mac", "\\u", "address", "'_", ":_", "mac", "\\u", "address_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "option", "\\u", "host", "name", "'_", ":_", "option", "\\u", "hostname_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dhcp", "\\u", "scope", "'_", ":_", "dhcp", "\\u", "scope_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dhcp", "\\u", "filename", "'_", ":_", "dhcp", "\\u", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dhcp", "\\u", "domain", "\\u", "name", "\\u", "server", "s", "'_", ":_", "dhcp", "\\u", "domain", "\\u", "name", "\\u", "servers_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "tmp", "\\u", "list", ".", "append", "(", "tmp", "\\u", "dict", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "final", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "key", "\\u", "type_", "==_", "'", "adapter", "s", "\\u", "by", "\\u", "system", "\\u", "and", "\\u", "zone", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Get", " ", "keystore", "s", " ", "from", " ", "truth", " ", "tha", "t", " ", "have", " ", "dhcp", ".", "is", "\\u", "scope", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "zone_", "=_", "request_", "._", "GET_", "[_", "'", "zone", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system_", "=_", "System_", "._", "objects_", "._", "get_", "(_", "hostname_", "=_", "request_", "._", "GET_", "[_", "'", "system", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keyval", "ue", "\\u", "pairs_", "=_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key", "\\u\\u", "startswith_", "=_", "'", "nic", ".'_", ")_", "._", "filter_", "(_", "obj_", "=_", "system_", ")_", "._", "order", "\\u", "by_", "(_", "'", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Iterat", "e", " ", "through", " ", "the", " ", "list", " ", "and", " ", "get", " ", "all", " ", "of", " ", "the", " ", "key", "/", "value", " ", "pairs_", "\\u\\u\\uNL\\u\\u\\u_", "tmp", "\\u", "dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "adapter", "\\u", "ids_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "final", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "kv_", "in_", "keyval", "ue", "\\u", "pairs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "tmp", "\\u", "dict_", "[_", "kv_", "._", "key_", "]_", "=_", "kv_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "k_", "in_", "tmp", "\\u", "dict_", "._", "iterkeys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "matches_", "=_", "re_", "._", "match_", "(_", "'", "nic", "\\\\.(", "\\\\", "d", "+)", ".*'_", ",_", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "matches_", "._", "group_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "scope", "\\u", "match_", "=_", "'", "nic", ".", "%", "s", ".", "reverse", "\\u", "dns", "\\u", "zone", ".0", "'_", "%_", "matches_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "matches_", "._", "group_", "(_", "1_", ")_", "not_", "in_", "adapter", "\\u", "ids_", "and_", "dhcp", "\\u", "scope", "\\u", "match_", "in_", "tmp", "\\u", "dict_", "and_", "tmp", "\\u", "dict_", "[_", "dhcp", "\\u", "scope", "\\u", "match_", "]_", "==_", "zone_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "matche", "s", ".", "group", "(", "1", ")", " ", "not", " ", "in", " ", "adapter", "\\u", "ids", " ", "and", " ", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "scope", ".0", "'", " ", "%", " ", "matche", "s", ".", "group", "(", "1", ")", " ", "in", " ", "tmp", "\\u", "dict", " ", "and", " ", "tmp", "\\u", "dict", "['", "nic", ".", "%", "s", ".", "dhcp", "\\u", "scope", ".0", "'", " ", "%", " ", "matche", "s", ".", "group", "(", "1", ")]", " ", "==", " ", "dhcp", "\\u", "scope", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "adapter", "\\u", "ids_", "._", "append_", "(_", "matches_", "._", "group_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "adapter", "\\u", "ids_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "a_", "in_", "adapter", "\\u", "ids_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "adapter", "\\u", "name_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mac", "\\u", "address_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dhcp", "\\u", "hostname_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dhcp", "\\u", "filename_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dhcp", "\\u", "domain", "\\u", "name_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ipv", "4", "\\u", "address_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "ipv", "4", "\\u", "address", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "ipv", "4", "\\u", "address_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "ipv", "4", "\\u", "address", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "name", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "adapter", "\\u", "name_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "name", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "mac", "\\u", "address", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "mac", "\\u", "address_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "mac", "\\u", "address", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "host", "name", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "hostname_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "host", "name", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "filename", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "filename_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "filename", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "domain", "\\u", "name", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "domain", "\\u", "name_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "domain", "\\u", "name", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "final", "\\u", "list_", "._", "append_", "(_", "{_", "'", "system", "\\u", "host", "name", "'_", ":_", "system_", "._", "hostname_", ",_", "'", "ipv", "4", "\\u", "address", "'_", ":_", "ipv", "4", "\\u", "address_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "tmp", "\\u", "list", ".", "append", "(", "tmp", "\\u", "dict", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "final", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "key", "\\u", "type", "'_", "in_", "request_", "._", "GET_", "and_", "request_", "._", "GET_", "[_", "'", "key", "\\u", "type", "'_", "]_", "==_", "'", "key", "\\u", "by", "\\u", "system", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "hostname_", "=_", "request_", "._", "GET_", "._", "get_", "(_", "'", "host", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "request_", "._", "GET_", "._", "get_", "(_", "'", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system_", "=_", "System_", "._", "objects_", "._", "get_", "(_", "hostname_", "=_", "hostname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "objects_", "=_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key_", "=_", "key_", ",_", "obj_", "=_", "system_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "obj_", "in_", "objects_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "tmp_", "._", "append_", "(_", "{_", "'", "key", "'_", ":_", "obj_", "._", "key_", ",_", "'", "value", "'_", ":_", "obj_", "._", "value_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "resp_", "=_", "rc_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "\"", "json", " ", "=", " ", "{", "'", "data", "':", " ", "%", "s", "}\"_", "%_", "json_", "._", "dumps_", "(_", "tmp_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "error", "\\u", "message", "\":\"", "Una", "ble", " ", "to", " ", "find", " ", "Key", " ", "or", " ", "system", "\"}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "key", "\\u", "type_", "==_", "'", "adapter", "s", "\\u", "by", "\\u", "system", "\\u", "and", "\\u", "scope", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Get", " ", "keystore", "s", " ", "from", " ", "truth", " ", "tha", "t", " ", "have", " ", "dhcp", ".", "is", "\\u", "scope", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dhcp", "\\u", "scope_", "=_", "request_", "._", "GET_", "[_", "'", "dhcp", "\\u", "scope", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system_", "=_", "System_", "._", "objects_", "._", "get_", "(_", "hostname_", "=_", "request_", "._", "GET_", "[_", "'", "system", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keyval", "ue", "\\u", "pairs_", "=_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key", "\\u\\u", "startswith_", "=_", "'", "nic", ".'_", ")_", "._", "filter_", "(_", "obj_", "=_", "system_", ")_", "._", "order", "\\u", "by_", "(_", "'", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Iterat", "e", " ", "through", " ", "the", " ", "list", " ", "and", " ", "get", " ", "all", " ", "of", " ", "the", " ", "key", "/", "value", " ", "pairs_", "\\u\\u\\uNL\\u\\u\\u_", "tmp", "\\u", "dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "adapter", "\\u", "ids_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "final", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "kv_", "in_", "keyval", "ue", "\\u", "pairs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "tmp", "\\u", "dict_", "[_", "kv_", "._", "key_", "]_", "=_", "kv_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "k_", "in_", "tmp", "\\u", "dict_", "._", "iterkeys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "matches_", "=_", "re_", "._", "match_", "(_", "'", "nic", "\\\\.(", "\\\\", "d", "+)", ".*'_", ",_", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "matches_", "._", "group_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "scope", "\\u", "match_", "=_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "scope", ".0", "'_", "%_", "matches_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ip", "\\u", "address", "\\u", "match_", "=_", "'", "nic", ".", "%", "s", ".", "ipv", "4", "\\u", "address", ".0", "'_", "%_", "matches_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "matches_", "._", "group_", "(_", "1_", ")_", "not_", "in_", "adapter", "\\u", "ids_", "and_", "ip", "\\u", "address", "\\u", "match_", "in_", "tmp", "\\u", "dict_", "and_", "dhcp", "\\u", "scope", "\\u", "match_", "in_", "tmp", "\\u", "dict_", "and_", "tmp", "\\u", "dict_", "[_", "dhcp", "\\u", "scope", "\\u", "match_", "]_", "==_", "dhcp", "\\u", "scope_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "matche", "s", ".", "group", "(", "1", ")", " ", "not", " ", "in", " ", "adapter", "\\u", "ids", " ", "and", " ", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "scope", ".0", "'", " ", "%", " ", "matche", "s", ".", "group", "(", "1", ")", " ", "in", " ", "tmp", "\\u", "dict", " ", "and", " ", "tmp", "\\u", "dict", "['", "nic", ".", "%", "s", ".", "dhcp", "\\u", "scope", ".0", "'", " ", "%", " ", "matche", "s", ".", "group", "(", "1", ")]", " ", "==", " ", "dhcp", "\\u", "scope", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "adapter", "\\u", "ids_", "._", "append_", "(_", "matches_", "._", "group_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "adapter", "\\u", "ids_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "a_", "in_", "adapter", "\\u", "ids_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "adapter", "\\u", "name_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mac", "\\u", "address_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dhcp", "\\u", "hostname_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dhcp", "\\u", "filename_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dhcp", "\\u", "domain", "\\u", "name_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ipv", "4", "\\u", "address_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dhcp", "\\u", "domain", "\\u", "name", "\\u", "servers_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "ipv", "4", "\\u", "address", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "ipv", "4", "\\u", "address_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "ipv", "4", "\\u", "address", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "name", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "adapter", "\\u", "name_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "name", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "mac", "\\u", "address", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "mac", "\\u", "address_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "mac", "\\u", "address", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "host", "name", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", "and_", "'", "nic", ".", "%", "s", ".", "option", "\\u", "host", "name", ".0", "'_", "%_", "a_", "not_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "hostname_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "host", "name", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "option", "\\u", "host", "name", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "hostname_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "option", "\\u", "host", "name", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "filename", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "filename_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "filename", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "domain", "\\u", "name", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "domain", "\\u", "name_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "domain", "\\u", "name", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "domain", "\\u", "name", "\\u", "server", "s", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "domain", "\\u", "name", "\\u", "servers_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "domain", "\\u", "name", "\\u", "server", "s", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "final", "\\u", "list_", "._", "append_", "(_", "{_", "'", "system", "\\u", "host", "name", "'_", ":_", "system_", "._", "hostname_", ",_", "'", "ipv", "4", "\\u", "address", "'_", ":_", "ipv", "4", "\\u", "address_", ",_", "'", "adapter", "\\u", "name", "'_", ":_", "adapter", "\\u", "name_", ",_", "'", "mac", "\\u", "address", "'_", ":_", "mac", "\\u", "address_", ",_", "'", "option", "\\u", "host", "name", "'_", ":_", "dhcp", "\\u", "hostname_", ",_", "'", "dhcp", "\\u", "host", "name", "'_", ":_", "dhcp", "\\u", "hostname_", ",_", "'", "dhcp", "\\u", "filename", "'_", ":_", "dhcp", "\\u", "filename_", ",_", "'", "dhcp", "\\u", "domain", "\\u", "name", "'_", ":_", "dhcp", "\\u", "domain", "\\u", "name_", ",_", "'", "dhcp", "\\u", "domain", "\\u", "name", "\\u", "server", "s", "'_", ":_", "dhcp", "\\u", "domain", "\\u", "name", "\\u", "servers_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "tmp", "\\u", "list", ".", "append", "(", "tmp", "\\u", "dict", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "final", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'", "key", "'_", "in_", "request_", "._", "GET_", "and_", "request_", "._", "GET_", "[_", "'", "key", "'_", "]_", ">_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tmp", "\\u", "list_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "base_", "=_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key_", "=_", "request_", "._", "GET_", "[_", "'", "key", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "base_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "matches_", "=_", "re_", "._", "match_", "(_", "\"\\\\", "$", "\\\\{", "(.*)", "\\\\}", "\"_", ",_", "row_", "._", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "matches_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "m_", "=_", "Macro", "Expa", "nsion", "_", "(_", "matches_", "._", "group_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row_", "._", "value_", "=_", "m_", "._", "output_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "r_", "in_", "base_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "key", "\\u", "name_", "=_", "'", "host", ":", "%", "s", ":", "%", "s", "'_", "%_", "(_", "r_", "._", "obj_", "._", "hostname_", ",_", "r_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "list_", "[_", "key", "\\u", "name_", "]_", "=_", "r_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "base_", "=_", "Tru", "th", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key_", "=_", "request_", "._", "GET_", "[_", "'", "key", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "base_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "matches_", "=_", "re_", "._", "match_", "(_", "\"\\\\", "$", "\\\\{", "(.*)", "\\\\}", "\"_", ",_", "row_", "._", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "matches_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "m_", "=_", "Macro", "Expa", "nsion", "_", "(_", "matches_", "._", "group_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row_", "._", "value_", "=_", "m_", "._", "output_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "r_", "in_", "base_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "key", "\\u", "name_", "=_", "'", "truth", ":", "%", "s", ":", "%", "s", "'_", "%_", "(_", "r_", "._", "truth_", "._", "name_", ",_", "r_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "list_", "[_", "key", "\\u", "name_", "]_", "=_", "r_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "tmp", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'", "value", "'_", "in_", "request_", "._", "GET_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tmp", "\\u", "list_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "base_", "=_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "value_", "=_", "request_", "._", "GET_", "[_", "'", "value", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "base_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "matches_", "=_", "re_", "._", "match_", "(_", "\"\\\\", "$", "\\\\{", "(.*)", "\\\\}", "\"_", ",_", "row_", "._", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "matches_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "m_", "=_", "Macro", "Expa", "nsion", "_", "(_", "matches_", "._", "group_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row_", "._", "value_", "=_", "m_", "._", "output_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "r_", "in_", "base_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "key", "\\u", "name_", "=_", "'", "host", ":", "%", "s", ":", "%", "s", "'_", "%_", "(_", "r_", "._", "obj_", "._", "hostname_", ",_", "r_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "list_", "[_", "key", "\\u", "name_", "]_", "=_", "r_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "base_", "=_", "Tru", "th", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "value_", "=_", "request_", "._", "GET_", "[_", "'", "value", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "base_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "matches_", "=_", "re_", "._", "match_", "(_", "\"\\\\", "$", "\\\\{", "(.*)", "\\\\}", "\"_", ",_", "row_", "._", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "matches_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "m_", "=_", "Macro", "Expa", "nsion", "_", "(_", "matches_", "._", "group_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row_", "._", "value_", "=_", "m_", "._", "output_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "r_", "in_", "base_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "key", "\\u", "name_", "=_", "'", "truth", ":", "%", "s", ":", "%", "s", "'_", "%_", "(_", "r_", "._", "truth_", "._", "name_", ",_", "r_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "list_", "[_", "key", "\\u", "name_", "]_", "=_", "r_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "tmp", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Key", "Value", "Handler_", "(_", "Base", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete_", "(_", "self_", ",_", "request_", ",_", "key", "\\u", "value", "\\u", "id_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "key", "\\u", "type", "'_", "in_", "request_", "._", "GET_", "and_", "request_", "._", "GET_", "[_", "'", "key", "\\u", "type", "'_", "]_", "==_", "'", "delete", "\\u", "all", "\\u", "network", "\\u", "adapter", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Get", " ", "keystore", "s", " ", "from", " ", "truth", " ", "tha", "t", " ", "have", " ", "dhcp", ".", "is", "\\u", "scope", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "system", "\\u", "hostname_", "=_", "request_", "._", "GET_", "[_", "'", "system", "\\u", "host", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system_", "=_", "System_", "._", "objects_", "._", "get_", "(_", "hostname_", "=_", "system", "\\u", "hostname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key", "\\u\\u", "startswith_", "=_", "'", "nic", "'_", ",_", "obj_", "=_", "system_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "rc_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "id", "\":\"", "0", "\"}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "error", "\\u", "message", "\":\"", "Una", "ble", " ", "to", " ", "Delete", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "key", "\\u", "type", "'_", "in_", "request_", "._", "GET_", "and_", "request_", "._", "GET_", "[_", "'", "key", "\\u", "type", "'_", "]_", "==_", "'", "delete", "\\u", "network", "\\u", "adapter", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Get", " ", "keystore", "s", " ", "from", " ", "truth", " ", "tha", "t", " ", "have", " ", "dhcp", ".", "is", "\\u", "scope", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "adapter", "\\u", "number_", "=_", "request_", "._", "GET_", "[_", "'", "adapter", "\\u", "number", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system", "\\u", "hostname_", "=_", "request_", "._", "GET_", "[_", "'", "system", "\\u", "host", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system_", "=_", "System_", "._", "objects_", "._", "get_", "(_", "hostname_", "=_", "system", "\\u", "hostname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key", "\\u\\u", "startswith_", "=_", "'", "nic", ".", "%", "s", "'_", "%_", "adapter", "\\u", "number_", ",_", "obj_", "=_", "system_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Key", "Value", ".", "object", "s", ".", "filter", "(", "key", "\\u\\u", "startswith", "='", "nic", ".0", "',", " ", "system", "=", "system", ").", "delete", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "rc_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "id", "\":\"", "14", "\"}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "error", "\\u", "message", "\":\"", "Una", "ble", " ", "to", " ", "Delete", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "key", "\\u", "type", "'_", "in_", "request_", "._", "GET_", "and_", "request_", "._", "GET_", "[_", "'", "key", "\\u", "type", "'_", "]_", "==_", "'", "delete", "\\u", "key", "\\u", "by", "\\u", "system", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "system", "\\u", "hostname_", "=_", "request_", "._", "GET_", "._", "get_", "(_", "'", "system", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "request_", "._", "GET_", "._", "get_", "(_", "'", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system_", "=_", "System_", "._", "objects_", "._", "get_", "(_", "hostname_", "=_", "system", "\\u", "hostname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key_", "=_", "key_", ",_", "obj_", "=_", "system_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "rc_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "id", "\":\"", "14", "\"}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "error", "\\u", "message", "\":\"", "Una", "ble", " ", "to", " ", "Delete", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "key", "\\u", "type", "'_", "not_", "in_", "request_", "._", "GET_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "system", "\\u", "id", "'_", "in_", "request_", "._", "GET_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "n_", "=_", "Key", "Value_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "key", "\\u", "value", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "rc_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "id", "\":\"", "%", "s", "\"}'_", "%_", "str_", "(_", "key", "\\u", "value", "\\u", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "truth", "\\u", "id", "'_", "in_", "request_", "._", "GET_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "n_", "=_", "Tru", "th", "Key", "Value_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "key", "\\u", "value", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "rc_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "id", "\":\"", "%", "s", "\"}'_", "%_", "str_", "(_", "key", "\\u", "value", "\\u", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "resp_", "=_", "rc_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "id", "\":\"", "1", "\"}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "resp_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
kvh/ramp/ramp/folds.py
[ { "content": "import logging\nimport random\n\nimport numpy as np\nimport pandas as pd\n\nfrom ramp.builders import build_target_safe\n\n#TODO: how to repeat folds?\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nmake_default_folds = BasicFolds\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class BasicFolds(object):\n", "metadata": "root.BasicFolds", "header": "['module', '___EOS___']", "index": 11 }, { "content": " def __init__(self, num_folds, data, repeat=1, seed=None):\n self.num_folds = num_folds\n self.data = data\n self.seed = seed\n self.repeat = repeat", "metadata": "root.BasicFolds.__init__", "header": "['class', 'BasicFolds', '(', 'object', ')', ':', '___EOS___']", "index": 12 }, { "content": " def __iter__(self):\n n = len(self.data)\n index = self.data.index\n indices = range(n)\n foldsize = n / self.num_folds\n folds = []\n if self.seed is not None:\n np.random.seed(self.seed)\n for i in range(self.repeat):\n np.random.shuffle(indices)\n for i in range(self.num_folds):\n test = index[indices[i*foldsize:(i + 1)*foldsize]]\n train = index - test\n assert not (train & test)\n fold = (pd.Index(train), pd.Index(test))\n yield fold", "metadata": "root.BasicFolds.__iter__", "header": "['class', 'BasicFolds', '(', 'object', ')', ':', '___EOS___']", "index": 18 }, { "content": "class WatertightFolds(BasicFolds):\n \"\"\"\n Ensure that there is no leakage across a particular factor, given by\n `leakage_column`.\n\n For example, if there are multiple entries for a given user, this could be\n used to ensure that each user is completely contained in a single fold.\n \"\"\"\n", "metadata": "root.WatertightFolds", "header": "['module', '___EOS___']", "index": 36 }, { "content": " def __init__(self, num_folds, data, leakage_column, **kwargs):\n super(WatertightFolds, self).__init__(num_folds, data, **kwargs)\n self.leakage_column = leakage_column", "metadata": "root.WatertightFolds.__init__", "header": "['class', 'WatertightFolds', '(', 'BasicFolds', ')', ':', '___EOS___']", "index": 44 }, { "content": " def __iter__(self):\n n = len(self.data)\n index = self.data.index\n indices = range(n)\n foldsize = n / self.num_folds\n folds = []\n\n if self.seed is not None:\n np.random.seed(self.seed)\n\n for i in range(self.repeat):\n watertight_bins = self.data.groupby(self.leakage_column)[self.data.columns[0]].count()\n watertight_bins = watertight_bins.reindex(np.random.permutation(watertight_bins.index))\n watertight_bins_cum = watertight_bins.cumsum()\n for i in range(self.num_folds):\n test_bins = watertight_bins_cum[(watertight_bins_cum > i * foldsize) &\n (watertight_bins_cum <= (i+1) * foldsize)]\n test =index[self.data[self.leakage_column].isin(test_bins.index)]\n train = index - test\n\n # Sanity checks\n assert not (train & test)\n if np.abs(len(test) - foldsize) > 0.05*foldsize:\n # Folds will not be exact in size, but a warning will be\n # emitted if they are far from the expected value.\n logging.warn(\"Fold deviated from expected size. Target: {target} Actual: {actual}\".format(target=foldsize, actual=len(test)))\n fold = (pd.Index(train), pd.Index(test))\n yield fold", "metadata": "root.WatertightFolds.__iter__", "header": "['class', 'WatertightFolds', '(', 'BasicFolds', ')', ':', '___EOS___']", "index": 48 }, { "content": "class BinaryTargetFolds(object):\n\n\n\n", "metadata": "root.BinaryTargetFolds", "header": "['module', '___EOS___']", "index": 78 }, { "content": " def __init__(self, target, data, seed=None):\n self.seed = seed\n self.target = target\n self.data = data\n self.folds = None\n self.y = None", "metadata": "root.BinaryTargetFolds.__init__", "header": "['class', 'BinaryTargetFolds', '(', 'object', ')', ':', '___EOS___']", "index": 79 }, { "content": " def compute_folds(self):\n raise NotImplementedError", "metadata": "root.BinaryTargetFolds.compute_folds", "header": "['class', 'BinaryTargetFolds', '(', 'object', ')', ':', '___EOS___']", "index": 86 }, { "content": " def build_target(self):\n y, ff = build_target_safe(self.target, self.data)\n self.y = y\n self.negatives = y[~y.astype('bool')].index\n self.positives = y[y.astype('bool')].index\n self.n_positives = len(self.positives)\n self.n_negatives = len(self.negatives)", "metadata": "root.BinaryTargetFolds.build_target", "header": "['class', 'BinaryTargetFolds', '(', 'object', ')', ':', '___EOS___']", "index": 89 }, { "content": " def randomize(self):\n if self.seed is not None:\n np.random.seed(self.seed)\n neg = pd.Index(np.random.permutation(self.negatives))\n pos = pd.Index(np.random.permutation(self.positives))\n return neg, pos", "metadata": "root.BinaryTargetFolds.randomize", "header": "['class', 'BinaryTargetFolds', '(', 'object', ')', ':', '___EOS___']", "index": 97 }, { "content": " def __iter__(self):\n if self.y is None:\n self.build_target()\n if self.folds is None:\n self.compute_folds()\n for fold in self.folds:\n yield fold", "metadata": "root.BinaryTargetFolds.__iter__", "header": "['class', 'BinaryTargetFolds', '(', 'object', ')', ':', '___EOS___']", "index": 104 }, { "content": "class BalancedFolds(BinaryTargetFolds):\n", "metadata": "root.BalancedFolds", "header": "['module', '___EOS___']", "index": 113 }, { "content": " def __init__(self, num_folds, target, data, seed=None):\n self.num_folds = num_folds\n super(BalancedFolds, self).__init__(target, data, seed)", "metadata": "root.BalancedFolds.__init__", "header": "['class', 'BalancedFolds', '(', 'BinaryTargetFolds', ')', ':', '___EOS___']", "index": 114 }, { "content": " def compute_folds(self):\n neg, pos = self.randomize()\n nn = len(neg) / self.num_folds\n np = len(pos) / self.num_folds\n folds = []\n for i in range(self.num_folds):\n s = i * nn\n e = (i + 1) * nn\n train_neg, test_neg = neg[:s] + neg[e:], neg[s:e]\n s = i * np\n e = (i + 1) * np\n train_pos, test_pos = pos[:s] + pos[e:], pos[s:e]\n fold = (train_neg + train_pos, test_neg + test_pos)\n folds.append(fold)\n self.folds = folds", "metadata": "root.BalancedFolds.compute_folds", "header": "['class', 'BalancedFolds', '(', 'BinaryTargetFolds', ')', ':', '___EOS___']", "index": 118 }, { "content": "class BootstrapFolds(BalancedFolds):\n\n\n", "metadata": "root.BootstrapFolds", "header": "['module', '___EOS___']", "index": 135 }, { "content": " def __init__(self, num_folds, target, data,\n pos_train=None, pos_test=None, neg_train=None, neg_test=None,\n train_pos_percent=None, test_pos_percent=None, train_percent=None,\n seed=None):\n super(BootstrapFolds, self).__init__(num_folds, target, data, seed)\n if (any([pos_train, pos_test, neg_train, neg_test])\n and not all([pos_train, pos_test, neg_train, neg_test])):\n raise ValueError(\"Please specify all four sizes, or none at all\")\n if (any([train_pos_percent, test_pos_percent, train_percent])\n and not all([train_pos_percent, test_pos_percent, train_percent])):\n raise ValueError(\"Please specify both percentages, or none at all\")\n if (train_pos_percent is None) == (pos_test is None):\n raise ValueError(\"Please specify either sizes or percentages, not both\")\n self.pos_train = pos_train\n self.neg_train = neg_train\n self.pos_test = pos_test\n self.neg_test = neg_test\n self.train_pos_percent = train_pos_percent\n self.test_pos_percent = test_pos_percent\n self.train_percent = train_percent\n self.using_percents = False\n if self.test_pos_percent is not None:\n self.using_percents = True", "metadata": "root.BootstrapFolds.__init__", "header": "['class', 'BootstrapFolds', '(', 'BalancedFolds', ')', ':', '___EOS___']", "index": 136 }, { "content": " def from_sizes(self):\n train_neg = pd.Index(np.random.choice(self.negatives, self.neg_train, replace=True))\n test_neg = pd.Index(np.random.choice(self.negatives - train_neg, self.neg_test, replace=True))\n train_pos = pd.Index(np.random.choice(self.positives, self.pos_train, replace=True))\n test_pos = pd.Index(np.random.choice(self.positives - train_pos, self.pos_test, replace=True))\n return train_neg, test_neg, train_pos, test_pos", "metadata": "root.BootstrapFolds.from_sizes", "header": "['class', 'BootstrapFolds', '(', 'BalancedFolds', ')', ':', '___EOS___']", "index": 160 }, { "content": " def from_percents(self):\n # Assumes positive is constrained (rarer) class\n rp = self.train_percent * self.n_positives\n tp = (1 - self.train_percent) * self.n_positives\n rn = rp / self.train_pos_percent - rp\n tn = tp / self.test_pos_percent - tp\n train_neg = pd.Index(np.random.choice(self.negatives,\n int(rn),\n replace=True))\n test_neg = pd.Index(np.random.choice(self.negatives - train_neg,\n int(tn),\n replace=True))\n train_pos = pd.Index(np.random.choice(self.positives,\n int(rp),\n replace=True))\n test_pos = pd.Index(np.random.choice(self.positives - train_pos,\n int(tp),\n replace=True))\n return train_neg, test_neg, train_pos, test_pos", "metadata": "root.BootstrapFolds.from_percents", "header": "['class', 'BootstrapFolds', '(', 'BalancedFolds', ')', ':', '___EOS___']", "index": 167 }, { "content": " def compute_folds(self):\n if self.seed is not None:\n np.random.seed(self.seed)\n folds = []\n for i in range(self.num_folds):\n if self.using_percents:\n train_neg, test_neg, train_pos, test_pos = self.from_percents()\n else:\n train_neg, test_neg, train_pos, test_pos = self.from_sizes()\n fold = (train_neg.append(train_pos), test_neg.append(test_pos))\n folds.append(fold)\n self.folds = folds", "metadata": "root.BootstrapFolds.compute_folds", "header": "['class', 'BootstrapFolds', '(', 'BalancedFolds', ')', ':', '___EOS___']", "index": 187 }, { "content": "class BootstrapFoldsByPercentPositive(BootstrapFolds):\n", "metadata": "root.BootstrapFoldsByPercentPositive", "header": "['module', '___EOS___']", "index": 201 }, { "content": " def __init__(self, num_folds, target, data,\n train_pos_percent, test_pos_percent, train_percent,\n seed=None):\n super(BootstrapFoldsByPercentPositive,\n self).__init__(num_folds, target, data, seed=seed,\n train_pos_percent=train_pos_percent,\n test_pos_percent=test_pos_percent,\n train_percent=train_percent)", "metadata": "root.BootstrapFoldsByPercentPositive.__init__", "header": "['class', 'BootstrapFoldsByPercentPositive', '(', 'BootstrapFolds', ')', ':', '___EOS___']", "index": 203 }, { "content": "class BootstrapFoldsBySize(BootstrapFolds):\n", "metadata": "root.BootstrapFoldsBySize", "header": "['module', '___EOS___']", "index": 212 }, { "content": " def __init__(self, num_folds, target, data,\n pos_train=None, pos_test=None, neg_train=None, neg_test=None,\n seed=None):\n super(BootstrapFoldsBySize, self).__init__(num_folds, target, data, seed=seed,\n pos_train=pos_train,\n pos_test=pos_test,\n neg_train=neg_train,\n neg_test=neg_test)", "metadata": "root.BootstrapFoldsBySize.__init__", "header": "['class', 'BootstrapFoldsBySize', '(', 'BootstrapFolds', ')', ':', '___EOS___']", "index": 214 } ]
[ { "span": "import random", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 13 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pandas_", "as_", "pd_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "ramp", "_", "._", "builders_", "import_", "build", "\\u", "target", "\\u", "safe_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "TOD", "O", ":", " ", "how", " ", "to", " ", "repeat", " ", "fold", "s", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "make", "\\u", "default", "\\u", "folds_", "=_", "Basic", "Fold", "s_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Basic", "Fold", "s_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Basic", "Fold", "s_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "num", "\\u", "folds_", ",_", "data_", ",_", "repeat_", "=_", "1_", ",_", "seed_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "num", "\\u", "folds_", "=_", "num", "\\u", "folds_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "data_", "=_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "seed_", "=_", "seed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "repeat_", "=_", "repeat_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "Fold", "s_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "iter\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "len_", "(_", "self_", "._", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index_", "=_", "self_", "._", "data_", "._", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "indices_", "=_", "range_", "(_", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fold", "size_", "=_", "n_", "/_", "self_", "._", "num", "\\u", "folds_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "folds_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "seed_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "np_", "._", "random_", "._", "seed_", "(_", "self_", "._", "seed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "self_", "._", "repeat_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "np_", "._", "random_", "._", "shuffle_", "(_", "indices_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "self_", "._", "num", "\\u", "folds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test_", "=_", "index_", "[_", "indices_", "[_", "i_", "*_", "fold", "size_", ":_", "(_", "i_", "+_", "1_", ")_", "*_", "fold", "size_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train_", "=_", "index_", "-_", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "(_", "train_", "&_", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fold_", "=_", "(_", "pd_", "._", "Index_", "(_", "train_", ")_", ",_", "pd_", "._", "Index_", "(_", "test_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "fold_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Water", "tig", "ht", "Fold", "s_", "(_", "Basic", "Fold", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Ensur", "e", " ", "tha", "t", " ", "there", " ", "is", " ", "no", " ", "leak", "age", " ", "acro", "ss", " ", "a", " ", "partic", "ular", " ", "factor", ",", " ", "give", "n", " ", "by", "\\", "10", ";", " ", " ", " ", " ", "`", "leak", "age", "\\u", "column", "`.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "For", " ", "example", ",", " ", "if", " ", "there", " ", "are", " ", "multiple", " ", "entri", "es", " ", "for", " ", "a", " ", "give", "n", " ", "user", ",", " ", "this", " ", "coul", "d", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "used", " ", "to", " ", "ensure", " ", "tha", "t", " ", "each", " ", "user", " ", "is", " ", "complete", "ly", " ", "contain", "ed", " ", "in", " ", "a", " ", "single", " ", "fold", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Water", "tig", "ht", "Fold", "s_", "(_", "Basic", "Fold", "s_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "num", "\\u", "folds_", ",_", "data_", ",_", "leak", "age", "\\u", "column_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Water", "tig", "ht", "Fold", "s_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "num", "\\u", "folds_", ",_", "data_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "leak", "age", "\\u", "column_", "=_", "leak", "age", "\\u", "column_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Water", "tig", "ht", "Fold", "s_", "(_", "Basic", "Fold", "s_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "iter\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "len_", "(_", "self_", "._", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index_", "=_", "self_", "._", "data_", "._", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "indices_", "=_", "range_", "(_", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fold", "size_", "=_", "n_", "/_", "self_", "._", "num", "\\u", "folds_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "folds_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "seed_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "np_", "._", "random_", "._", "seed_", "(_", "self_", "._", "seed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "self_", "._", "repeat_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "water", "tig", "ht", "\\u", "bins_", "=_", "self_", "._", "data_", "._", "groupby_", "(_", "self_", "._", "leak", "age", "\\u", "column_", ")_", "[_", "self_", "._", "data_", "._", "columns_", "[_", "0_", "]_", "]_", "._", "count_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "water", "tig", "ht", "\\u", "bins_", "=_", "water", "tig", "ht", "\\u", "bins_", "._", "reindex", "_", "(_", "np_", "._", "random_", "._", "permutation_", "(_", "water", "tig", "ht", "\\u", "bins_", "._", "index_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "water", "tig", "ht", "\\u", "bins", "\\u", "cum", "_", "=_", "water", "tig", "ht", "\\u", "bins_", "._", "cumsum_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "self_", "._", "num", "\\u", "folds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "bins_", "=_", "water", "tig", "ht", "\\u", "bins", "\\u", "cum", "_", "[_", "(_", "water", "tig", "ht", "\\u", "bins", "\\u", "cum", "_", ">_", "i_", "*_", "fold", "size_", ")_", "&_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "water", "tig", "ht", "\\u", "bins", "\\u", "cum", "_", "<=_", "(_", "i_", "+_", "1_", ")_", "*_", "fold", "size_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test_", "=_", "index_", "[_", "self_", "._", "data_", "[_", "self_", "._", "leak", "age", "\\u", "column_", "]_", "._", "isin_", "(_", "test\\u", "bins_", "._", "index_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train_", "=_", "index_", "-_", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sanit", "y", " ", "checks_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "not_", "(_", "train_", "&_", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "np_", "._", "abs_", "(_", "len_", "(_", "test_", ")_", "-_", "fold", "size_", ")_", ">_", "0.05_", "*_", "fold", "size_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fold", "s", " ", "will", " ", "not", " ", "be", " ", "exact", " ", "in", " ", "size", ",", " ", "but", " ", "a", " ", "warn", "ing", " ", "will", " ", "be_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "emitte", "d", " ", "if", " ", "the", "y", " ", "are", " ", "far", " ", "from", " ", "the", " ", "expected", " ", "value", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "logging_", "._", "warn_", "(_", "\"", "Fold", " ", "devi", "ated", " ", "from", " ", "expected", " ", "size", ".", " ", "Target", ":", " ", "{", "target", "}", " ", "Actual", ":", " ", "{", "actual", "}\"_", "._", "format_", "(_", "target_", "=_", "fold", "size_", ",_", "actual_", "=_", "len_", "(_", "test_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fold_", "=_", "(_", "pd_", "._", "Index_", "(_", "train_", ")_", ",_", "pd_", "._", "Index_", "(_", "test_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "fold_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Bin", "ary", "Target", "Fold", "s_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Bin", "ary", "Target", "Fold", "s_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "target_", ",_", "data_", ",_", "seed_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "seed_", "=_", "seed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "target_", "=_", "target_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "data_", "=_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "folds_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "y_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bin", "ary", "Target", "Fold", "s_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "compute", "\\u", "folds_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bin", "ary", "Target", "Fold", "s_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "\\u", "target_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "y_", ",_", "ff_", "=_", "build", "\\u", "target", "\\u", "safe_", "(_", "self_", "._", "target_", ",_", "self_", "._", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "y_", "=_", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "negatives", "_", "=_", "y_", "[_", "~_", "y_", "._", "astype_", "(_", "'", "bool", "'_", ")_", "]_", "._", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "positives", "_", "=_", "y_", "[_", "y_", "._", "astype_", "(_", "'", "bool", "'_", ")_", "]_", "._", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "n", "\\u", "positives", "_", "=_", "len_", "(_", "self_", "._", "positives", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "n", "\\u", "negatives", "_", "=_", "len_", "(_", "self_", "._", "negatives", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bin", "ary", "Target", "Fold", "s_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "randomize", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "seed_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "np_", "._", "random_", "._", "seed_", "(_", "self_", "._", "seed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "neg_", "=_", "pd_", "._", "Index_", "(_", "np_", "._", "random_", "._", "permutation_", "(_", "self_", "._", "negatives", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "=_", "pd_", "._", "Index_", "(_", "np_", "._", "random_", "._", "permutation_", "(_", "self_", "._", "positives", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "neg_", ",_", "pos_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bin", "ary", "Target", "Fold", "s_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "iter\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "y_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "build", "\\u", "target_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "folds_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "compute", "\\u", "folds_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "fold_", "in_", "self_", "._", "folds_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "fold_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Balance", "d", "Fold", "s_", "(_", "Bin", "ary", "Target", "Fold", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Balance", "d", "Fold", "s_", "(_", "Bin", "ary", "Target", "Fold", "s_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "num", "\\u", "folds_", ",_", "target_", ",_", "data_", ",_", "seed_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "num", "\\u", "folds_", "=_", "num", "\\u", "folds_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Balance", "d", "Fold", "s_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "target_", ",_", "data_", ",_", "seed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Balance", "d", "Fold", "s_", "(_", "Bin", "ary", "Target", "Fold", "s_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "compute", "\\u", "folds_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "neg_", ",_", "pos_", "=_", "self_", "._", "randomize", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nn_", "=_", "len_", "(_", "neg_", ")_", "/_", "self_", "._", "num", "\\u", "folds_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "np_", "=_", "len_", "(_", "pos_", ")_", "/_", "self_", "._", "num", "\\u", "folds_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "folds_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "self_", "._", "num", "\\u", "folds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "i_", "*_", "nn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "=_", "(_", "i_", "+_", "1_", ")_", "*_", "nn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "\\u", "neg_", ",_", "test\\u", "neg_", "=_", "neg_", "[_", ":_", "s_", "]_", "+_", "neg_", "[_", "e_", ":_", "]_", ",_", "neg_", "[_", "s_", ":_", "e_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "i_", "*_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "=_", "(_", "i_", "+_", "1_", ")_", "*_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "\\u", "pos_", ",_", "test\\u", "pos_", "=_", "pos_", "[_", ":_", "s_", "]_", "+_", "pos_", "[_", "e_", ":_", "]_", ",_", "pos_", "[_", "s_", ":_", "e_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fold_", "=_", "(_", "train", "\\u", "neg_", "+_", "train", "\\u", "pos_", ",_", "test\\u", "neg_", "+_", "test\\u", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "folds_", "._", "append_", "(_", "fold_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "folds_", "=_", "folds_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Boots", "trap", "Fold", "s_", "(_", "Balance", "d", "Fold", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Boots", "trap", "Fold", "s_", "(_", "Balance", "d", "Fold", "s_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "num", "\\u", "folds_", ",_", "target_", ",_", "data_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pos", "\\u", "train_", "=_", "None_", ",_", "pos", "\\u", "test_", "=_", "None_", ",_", "neg", "\\u", "train_", "=_", "None_", ",_", "neg", "\\u", "test_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "train", "\\u", "pos", "\\u", "percent_", "=_", "None_", ",_", "test\\u", "pos", "\\u", "percent_", "=_", "None_", ",_", "train", "\\u", "percent_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seed_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Boots", "trap", "Fold", "s_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "num", "\\u", "folds_", ",_", "target_", ",_", "data_", ",_", "seed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "any_", "(_", "[_", "pos", "\\u", "train_", ",_", "pos", "\\u", "test_", ",_", "neg", "\\u", "train_", ",_", "neg", "\\u", "test_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "and_", "not_", "all_", "(_", "[_", "pos", "\\u", "train_", ",_", "pos", "\\u", "test_", ",_", "neg", "\\u", "train_", ",_", "neg", "\\u", "test_", "]_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Ple", "ase", " ", "speci", "fy", " ", "all", " ", "four", " ", "size", "s", ",", " ", "or", " ", "none", " ", "at", " ", "all", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "any_", "(_", "[_", "train", "\\u", "pos", "\\u", "percent_", ",_", "test\\u", "pos", "\\u", "percent_", ",_", "train", "\\u", "percent_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "and_", "not_", "all_", "(_", "[_", "train", "\\u", "pos", "\\u", "percent_", ",_", "test\\u", "pos", "\\u", "percent_", ",_", "train", "\\u", "percent_", "]_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Ple", "ase", " ", "speci", "fy", " ", "bot", "h", " ", "percentage", "s", ",", " ", "or", " ", "none", " ", "at", " ", "all", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "train", "\\u", "pos", "\\u", "percent_", "is_", "None_", ")_", "==_", "(_", "pos", "\\u", "test_", "is_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Ple", "ase", " ", "speci", "fy", " ", "eit", "her", " ", "size", "s", " ", "or", " ", "percentage", "s", ",", " ", "not", " ", "bot", "h", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "pos", "\\u", "train_", "=_", "pos", "\\u", "train_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "neg", "\\u", "train_", "=_", "neg", "\\u", "train_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "pos", "\\u", "test_", "=_", "pos", "\\u", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "neg", "\\u", "test_", "=_", "neg", "\\u", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "train", "\\u", "pos", "\\u", "percent_", "=_", "train", "\\u", "pos", "\\u", "percent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "test\\u", "pos", "\\u", "percent_", "=_", "test\\u", "pos", "\\u", "percent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "train", "\\u", "percent_", "=_", "train", "\\u", "percent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "usi", "ng", "\\u", "percent", "s_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "test\\u", "pos", "\\u", "percent_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "usi", "ng", "\\u", "percent", "s_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Boots", "trap", "Fold", "s_", "(_", "Balance", "d", "Fold", "s_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "from", "\\u", "sizes_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "train", "\\u", "neg_", "=_", "pd_", "._", "Index_", "(_", "np_", "._", "random_", "._", "choice_", "(_", "self_", "._", "negatives", "_", ",_", "self_", "._", "neg", "\\u", "train_", ",_", "replace_", "=_", "True_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "neg_", "=_", "pd_", "._", "Index_", "(_", "np_", "._", "random_", "._", "choice_", "(_", "self_", "._", "negatives", "_", "-_", "train", "\\u", "neg_", ",_", "self_", "._", "neg", "\\u", "test_", ",_", "replace_", "=_", "True_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "\\u", "pos_", "=_", "pd_", "._", "Index_", "(_", "np_", "._", "random_", "._", "choice_", "(_", "self_", "._", "positives", "_", ",_", "self_", "._", "pos", "\\u", "train_", ",_", "replace_", "=_", "True_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "pos_", "=_", "pd_", "._", "Index_", "(_", "np_", "._", "random_", "._", "choice_", "(_", "self_", "._", "positives", "_", "-_", "train", "\\u", "pos_", ",_", "self_", "._", "pos", "\\u", "test_", ",_", "replace_", "=_", "True_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "train", "\\u", "neg_", ",_", "test\\u", "neg_", ",_", "train", "\\u", "pos_", ",_", "test\\u", "pos_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Boots", "trap", "Fold", "s_", "(_", "Balance", "d", "Fold", "s_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "from", "\\u", "percent", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Assume", "s", " ", "posit", "ive", " ", "is", " ", "constrained", " ", "(", "rare", "r", ")", " ", "class_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rp_", "=_", "self_", "._", "train", "\\u", "percent_", "*_", "self_", "._", "n", "\\u", "positives", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tp_", "=_", "(_", "1_", "-_", "self_", "._", "train", "\\u", "percent_", ")_", "*_", "self_", "._", "n", "\\u", "positives", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rn_", "=_", "rp_", "/_", "self_", "._", "train", "\\u", "pos", "\\u", "percent_", "-_", "rp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tn_", "=_", "tp_", "/_", "self_", "._", "test\\u", "pos", "\\u", "percent_", "-_", "tp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "\\u", "neg_", "=_", "pd_", "._", "Index_", "(_", "np_", "._", "random_", "._", "choice_", "(_", "self_", "._", "negatives", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "int_", "(_", "rn_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "replace_", "=_", "True_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "neg_", "=_", "pd_", "._", "Index_", "(_", "np_", "._", "random_", "._", "choice_", "(_", "self_", "._", "negatives", "_", "-_", "train", "\\u", "neg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "int_", "(_", "tn_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "replace_", "=_", "True_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "\\u", "pos_", "=_", "pd_", "._", "Index_", "(_", "np_", "._", "random_", "._", "choice_", "(_", "self_", "._", "positives", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "int_", "(_", "rp_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "replace_", "=_", "True_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "pos_", "=_", "pd_", "._", "Index_", "(_", "np_", "._", "random_", "._", "choice_", "(_", "self_", "._", "positives", "_", "-_", "train", "\\u", "pos_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "int_", "(_", "tp_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "replace_", "=_", "True_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "train", "\\u", "neg_", ",_", "test\\u", "neg_", ",_", "train", "\\u", "pos_", ",_", "test\\u", "pos_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Boots", "trap", "Fold", "s_", "(_", "Balance", "d", "Fold", "s_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "compute", "\\u", "folds_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "seed_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "np_", "._", "random_", "._", "seed_", "(_", "self_", "._", "seed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "folds_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "self_", "._", "num", "\\u", "folds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "usi", "ng", "\\u", "percent", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "train", "\\u", "neg_", ",_", "test\\u", "neg_", ",_", "train", "\\u", "pos_", ",_", "test\\u", "pos_", "=_", "self_", "._", "from", "\\u", "percent", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "train", "\\u", "neg_", ",_", "test\\u", "neg_", ",_", "train", "\\u", "pos_", ",_", "test\\u", "pos_", "=_", "self_", "._", "from", "\\u", "sizes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fold_", "=_", "(_", "train", "\\u", "neg_", "._", "append_", "(_", "train", "\\u", "pos_", ")_", ",_", "test\\u", "neg_", "._", "append_", "(_", "test\\u", "pos_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "folds_", "._", "append_", "(_", "fold_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "folds_", "=_", "folds_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Boots", "trap", "Fold", "s", "By", "Perce", "nt", "Posi", "tive_", "(_", "Boots", "trap", "Fold", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Boots", "trap", "Fold", "s", "By", "Perce", "nt", "Posi", "tive_", "(_", "Boots", "trap", "Fold", "s_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "num", "\\u", "folds_", ",_", "target_", ",_", "data_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "train", "\\u", "pos", "\\u", "percent_", ",_", "test\\u", "pos", "\\u", "percent_", ",_", "train", "\\u", "percent_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seed_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Boots", "trap", "Fold", "s", "By", "Perce", "nt", "Posi", "tive_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "num", "\\u", "folds_", ",_", "target_", ",_", "data_", ",_", "seed_", "=_", "seed_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "train", "\\u", "pos", "\\u", "percent_", "=_", "train", "\\u", "pos", "\\u", "percent_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "pos", "\\u", "percent_", "=_", "test\\u", "pos", "\\u", "percent_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "train", "\\u", "percent_", "=_", "train", "\\u", "percent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Boots", "trap", "Fold", "s", "By", "Size_", "(_", "Boots", "trap", "Fold", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Boots", "trap", "Fold", "s", "By", "Size_", "(_", "Boots", "trap", "Fold", "s_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "num", "\\u", "folds_", ",_", "target_", ",_", "data_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pos", "\\u", "train_", "=_", "None_", ",_", "pos", "\\u", "test_", "=_", "None_", ",_", "neg", "\\u", "train_", "=_", "None_", ",_", "neg", "\\u", "test_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seed_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Boots", "trap", "Fold", "s", "By", "Size_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "num", "\\u", "folds_", ",_", "target_", ",_", "data_", ",_", "seed_", "=_", "seed_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pos", "\\u", "train_", "=_", "pos", "\\u", "train_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pos", "\\u", "test_", "=_", "pos", "\\u", "test_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "neg", "\\u", "train_", "=_", "neg", "\\u", "train_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "neg", "\\u", "test_", "=_", "neg", "\\u", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
flashingpumpkin/django-socialregistration/socialregistration/contrib/openid/tests.py
[ { "content": " def test_tag_renders_correctly(self):\n render = lambda tpl: template.Template(\n tpl).render(template.Context({'request':None}))\n \n tpl = \"\"\"{% load openid %}{% openid_form %}\"\"\"\n \n rendered = render(tpl)\n\n self.assertTrue('form' in rendered)\n \n tpl = \"\"\"\n\t{% load openid %}\n\t{% openid_form \"https://www.google.com/accounts/o8/id\" \"image/for/google.jpg\" %}\n\t\"\"\"\n \n rendered = render(tpl)\n\n self.assertTrue('https://www.google.com/accounts/o8/id' in rendered)\n\n self.assertTrue('image/for/google.jpg' in rendered)", "metadata": "root.TestTemplateTag.test_tag_renders_correctly", "header": "['class', 'TestTemplateTag', '(', 'TestCase', ')', ':', '___EOS___']", "index": 6 }, { "content": " def test_authentication_backend_should_be_configured_in_settings(self):\n self.assertTrue('socialregistration.contrib.openid.auth.OpenIDAuth' in settings.AUTHENTICATION_BACKENDS)", "metadata": "root.TestAuthenticationBackend.test_authentication_backend_should_be_configured_in_settings", "header": "['class', 'TestAuthenticationBackend', '(', 'TestCase', ')', ':', '___EOS___']", "index": 30 } ]
[ { "span": "self.assertTrue('form' in rendered)", "start_line": 14, "start_column": 8, "end_line": 14, "end_column": 43 }, { "span": "self.assertTrue('https://www.google.com/accounts/o8/id' in rendered)", "start_line": 23, "start_column": 8, "end_line": 23, "end_column": 76 }, { "span": "self.assertTrue('image/for/google.jpg' in rendered)", "start_line": 25, "start_column": 8, "end_line": 25, "end_column": 59 }, { "span": "self.assertTrue('socialregistration.contrib.openid.auth.OpenIDAuth' in settings.AUTHENTICATION_BACKENDS)", "start_line": 31, "start_column": 8, "end_line": 31, "end_column": 112 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Templa", "te", "Tag_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "tag", "\\u", "render", "s", "\\u", "correct", "ly_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "render_", "=_", "lambda_", "tpl_", ":_", "template_", "._", "Template_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "tpl_", ")_", "._", "render_", "(_", "template_", "._", "Context_", "(_", "{_", "'", "request", "'_", ":_", "None_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tpl_", "=_", "\"\"\"{", "%", " ", "load", " ", "openid", " ", "%}", "{%", " ", "openid", "\\u", "form", " ", "%}", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rendered_", "=_", "render_", "(_", "tpl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "form", "'_", "in_", "rendered_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tpl_", "=_", "\"\"\"", "\\", "10", ";", "\t", "{%", " ", "load", " ", "openid", " ", "%}", "\\", "10", ";", "\t", "{%", " ", "openid", "\\u", "form", " ", "\"", "https", "://", "www", ".", "google", ".", "com", "/", "account", "s", "/", "o", "8", "/", "id", "\"", " ", "\"", "image", "/", "for", "/", "google", ".", "jp", "g", "\"", " ", "%}", "\\", "10", ";", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rendered_", "=_", "render_", "(_", "tpl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "https", "://", "www", ".", "google", ".", "com", "/", "account", "s", "/", "o", "8", "/", "id", "'_", "in_", "rendered_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "image", "/", "for", "/", "google", ".", "jp", "g", "'_", "in_", "rendered_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Auth", "entica", "tion", "Backend_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "authenticat", "ion", "\\u", "back", "end", "\\u", "shou", "ld", "\\u", "be", "\\u", "configur", "ed", "\\u", "in", "\\u", "settings_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "'", "social", "registration", ".", "contrib", ".", "openid", ".", "auth", ".", "Open", "IDA", "uth", "'_", "in_", "settings_", "._", "AUTHENTICATION", "\\u", "BACKENDS", "_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
Imprecise assert
SmokinCaterpillar/pypet/pypet/tests/integration/environment_test.py
[ { "content": " def test_full_store(self):\n filename = make_temp_dir('full_store.hdf5')\n with Environment(filename=filename,\n log_config=get_log_config()) as env:\n\n traj = env.v_trajectory\n\n traj.par.x = Parameter('x', 3, 'jj')\n\n traj.f_explore({'x': [1,2,3]})\n\n env.f_run(add_one_particular_item, True)\n\n traj = load_trajectory(index=-1, filename=filename)\n\n self.assertTrue('hi' in traj)", "metadata": "root.FullStorageTest.test_full_store", "header": "['class', 'FullStorageTest', '(', 'TrajectoryComparator', ')', ':', '___EOS___']", "index": 62 }, { "content": " def test_file_overwriting(self):\n self.traj.f_store()\n\n with ptcompat.open_file(self.filename, mode='r') as file:\n nchildren = len(file.root._v_children)\n self.assertTrue(nchildren > 0)\n\n env2 = Environment(filename=self.filename,\n log_config=get_log_config())\n traj2 = env2.v_trajectory\n traj2.f_store()\n\n self.assertTrue(os.path.exists(self.filename))\n\n with ptcompat.open_file(self.filename, mode='r') as file:\n nchildren = len(file.root._v_children)\n self.assertTrue(nchildren > 1)\n\n env3 = Environment(filename=self.filename, overwrite_file=True,\n log_config=get_log_config())\n\n self.assertFalse(os.path.exists(self.filename))\n\n env2.f_disable_logging()\n env3.f_disable_logging()", "metadata": "root.EnvironmentTest.test_file_overwriting", "header": "['class', 'EnvironmentTest', '(', 'TrajectoryComparator', ')', ':', '___EOS___']", "index": 302 }, { "content": " def test_time_display_of_loading(self):\n filename = make_temp_dir('sloooow.hdf5')\n env = Environment(trajectory='traj', add_time=True, filename=filename,\n log_stdout=False,\n log_config=get_log_config(),\n dynamic_imports=SlowResult,\n display_time=0.1)\n traj = env.v_traj\n res=traj.f_add_result(SlowResult, 'iii', 42, 43, comment='llk')\n traj.f_store()\n service_logger = traj.v_storage_service._logger\n root = logging.getLogger('pypet')\n old_level = root.level\n service_logger.setLevel(logging.INFO)\n root.setLevel(logging.INFO)\n\n traj.f_load(load_data=3)\n service_logger.setLevel(old_level)\n root.setLevel(old_level)\n\n path = get_log_path(traj)\n mainfilename = os.path.join(path, 'LOG.txt')\n with open(mainfilename, mode='r') as mainf:\n full_text = mainf.read()\n self.assertTrue('nodes/s)' in full_text)\n\n env.f_disable_logging()", "metadata": "root.EnvironmentTest.test_time_display_of_loading", "header": "['class', 'EnvironmentTest', '(', 'TrajectoryComparator', ')', ':', '___EOS___']", "index": 328 }, { "content": " def test_just_one_run(self):\n self.make_run()\n self.assertTrue(self.traj.f_is_completed())\n\n newtraj = self.load_trajectory(trajectory_name=self.traj.v_name,as_new=False)\n self.traj.f_load_skeleton()\n self.traj.f_load_items(self.traj.f_to_dict().keys(), only_empties=True)\n\n self.compare_trajectories(self.traj, newtraj)\n\n self.assertTrue(len(newtraj) == 1)\n\n size=os.path.getsize(self.filename)\n size_in_mb = size/1000000.\n get_root_logger().info('Size is %sMB' % str(size_in_mb))\n self.assertTrue(size_in_mb < 2.0, 'Size is %sMB > 6MB' % str(size_in_mb))\n\n with self.assertRaises(TypeError):\n self.explore(self.traj)", "metadata": "root.EnvironmentTest.test_just_one_run", "header": "['class', 'EnvironmentTest', '(', 'TrajectoryComparator', ')', ':', '___EOS___']", "index": 488 }, { "content": " def test_store_form_tuple(self):\n self.traj.f_store()\n\n self.traj.f_add_result('TestResItem', 42, 43)\n\n with self.assertRaises(ValueError):\n self.traj.f_store_item((pypetconstants.LEAF, self.traj.TestResItem,(),{},5))\n\n self.traj.f_store_item((pypetconstants.LEAF, self.traj.TestResItem))\n\n self.traj.results.f_remove_child('TestResItem')\n\n self.assertTrue('TestResItem' not in self.traj)\n\n self.traj.results.f_load_child('TestResItem', load_data=pypetconstants.LOAD_SKELETON)\n\n self.traj.f_load_item((pypetconstants.LEAF,self.traj.TestResItem,(),{'load_only': 'TestResItem'}))\n\n self.assertTrue(self.traj.TestResItem, 42)", "metadata": "root.EnvironmentTest.test_store_form_tuple", "header": "['class', 'EnvironmentTest', '(', 'TrajectoryComparator', ')', ':', '___EOS___']", "index": 647 }, { "content": " def test_store_single_group(self):\n self.traj.f_store()\n\n self.traj.f_add_parameter_group('new.test.group').v_annotations.f_set(42)\n\n self.traj.f_store_item('new.group')\n\n\n # group is below test not new, so ValueError thrown:\n with self.assertRaises(ValueError):\n self.traj.parameters.new.f_remove_child('group')\n\n # group is below test not new, so ValueError thrown:\n with self.assertRaises(ValueError):\n self.traj.parameters.new.f_store_child('group')\n\n # group has children and recursive is false\n with self.assertRaises(TypeError):\n self.traj.parameters.new.f_remove_child('test')\n\n\n self.traj.new.f_remove_child('test', recursive=True)\n\n self.assertTrue('new.group' not in self.traj)\n\n self.traj.new.f_load_child('test', recursive=True, load_data=pypetconstants.LOAD_SKELETON)\n\n self.assertTrue(self.traj.new.group.v_annotations.annotation, 42)\n\n self.traj.f_delete_item('new.test.group')\n\n with self.assertRaises(pex.DataNotInStorageError):\n self.traj.parameters.f_load_child('new.test.group',\n load_data=pypetconstants.LOAD_SKELETON)", "metadata": "root.EnvironmentTest.test_store_single_group", "header": "['class', 'EnvironmentTest', '(', 'TrajectoryComparator', ')', ':', '___EOS___']", "index": 667 }, { "content": " def test_if_results_are_sorted_correctly_manual_runs(self):\n ###Explore\n self.explore(self.traj)\n self.traj.f_store(only_init=True)\n man_multiply = manual_run()(multiply_with_storing)\n for idx in self.traj.f_iter_runs(yields='idx'):\n self.assertTrue(isinstance(idx, int))\n man_multiply(self.traj)\n traj = self.traj\n traj.f_store()\n self.assertTrue(len(traj), 5)\n self.assertTrue(len(traj) == len(compat.listvalues(self.explore_dict)[0]))\n\n self.traj.f_load_skeleton()\n self.traj.f_load_items(self.traj.f_to_dict().keys(), only_empties=True)\n self.check_if_z_is_correct(traj)\n\n newtraj = self.load_trajectory(trajectory_name=self.traj.v_name,as_new=False)\n self.traj.f_load_skeleton()\n self.traj.f_load_items(self.traj.f_to_dict().keys(), only_empties=True)\n\n self.compare_trajectories(self.traj,newtraj)", "metadata": "root.ResultSortTest.test_if_results_are_sorted_correctly_manual_runs", "header": "['class', 'ResultSortTest', '(', 'TrajectoryComparator', ')', ':', '___EOS___']", "index": 913 }, { "content": " def test_if_results_are_sorted_correctly_using_map(self):\n ###Explore\n self.explore(self.traj)\n\n args1=[10*x for x in range(len(self.traj))]\n args2=[100*x for x in range(len(self.traj))]\n args3=list(range(len(self.traj)))\n\n results = self.env.f_run_map(multiply_args, args1, arg2=args2, arg3=args3)\n self.assertEqual(len(results), len(self.traj))\n\n traj = self.traj\n self.assertTrue(len(traj) == len(compat.listvalues(self.explore_dict)[0]))\n\n self.traj.f_load_skeleton()\n self.traj.f_load_items(self.traj.f_to_dict().keys(), only_empties=True)\n self.check_if_z_is_correct_map(traj, args1, args2, args3)\n\n for res in results:\n self.assertEqual(len(res), 2)\n self.assertTrue(isinstance(res[0], int))\n self.assertTrue(isinstance(res[1], int))\n idx = res[0]\n self.assertEqual(self.traj.res.runs[idx].z, res[1])\n\n newtraj = self.load_trajectory(trajectory_name=self.traj.v_name,as_new=False)\n self.traj.f_load_skeleton()\n self.traj.f_load_items(self.traj.f_to_dict().keys(), only_empties=True)\n\n self.assertEqual(len(traj), 5)\n self.compare_trajectories(self.traj,newtraj)", "metadata": "root.ResultSortTest.test_if_results_are_sorted_correctly_using_map", "header": "['class', 'ResultSortTest', '(', 'TrajectoryComparator', ')', ':', '___EOS___']", "index": 936 }, { "content": " def test_if_results_are_sorted_correctly(self):\n\n ###Explore\n self.explore(self.traj)\n\n results = self.env.f_run(multiply)\n self.are_results_in_order(results)\n self.assertEqual(len(results), len(self.traj))\n\n\n traj = self.traj\n self.assertTrue(len(traj) == len(compat.listvalues(self.explore_dict)[0]))\n\n self.traj.f_load_skeleton()\n self.traj.f_load_items(self.traj.f_to_dict().keys(), only_empties=True)\n self.check_if_z_is_correct(traj)\n\n for res in results:\n self.assertEqual(len(res), 2)\n self.assertTrue(isinstance(res[0], int))\n self.assertTrue(isinstance(res[1], int))\n idx = res[0]\n self.assertEqual(self.traj.res.runs[idx].z, res[1])\n\n newtraj = self.load_trajectory(trajectory_name=self.traj.v_name,as_new=False)\n self.traj.f_load_skeleton()\n self.traj.f_load_items(self.traj.f_to_dict().keys(), only_empties=True)\n\n self.compare_trajectories(self.traj,newtraj)", "metadata": "root.ResultSortTest.test_if_results_are_sorted_correctly", "header": "['class', 'ResultSortTest', '(', 'TrajectoryComparator', ')', ':', '___EOS___']", "index": 968 }, { "content": " def test_f_iter_runs(self):\n\n ###Explore\n self.explore(self.traj)\n\n\n results = self.env.f_run(multiply)\n self.are_results_in_order(results)\n traj = self.traj\n self.assertTrue(len(traj) == len(compat.listvalues(self.explore_dict)[0]))\n\n self.traj.f_load_skeleton()\n self.traj.f_load_items(self.traj.f_to_dict().keys(), only_empties=True)\n self.check_if_z_is_correct(traj)\n\n newtraj = self.load_trajectory(trajectory_name=self.traj.v_name,as_new=False)\n self.traj.f_load_skeleton()\n self.traj.f_load_items(self.traj.f_to_dict().keys(), only_empties=True)\n\n for idx, run_name in enumerate(self.traj.f_iter_runs()):\n newtraj.v_crun=run_name\n self.traj.v_idx = idx\n newtraj.v_idx = idx\n nameset = set((x.v_name for x in traj.f_iter_nodes(predicate=(idx,))))\n self.assertTrue('run_%08d' % (idx+1) not in nameset)\n self.assertTrue('run_%08d' % idx in nameset)\n self.assertTrue(traj.v_crun == run_name)\n self.assertTrue(newtraj.crun.z==traj.x*traj.y,' z != x*y: %s != %s * %s' %\n (str(newtraj.crun.z),str(traj.x),str(traj.y)))\n\n for idx, traj in enumerate(self.traj.f_iter_runs(yields='self')):\n run_name = traj.f_idx_to_run(idx)\n self.assertTrue(traj is self.traj)\n newtraj.v_crun=run_name\n self.traj.v_idx = idx\n newtraj.v_idx = idx\n nameset = set((x.v_name for x in traj.f_iter_nodes(predicate=(idx,))))\n self.assertTrue('run_%08d' % (idx+1) not in nameset)\n self.assertTrue('run_%08d' % idx in nameset)\n self.assertTrue(traj.v_crun == run_name)\n self.assertTrue(newtraj.crun.z==traj.x*traj.y,' z != x*y: %s != %s * %s' %\n (str(newtraj.crun.z),str(traj.x),str(traj.y)))\n\n for idx, traj in enumerate(self.traj.f_iter_runs(yields='copy')):\n run_name = traj.f_idx_to_run(idx)\n self.assertTrue(traj is not self.traj)\n newtraj.v_crun=run_name\n self.traj.v_idx = idx\n newtraj.v_idx = idx\n nameset = set((x.v_name for x in traj.f_iter_nodes(predicate=(idx,))))\n self.assertTrue('run_%08d' % (idx+1) not in nameset)\n self.assertTrue('run_%08d' % idx in nameset)\n self.assertTrue(traj.v_crun == run_name)\n self.assertTrue(newtraj.crun.z==traj.x*traj.y,' z != x*y: %s != %s * %s' %\n (str(newtraj.crun.z),str(traj.x),str(traj.y)))\n\n traj = self.traj\n self.assertTrue(traj.v_idx == -1)\n self.assertTrue(traj.v_crun is None)\n self.assertTrue(traj.v_crun_ == pypetconstants.RUN_NAME_DUMMY)\n self.assertTrue(newtraj.v_idx == idx)", "metadata": "root.ResultSortTest.test_f_iter_runs", "header": "['class', 'ResultSortTest', '(', 'TrajectoryComparator', ')', ':', '___EOS___']", "index": 1007 }, { "content": " def test_f_iter_runs_auto_load(self):\n\n ###Explore\n self.explore(self.traj)\n\n results = self.env.f_run(multiply)\n self.are_results_in_order(results)\n traj = self.traj\n self.assertTrue(len(traj) == len(compat.listvalues(self.explore_dict)[0]))\n\n self.traj.f_load_skeleton()\n self.traj.f_load_items(self.traj.f_to_dict().keys(), only_empties=True)\n self.check_if_z_is_correct(traj)\n\n newtraj = Trajectory()\n newtraj.v_storage_service=HDF5StorageService(filename=self.filename)\n newtraj.f_load(name=self.traj.v_name, index=None, as_new=False, load_data=0)\n newtraj.v_auto_load = True\n\n newtraj.par.f_load_child('y', load_data=1)\n\n for idx, run_name in enumerate(self.traj.f_iter_runs()):\n newtraj.v_crun=run_name\n self.traj.v_idx = idx\n newtraj.v_idx = idx\n nameset = set((x.v_name for x in traj.f_iter_nodes(predicate=(idx,))))\n self.assertTrue('run_%08d' % (idx+1) not in nameset)\n self.assertTrue('run_%08d' % idx in nameset)\n self.assertTrue(traj.v_crun == run_name)\n self.assertTrue(newtraj.res.runs.crun.z==newtraj.par.x*newtraj.par.y,' z != x*y: %s != %s * %s' %\n (str(newtraj.crun.z),str(newtraj.x),str(newtraj.y)))\n\n\n traj = self.traj\n self.assertTrue(traj.v_idx == -1)\n self.assertTrue(traj.v_crun is None)\n self.assertTrue(traj.v_crun_ == pypetconstants.RUN_NAME_DUMMY)\n self.assertTrue(newtraj.v_idx == idx)", "metadata": "root.ResultSortTest.test_f_iter_runs_auto_load", "header": "['class', 'ResultSortTest', '(', 'TrajectoryComparator', ')', ':', '___EOS___']", "index": 1070 }, { "content": " def test_expand(self):\n ###Explore\n self.explore(self.traj)\n\n results = self.env.f_run(multiply)\n self.are_results_in_order(results)\n\n get_root_logger().info(results)\n traj = self.traj\n self.assertEqual(len(traj), len(list(compat.listvalues(self.explore_dict)[0])))\n\n self.traj.f_load_skeleton()\n self.traj.f_load_items(self.traj.f_to_dict().keys(), only_empties=True)\n self.check_if_z_is_correct(traj)\n\n traj_name = self.env.v_trajectory.v_name\n del self.env\n self.env = Environment(trajectory=self.traj,\n log_stdout=False,\n log_config=get_log_config())\n\n self.traj = self.env.v_trajectory\n\n self.traj.f_load(name=traj_name)\n\n self.expand(self.traj)\n\n results = self.env.f_run(multiply)\n self.are_results_in_order(results)\n\n traj = self.traj\n self.assertTrue(len(traj) == len(compat.listvalues(self.expand_dict)[0])+ len(compat.listvalues(self.explore_dict)[0]))\n\n\n self.traj.f_load_skeleton()\n self.traj.f_load_items(self.traj.f_to_dict().keys(), only_empties=True)\n self.check_if_z_is_correct(traj)\n\n newtraj = self.load_trajectory(trajectory_name=self.traj.v_name,as_new=False)\n self.traj.f_load_skeleton()\n self.traj.f_load_items(self.traj.f_to_dict().keys(), only_empties=True)\n\n self.compare_trajectories(self.traj,newtraj)", "metadata": "root.ResultSortTest.test_expand", "header": "['class', 'ResultSortTest', '(', 'TrajectoryComparator', ')', ':', '___EOS___']", "index": 1111 }, { "content": " def test_expand_after_reload(self):\n ###Explore\n self.explore(self.traj)\n\n results = self.env.f_run(multiply)\n self.are_results_in_order(results)\n\n traj = self.traj\n self.assertTrue(len(traj) == len(compat.listvalues(self.explore_dict)[0]))\n\n self.traj.f_load_skeleton()\n self.traj.f_load_items(self.traj.f_to_dict().keys(), only_empties=True)\n self.check_if_z_is_correct(traj)\n\n self.expand(self.traj)\n\n self.env.f_run(multiply)\n traj = self.traj\n self.assertTrue(len(traj) == len(compat.listvalues(self.expand_dict)[0])+\\\n len(compat.listvalues(self.explore_dict)[0]))\n\n self.traj.f_load_skeleton()\n self.traj.f_load_items(self.traj.f_to_dict().keys(), only_empties=True)\n self.check_if_z_is_correct(traj)\n\n newtraj = self.load_trajectory(trajectory_name=self.traj.v_name,as_new=False)\n self.traj.f_load_skeleton()\n self.traj.f_load_items(self.traj.f_to_dict().keys(), only_empties=True)\n\n self.compare_trajectories(self.traj,newtraj)", "metadata": "root.ResultSortTest.test_expand_after_reload", "header": "['class', 'ResultSortTest', '(', 'TrajectoryComparator', ')', ':', '___EOS___']", "index": 1155 } ]
[ { "span": "self.assertTrue('hi' in traj)", "start_line": 77, "start_column": 12, "end_line": 77, "end_column": 41 }, { "span": "self.assertTrue(nchildren > 0)", "start_line": 307, "start_column": 12, "end_line": 307, "end_column": 42 }, { "span": "self.assertTrue(nchildren > 1)", "start_line": 318, "start_column": 12, "end_line": 318, "end_column": 42 }, { "span": "self.assertTrue('nodes/s)' in full_text)", "start_line": 352, "start_column": 12, "end_line": 352, "end_column": 52 }, { "span": "self.assertTrue(len(newtraj) == 1)", "start_line": 498, "start_column": 8, "end_line": 498, "end_column": 42 }, { "span": "self.assertTrue('TestResItem' not in self.traj)", "start_line": 659, "start_column": 8, "end_line": 659, "end_column": 55 }, { "span": "self.assertTrue('new.group' not in self.traj)", "start_line": 690, "start_column": 8, "end_line": 690, "end_column": 53 }, { "span": "self.assertTrue(len(traj) == len(compat.listvalues(self.explore_dict)[0]))", "start_line": 924, "start_column": 8, "end_line": 924, "end_column": 82 }, { "span": "self.assertTrue(len(traj) == len(compat.listvalues(self.explore_dict)[0]))", "start_line": 948, "start_column": 8, "end_line": 948, "end_column": 82 }, { "span": "self.assertTrue(len(traj) == len(compat.listvalues(self.explore_dict)[0]))", "start_line": 979, "start_column": 8, "end_line": 979, "end_column": 82 }, { "span": "self.assertTrue(len(traj) == len(compat.listvalues(self.explore_dict)[0]))", "start_line": 1016, "start_column": 8, "end_line": 1016, "end_column": 82 }, { "span": "self.assertTrue('run_%08d' % (idx+1) not in nameset)", "start_line": 1031, "start_column": 12, "end_line": 1031, "end_column": 64 }, { "span": "self.assertTrue('run_%08d' % idx in nameset)", "start_line": 1032, "start_column": 12, "end_line": 1032, "end_column": 56 }, { "span": "self.assertTrue(traj.v_crun == run_name)", "start_line": 1033, "start_column": 12, "end_line": 1033, "end_column": 52 }, { "span": "self.assertTrue(traj is self.traj)", "start_line": 1039, "start_column": 12, "end_line": 1039, "end_column": 46 }, { "span": "self.assertTrue('run_%08d' % (idx+1) not in nameset)", "start_line": 1044, "start_column": 12, "end_line": 1044, "end_column": 64 }, { "span": "self.assertTrue('run_%08d' % idx in nameset)", "start_line": 1045, "start_column": 12, "end_line": 1045, "end_column": 56 }, { "span": "self.assertTrue(traj.v_crun == run_name)", "start_line": 1046, "start_column": 12, "end_line": 1046, "end_column": 52 }, { "span": "self.assertTrue(traj is not self.traj)", "start_line": 1052, "start_column": 12, "end_line": 1052, "end_column": 50 }, { "span": "self.assertTrue('run_%08d' % (idx+1) not in nameset)", "start_line": 1057, "start_column": 12, "end_line": 1057, "end_column": 64 }, { "span": "self.assertTrue('run_%08d' % idx in nameset)", "start_line": 1058, "start_column": 12, "end_line": 1058, "end_column": 56 }, { "span": "self.assertTrue(traj.v_crun == run_name)", "start_line": 1059, "start_column": 12, "end_line": 1059, "end_column": 52 }, { "span": "self.assertTrue(traj.v_idx == -1)", "start_line": 1064, "start_column": 8, "end_line": 1064, "end_column": 41 }, { "span": "self.assertTrue(traj.v_crun is None)", "start_line": 1065, "start_column": 8, "end_line": 1065, "end_column": 44 }, { "span": "self.assertTrue(traj.v_crun_ == pypetconstants.RUN_NAME_DUMMY)", "start_line": 1066, "start_column": 8, "end_line": 1066, "end_column": 70 }, { "span": "self.assertTrue(newtraj.v_idx == idx)", "start_line": 1067, "start_column": 8, "end_line": 1067, "end_column": 45 }, { "span": "self.assertTrue(len(traj) == len(compat.listvalues(self.explore_dict)[0]))", "start_line": 1078, "start_column": 8, "end_line": 1078, "end_column": 82 }, { "span": "self.assertTrue('run_%08d' % (idx+1) not in nameset)", "start_line": 1096, "start_column": 12, "end_line": 1096, "end_column": 64 }, { "span": "self.assertTrue('run_%08d' % idx in nameset)", "start_line": 1097, "start_column": 12, "end_line": 1097, "end_column": 56 }, { "span": "self.assertTrue(traj.v_crun == run_name)", "start_line": 1098, "start_column": 12, "end_line": 1098, "end_column": 52 }, { "span": "self.assertTrue(traj.v_idx == -1)", "start_line": 1104, "start_column": 8, "end_line": 1104, "end_column": 41 }, { "span": "self.assertTrue(traj.v_crun is None)", "start_line": 1105, "start_column": 8, "end_line": 1105, "end_column": 44 }, { "span": "self.assertTrue(traj.v_crun_ == pypetconstants.RUN_NAME_DUMMY)", "start_line": 1106, "start_column": 8, "end_line": 1106, "end_column": 70 }, { "span": "self.assertTrue(newtraj.v_idx == idx)", "start_line": 1107, "start_column": 8, "end_line": 1107, "end_column": 45 }, { "span": "self.assertTrue(len(traj) == len(compat.listvalues(self.expand_dict)[0])+ len(compat.listvalues(self.explore_dict)[0]))", "start_line": 1142, "start_column": 8, "end_line": 1142, "end_column": 127 }, { "span": "self.assertTrue(len(traj) == len(compat.listvalues(self.explore_dict)[0]))", "start_line": 1163, "start_column": 8, "end_line": 1163, "end_column": 82 }, { "span": "self.assertTrue(len(traj) == len(compat.listvalues(self.expand_dict)[0])+\\\n len(compat.listvalues(self.explore_dict)[0]))", "start_line": 1173, "start_column": 8, "end_line": 1174, "end_column": 69 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Full", "Stor", "age", "Test_", "(_", "Trajector", "y", "Compara", "tor_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "full", "\\u", "store_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "make", "\\u", "temp", "\\u", "dir_", "(_", "'", "full", "\\u", "store", ".", "hdf5", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "Environment_", "(_", "filename_", "=_", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "log", "\\u", "config_", "=_", "get", "\\u", "log", "\\u", "config_", "(_", ")_", ")_", "as_", "env_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "traj_", "=_", "env_", "._", "v", "\\u", "trajectory_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "traj_", "._", "par_", "._", "x_", "=_", "Parameter_", "(_", "'", "x", "'_", ",_", "3_", ",_", "'", "jj", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "traj_", "._", "f", "\\u", "explore", "_", "(_", "{_", "'", "x", "'_", ":_", "[_", "1_", ",_", "2_", ",_", "3_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "env_", "._", "f", "\\u", "run_", "(_", "add", "\\u", "one", "\\u", "partic", "ular", "\\u", "item_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "traj_", "=_", "load", "\\u", "trajectory_", "(_", "index_", "=_", "-_", "1_", ",_", "filename_", "=_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "hi", "'_", "in_", "traj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Environ", "ment", "Test_", "(_", "Trajector", "y", "Compara", "tor_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "file", "\\u", "overwrit", "ing_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "traj_", "._", "f", "\\u", "store_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "pt", "compat_", "._", "open", "\\u", "file_", "(_", "self_", "._", "filename_", ",_", "mode_", "=_", "'", "r", "'_", ")_", "as_", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nch", "ildren_", "=_", "len_", "(_", "file_", "._", "root_", "._", "\\u", "v", "\\u", "children_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "nch", "ildren_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "env", "2_", "=_", "Environment_", "(_", "filename_", "=_", "self_", "._", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "log", "\\u", "config_", "=_", "get", "\\u", "log", "\\u", "config_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "traj", "2_", "=_", "env", "2_", "._", "v", "\\u", "trajectory_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "traj", "2_", "._", "f", "\\u", "store_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "os_", "._", "path_", "._", "exists_", "(_", "self_", "._", "filename_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "pt", "compat_", "._", "open", "\\u", "file_", "(_", "self_", "._", "filename_", ",_", "mode_", "=_", "'", "r", "'_", ")_", "as_", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nch", "ildren_", "=_", "len_", "(_", "file_", "._", "root_", "._", "\\u", "v", "\\u", "children_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "nch", "ildren_", ">_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "env", "3_", "=_", "Environment_", "(_", "filename_", "=_", "self_", "._", "filename_", ",_", "overwrit", "e\\u", "file_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "log", "\\u", "config_", "=_", "get", "\\u", "log", "\\u", "config_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "os_", "._", "path_", "._", "exists_", "(_", "self_", "._", "filename_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "env", "2_", "._", "f", "\\u", "disable", "\\u", "logging_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "env", "3_", "._", "f", "\\u", "disable", "\\u", "logging_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Environ", "ment", "Test_", "(_", "Trajector", "y", "Compara", "tor_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "time", "\\u", "display", "\\u", "of", "\\u", "loading_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "make", "\\u", "temp", "\\u", "dir_", "(_", "'", "slo", "ooo", "w", ".", "hdf5", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "env_", "=_", "Environment_", "(_", "trajectory_", "=_", "'", "traj", "'_", ",_", "add", "\\u", "time_", "=_", "True_", ",_", "filename_", "=_", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "log", "\\u", "stdout_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "log", "\\u", "config_", "=_", "get", "\\u", "log", "\\u", "config_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dynami", "c\\u", "imports_", "=_", "Slow", "Result_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "display", "\\u", "time_", "=_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "traj_", "=_", "env_", "._", "v", "\\u", "traj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "traj_", "._", "f", "\\u", "add", "\\u", "result_", "(_", "Slow", "Result_", ",_", "'", "iii", "'_", ",_", "42_", ",_", "43_", ",_", "comment_", "=_", "'", "ll", "k", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "traj_", "._", "f", "\\u", "store_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "service", "\\u", "logger_", "=_", "traj_", "._", "v", "\\u", "storage", "\\u", "service_", "._", "\\u", "logger_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "=_", "logging_", "._", "get", "Logger_", "(_", "'", "pype", "t", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "\\u", "level_", "=_", "root_", "._", "level_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "service", "\\u", "logger_", "._", "set", "Level_", "(_", "logging_", "._", "INFO_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "set", "Level_", "(_", "logging_", "._", "INFO_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "traj_", "._", "f", "\\u", "load_", "(_", "load", "\\u", "data_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "service", "\\u", "logger_", "._", "set", "Level_", "(_", "old", "\\u", "level_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "set", "Level_", "(_", "old", "\\u", "level_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "path_", "=_", "get", "\\u", "log", "\\u", "path_", "(_", "traj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "main", "filename_", "=_", "os_", "._", "path_", "._", "join_", "(_", "path_", ",_", "'", "LOG", ".", "txt", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "main", "filename_", ",_", "mode_", "=_", "'", "r", "'_", ")_", "as_", "main", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "full", "\\u", "text_", "=_", "main", "f_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "nodes", "/", "s", ")'_", "in_", "full", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "env_", "._", "f", "\\u", "disable", "\\u", "logging_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Environ", "ment", "Test_", "(_", "Trajector", "y", "Compara", "tor_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "just", "\\u", "one", "\\u", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "make", "\\u", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "traj_", "._", "f", "\\u", "is", "\\u", "completed_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "newt", "raj", "_", "=_", "self_", "._", "load", "\\u", "trajectory_", "(_", "trajecto", "ry", "\\u", "name_", "=_", "self_", "._", "traj_", "._", "v", "\\u", "name_", ",_", "as", "\\u", "new_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "skeleton_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "items_", "(_", "self_", "._", "traj_", "._", "f", "\\u", "to", "\\u", "dict_", "(_", ")_", "._", "keys_", "(_", ")_", ",_", "only", "\\u", "emp", "ties_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "compare", "\\u", "trajectories", "_", "(_", "self_", "._", "traj_", ",_", "newt", "raj", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "newt", "raj", "_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "size_", "=_", "os_", "._", "path_", "._", "getsize_", "(_", "self_", "._", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "size", "\\u", "in", "\\u", "mb_", "=_", "size_", "/_", "1000000", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "get", "\\u", "root", "\\u", "logger_", "(_", ")_", "._", "info_", "(_", "'", "Size", " ", "is", " ", "%", "s", "MB", "'_", "%_", "str_", "(_", "size", "\\u", "in", "\\u", "mb_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "size", "\\u", "in", "\\u", "mb_", "<_", "2.0_", ",_", "'", "Size", " ", "is", " ", "%", "s", "MB", " ", ">", " ", "6", "MB", "'_", "%_", "str_", "(_", "size", "\\u", "in", "\\u", "mb_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "explore", "_", "(_", "self_", "._", "traj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Environ", "ment", "Test_", "(_", "Trajector", "y", "Compara", "tor_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "store", "\\u", "form", "\\u", "tuple_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "traj_", "._", "f", "\\u", "store_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "add", "\\u", "result_", "(_", "'", "Test", "Res", "Item", "'_", ",_", "42_", ",_", "43_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "traj_", "._", "f", "\\u", "store", "\\u", "item_", "(_", "(_", "pype", "tcon", "stan", "ts_", "._", "LEA", "F_", ",_", "self_", "._", "traj_", "._", "Test", "Res", "Item_", ",_", "(_", ")_", ",_", "{_", "}_", ",_", "5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "store", "\\u", "item_", "(_", "(_", "pype", "tcon", "stan", "ts_", "._", "LEA", "F_", ",_", "self_", "._", "traj_", "._", "Test", "Res", "Item_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "traj_", "._", "results_", "._", "f", "\\u", "remove", "\\u", "child_", "(_", "'", "Test", "Res", "Item", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "Test", "Res", "Item", "'_", "not_", "in_", "self_", "._", "traj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "traj_", "._", "results_", "._", "f", "\\u", "load", "\\u", "child_", "(_", "'", "Test", "Res", "Item", "'_", ",_", "load", "\\u", "data_", "=_", "pype", "tcon", "stan", "ts_", "._", "LOAD", "\\u", "SK", "ELE", "TON", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "item_", "(_", "(_", "pype", "tcon", "stan", "ts_", "._", "LEA", "F_", ",_", "self_", "._", "traj_", "._", "Test", "Res", "Item_", ",_", "(_", ")_", ",_", "{_", "'", "load", "\\u", "only", "'_", ":_", "'", "Test", "Res", "Item", "'_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "traj_", "._", "Test", "Res", "Item_", ",_", "42_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Environ", "ment", "Test_", "(_", "Trajector", "y", "Compara", "tor_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "store", "\\u", "single", "\\u", "group_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "traj_", "._", "f", "\\u", "store_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "add", "\\u", "parameter", "\\u", "group_", "(_", "'", "new", ".", "test", ".", "group", "'_", ")_", "._", "v", "\\u", "annotations_", "._", "f", "\\u", "set_", "(_", "42_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "store", "\\u", "item_", "(_", "'", "new", ".", "group", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "group", " ", "is", " ", "belo", "w", " ", "test", " ", "not", " ", "new", ",", " ", "so", " ", "Value", "Error", " ", "throw", "n", ":_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "traj_", "._", "parameters_", "._", "new_", "._", "f", "\\u", "remove", "\\u", "child_", "(_", "'", "group", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "group", " ", "is", " ", "belo", "w", " ", "test", " ", "not", " ", "new", ",", " ", "so", " ", "Value", "Error", " ", "throw", "n", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "traj_", "._", "parameters_", "._", "new_", "._", "f", "\\u", "store", "\\u", "child_", "(_", "'", "group", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "group", " ", "has", " ", "child", "ren", " ", "and", " ", "recurs", "ive", " ", "is", " ", "false_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "traj_", "._", "parameters_", "._", "new_", "._", "f", "\\u", "remove", "\\u", "child_", "(_", "'", "test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "traj_", "._", "new_", "._", "f", "\\u", "remove", "\\u", "child_", "(_", "'", "test", "'_", ",_", "recursive_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "new", ".", "group", "'_", "not_", "in_", "self_", "._", "traj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "traj_", "._", "new_", "._", "f", "\\u", "load", "\\u", "child_", "(_", "'", "test", "'_", ",_", "recursive_", "=_", "True_", ",_", "load", "\\u", "data_", "=_", "pype", "tcon", "stan", "ts_", "._", "LOAD", "\\u", "SK", "ELE", "TON", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "traj_", "._", "new_", "._", "group_", "._", "v", "\\u", "annotations_", "._", "annotation_", ",_", "42_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "delete", "\\u", "item_", "(_", "'", "new", ".", "test", ".", "group", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "pex", "_", "._", "Data", "Not", "In", "Stor", "age", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "traj_", "._", "parameters_", "._", "f", "\\u", "load", "\\u", "child_", "(_", "'", "new", ".", "test", ".", "group", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "load", "\\u", "data_", "=_", "pype", "tcon", "stan", "ts_", "._", "LOAD", "\\u", "SK", "ELE", "TON", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Result", "Sort", "Test_", "(_", "Trajector", "y", "Compara", "tor_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "if", "\\u", "results", "\\u", "are", "\\u", "sorte", "d\\u", "correct", "ly", "\\u", "manu", "al", "\\u", "runs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "###", "Explo", "re_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "explore", "_", "(_", "self_", "._", "traj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "store_", "(_", "only", "\\u", "init_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "man", "\\u", "multiply_", "=_", "manu", "al", "\\u", "run_", "(_", ")_", "(_", "multipl", "y", "\\u", "with", "\\u", "stor", "ing_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "idx_", "in_", "self_", "._", "traj_", "._", "f", "\\u", "iter", "\\u", "runs_", "(_", "yield", "s_", "=_", "'", "idx", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "idx_", ",_", "int_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "man", "\\u", "multiply_", "(_", "self_", "._", "traj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "traj_", "=_", "self_", "._", "traj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "traj_", "._", "f", "\\u", "store_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "traj_", ")_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "traj_", ")_", "==_", "len_", "(_", "compat_", "._", "list", "values_", "(_", "self_", "._", "explore", "\\u", "dict_", ")_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "skeleton_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "items_", "(_", "self_", "._", "traj_", "._", "f", "\\u", "to", "\\u", "dict_", "(_", ")_", "._", "keys_", "(_", ")_", ",_", "only", "\\u", "emp", "ties_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "check", "\\u", "if", "\\u", "z", "\\u", "is", "\\u", "correct_", "(_", "traj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "newt", "raj", "_", "=_", "self_", "._", "load", "\\u", "trajectory_", "(_", "trajecto", "ry", "\\u", "name_", "=_", "self_", "._", "traj_", "._", "v", "\\u", "name_", ",_", "as", "\\u", "new_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "skeleton_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "items_", "(_", "self_", "._", "traj_", "._", "f", "\\u", "to", "\\u", "dict_", "(_", ")_", "._", "keys_", "(_", ")_", ",_", "only", "\\u", "emp", "ties_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "compare", "\\u", "trajectories", "_", "(_", "self_", "._", "traj_", ",_", "newt", "raj", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Result", "Sort", "Test_", "(_", "Trajector", "y", "Compara", "tor_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "if", "\\u", "results", "\\u", "are", "\\u", "sorte", "d\\u", "correct", "ly", "\\u", "usi", "ng", "\\u", "map_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "###", "Explo", "re_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "explore", "_", "(_", "self_", "._", "traj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "args", "1_", "=_", "[_", "10_", "*_", "x_", "for_", "x_", "in_", "range_", "(_", "len_", "(_", "self_", "._", "traj_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args", "2_", "=_", "[_", "100_", "*_", "x_", "for_", "x_", "in_", "range_", "(_", "len_", "(_", "self_", "._", "traj_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args", "3_", "=_", "list_", "(_", "range_", "(_", "len_", "(_", "self_", "._", "traj_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "results_", "=_", "self_", "._", "env_", "._", "f", "\\u", "run", "\\u", "map_", "(_", "multipl", "y", "\\u", "args_", ",_", "args", "1_", ",_", "arg2_", "=_", "args", "2_", ",_", "arg", "3_", "=_", "args", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "results_", ")_", ",_", "len_", "(_", "self_", "._", "traj_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "traj_", "=_", "self_", "._", "traj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "traj_", ")_", "==_", "len_", "(_", "compat_", "._", "list", "values_", "(_", "self_", "._", "explore", "\\u", "dict_", ")_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "skeleton_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "items_", "(_", "self_", "._", "traj_", "._", "f", "\\u", "to", "\\u", "dict_", "(_", ")_", "._", "keys_", "(_", ")_", ",_", "only", "\\u", "emp", "ties_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "check", "\\u", "if", "\\u", "z", "\\u", "is", "\\u", "correct", "\\u", "map_", "(_", "traj_", ",_", "args", "1_", ",_", "args", "2_", ",_", "args", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "res_", "in_", "results_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "res_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "res_", "[_", "0_", "]_", ",_", "int_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "res_", "[_", "1_", "]_", ",_", "int_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "idx_", "=_", "res_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "traj_", "._", "res_", "._", "runs_", "[_", "idx_", "]_", "._", "z_", ",_", "res_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "newt", "raj", "_", "=_", "self_", "._", "load", "\\u", "trajectory_", "(_", "trajecto", "ry", "\\u", "name_", "=_", "self_", "._", "traj_", "._", "v", "\\u", "name_", ",_", "as", "\\u", "new_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "skeleton_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "items_", "(_", "self_", "._", "traj_", "._", "f", "\\u", "to", "\\u", "dict_", "(_", ")_", "._", "keys_", "(_", ")_", ",_", "only", "\\u", "emp", "ties_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "traj_", ")_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "compare", "\\u", "trajectories", "_", "(_", "self_", "._", "traj_", ",_", "newt", "raj", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Result", "Sort", "Test_", "(_", "Trajector", "y", "Compara", "tor_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "if", "\\u", "results", "\\u", "are", "\\u", "sorte", "d\\u", "correct", "ly_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", "Explo", "re_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "explore", "_", "(_", "self_", "._", "traj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "results_", "=_", "self_", "._", "env_", "._", "f", "\\u", "run_", "(_", "multiply_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "are", "\\u", "results", "\\u", "in", "\\u", "order_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "results_", ")_", ",_", "len_", "(_", "self_", "._", "traj_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "traj_", "=_", "self_", "._", "traj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "traj_", ")_", "==_", "len_", "(_", "compat_", "._", "list", "values_", "(_", "self_", "._", "explore", "\\u", "dict_", ")_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "skeleton_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "items_", "(_", "self_", "._", "traj_", "._", "f", "\\u", "to", "\\u", "dict_", "(_", ")_", "._", "keys_", "(_", ")_", ",_", "only", "\\u", "emp", "ties_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "check", "\\u", "if", "\\u", "z", "\\u", "is", "\\u", "correct_", "(_", "traj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "res_", "in_", "results_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "res_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "res_", "[_", "0_", "]_", ",_", "int_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "res_", "[_", "1_", "]_", ",_", "int_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "idx_", "=_", "res_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "traj_", "._", "res_", "._", "runs_", "[_", "idx_", "]_", "._", "z_", ",_", "res_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "newt", "raj", "_", "=_", "self_", "._", "load", "\\u", "trajectory_", "(_", "trajecto", "ry", "\\u", "name_", "=_", "self_", "._", "traj_", "._", "v", "\\u", "name_", ",_", "as", "\\u", "new_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "skeleton_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "items_", "(_", "self_", "._", "traj_", "._", "f", "\\u", "to", "\\u", "dict_", "(_", ")_", "._", "keys_", "(_", ")_", ",_", "only", "\\u", "emp", "ties_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "compare", "\\u", "trajectories", "_", "(_", "self_", "._", "traj_", ",_", "newt", "raj", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Result", "Sort", "Test_", "(_", "Trajector", "y", "Compara", "tor_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "f", "\\u", "iter", "\\u", "runs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", "Explo", "re_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "explore", "_", "(_", "self_", "._", "traj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "results_", "=_", "self_", "._", "env_", "._", "f", "\\u", "run_", "(_", "multiply_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "are", "\\u", "results", "\\u", "in", "\\u", "order_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "traj_", "=_", "self_", "._", "traj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "traj_", ")_", "==_", "len_", "(_", "compat_", "._", "list", "values_", "(_", "self_", "._", "explore", "\\u", "dict_", ")_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "skeleton_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "items_", "(_", "self_", "._", "traj_", "._", "f", "\\u", "to", "\\u", "dict_", "(_", ")_", "._", "keys_", "(_", ")_", ",_", "only", "\\u", "emp", "ties_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "check", "\\u", "if", "\\u", "z", "\\u", "is", "\\u", "correct_", "(_", "traj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "newt", "raj", "_", "=_", "self_", "._", "load", "\\u", "trajectory_", "(_", "trajecto", "ry", "\\u", "name_", "=_", "self_", "._", "traj_", "._", "v", "\\u", "name_", ",_", "as", "\\u", "new_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "skeleton_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "items_", "(_", "self_", "._", "traj_", "._", "f", "\\u", "to", "\\u", "dict_", "(_", ")_", "._", "keys_", "(_", ")_", ",_", "only", "\\u", "emp", "ties_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "idx_", ",_", "run", "\\u", "name_", "in_", "enumerate_", "(_", "self_", "._", "traj_", "._", "f", "\\u", "iter", "\\u", "runs_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "newt", "raj", "_", "._", "v", "\\u", "cru", "n_", "=_", "run", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "v", "\\u", "idx_", "=_", "idx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "newt", "raj", "_", "._", "v", "\\u", "idx_", "=_", "idx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "names", "et_", "=_", "set_", "(_", "(_", "x_", "._", "v", "\\u", "name_", "for_", "x_", "in_", "traj_", "._", "f", "\\u", "iter", "\\u", "nodes_", "(_", "predicate_", "=_", "(_", "idx_", ",_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "run", "\\u", "%", "0", "8d", "'_", "%_", "(_", "idx_", "+_", "1_", ")_", "not_", "in_", "names", "et_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "run", "\\u", "%", "0", "8d", "'_", "%_", "idx_", "in_", "names", "et_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "traj_", "._", "v", "\\u", "cru", "n_", "==_", "run", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "newt", "raj", "_", "._", "cru", "n_", "._", "z_", "==_", "traj_", "._", "x_", "*_", "traj_", "._", "y_", ",_", "'", " ", "z", " ", "!=", " ", "x", "*", "y", ":", " ", "%", "s", " ", "!=", " ", "%", "s", " ", "*", " ", "%", "s", "'_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "str_", "(_", "newt", "raj", "_", "._", "cru", "n_", "._", "z_", ")_", ",_", "str_", "(_", "traj_", "._", "x_", ")_", ",_", "str_", "(_", "traj_", "._", "y_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "idx_", ",_", "traj_", "in_", "enumerate_", "(_", "self_", "._", "traj_", "._", "f", "\\u", "iter", "\\u", "runs_", "(_", "yield", "s_", "=_", "'", "self", "'_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "run", "\\u", "name_", "=_", "traj_", "._", "f", "\\u", "idx", "\\u", "to", "\\u", "run_", "(_", "idx_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "traj_", "is_", "self_", "._", "traj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "newt", "raj", "_", "._", "v", "\\u", "cru", "n_", "=_", "run", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "v", "\\u", "idx_", "=_", "idx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "newt", "raj", "_", "._", "v", "\\u", "idx_", "=_", "idx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "names", "et_", "=_", "set_", "(_", "(_", "x_", "._", "v", "\\u", "name_", "for_", "x_", "in_", "traj_", "._", "f", "\\u", "iter", "\\u", "nodes_", "(_", "predicate_", "=_", "(_", "idx_", ",_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "run", "\\u", "%", "0", "8d", "'_", "%_", "(_", "idx_", "+_", "1_", ")_", "not_", "in_", "names", "et_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "run", "\\u", "%", "0", "8d", "'_", "%_", "idx_", "in_", "names", "et_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "traj_", "._", "v", "\\u", "cru", "n_", "==_", "run", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "newt", "raj", "_", "._", "cru", "n_", "._", "z_", "==_", "traj_", "._", "x_", "*_", "traj_", "._", "y_", ",_", "'", " ", "z", " ", "!=", " ", "x", "*", "y", ":", " ", "%", "s", " ", "!=", " ", "%", "s", " ", "*", " ", "%", "s", "'_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "str_", "(_", "newt", "raj", "_", "._", "cru", "n_", "._", "z_", ")_", ",_", "str_", "(_", "traj_", "._", "x_", ")_", ",_", "str_", "(_", "traj_", "._", "y_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "idx_", ",_", "traj_", "in_", "enumerate_", "(_", "self_", "._", "traj_", "._", "f", "\\u", "iter", "\\u", "runs_", "(_", "yield", "s_", "=_", "'", "copy", "'_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "run", "\\u", "name_", "=_", "traj_", "._", "f", "\\u", "idx", "\\u", "to", "\\u", "run_", "(_", "idx_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "traj_", "is_", "not_", "self_", "._", "traj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "newt", "raj", "_", "._", "v", "\\u", "cru", "n_", "=_", "run", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "v", "\\u", "idx_", "=_", "idx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "newt", "raj", "_", "._", "v", "\\u", "idx_", "=_", "idx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "names", "et_", "=_", "set_", "(_", "(_", "x_", "._", "v", "\\u", "name_", "for_", "x_", "in_", "traj_", "._", "f", "\\u", "iter", "\\u", "nodes_", "(_", "predicate_", "=_", "(_", "idx_", ",_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "run", "\\u", "%", "0", "8d", "'_", "%_", "(_", "idx_", "+_", "1_", ")_", "not_", "in_", "names", "et_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "run", "\\u", "%", "0", "8d", "'_", "%_", "idx_", "in_", "names", "et_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "traj_", "._", "v", "\\u", "cru", "n_", "==_", "run", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "newt", "raj", "_", "._", "cru", "n_", "._", "z_", "==_", "traj_", "._", "x_", "*_", "traj_", "._", "y_", ",_", "'", " ", "z", " ", "!=", " ", "x", "*", "y", ":", " ", "%", "s", " ", "!=", " ", "%", "s", " ", "*", " ", "%", "s", "'_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "str_", "(_", "newt", "raj", "_", "._", "cru", "n_", "._", "z_", ")_", ",_", "str_", "(_", "traj_", "._", "x_", ")_", ",_", "str_", "(_", "traj_", "._", "y_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "traj_", "=_", "self_", "._", "traj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "traj_", "._", "v", "\\u", "idx_", "==_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "traj_", "._", "v", "\\u", "cru", "n_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "traj_", "._", "v", "\\u", "cru", "n", "\\u_", "==_", "pype", "tcon", "stan", "ts_", "._", "RUN", "\\u", "NAME", "\\u", "DUMMY", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "newt", "raj", "_", "._", "v", "\\u", "idx_", "==_", "idx_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Result", "Sort", "Test_", "(_", "Trajector", "y", "Compara", "tor_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "f", "\\u", "iter", "\\u", "runs", "\\u", "auto", "\\u", "load_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", "Explo", "re_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "explore", "_", "(_", "self_", "._", "traj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "results_", "=_", "self_", "._", "env_", "._", "f", "\\u", "run_", "(_", "multiply_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "are", "\\u", "results", "\\u", "in", "\\u", "order_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "traj_", "=_", "self_", "._", "traj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "traj_", ")_", "==_", "len_", "(_", "compat_", "._", "list", "values_", "(_", "self_", "._", "explore", "\\u", "dict_", ")_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "skeleton_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "items_", "(_", "self_", "._", "traj_", "._", "f", "\\u", "to", "\\u", "dict_", "(_", ")_", "._", "keys_", "(_", ")_", ",_", "only", "\\u", "emp", "ties_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "check", "\\u", "if", "\\u", "z", "\\u", "is", "\\u", "correct_", "(_", "traj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "newt", "raj", "_", "=_", "Trajector", "y_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "newt", "raj", "_", "._", "v", "\\u", "storage", "\\u", "service_", "=_", "HDF", "5", "Stor", "age", "Service_", "(_", "filename_", "=_", "self_", "._", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "newt", "raj", "_", "._", "f", "\\u", "load_", "(_", "name_", "=_", "self_", "._", "traj_", "._", "v", "\\u", "name_", ",_", "index_", "=_", "None_", ",_", "as", "\\u", "new_", "=_", "False_", ",_", "load", "\\u", "data_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "newt", "raj", "_", "._", "v", "\\u", "auto", "\\u", "load_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "newt", "raj", "_", "._", "par_", "._", "f", "\\u", "load", "\\u", "child_", "(_", "'", "y", "'_", ",_", "load", "\\u", "data_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "idx_", ",_", "run", "\\u", "name_", "in_", "enumerate_", "(_", "self_", "._", "traj_", "._", "f", "\\u", "iter", "\\u", "runs_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "newt", "raj", "_", "._", "v", "\\u", "cru", "n_", "=_", "run", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "v", "\\u", "idx_", "=_", "idx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "newt", "raj", "_", "._", "v", "\\u", "idx_", "=_", "idx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "names", "et_", "=_", "set_", "(_", "(_", "x_", "._", "v", "\\u", "name_", "for_", "x_", "in_", "traj_", "._", "f", "\\u", "iter", "\\u", "nodes_", "(_", "predicate_", "=_", "(_", "idx_", ",_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "run", "\\u", "%", "0", "8d", "'_", "%_", "(_", "idx_", "+_", "1_", ")_", "not_", "in_", "names", "et_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "run", "\\u", "%", "0", "8d", "'_", "%_", "idx_", "in_", "names", "et_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "traj_", "._", "v", "\\u", "cru", "n_", "==_", "run", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "newt", "raj", "_", "._", "res_", "._", "runs_", "._", "cru", "n_", "._", "z_", "==_", "newt", "raj", "_", "._", "par_", "._", "x_", "*_", "newt", "raj", "_", "._", "par_", "._", "y_", ",_", "'", " ", "z", " ", "!=", " ", "x", "*", "y", ":", " ", "%", "s", " ", "!=", " ", "%", "s", " ", "*", " ", "%", "s", "'_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "str_", "(_", "newt", "raj", "_", "._", "cru", "n_", "._", "z_", ")_", ",_", "str_", "(_", "newt", "raj", "_", "._", "x_", ")_", ",_", "str_", "(_", "newt", "raj", "_", "._", "y_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "traj_", "=_", "self_", "._", "traj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "traj_", "._", "v", "\\u", "idx_", "==_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "traj_", "._", "v", "\\u", "cru", "n_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "traj_", "._", "v", "\\u", "cru", "n", "\\u_", "==_", "pype", "tcon", "stan", "ts_", "._", "RUN", "\\u", "NAME", "\\u", "DUMMY", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "newt", "raj", "_", "._", "v", "\\u", "idx_", "==_", "idx_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Result", "Sort", "Test_", "(_", "Trajector", "y", "Compara", "tor_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "expand_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "###", "Explo", "re_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "explore", "_", "(_", "self_", "._", "traj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "results_", "=_", "self_", "._", "env_", "._", "f", "\\u", "run_", "(_", "multiply_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "are", "\\u", "results", "\\u", "in", "\\u", "order_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "get", "\\u", "root", "\\u", "logger_", "(_", ")_", "._", "info_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "traj_", "=_", "self_", "._", "traj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "traj_", ")_", ",_", "len_", "(_", "list_", "(_", "compat_", "._", "list", "values_", "(_", "self_", "._", "explore", "\\u", "dict_", ")_", "[_", "0_", "]_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "skeleton_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "items_", "(_", "self_", "._", "traj_", "._", "f", "\\u", "to", "\\u", "dict_", "(_", ")_", "._", "keys_", "(_", ")_", ",_", "only", "\\u", "emp", "ties_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "check", "\\u", "if", "\\u", "z", "\\u", "is", "\\u", "correct_", "(_", "traj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "traj", "\\u", "name_", "=_", "self_", "._", "env_", "._", "v", "\\u", "trajectory_", "._", "v", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "self_", "._", "env_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "env_", "=_", "Environment_", "(_", "trajectory_", "=_", "self_", "._", "traj_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "log", "\\u", "stdout_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "log", "\\u", "config_", "=_", "get", "\\u", "log", "\\u", "config_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "traj_", "=_", "self_", "._", "env_", "._", "v", "\\u", "trajectory_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load_", "(_", "name_", "=_", "traj", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "expand_", "(_", "self_", "._", "traj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "results_", "=_", "self_", "._", "env_", "._", "f", "\\u", "run_", "(_", "multiply_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "are", "\\u", "results", "\\u", "in", "\\u", "order_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "traj_", "=_", "self_", "._", "traj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "traj_", ")_", "==_", "len_", "(_", "compat_", "._", "list", "values_", "(_", "self_", "._", "expand", "\\u", "dict_", ")_", "[_", "0_", "]_", ")_", "+_", "len_", "(_", "compat_", "._", "list", "values_", "(_", "self_", "._", "explore", "\\u", "dict_", ")_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "skeleton_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "items_", "(_", "self_", "._", "traj_", "._", "f", "\\u", "to", "\\u", "dict_", "(_", ")_", "._", "keys_", "(_", ")_", ",_", "only", "\\u", "emp", "ties_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "check", "\\u", "if", "\\u", "z", "\\u", "is", "\\u", "correct_", "(_", "traj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "newt", "raj", "_", "=_", "self_", "._", "load", "\\u", "trajectory_", "(_", "trajecto", "ry", "\\u", "name_", "=_", "self_", "._", "traj_", "._", "v", "\\u", "name_", ",_", "as", "\\u", "new_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "skeleton_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "items_", "(_", "self_", "._", "traj_", "._", "f", "\\u", "to", "\\u", "dict_", "(_", ")_", "._", "keys_", "(_", ")_", ",_", "only", "\\u", "emp", "ties_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "compare", "\\u", "trajectories", "_", "(_", "self_", "._", "traj_", ",_", "newt", "raj", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Result", "Sort", "Test_", "(_", "Trajector", "y", "Compara", "tor_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "expand", "\\u", "after", "\\u", "reload_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "###", "Explo", "re_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "explore", "_", "(_", "self_", "._", "traj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "results_", "=_", "self_", "._", "env_", "._", "f", "\\u", "run_", "(_", "multiply_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "are", "\\u", "results", "\\u", "in", "\\u", "order_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "traj_", "=_", "self_", "._", "traj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "traj_", ")_", "==_", "len_", "(_", "compat_", "._", "list", "values_", "(_", "self_", "._", "explore", "\\u", "dict_", ")_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "skeleton_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "items_", "(_", "self_", "._", "traj_", "._", "f", "\\u", "to", "\\u", "dict_", "(_", ")_", "._", "keys_", "(_", ")_", ",_", "only", "\\u", "emp", "ties_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "check", "\\u", "if", "\\u", "z", "\\u", "is", "\\u", "correct_", "(_", "traj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "expand_", "(_", "self_", "._", "traj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "env_", "._", "f", "\\u", "run_", "(_", "multiply_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "traj_", "=_", "self_", "._", "traj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "traj_", ")_", "==_", "len_", "(_", "compat_", "._", "list", "values_", "(_", "self_", "._", "expand", "\\u", "dict_", ")_", "[_", "0_", "]_", ")_", "+_", "len_", "(_", "compat_", "._", "list", "values_", "(_", "self_", "._", "explore", "\\u", "dict_", ")_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "skeleton_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "items_", "(_", "self_", "._", "traj_", "._", "f", "\\u", "to", "\\u", "dict_", "(_", ")_", "._", "keys_", "(_", ")_", ",_", "only", "\\u", "emp", "ties_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "check", "\\u", "if", "\\u", "z", "\\u", "is", "\\u", "correct_", "(_", "traj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "newt", "raj", "_", "=_", "self_", "._", "load", "\\u", "trajectory_", "(_", "trajecto", "ry", "\\u", "name_", "=_", "self_", "._", "traj_", "._", "v", "\\u", "name_", ",_", "as", "\\u", "new_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "skeleton_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "traj_", "._", "f", "\\u", "load", "\\u", "items_", "(_", "self_", "._", "traj_", "._", "f", "\\u", "to", "\\u", "dict_", "(_", ")_", "._", "keys_", "(_", ")_", ",_", "only", "\\u", "emp", "ties_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "compare", "\\u", "trajectories", "_", "(_", "self_", "._", "traj_", ",_", "newt", "raj", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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admin/examples/pymongo/app.py
[ { "content": "import pymongo\nfrom bson.objectid import ObjectId\n\nfrom flask import Flask\nimport flask_admin as admin\n\nfrom wtforms import form, fields\n\nfrom flask_admin.form import Select2Widget\nfrom flask_admin.contrib.pymongo import ModelView, filters\nfrom flask_admin.model.fields import InlineFormField, InlineFieldList\n\n# Create application\napp = Flask(__name__)\n\n# Create dummy secrey key so we can use sessions\napp.config['SECRET_KEY'] = '123456790'\n\n# Create models\nconn = pymongo.Connection()\ndb = conn.test\n\n\n# User admin\n\n\n\n\n\n\n# Tweet view\n\n\n\n\n# Flask views\n\n\nif __name__ == '__main__':\n # Create admin\n admin = admin.Admin(app, name='Example: PyMongo')\n\n # Add views\n admin.add_view(UserView(db.user, 'User'))\n admin.add_view(TweetView(db.tweet, 'Tweets'))\n\n # Start app\n app.run(debug=True)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "app.run(debug=True)", "start_line": 123, "start_column": 4, "end_line": 123, "end_column": 23 } ]
[]
1
false
[ "[CLS]_", "Flask_", "app_", "is_", "run_", "in_", "debug_", "mode_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "pymongo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bson_", "._", "objectid", "_", "import_", "Object", "Id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "flask_", "import_", "Flask_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "fla", "sk", "\\u", "admin_", "as_", "admin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "wtforms_", "import_", "form_", ",_", "fields_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "fla", "sk", "\\u", "admin_", "._", "form_", "import_", "Select", "2", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "fla", "sk", "\\u", "admin_", "._", "contrib_", "._", "pymongo_", "import_", "Model", "View_", ",_", "filters_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "fla", "sk", "\\u", "admin_", "._", "model_", "._", "fields_", "import_", "In", "line", "Form", "Field_", ",_", "In", "line", "Field", "List_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "application_", "\\u\\u\\uNL\\u\\u\\u_", "app_", "=_", "Flask_", "(_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "dummy", " ", "sec", "rey", " ", "key", " ", "so", " ", "we", " ", "can", " ", "use", " ", "sessions_", "\\u\\u\\uNL\\u\\u\\u_", "app_", "._", "config_", "[_", "'", "SEC", "RET", "\\u", "KEY", "'_", "]_", "=_", "'", "1234567", "90", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "models_", "\\u\\u\\uNL\\u\\u\\u_", "conn_", "=_", "pymongo_", "._", "Connection_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "=_", "conn_", "._", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "User", " ", "admin_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tweet", " ", "view_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fla", "sk", " ", "views_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Creat", "e", " ", "admin_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "admin_", "=_", "admin_", "._", "Admin_", "(_", "app_", ",_", "name_", "=_", "'", "Exam", "ple", ":", " ", "Py", "Mon", "go", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "views_", "\\u\\u\\uNL\\u\\u\\u_", "admin_", "._", "add", "\\u", "view_", "(_", "User", "View_", "(_", "db_", "._", "user_", ",_", "'", "User", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "admin_", "._", "add", "\\u", "view_", "(_", "Tweet", "View_", "(_", "db_", "._", "tweet_", ",_", "'", "Tweet", "s", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Start", " ", "app_", "\\u\\u\\uNL\\u\\u\\u_", "app_", "._", "run_", "(_", "debug_", "=_", "True_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused local variable
benoitc/gaffer/gaffer/gafferd/http_handlers/keys.py
[ { "content": " def head(self, *args):\n if (not self.api_key.can_create_key() and\n self.api_key.api_key != args[0]):\n # only those who can create keys or the key owner can read the key\n # object\n raise HTTPError(403)\n\n try:\n key_obj = self.key_mgr.has_key(args[0])\n except KeyNotFound:\n raise HTTPError(404)\n\n self.set_status(200)", "metadata": "root.KeyHandler.head", "header": "['class', 'KeyHandler', '(', 'CorsHandlerWithAuth', ')', ':', '___EOS___']", "index": 68 }, { "content": " def delete(self, *args):\n if (not self.api_key.can_create_key() and\n self.api_key.api_key != args[0]):\n # only those who can create keys or the key owner can read the key\n # object\n raise HTTPError(403)\n\n try:\n key_obj = self.key_mgr.delete_key(args[0])\n except KeyNotFound:\n raise HTTPError(404)\n\n self.write({\"ok\": True})", "metadata": "root.KeyHandler.delete", "header": "['class', 'KeyHandler', '(', 'CorsHandlerWithAuth', ')', ':', '___EOS___']", "index": 101 } ]
[ { "span": "key_obj ", "start_line": 76, "start_column": 12, "end_line": 76, "end_column": 19 }, { "span": "key_obj ", "start_line": 109, "start_column": 12, "end_line": 109, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Key", "Handler_", "(_", "Cor", "s", "Handle", "r", "With", "Auth_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "head_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "not_", "self_", "._", "api", "\\u", "key_", "._", "can", "\\u", "create", "\\u", "key_", "(_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "api", "\\u", "key_", "._", "api", "\\u", "key_", "!=_", "args_", "[_", "0_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "only", " ", "tho", "se", " ", "who", " ", "can", " ", "create", " ", "keys", " ", "or", " ", "the", " ", "key", " ", "owner", " ", "can", " ", "read", " ", "the", " ", "key_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "HTTP", "Error_", "(_", "403_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key", "\\u", "obj_", "=_", "self_", "._", "key", "\\u", "mgr_", "._", "has", "\\u", "key_", "(_", "args_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Not", "Found_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "HTTP", "Error_", "(_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "set\\u", "status_", "(_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Key", "Handler_", "(_", "Cor", "s", "Handle", "r", "With", "Auth_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "not_", "self_", "._", "api", "\\u", "key_", "._", "can", "\\u", "create", "\\u", "key_", "(_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "api", "\\u", "key_", "._", "api", "\\u", "key_", "!=_", "args_", "[_", "0_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "only", " ", "tho", "se", " ", "who", " ", "can", " ", "create", " ", "keys", " ", "or", " ", "the", " ", "key", " ", "owner", " ", "can", " ", "read", " ", "the", " ", "key_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "HTTP", "Error_", "(_", "403_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key", "\\u", "obj_", "=_", "self_", "._", "key", "\\u", "mgr_", "._", "delete", "\\u", "key_", "(_", "args_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Not", "Found_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "HTTP", "Error_", "(_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "write_", "(_", "{_", "\"", "ok", "\"_", ":_", "True_", "}_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Variable defined multiple times
pystruct/pystruct/pystruct/models/latent_node_crf.py
[ { "content": " def joint_feature(self, x, y):\n \"\"\"Feature vector associated with instance (x, y).\n\n Feature representation joint_feature, such that the energy of the\n configuration (x, y) and a weight vector w is given by\n np.dot(w, joint_feature(x, y)).\n\n Parameters\n ----------\n x : tuple\n Unary evidence.\n\n y : ndarray or tuple\n Either y is an integral ndarray, giving\n a complete labeling for x.\n Or it is the result of a linear programming relaxation. In this\n case, ``y=(unary_marginals, pariwise_marginals)``.\n\n Returns\n -------\n p : ndarray, shape (size_joint_feature,)\n Feature vector associated with state (x, y).\n\n \"\"\"\n self._check_size_x(x)\n features, edges = self._get_features(x), self._get_edges(x)\n\n if isinstance(y, tuple):\n # y is result of relaxation, tuple of unary and pairwise marginals\n unary_marginals, pw = y\n # accumulate pairwise\n pw = pw.reshape(-1, self.n_states, self.n_states).sum(axis=0)\n else:\n n_nodes = y.size\n gx = np.ogrid[:n_nodes]\n\n #make one hot encoding\n unary_marginals = np.zeros((n_nodes, self.n_states), dtype=np.int)\n gx = np.ogrid[:n_nodes]\n unary_marginals[gx, y] = 1\n\n ##accumulated pairwise\n pw = np.dot(unary_marginals[edges[:, 0]].T,\n unary_marginals[edges[:, 1]])\n n_visible = features.shape[0]\n unaries_acc = np.dot(unary_marginals[:n_visible,\n :self.n_input_states].T, features)\n\n joint_feature_vector = np.hstack([unaries_acc.ravel(),\n compress_sym(pw)])\n return joint_feature_vector", "metadata": "root.LatentNodeCRF.joint_feature", "header": "['class', 'LatentNodeCRF', '(', 'GraphCRF', ')', ':', '___EOS___']", "index": 266 }, { "content": " def joint_feature(self, x, y):\n \"\"\"Feature vector associated with instance (x, y).\n\n Feature representation joint_feature, such that the energy of the\n configuration (x, y) and a weight vector w is given by\n np.dot(w, joint_feature(x, y)).\n\n Parameters\n ----------\n x : tuple\n Unary evidence.\n\n y : ndarray or tuple\n Either y is an integral ndarray, giving\n a complete labeling for x.\n Or it is the result of a linear programming relaxation. In this\n case, ``y=(unary_marginals, pariwise_marginals)``.\n\n Returns\n -------\n p : ndarray, shape (size_joint_feature,)\n Feature vector associated with state (x, y).\n\n \"\"\"\n self._check_size_x(x)\n features, edges = self._get_features(x), self._get_edges(x)\n n_nodes = features.shape[0]\n edge_features = x[2]\n\n if isinstance(y, tuple):\n # y is result of relaxation, tuple of unary and pairwise marginals\n unary_marginals, pw = y\n else:\n n_nodes = y.size\n gx = np.ogrid[:n_nodes]\n\n # make one hot encoding\n unary_marginals = np.zeros((n_nodes, self.n_states), dtype=np.int)\n gx = np.ogrid[:n_nodes]\n unary_marginals[gx, y] = 1\n\n # pairwise\n pw = [np.outer(unary_marginals[edge[0]].T,\n unary_marginals[edge[1]]).ravel()\n for edge in edges]\n pw = np.vstack(pw)\n\n pw = np.dot(edge_features.T, pw)\n for i in self.symmetric_edge_features:\n pw_ = pw[i].reshape(self.n_states, self.n_states)\n pw[i] = (pw_ + pw_.T).ravel() / 2.\n\n for i in self.antisymmetric_edge_features:\n pw_ = pw[i].reshape(self.n_states, self.n_states)\n pw[i] = (pw_ - pw_.T).ravel() / 2.\n\n n_visible = features.shape[0]\n unaries_acc = np.dot(unary_marginals[:n_visible,\n :self.n_input_states].T, features)\n\n joint_feature_vector = np.hstack([unaries_acc.ravel(), pw.ravel()])\n return joint_feature_vector", "metadata": "root.EdgeFeatureLatentNodeCRF.joint_feature", "header": "['class', 'EdgeFeatureLatentNodeCRF', '(', 'LatentNodeCRF', ')', ':', '___EOS___']", "index": 566 } ]
[ { "span": "gx ", "start_line": 300, "start_column": 12, "end_line": 300, "end_column": 14 }, { "span": "n_nodes ", "start_line": 592, "start_column": 8, "end_line": 592, "end_column": 15 }, { "span": "gx ", "start_line": 600, "start_column": 12, "end_line": 600, "end_column": 14 } ]
[ { "span": "gx ", "start_line": 304, "start_column": 12, "end_line": 304, "end_column": 14 }, { "span": "n_nodes ", "start_line": 599, "start_column": 12, "end_line": 599, "end_column": 19 }, { "span": "gx ", "start_line": 604, "start_column": 12, "end_line": 604, "end_column": 14 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Late", "nt", "Node", "CR", "F_", "(_", "Graph", "CR", "F_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "joint", "\\u", "feature_", "(_", "self_", ",_", "x_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Feature", " ", "vector", " ", "associate", "d", " ", "with", " ", "instance", " ", "(", "x", ",", " ", "y", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Feature", " ", "represent", "ation", " ", "joint", "\\u", "feature", ",", " ", "suc", "h", " ", "tha", "t", " ", "the", " ", "energ", "y", " ", "of", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "configura", "tion", " ", "(", "x", ",", " ", "y", ")", " ", "and", " ", "a", " ", "weight", " ", "vector", " ", "w", " ", "is", " ", "give", "n", " ", "by", "\\", "10", ";", " ", " ", " ", " ", "np", ".", "dot", "(", "w", ",", " ", "joint", "\\u", "feature", "(", "x", ",", " ", "y", "))", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", " ", " ", " ", " ", "x", " ", ":", " ", "tuple", "\\", "10", ";", " ", " ", " ", " ", "Una", "ry", " ", "eviden", "ce", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "y", " ", ":", " ", "ndar", "ray", " ", "or", " ", "tuple", "\\", "10", ";", " ", " ", " ", " ", "Ei", "ther", " ", "y", " ", "is", " ", "an", " ", "integral", " ", "ndar", "ray", ",", " ", "gi", "ving", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "complete", " ", "labeling", " ", "for", " ", "x", ".", "\\", "10", ";", " ", " ", " ", " ", "Or", " ", "it", " ", "is", " ", "the", " ", "result", " ", "of", " ", "a", " ", "linear", " ", "program", "ming", " ", "relax", "ation", ".", " ", "In", " ", "this", "\\", "10", ";", " ", " ", " ", " ", "case", ",", " ", "``", "y", "=(", "una", "ry", "\\u", "marginal", "s", ",", " ", "pari", "wis", "e\\u", "marginal", "s", ")``.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", "\\", "10", ";", " ", " ", " ", " ", "-------", "\\", "10", ";", " ", " ", " ", " ", "p", " ", ":", " ", "ndar", "ray", ",", " ", "shape", " ", "(", "size", "\\u", "joint", "\\u", "feature", ",)", "\\", "10", ";", " ", " ", " ", " ", "Feature", " ", "vector", " ", "associate", "d", " ", "with", " ", "state", " ", "(", "x", ",", " ", "y", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "size", "\\u", "x_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "features_", ",_", "edges_", "=_", "self_", "._", "\\u", "get", "\\u", "features_", "(_", "x_", ")_", ",_", "self_", "._", "\\u", "get", "\\u", "edges_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "y_", ",_", "tuple_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "y", " ", "is", " ", "result", " ", "of", " ", "relax", "ation", ",", " ", "tuple", " ", "of", " ", "una", "ry", " ", "and", " ", "pairwise", " ", "marginal", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "una", "ry", "\\u", "marginal", "s_", ",_", "pw_", "=_", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "accumulate", " ", "pairwise", "_", "\\u\\u\\uNL\\u\\u\\u_", "pw_", "=_", "pw_", "._", "reshape_", "(_", "-_", "1_", ",_", "self_", "._", "n", "\\u", "states_", ",_", "self_", "._", "n", "\\u", "states_", ")_", "._", "sum_", "(_", "axis_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n", "\\u", "nodes_", "=_", "y_", "._", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gx_", "=_", "np_", "._", "ogr", "id_", "[_", ":_", "n", "\\u", "nodes_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "make", " ", "one", " ", "hot", " ", "encoding_", "\\u\\u\\uNL\\u\\u\\u_", "una", "ry", "\\u", "marginal", "s_", "=_", "np_", "._", "zeros_", "(_", "(_", "n", "\\u", "nodes_", ",_", "self_", "._", "n", "\\u", "states_", ")_", ",_", "dtype_", "=_", "np_", "._", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gx_", "=_", "np_", "._", "ogr", "id_", "[_", ":_", "n", "\\u", "nodes_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "una", "ry", "\\u", "marginal", "s_", "[_", "gx_", ",_", "y_", "]_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", "accumulated", " ", "pairwise", "_", "\\u\\u\\uNL\\u\\u\\u_", "pw_", "=_", "np_", "._", "dot_", "(_", "una", "ry", "\\u", "marginal", "s_", "[_", "edges_", "[_", ":_", ",_", "0_", "]_", "]_", "._", "T_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "una", "ry", "\\u", "marginal", "s_", "[_", "edges_", "[_", ":_", ",_", "1_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "n", "\\u", "visible_", "=_", "features_", "._", "shape_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "una", "rie", "s", "\\u", "acc_", "=_", "np_", "._", "dot_", "(_", "una", "ry", "\\u", "marginal", "s_", "[_", ":_", "n", "\\u", "visible_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ":_", "self_", "._", "n", "\\u", "input", "\\u", "states_", "]_", "._", "T_", ",_", "features_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "joint", "\\u", "feature", "\\u", "vector_", "=_", "np_", "._", "hstack_", "(_", "[_", "una", "rie", "s", "\\u", "acc_", "._", "ravel_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "compress", "\\u", "sym_", "(_", "pw_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "joint", "\\u", "feature", "\\u", "vector_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ed", "ge", "Feature", "Late", "nt", "Node", "CR", "F_", "(_", "Late", "nt", "Node", "CR", "F_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "joint", "\\u", "feature_", "(_", "self_", ",_", "x_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Feature", " ", "vector", " ", "associate", "d", " ", "with", " ", "instance", " ", "(", "x", ",", " ", "y", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Feature", " ", "represent", "ation", " ", "joint", "\\u", "feature", ",", " ", "suc", "h", " ", "tha", "t", " ", "the", " ", "energ", "y", " ", "of", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "configura", "tion", " ", "(", "x", ",", " ", "y", ")", " ", "and", " ", "a", " ", "weight", " ", "vector", " ", "w", " ", "is", " ", "give", "n", " ", "by", "\\", "10", ";", " ", " ", " ", " ", "np", ".", "dot", "(", "w", ",", " ", "joint", "\\u", "feature", "(", "x", ",", " ", "y", "))", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", " ", " ", " ", " ", "x", " ", ":", " ", "tuple", "\\", "10", ";", " ", " ", " ", " ", "Una", "ry", " ", "eviden", "ce", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "y", " ", ":", " ", "ndar", "ray", " ", "or", " ", "tuple", "\\", "10", ";", " ", " ", " ", " ", "Ei", "ther", " ", "y", " ", "is", " ", "an", " ", "integral", " ", "ndar", "ray", ",", " ", "gi", "ving", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "complete", " ", "labeling", " ", "for", " ", "x", ".", "\\", "10", ";", " ", " ", " ", " ", "Or", " ", "it", " ", "is", " ", "the", " ", "result", " ", "of", " ", "a", " ", "linear", " ", "program", "ming", " ", "relax", "ation", ".", " ", "In", " ", "this", "\\", "10", ";", " ", " ", " ", " ", "case", ",", " ", "``", "y", "=(", "una", "ry", "\\u", "marginal", "s", ",", " ", "pari", "wis", "e\\u", "marginal", "s", ")``.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", "\\", "10", ";", " ", " ", " ", " ", "-------", "\\", "10", ";", " ", " ", " ", " ", "p", " ", ":", " ", "ndar", "ray", ",", " ", "shape", " ", "(", "size", "\\u", "joint", "\\u", "feature", ",)", "\\", "10", ";", " ", " ", " ", " ", "Feature", " ", "vector", " ", "associate", "d", " ", "with", " ", "state", " ", "(", "x", ",", " ", "y", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "size", "\\u", "x_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "features_", ",_", "edges_", "=_", "self_", "._", "\\u", "get", "\\u", "features_", "(_", "x_", ")_", ",_", "self_", "._", "\\u", "get", "\\u", "edges_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n", "\\u", "nodes_", "=_", "features_", "._", "shape_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "edge", "\\u", "features_", "=_", "x_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "y_", ",_", "tuple_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "y", " ", "is", " ", "result", " ", "of", " ", "relax", "ation", ",", " ", "tuple", " ", "of", " ", "una", "ry", " ", "and", " ", "pairwise", " ", "marginal", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "una", "ry", "\\u", "marginal", "s_", ",_", "pw_", "=_", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n", "\\u", "nodes_", "=_", "y_", "._", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gx_", "=_", "np_", "._", "ogr", "id_", "[_", ":_", "n", "\\u", "nodes_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "make", " ", "one", " ", "hot", " ", "encoding_", "\\u\\u\\uNL\\u\\u\\u_", "una", "ry", "\\u", "marginal", "s_", "=_", "np_", "._", "zeros_", "(_", "(_", "n", "\\u", "nodes_", ",_", "self_", "._", "n", "\\u", "states_", ")_", ",_", "dtype_", "=_", "np_", "._", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gx_", "=_", "np_", "._", "ogr", "id_", "[_", ":_", "n", "\\u", "nodes_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "una", "ry", "\\u", "marginal", "s_", "[_", "gx_", ",_", "y_", "]_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pairwise", "_", "\\u\\u\\uNL\\u\\u\\u_", "pw_", "=_", "[_", "np_", "._", "outer_", "(_", "una", "ry", "\\u", "marginal", "s_", "[_", "edge_", "[_", "0_", "]_", "]_", "._", "T_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "una", "ry", "\\u", "marginal", "s_", "[_", "edge_", "[_", "1_", "]_", "]_", ")_", "._", "ravel_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "edge_", "in_", "edges_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pw_", "=_", "np_", "._", "vstack_", "(_", "pw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pw_", "=_", "np_", "._", "dot_", "(_", "edge", "\\u", "features_", "._", "T_", ",_", "pw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "self_", "._", "symmetric", "\\u", "edge", "\\u", "features_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pw", "\\u_", "=_", "pw_", "[_", "i_", "]_", "._", "reshape_", "(_", "self_", "._", "n", "\\u", "states_", ",_", "self_", "._", "n", "\\u", "states_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pw_", "[_", "i_", "]_", "=_", "(_", "pw", "\\u_", "+_", "pw", "\\u_", "._", "T_", ")_", "._", "ravel_", "(_", ")_", "/_", "2._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "self_", "._", "anti", "symmetric", "\\u", "edge", "\\u", "features_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pw", "\\u_", "=_", "pw_", "[_", "i_", "]_", "._", "reshape_", "(_", "self_", "._", "n", "\\u", "states_", ",_", "self_", "._", "n", "\\u", "states_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pw_", "[_", "i_", "]_", "=_", "(_", "pw", "\\u_", "-_", "pw", "\\u_", "._", "T_", ")_", "._", "ravel_", "(_", ")_", "/_", "2._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "n", "\\u", "visible_", "=_", "features_", "._", "shape_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "una", "rie", "s", "\\u", "acc_", "=_", "np_", "._", "dot_", "(_", "una", "ry", "\\u", "marginal", "s_", "[_", ":_", "n", "\\u", "visible_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ":_", "self_", "._", "n", "\\u", "input", "\\u", "states_", "]_", "._", "T_", ",_", "features_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "joint", "\\u", "feature", "\\u", "vector_", "=_", "np_", "._", "hstack_", "(_", "[_", "una", "rie", "s", "\\u", "acc_", "._", "ravel_", "(_", ")_", ",_", "pw_", "._", "ravel_", "(_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "joint", "\\u", "feature", "\\u", "vector_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
heyaaron/openmesher/OpenMesher/plugins/makedebs/__init__.py
[ { "content": "import logging, os, datetime, sys\nimport glob, tempfile, subprocess\nfrom OpenMesher.lib import nested_dict_merge\nfrom OpenMesher.interfaces import IOpenMesherPackagePlugin\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def dump_config_files(base_path, files_dict):\n for router in files_dict:\n for cfgfile in files_dict[router]:\n cfgfile_path = os.path.abspath(base_path + '/' + router + '/' + cfgfile)\n logging.debug('Creating file %s for router %s' %(cfgfile_path, router))\n fpath, fname = os.path.split(cfgfile_path)\n _mkdirs(fpath)\n fh = open(cfgfile_path, 'w')\n fh.write(files_dict[router][cfgfile])\n fh.close()\n if fname == 'rules' or fname == 'postinst':\n os.chmod(cfgfile_path, 0744)", "metadata": "root.dump_config_files", "header": "['module', '___EOS___']", "index": 5 }, { "content": "def _mkdirs(path):\n try:\n os.makedirs(path)\n except OSError as e:\n if e.errno == 17:\n pass\n else:\n raise", "metadata": "root._mkdirs", "header": "['module', '___EOS___']", "index": 18 }, { "content": "class MakeDEBs(IOpenMesherPackagePlugin):\n \n\n #BUG: Need to fix the plugin arch so services can pass their config dirs to the package generator", "metadata": "root.MakeDEBs", "header": "['module', '___EOS___']", "index": 28 }, { "content": " def activate(self):\n self._register('makedebs/changelog.conf')\n self._register('makedebs/compat.conf')\n self._register('makedebs/control.conf')\n self._register('makedebs/rules.conf')\n self._register('makedebs/postinst.conf')", "metadata": "root.MakeDEBs.activate", "header": "['class', 'MakeDEBs', '(', 'IOpenMesherPackagePlugin', ')', ':', '___EOS___']", "index": 29 }, { "content": " def setupargs(self, parser):\n parser.add_argument('--dpkg-version', default='1.0', action='store', help='Version number of the deb to create')\n super(MakeDEBs, self).setupargs(parser)", "metadata": "root.MakeDEBs.setupargs", "header": "['class', 'MakeDEBs', '(', 'IOpenMesherPackagePlugin', ')', ':', '___EOS___']", "index": 36 }, { "content": " def process(self, mesh, configPlugins = None, cliargs = None, include_dirs = ['openvpn', 'quagga', 'shorewall', 'mesh-reverse.db'], restart_services = ['openvpn', 'quagga', 'shorewall']):\n base_path = tempfile.mkdtemp(prefix='openmesher-')\n logging.warn('Packaging path: %s' %(base_path))\n _mkdirs(base_path)\n \n logging.info('Generating control files for package...')\n \n for router in mesh.routers:\n self._files[router] = {}\n changelog_date = datetime.datetime.strftime(datetime.datetime.now(), '%A, %d %B %Y %H:%M:%S -0800')\n \n #BUG: %z doesn't work for some dumb reason: http://www.aczoom.com/blog/ac/2007-02-24/strftime-in-python\n # changelog_date = datetime.datetime.strftime(datetime.datetime.utcnow(), '%A, %d %B %Y %H:%M:%S +%z')\n self._files[router]['/debian/changelog'] = self._templates['makedebs/changelog.conf'].render(\n hostname=mesh.routers[router].hostname.lower(),\n package_version = cliargs.dpkg_version,\n changelog_date = changelog_date,\n )\n \n self._files[router]['/debian/compat'] = self._templates['makedebs/compat.conf'].render()\n \n self._files[router]['/debian/control'] = self._templates['makedebs/control.conf'].render(\n hostname = mesh.routers[router].hostname.lower(),\n fqdn = mesh.routers[router].fqdn,\n changelog_date = changelog_date,\n )\n \n #BUG: Need to figure out which files need to be installed / services restarted from various plugins\n self._files[router]['/debian/rules'] = self._templates['makedebs/rules.conf'].render(\n hostname = mesh.routers[router].hostname.lower(),\n dirs = include_dirs,\n )\n \n self._files[router]['/debian/postinst'] = self._templates['makedebs/postinst.conf'].render(\n restart = restart_services,\n )\n self._packages[router] = '%s/%s.deb' %(base_path, mesh.routers[router].hostname.lower())\n \n logging.debug('Writing control files...')\n \n dump_config_files(base_path, self._files)\n \n logging.info('Assembling files for debs...')\n for plugin in configPlugins:\n logging.debug('Processing package files from plugin %s...' %(plugin))\n dump_config_files(base_path, plugin.files())\n \n for router in self._files:\n logging.info('Building package for router: %s' %(router))\n router_path = os.path.abspath(base_path + '/' + router)\n sCMD = 'fakeroot debian/rules binary'\n process = subprocess.Popen(sCMD, shell=True, stdout=subprocess.PIPE, cwd=router_path)\n process.wait()\n if process.returncode != 0:\n raise Exception('Package generation failed in %s. Do you have debhelper and fakeroot installed?' %(base_path))", "metadata": "root.MakeDEBs.process", "header": "['class', 'MakeDEBs', '(', 'IOpenMesherPackagePlugin', ')', ':', '___EOS___']", "index": 41 } ]
[ { "span": "import logging, os, datetime, sys", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 33 }, { "span": "import glob, tempfile, subprocess", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 33 }, { "span": "from OpenMesher.lib import nested_dict_merge", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 44 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "logging_", ",_", "os_", ",_", "datetime_", ",_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "glob_", ",_", "tempfile_", ",_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Open", "Mesh", "er_", "._", "lib_", "import_", "nest", "ed", "\\u", "dict", "\\u", "merge_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Open", "Mesh", "er_", "._", "interfaces_", "import_", "IO", "pen", "Mesh", "er", "Packa", "ge", "Plugin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "dump", "\\u", "config", "\\u", "files_", "(_", "base", "\\u", "path_", ",_", "files", "\\u", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "router_", "in_", "files", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "cfg", "file_", "in_", "files", "\\u", "dict_", "[_", "router_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "cfg", "file", "\\u", "path_", "=_", "os_", "._", "path_", "._", "abspath_", "(_", "base", "\\u", "path_", "+_", "'/'_", "+_", "router_", "+_", "'/'_", "+_", "cfg", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "Creat", "ing", " ", "file", " ", "%", "s", " ", "for", " ", "router", " ", "%", "s", "'_", "%_", "(_", "cfg", "file", "\\u", "path_", ",_", "router_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fpath_", ",_", "fname_", "=_", "os_", "._", "path_", "._", "split_", "(_", "cfg", "file", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "mkd", "irs_", "(_", "fpath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fh_", "=_", "open_", "(_", "cfg", "file", "\\u", "path_", ",_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fh_", "._", "write_", "(_", "files", "\\u", "dict_", "[_", "router_", "]_", "[_", "cfg", "file_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fh_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "fname_", "==_", "'", "rule", "s", "'_", "or_", "fname_", "==_", "'", "posti", "nst", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "os_", "._", "chmod_", "(_", "cfg", "file", "\\u", "path_", ",_", "0_", "744", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "mkd", "irs_", "(_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "makedirs_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "OSE", "rror_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "e_", "._", "errno_", "==_", "17_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Make", "DEB", "s_", "(_", "IO", "pen", "Mesh", "er", "Packa", "ge", "Plugin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "BUG", ":", " ", "Ne", "ed", " ", "to", " ", "fix", " ", "the", " ", "plugin", " ", "arch", " ", "so", " ", "service", "s", " ", "can", " ", "pass", " ", "thei", "r", " ", "config", " ", "dirs", " ", "to", " ", "the", " ", "package", " ", "generator_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Make", "DEB", "s_", "(_", "IO", "pen", "Mesh", "er", "Packa", "ge", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "activate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "register_", "(_", "'", "maked", "ebs", "/", "change", "log", ".", "conf", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "register_", "(_", "'", "maked", "ebs", "/", "compa", "t", ".", "conf", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "register_", "(_", "'", "maked", "ebs", "/", "control", ".", "conf", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "register_", "(_", "'", "maked", "ebs", "/", "rule", "s", ".", "conf", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "register_", "(_", "'", "maked", "ebs", "/", "posti", "nst", ".", "conf", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Make", "DEB", "s_", "(_", "IO", "pen", "Mesh", "er", "Packa", "ge", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "setup", "args_", "(_", "self_", ",_", "parser_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "dpkg", "-", "version", "'_", ",_", "default_", "=_", "'", "1.0", "'_", ",_", "action_", "=_", "'", "store", "'_", ",_", "help_", "=_", "'", "Version", " ", "number", " ", "of", " ", "the", " ", "deb", " ", "to", " ", "create", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Make", "DEB", "s_", ",_", "self_", ")_", "._", "setup", "args_", "(_", "parser_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Make", "DEB", "s_", "(_", "IO", "pen", "Mesh", "er", "Packa", "ge", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process_", "(_", "self_", ",_", "mesh_", ",_", "config", "Plugins_", "=_", "None_", ",_", "cli", "args_", "=_", "None_", ",_", "include", "\\u", "dirs_", "=_", "[_", "'", "openv", "pn", "'_", ",_", "'", "qua", "gga", "'_", ",_", "'", "sho", "rew", "all", "'_", ",_", "'", "mesh", "-", "reverse", ".", "db", "'_", "]_", ",_", "restart", "\\u", "services_", "=_", "[_", "'", "openv", "pn", "'_", ",_", "'", "qua", "gga", "'_", ",_", "'", "sho", "rew", "all", "'_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "base", "\\u", "path_", "=_", "tempfile_", "._", "mkdtemp_", "(_", "prefix_", "=_", "'", "openm", "esh", "er", "-'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "warn_", "(_", "'", "Packa", "ging", " ", "path", ":", " ", "%", "s", "'_", "%_", "(_", "base", "\\u", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "mkd", "irs_", "(_", "base", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logging_", "._", "info_", "(_", "'", "Generat", "ing", " ", "control", " ", "files", " ", "for", " ", "package", "...'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "router_", "in_", "mesh_", "._", "routers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "files_", "[_", "router_", "]_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "change", "log", "\\u", "date_", "=_", "datetime_", "._", "datetime_", "._", "strftime_", "(_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", ",_", "'%", "A", ",", " ", "%", "d", " ", "%", "B", " ", "%", "Y", " ", "%", "H", ":", "%", "M", ":", "%", "S", " ", "-0", "800", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "BUG", ":", " ", "%", "z", " ", "doe", "sn", "'", "t", " ", "work", " ", "for", " ", "some", " ", "dumb", " ", "reason", ":", " ", "http", "://", "www", ".", "ac", "zoom", ".", "com", "/", "blog", "/", "ac", "/", "2007", "-0", "2", "-", "24", "/", "strf", "time", "-", "in", "-", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "change", "log", "\\u", "date", " ", "=", " ", "datetime", ".", "datetime", ".", "strf", "time", "(", "datetime", ".", "datetime", ".", "utc", "now", "()", ",", " ", "'%", "A", ",", " ", "%", "d", " ", "%", "B", " ", "%", "Y", " ", "%", "H", ":", "%", "M", ":", "%", "S", " ", "+", "%", "z", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "files_", "[_", "router_", "]_", "[_", "'/", "debi", "an", "/", "change", "log", "'_", "]_", "=_", "self_", "._", "\\u", "templates_", "[_", "'", "maked", "ebs", "/", "change", "log", ".", "conf", "'_", "]_", "._", "render_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "hostname_", "=_", "mesh_", "._", "routers_", "[_", "router_", "]_", "._", "hostname_", "._", "lower_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "version_", "=_", "cli", "args_", "._", "dpkg", "\\u", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "change", "log", "\\u", "date_", "=_", "change", "log", "\\u", "date_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "files_", "[_", "router_", "]_", "[_", "'/", "debi", "an", "/", "compa", "t", "'_", "]_", "=_", "self_", "._", "\\u", "templates_", "[_", "'", "maked", "ebs", "/", "compa", "t", ".", "conf", "'_", "]_", "._", "render_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "files_", "[_", "router_", "]_", "[_", "'/", "debi", "an", "/", "control", "'_", "]_", "=_", "self_", "._", "\\u", "templates_", "[_", "'", "maked", "ebs", "/", "control", ".", "conf", "'_", "]_", "._", "render_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "hostname_", "=_", "mesh_", "._", "routers_", "[_", "router_", "]_", "._", "hostname_", "._", "lower_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fqdn_", "=_", "mesh_", "._", "routers_", "[_", "router_", "]_", "._", "fqdn_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "change", "log", "\\u", "date_", "=_", "change", "log", "\\u", "date_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "BUG", ":", " ", "Ne", "ed", " ", "to", " ", "figure", " ", "out", " ", "whi", "ch", " ", "files", " ", "need", " ", "to", " ", "be", " ", "install", "ed", " ", "/", " ", "service", "s", " ", "restart", "ed", " ", "from", " ", "vari", "ous", " ", "plugins_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "files_", "[_", "router_", "]_", "[_", "'/", "debi", "an", "/", "rule", "s", "'_", "]_", "=_", "self_", "._", "\\u", "templates_", "[_", "'", "maked", "ebs", "/", "rule", "s", ".", "conf", "'_", "]_", "._", "render_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "hostname_", "=_", "mesh_", "._", "routers_", "[_", "router_", "]_", "._", "hostname_", "._", "lower_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dirs_", "=_", "include", "\\u", "dirs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "files_", "[_", "router_", "]_", "[_", "'/", "debi", "an", "/", "posti", "nst", "'_", "]_", "=_", "self_", "._", "\\u", "templates_", "[_", "'", "maked", "ebs", "/", "posti", "nst", ".", "conf", "'_", "]_", "._", "render_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "restart_", "=_", "restart", "\\u", "services_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "packages_", "[_", "router_", "]_", "=_", "'%", "s", "/", "%", "s", ".", "deb", "'_", "%_", "(_", "base", "\\u", "path_", ",_", "mesh_", "._", "routers_", "[_", "router_", "]_", "._", "hostname_", "._", "lower_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "Writ", "ing", " ", "control", " ", "files", "...'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dump", "\\u", "config", "\\u", "files_", "(_", "base", "\\u", "path_", ",_", "self_", "._", "\\u", "files_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logging_", "._", "info_", "(_", "'", "Asse", "mbl", "ing", " ", "files", " ", "for", " ", "deb", "s", "...'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "plugin_", "in_", "config", "Plugins_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "debug_", "(_", "'", "Process", "ing", " ", "package", " ", "files", " ", "from", " ", "plugin", " ", "%", "s", "...'_", "%_", "(_", "plugin_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dump", "\\u", "config", "\\u", "files_", "(_", "base", "\\u", "path_", ",_", "plugin_", "._", "files_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "router_", "in_", "self_", "._", "\\u", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "info_", "(_", "'", "Building", " ", "package", " ", "for", " ", "router", ":", " ", "%", "s", "'_", "%_", "(_", "router_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "router", "\\u", "path_", "=_", "os_", "._", "path_", "._", "abspath_", "(_", "base", "\\u", "path_", "+_", "'/'_", "+_", "router_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s", "CMD_", "=_", "'", "faker", "oot", " ", "debi", "an", "/", "rule", "s", " ", "binar", "y", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "=_", "subprocess_", "._", "Popen_", "(_", "s", "CMD_", ",_", "shell_", "=_", "True_", ",_", "stdout_", "=_", "subprocess_", "._", "PIPE_", ",_", "cwd_", "=_", "router", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "process_", "._", "returncode_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "Packa", "ge", " ", "generat", "ion", " ", "fail", "ed", " ", "in", " ", "%", "s", ".", " ", " ", "Do", " ", "you", " ", "have", " ", "deb", "help", "er", " ", "and", " ", "faker", "oot", " ", "install", "ed", "?'_", "%_", "(_", "base", "\\u", "path_", ")_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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def process_files(self, data, edit=True, obj=None):\n from uliweb.form import FileField\n \n file_fields = {}\n \n flag = False\n fields_list = self.get_fields()\n for name, f in self.form.fields_list:\n if isinstance(f, FileField):\n if name in data and data[name]:\n if edit:\n if not obj:\n raise UliwebError(\"obj can't be empty\")\n \n #if obj has the filename, then delete it first\n filename = getattr(obj, name)\n if filename:\n self.fileserving.delete_filename(filename) \n data[name] = self._process_file(obj, data[name], f)\n flag = True\n else:\n #if not data[name] and edit status, so just delete name\n if edit:\n data.pop(name, None)\n return flag", "metadata": "root.AddView.process_files", "header": "['class', 'AddView', '(', 'object', ')', ':', '___EOS___']", "index": 844 }, { "content": " def on_success(self, d, json_result=False):\n from uliweb import response\n\n if self.pre_save:\n self.pre_save(d)\n \n files = self.process_files(d, edit=False)\n obj = self._save(d)\n \n if self.post_save:\n self.post_save(obj, d)\n \n if json_result:\n return to_json_result(True, self.success_msg, self.on_success_data(obj, d), json_func=self.json_func)\n else:\n if self.use_flash:\n if 'flash' in functions:\n functions.flash(self.success_msg)\n else:\n log.debug(\"Can't find flash function in functions\")\n \n if self.ok_url:\n return redirect(self.get_url(obj))\n else:\n response.template = self.ok_template\n return d", "metadata": "root.AddView.on_success", "header": "['class', 'AddView', '(', 'object', ')', ':', '___EOS___']", "index": 933 }, { "content": " def query_range(self, pageno=0, pagination=True):\n if callable(self._query):\n query_result = self._query()\n else:\n query_result = self._query\n \n def repeat(data, begin, n):\n result = []\n no_data_flag = False\n i = 0\n while (begin > 0 and i < begin) or (begin == -1):\n try:\n result.append(data.next())\n i += 1\n n += 1\n except StopIteration:\n no_data_flag = True\n break\n return no_data_flag, n, result\n \n if self.manual:\n if isinstance(query_result, (list, tuple)):\n if not self.total:\n self.total = len(query_result)\n return query_result\n else:\n if not self.total:\n flag, self.total, result = repeat(query_result, -1, self.total)\n else:\n result = query_result\n return result\n else:\n self.total = 0\n if pagination:\n if isinstance(query_result, (list, tuple)):\n self.total = len(query_result)\n result = query_result[pageno*self.rows_per_page : (pageno+1)*self.rows_per_page]\n return result\n else:\n #first step, skip records before pageno*self.rows_per_page\n flag, self.total, result = repeat(query_result, pageno*self.rows_per_page, self.total)\n if flag:\n return []\n \n #second step, get the records\n flag, self.total, result = repeat(query_result, self.rows_per_page, self.total)\n if flag:\n return result\n \n #third step, skip the rest records, and get the really total\n flag, self.total, r = repeat(query_result, -1, self.total)\n return result\n else:\n if isinstance(query_result, (list, tuple)):\n self.total = len(query_result)\n return query_result\n else:\n flag, self.total, result = repeat(query_result, -1, self.total)\n return result", "metadata": "root.SimpleListView.query_range", "header": "['class', 'SimpleListView', '(', 'object', ')', ':', '___EOS___']", "index": 1706 }, { "content": " def get_data(self, query, fields_convert_map, encoding='utf-8', auto_convert=True, include_hidden=False):\n \"\"\"\n If convert=True, will convert field value\n \"\"\"\n fields_convert_map = fields_convert_map or {}\n d = self.fields_convert_map.copy() \n d.update(fields_convert_map)\n \n if isinstance(query, Select):\n query = do_(query)\n \n def get_value(name, value, record):\n convert = d.get(name)\n if convert:\n value = convert(value, record)\n return safe_unicode(value, encoding)\n \n for record in query:\n self._cal_sum(record)\n row = []\n record = self._get_record(record)\n if isinstance(record, orm.Model):\n model = record.__class__\n else:\n model = None\n \n for i, x in enumerate(self.table_info['fields_list']):\n field = self.get_field(x['name'], model)\n if not field:\n field = {'name':x['name']}\n else:\n field = {'name':x['name'], 'prop':field}\n if not include_hidden and x.get('hidden'):\n continue\n if isinstance(record, orm.Model):\n v = make_view_field(field, record, fields_convert_map=d, \n auto_convert=auto_convert)\n else:\n v = make_view_field(field, record, fields_convert_map=d, \n auto_convert=auto_convert, value=record[x['name']])\n value = v['display']\n #value = safe_unicode(v['display'], encoding)\n row.append(value)\n \n yield row\n total = self._get_sum()\n if total:\n row = []\n for x in total:\n v = x\n if isinstance(x, str):\n v = safe_unicode(x, encoding)\n row.append(v)\n yield row", "metadata": "root.SimpleListView.get_data", "header": "['class', 'SimpleListView', '(', 'object', ')', ':', '___EOS___']", "index": 1860 }, { "content": " def get_table_info(self):\n t = {'fields_name':[], 'fields_list':[], 'fields':[], 'fields_label':{}}\n \n if self.fields is not None:\n fields = self.fields\n elif hasattr(self.model, self.meta):\n fields = getattr(self.model, self.meta).fields\n else:\n fields = [x for x, y in self.model._fields_list]\n \n fields_list = []\n for x in fields:\n if isinstance(x, (str, unicode)):\n name = x\n d = {'name':x}\n f = self.get_table_meta_field(name, self.model)\n if f:\n d = f\n else:\n d['verbose_name'] = x\n elif isinstance(x, dict):\n name = x['name']\n d = x\n\n if 'verbose_name' not in d:\n f = self.get_table_meta_field(name, x.get('model', self.model))\n if f:\n d['verbose_name'] = f['verbose_name']\n else:\n d['verbose_name'] = name\n \n #process field width\n w = d.get('width')\n if w:\n if isinstance(w, int):\n width = '%dpx' % w\n else:\n width = w\n else:\n width = '*'\n d['width_str'] = width\n \n t['fields_list'].append(d)\n t['fields_name'].append(d['verbose_name'])\n t['fields'].append(name)\n t['fields_label'][name.replace('.', '_')] = name\n \n return t", "metadata": "root.ListView.get_table_info", "header": "['class', 'ListView', '(', 'SimpleListView', ')', ':', '___EOS___']", "index": 2413 } ]
[ { "span": "file_fields ", "start_line": 847, "start_column": 8, "end_line": 847, "end_column": 19 }, { "span": "fields_list ", "start_line": 850, "start_column": 8, "end_line": 850, "end_column": 19 }, { "span": "files ", "start_line": 939, "start_column": 8, "end_line": 939, "end_column": 13 }, { "span": "flag,", "start_line": 1756, "start_column": 20, "end_line": 1756, "end_column": 24 }, { "span": "r ", "start_line": 1756, "start_column": 38, "end_line": 1756, "end_column": 39 }, { "span": "get_value(", "start_line": 1871, "start_column": 12, "end_line": 1871, "end_column": 21 }, { "span": "fields_list ", "start_line": 2423, "start_column": 8, "end_line": 2423, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Add", "View_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "files_", "(_", "self_", ",_", "data_", ",_", "edit_", "=_", "True_", ",_", "obj_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "uli", "web_", "._", "form_", "import_", "File", "Field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "file", "\\u", "fields_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "flag_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields", "\\u", "list_", "=_", "self_", "._", "get", "\\u", "fields_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", ",_", "f_", "in_", "self_", "._", "form_", "._", "fields", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "f_", ",_", "File", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "name_", "in_", "data_", "and_", "data_", "[_", "name_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "edit_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "not_", "obj_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "Ul", "iw", "eb", "Error_", "(_", "\"", "obj", " ", "can", "'", "t", " ", "be", " ", "empty", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "obj", " ", "has", " ", "the", " ", "filename", ",", " ", "then", " ", "delete", " ", "it", " ", "first_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "filename_", "=_", "getattr_", "(_", "obj_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "filename_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "filese", "rvi", "ng_", "._", "delete", "\\u", "filename_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "[_", "name_", "]_", "=_", "self_", "._", "\\u", "process", "\\u", "file_", "(_", "obj_", ",_", "data_", "[_", "name_", "]_", ",_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flag_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "not", " ", "data", "[", "name", "]", " ", "and", " ", "edit", " ", "status", ",", " ", "so", " ", "just", " ", "delete", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "edit_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "data_", "._", "pop_", "(_", "name_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "flag_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Add", "View_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "\\u", "success_", "(_", "self_", ",_", "d_", ",_", "json", "\\u", "result_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "uli", "web_", "import_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "pre", "\\u", "save_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "pre", "\\u", "save_", "(_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "files_", "=_", "self_", "._", "process", "\\u", "files_", "(_", "d_", ",_", "edit_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "=_", "self_", "._", "\\u", "save_", "(_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "post", "\\u", "save_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "post", "\\u", "save_", "(_", "obj_", ",_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "json", "\\u", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "to", "\\u", "json", "\\u", "result_", "(_", "True_", ",_", "self_", "._", "success", "\\u", "msg_", ",_", "self_", "._", "on", "\\u", "success", "\\u", "data_", "(_", "obj_", ",_", "d_", ")_", ",_", "json", "\\u", "func_", "=_", "self_", "._", "json", "\\u", "func_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "use", "\\u", "flash_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "flash", "'_", "in_", "functions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "functions_", "._", "flash_", "(_", "self_", "._", "success", "\\u", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "log_", "._", "debug_", "(_", "\"", "Can", "'", "t", " ", "find", " ", "flash", " ", "function", " ", "in", " ", "function", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "ok", "\\u", "url_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "redirect_", "(_", "self_", "._", "get", "\\u", "url_", "(_", "obj_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "._", "template_", "=_", "self_", "._", "ok", "\\u", "template_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "List", "View_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "query", "\\u", "range_", "(_", "self_", ",_", "pagen", "o_", "=_", "0_", ",_", "pagination_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "callable_", "(_", "self_", "._", "\\u", "query_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query", "\\u", "result_", "=_", "self_", "._", "\\u", "query_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query", "\\u", "result_", "=_", "self_", "._", "\\u", "query_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "repeat_", "(_", "data_", ",_", "begin_", ",_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "no", "\\u", "data\\u", "flag_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "(_", "begin_", ">_", "0_", "and_", "i_", "<_", "begin_", ")_", "or_", "(_", "begin_", "==_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "result_", "._", "append_", "(_", "data_", "._", "next_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Sto", "p", "Iteration_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "no", "\\u", "data\\u", "flag_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "no", "\\u", "data\\u", "flag_", ",_", "n_", ",_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "manual_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "query", "\\u", "result_", ",_", "(_", "list_", ",_", "tuple_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "total_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "total_", "=_", "len_", "(_", "query", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "query", "\\u", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "total_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "flag_", ",_", "self_", "._", "total_", ",_", "result_", "=_", "repeat_", "(_", "query", "\\u", "result_", ",_", "-_", "1_", ",_", "self_", "._", "total_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "result_", "=_", "query", "\\u", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "total_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pagination_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "query", "\\u", "result_", ",_", "(_", "list_", ",_", "tuple_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "total_", "=_", "len_", "(_", "query", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "query", "\\u", "result_", "[_", "pagen", "o_", "*_", "self_", "._", "rows", "\\u", "per", "\\u", "page_", ":_", "(_", "pagen", "o_", "+_", "1_", ")_", "*_", "self_", "._", "rows", "\\u", "per", "\\u", "page_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "first", " ", "step", ",", " ", "skip", " ", "record", "s", " ", "bef", "ore", " ", "pagen", "o", "*", "self", ".", "rows", "\\u", "per", "\\u", "page_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "flag_", ",_", "self_", "._", "total_", ",_", "result_", "=_", "repeat_", "(_", "query", "\\u", "result_", ",_", "pagen", "o_", "*_", "self_", "._", "rows", "\\u", "per", "\\u", "page_", ",_", "self_", "._", "total_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "flag_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "second", " ", "step", ",", " ", "get", " ", "the", " ", "records_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "flag_", ",_", "self_", "._", "total_", ",_", "result_", "=_", "repeat_", "(_", "query", "\\u", "result_", ",_", "self_", "._", "rows", "\\u", "per", "\\u", "page_", ",_", "self_", "._", "total_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "flag_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "third", " ", "step", ",", " ", "skip", " ", "the", " ", "rest", " ", "record", "s", ",", " ", "and", " ", "get", " ", "the", " ", "reall", "y", " ", "total_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "flag_", ",_", "self_", "._", "total_", ",_", "r_", "=_", "repeat_", "(_", "query", "\\u", "result_", ",_", "-_", "1_", ",_", "self_", "._", "total_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "query", "\\u", "result_", ",_", "(_", "list_", ",_", "tuple_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "total_", "=_", "len_", "(_", "query", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "query", "\\u", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "flag_", ",_", "self_", "._", "total_", ",_", "result_", "=_", "repeat_", "(_", "query", "\\u", "result_", ",_", "-_", "1_", ",_", "self_", "._", "total_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "List", "View_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "data_", "(_", "self_", ",_", "query_", ",_", "fields", "\\u", "convert", "\\u", "map_", ",_", "encoding_", "=_", "'", "utf", "-", "8", "'_", ",_", "auto", "\\u", "convert_", "=_", "True_", ",_", "include", "\\u", "hidden_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "convert", "=", "Tru", "e", ",", " ", "will", " ", "convert", " ", "field", " ", "value", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields", "\\u", "convert", "\\u", "map_", "=_", "fields", "\\u", "convert", "\\u", "map_", "or_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "fields", "\\u", "convert", "\\u", "map_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "update_", "(_", "fields", "\\u", "convert", "\\u", "map_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "query_", ",_", "Select_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "do", "\\u_", "(_", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "value_", "(_", "name_", ",_", "value_", ",_", "record_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "convert_", "=_", "d_", "._", "get_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "convert_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "convert_", "(_", "value_", ",_", "record_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "safe", "\\u", "unicode_", "(_", "value_", ",_", "encoding_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "record_", "in_", "query_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "cal", "\\u", "sum_", "(_", "record_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "record_", "=_", "self_", "._", "\\u", "get", "\\u", "record_", "(_", "record_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "record_", ",_", "orm_", "._", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "record_", "._", "\\u\\u", "class\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", ",_", "x_", "in_", "enumerate_", "(_", "self_", "._", "table", "\\u", "info_", "[_", "'", "fields", "\\u", "list", "'_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field_", "=_", "self_", "._", "get", "\\u", "field_", "(_", "x_", "[_", "'", "name", "'_", "]_", ",_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "field_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "field_", "=_", "{_", "'", "name", "'_", ":_", "x_", "[_", "'", "name", "'_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "field_", "=_", "{_", "'", "name", "'_", ":_", "x_", "[_", "'", "name", "'_", "]_", ",_", "'", "prop", "'_", ":_", "field_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "include", "\\u", "hidden_", "and_", "x_", "._", "get_", "(_", "'", "hidden", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "record_", ",_", "orm_", "._", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "v_", "=_", "make", "\\u", "view", "\\u", "field_", "(_", "field_", ",_", "record_", ",_", "fields", "\\u", "convert", "\\u", "map_", "=_", "d_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "auto", "\\u", "convert_", "=_", "auto", "\\u", "convert_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "v_", "=_", "make", "\\u", "view", "\\u", "field_", "(_", "field_", ",_", "record_", ",_", "fields", "\\u", "convert", "\\u", "map_", "=_", "d_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "auto", "\\u", "convert_", "=_", "auto", "\\u", "convert_", ",_", "value_", "=_", "record_", "[_", "x_", "[_", "'", "name", "'_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "value_", "=_", "v_", "[_", "'", "display", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "value", " ", "=", " ", "safe", "\\u", "unicode", "(", "v", "['", "display", "']", ",", " ", "encoding", ")_", "\\u\\u\\uNL\\u\\u\\u_", "row_", "._", "append_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "yield_", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "total_", "=_", "self_", "._", "\\u", "get", "\\u", "sum_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "total_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "row_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "total_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "x_", ",_", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "v_", "=_", "safe", "\\u", "unicode_", "(_", "x_", ",_", "encoding_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "row_", "._", "append_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "yield_", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "List", "View_", "(_", "Simple", "List", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "table", "\\u", "info_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "{_", "'", "fields", "\\u", "name", "'_", ":_", "[_", "]_", ",_", "'", "fields", "\\u", "list", "'_", ":_", "[_", "]_", ",_", "'", "fields", "'_", ":_", "[_", "]_", ",_", "'", "fields", "\\u", "label", "'_", ":_", "{_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "fields_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fields_", "=_", "self_", "._", "fields_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "hasattr_", "(_", "self_", "._", "model_", ",_", "self_", "._", "meta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fields_", "=_", "getattr_", "(_", "self_", "._", "model_", ",_", "self_", "._", "meta_", ")_", "._", "fields_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fields_", "=_", "[_", "x_", "for_", "x_", ",_", "y_", "in_", "self_", "._", "model_", "._", "\\u", "fields", "\\u", "list_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fields", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "x_", ",_", "(_", "str_", ",_", "unicode_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "{_", "'", "name", "'_", ":_", "x_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "self_", "._", "get", "\\u", "table", "\\u", "meta", "\\u", "field_", "(_", "name_", ",_", "self_", "._", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "d_", "=_", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "d_", "[_", "'", "verbo", "se", "\\u", "name", "'_", "]_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "x_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "x_", "[_", "'", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "verbo", "se", "\\u", "name", "'_", "not_", "in_", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "f_", "=_", "self_", "._", "get", "\\u", "table", "\\u", "meta", "\\u", "field_", "(_", "name_", ",_", "x_", "._", "get_", "(_", "'", "model", "'_", ",_", "self_", "._", "model_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "d_", "[_", "'", "verbo", "se", "\\u", "name", "'_", "]_", "=_", "f_", "[_", "'", "verbo", "se", "\\u", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "d_", "[_", "'", "verbo", "se", "\\u", "name", "'_", "]_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "process", " ", "field", " ", "width_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "w_", "=_", "d_", "._", "get_", "(_", "'", "widt", "h", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "w_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "w_", ",_", "int_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "width_", "=_", "'%", "dp", "x", "'_", "%_", "w_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "width_", "=_", "w_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "width_", "=_", "'*'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "[_", "'", "widt", "h", "\\u", "str", "'_", "]_", "=_", "width_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "[_", "'", "fields", "\\u", "list", "'_", "]_", "._", "append_", "(_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "[_", "'", "fields", "\\u", "name", "'_", "]_", "._", "append_", "(_", "d_", "[_", "'", "verbo", "se", "\\u", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "[_", "'", "fields", "'_", "]_", "._", "append_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "[_", "'", "fields", "\\u", "label", "'_", "]_", "[_", "name_", "._", "replace_", "(_", "'.'_", ",_", "'\\u'_", ")_", "]_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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content": " def match(self, filepath):\n expected_headers = ['Group', 'Title', 'Username', 'Password', 'URL', 'Notes']\n with open(filepath) as csv_file:\n reader = unicode_csv_reader(csv_file)\n try:\n headers = next(reader)\n except StopIteration:\n raise ValueError('empty csv file: %s' % filepath)\n return headers == expected_headers\n return False", "metadata": "root.KeepassImporter.match", "header": "['class', 'KeepassImporter', '(', 'BaseImporter', ')', ':', '___EOS___']", "index": 6 } ]
[ { "span": "return False", "start_line": 15, "start_column": 8, "end_line": 15, "end_column": 20 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "class_", "Keep", "ass", "Importer_", "(_", "Base", "Importer_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "match_", "(_", "self_", ",_", "filepath_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected", "\\u", "headers_", "=_", "[_", "'", "Group", "'_", ",_", "'", "Tit", "le", "'_", ",_", "'", "User", "name", "'_", ",_", "'", "Passw", "ord", "'_", ",_", "'", "URL", "'_", ",_", "'", "Not", "es", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "filepath_", ")_", "as_", "csv", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "reader_", "=_", "unicode", "\\u", "csv", "\\u", "reader_", "(_", "csv", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "headers_", "=_", "next_", "(_", "reader_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Sto", "p", "Iteration_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "'", "empty", " ", "csv", " ", "file", ":", " ", "%", "s", "'_", "%_", "filepath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "headers_", "==_", "expected", "\\u", "headers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2 ]
Unreachable code
akaihola/django-cairo-text/cairotext/templatetags/cairotext.py
[ { "content": "def get_png_size(filepath):\n pngfile = file(filepath, 'rb')\n signature = pngfile.read(8)\n if (signature != struct.pack(\"8B\", 137, 80, 78, 71, 13, 10, 26, 10)):\n raise ValueError(\"Invalid PNG signature\")\n while True:\n try:\n tag, data = read_png_chunk(pngfile)\n except ValueError, e:\n raise ValueError('Invalid PNG file: ' + e.args[0])\n if tag == 'IHDR': # http://www.w3.org/TR/PNG/#11IHDR\n return struct.unpack(\"!2I5B\", data)[:2]\n raise ValueError('PNG header not found')", "metadata": "root.get_png_size", "header": "['module', '___EOS___']", "index": 97 } ]
[ { "span": "raise ValueError('PNG header not found')", "start_line": 109, "start_column": 4, "end_line": 109, "end_column": 44 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "png", "\\u", "size_", "(_", "filepath_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "png", "file_", "=_", "file_", "(_", "filepath_", ",_", "'", "rb", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "signature_", "=_", "png", "file_", "._", "read_", "(_", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "signature_", "!=_", "struct_", "._", "pack_", "(_", "\"", "8", "B", "\"_", ",_", "137_", ",_", "80_", ",_", "78_", ",_", "71_", ",_", "13_", ",_", "10_", ",_", "26_", ",_", "10_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Inva", "lid", " ", "PNG", " ", "signa", "ture", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tag_", ",_", "data_", "=_", "read", "\\u", "png", "\\u", "chunk_", "(_", "png", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "'", "Inva", "lid", " ", "PNG", " ", "file", ":", " ", "'_", "+_", "e_", "._", "args_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "tag_", "==_", "'", "IH", "DR", "'_", ":_", "#", " ", "http", "://", "www", ".", "w3", ".", "org", "/", "TR", "/", "PNG", "/", "#", "11", "IH", "DR", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "struct_", "._", "unpack_", "(_", "\"!", "2", "I", "5", "B", "\"_", ",_", "data_", ")_", "[_", ":_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "'", "PNG", " ", "header", " ", "not", " ", "found", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Illegal raise
AppScale/appscale/AppServer/google/appengine/ext/gql/__init__.py
[ { "content": " def __init__(self, query_string, _app=None, _auth_domain=None,\n namespace=None):\n \"\"\"Ctor.\n\n Parses the input query into the class as a pre-compiled query, allowing\n for a later call to Bind() to bind arguments as defined in the\n documentation.\n\n Args:\n query_string: properly formatted GQL query string.\n namespace: the namespace to use for this query.\n\n Raises:\n datastore_errors.BadQueryError: if the query is not parsable.\n \"\"\"\n\n self.__app = _app\n\n self.__namespace = namespace\n\n self.__auth_domain = _auth_domain\n\n\n self.__symbols = self.TOKENIZE_REGEX.findall(query_string)\n initial_error = None\n for backwards_compatibility_mode in xrange(len(self.RESERVED_KEYWORDS)):\n self.__InitializeParseState()\n self.__active_reserved_words = self.__GenerateReservedWords(\n backwards_compatibility_mode)\n try:\n self.__Select()\n except datastore_errors.BadQueryError, error:\n logging.log(LOG_LEVEL, initial_error)\n if not initial_error:\n initial_error = error\n else:\n break\n else:\n raise initial_error", "metadata": "root.GQL.__init__", "header": "['class', 'GQL', '(', 'object', ')', ':', '___EOS___']", "index": 241 } ]
[ { "span": "raise initial_error", "start_line": 279, "start_column": 6, "end_line": 279, "end_column": 25 } ]
[]
1
true
[ "[CLS]_", "Il", "lega", "l_", "raise_", "[SEP]_", "class_", "GQ", "L_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "query", "\\u", "string_", ",_", "\\u", "app_", "=_", "None_", ",_", "\\u", "auth", "\\u", "domain_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "namespace_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Ct", "or", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Pars", "es", " ", "the", " ", "input", " ", "query", " ", "int", "o", " ", "the", " ", "class", " ", "as", " ", "a", " ", "pre", "-", "compile", "d", " ", "query", ",", " ", "allow", "ing", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "a", " ", "late", "r", " ", "call", " ", "to", " ", "Bind", "()", " ", "to", " ", "bind", " ", "argu", "ment", "s", " ", "as", " ", "defin", "ed", " ", "in", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "documentation", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "query", "\\u", "string", ":", " ", "proper", "ly", " ", "format", "ted", " ", "GQ", "L", " ", "query", " ", "string", ".", "\\", "10", ";", " ", " ", "namespace", ":", " ", "the", " ", "namespace", " ", "to", " ", "use", " ", "for", " ", "this", " ", "query", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Rai", "ses", ":", "\\", "10", ";", " ", " ", "datast", "ore", "\\u", "error", "s", ".", "Ba", "d", "Query", "Error", ":", " ", "if", " ", "the", " ", "query", " ", "is", " ", "not", " ", "pars", "able", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "app_", "=_", "\\u", "app_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "namespace_", "=_", "namespace_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "auth", "\\u", "domain_", "=_", "\\u", "auth", "\\u", "domain_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "symbols_", "=_", "self_", "._", "TOKEN", "IZE", "\\u", "REGEX_", "._", "findall_", "(_", "query", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "initial", "\\u", "error_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "back", "ward", "s", "\\u", "compatibility", "\\u", "mode_", "in_", "xrange_", "(_", "len_", "(_", "self_", "._", "RESERVED", "\\u", "KEYWORDS", "_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "Initializ", "e", "Pars", "e", "State_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "active", "\\u", "reserve", "d\\u", "words_", "=_", "self_", "._", "\\u\\u", "Generate", "Reserve", "d", "Words_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "back", "ward", "s", "\\u", "compatibility", "\\u", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "Select_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "datast", "ore", "\\u", "errors_", "._", "Ba", "d", "Query", "Error_", ",_", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "log_", "(_", "LOG", "\\u", "LEVEL_", ",_", "initial", "\\u", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "initial", "\\u", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initial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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2 ]
Except block handles 'BaseException'
ufora/ufora/test_scripts/bigbox_perf/data/testBigboxPerf.py
[ { "content": " def writeToS3Test(self, bytecount, pageSizeOverride=1024*1024, workers=1, memoryLimitMb=45 * 1024,threadCount=30):\n text = \"\"\"Vector.range(__bytecount__, {UInt8(_%100)}).paged\"\"\"\n\n s3 = ActualS3Interface.ActualS3InterfaceFactory()\n\n keyGuid = \"bigbox-test-key-\" + str(uuid.uuid4())\n \n try:\n setupText = text.replace('__bytecount__', str(bytecount))\n\n setupResults, simulation = self.computeUsingSeveralWorkers(\n setupText,\n s3,\n workers,\n memoryLimitMb=memoryLimitMb,\n threadCount=threadCount,\n returnSimulation=True,\n ioTaskThreadOverride=8,\n useInMemoryCache=False,\n timeout=30,\n objectStore=self.createObjectStore(s3),\n pageSizeOverride=pageSizeOverride\n )\n\n result = simulation.executeExternalIoTask(\n CumulusNative.ExternalIoTask.WriteCharBigvecToS3(\n setupResults.asResult.result.getVectorBigvecGuid(),\n CumulusNative.S3KeyAndCredentials(\n self.getTestDataBucket(),\n keyGuid,\n \"\",\n \"\",\n \"\"\n )\n ),\n timeout=60\n )\n\n self.assertTrue(result.isSuccess(), result)\n\n assert s3().getKeySize(self.getTestDataBucket(), keyGuid) == bytecount\n finally:\n try:\n s3().deleteKey(self.getTestDataBucket(), keyGuid)\n except:\n logging.warn(\"Failed to cleanup the test key: %s\", traceback.format_exc())", "metadata": "root.BigboxPerformanceTest.writeToS3Test", "header": "['class', 'BigboxPerformanceTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 254 } ]
[ { "span": "except:", "start_line": 298, "start_column": 12, "end_line": 298, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Big", "box", "Perform", "anc", "e", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "To", "S", "3", "Test_", "(_", "self_", ",_", "byte", "count_", ",_", "page", "Size", "Override", "_", "=_", "1024_", "*_", "1024_", ",_", "workers_", "=_", "1_", ",_", "memory", "Limit", "Mb", "_", "=_", "45_", "*_", "1024_", ",_", "thread", "Count_", "=_", "30_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "\"\"\"", "Vector", ".", "range", "(\\u", "\\u", "byte", "count", "\\u\\u", ",", " ", "{", "UI", "nt", "8", "(\\u", "%", "100", ")}", ").", "paged", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s3_", "=_", "Actual", "S", "3", "Interface_", "._", "Actual", "S", "3", "Interface", "Factory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "key", "Guid", "_", "=_", "\"", "big", "box", "-", "test", "-", "key", "-\"_", "+_", "str_", "(_", "uuid_", "._", "uuid4_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "setup", "Text_", "=_", "text_", "._", "replace_", "(_", "'\\u", "\\u", "byte", "count", "\\u\\u'_", ",_", "str_", "(_", "byte", "count_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "setup", "Results_", ",_", "simulation_", "=_", "self_", "._", "compute", "Us", "ing", "Seve", "ral", "Worke", "rs_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "setup", "Text_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "workers_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "memory", "Limit", "Mb", "_", "=_", "memory", "Limit", "Mb", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "thread", "Count_", "=_", "thread", "Count_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "Simulation_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "io", "Task", "Thread", "Override", "_", "=_", "8_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "In", "Memo", "ry", "Cache_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "timeout_", "=_", "30_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "object", "Store_", "=_", "self_", "._", "create", "Object", "Store_", "(_", "s3_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "page", "Size", "Override", "_", "=_", "page", "Size", "Override", "_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "simulation_", "._", "execute", "Exter", "nal", "Io", "Task_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Cum", "ulus", "Nat", "ive_", "._", "Exter", "nal", "Io", "Task_", "._", "Write", "Char", "Big", "vec", "To", "S3_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "setup", "Results_", "._", "as", "Result_", "._", "result_", "._", "get", "Vector", "Big", "vec", "Guid", "_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Cum", "ulus", "Nat", "ive_", "._", "S", "3", "Key", "And", "Credentials_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "get", "Test", "Data", "Bucket_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "key", "Guid", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "timeout_", "=_", "60_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "result_", "._", "is", "Success_", "(_", ")_", ",_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "s3_", "(_", ")_", "._", "get", "Key", "Size_", "(_", "self_", "._", "get", "Test", "Data", "Bucket_", "(_", ")_", ",_", "key", "Guid", "_", ")_", "==_", "byte", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s3_", "(_", ")_", "._", "delete", "Key_", "(_", "self_", "._", "get", "Test", "Data", "Bucket_", "(_", ")_", ",_", "key", "Guid", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "warn_", "(_", "\"", "Fail", "ed", " ", "to", " ", "clean", "up", " ", "the", " ", "test", " ", "key", ":", " ", "%", "s", "\"_", ",_", "traceback_", "._", "format\\u", "exc_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
viewfinderco/viewfinder/backend/db/test/user_test.py
[ { "content": "# Copyright 2011 Viewfinder Inc. All Rights Reserved.\n\n\"\"\"Tests for User data object.\n\"\"\"\n\n__author__ = '[email protected] (Spencer Kimball)'\n\nimport logging\nimport sys\nimport time\nimport unittest\n\nfrom functools import partial\nfrom tornado import stack_context\nfrom viewfinder.backend.base import util\nfrom viewfinder.backend.base.testing import async_test\nfrom viewfinder.backend.db.schema import Location\nfrom viewfinder.backend.db import device, viewpoint\nfrom viewfinder.backend.db.user import User\n\nfrom base_test import DBBaseTestCase\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class UserTestCase(DBBaseTestCase):\n\n\n\n\n\n\n\n", "metadata": "root.UserTestCase", "header": "['module', '___EOS___']", "index": 22 }, { "content": " def _CreateDefaultUser(self):\n return self._CreateUserAndDevice(user_dict={'user_id': 4,\n 'given_name': 'Spencer',\n 'family_name': 'Kimball',\n 'email': '[email protected]'},\n ident_dict={'key': 'Email:[email protected]',\n 'authority': 'Test'},\n device_dict=None)", "metadata": "root.UserTestCase._CreateDefaultUser", "header": "['class', 'UserTestCase', '(', 'DBBaseTestCase', ')', ':', '___EOS___']", "index": 23 }, { "content": " def testPartialCreate(self):\n \"\"\"Creates a user with just a given name.\"\"\"\n user_dict = {'user_id': 5, 'given_name': 'Spencer'}\n user, device = self._CreateUserAndDevice(user_dict=user_dict,\n ident_dict={'key': 'Email:[email protected]',\n 'authority': 'Test'},\n device_dict=None)\n user._version = None\n user.signing_key = None\n user_dict['labels'] = [User.REGISTERED]\n user_dict['email'] = '[email protected]'\n user_dict['private_vp_id'] = 'v-k-'\n user_dict['webapp_dev_id'] = 3\n user_dict['asset_id_seq'] = 1\n self.assertEqual(user._asdict(), user_dict)", "metadata": "root.UserTestCase.testPartialCreate", "header": "['class', 'UserTestCase', '(', 'DBBaseTestCase', ')', ':', '___EOS___']", "index": 32 }, { "content": " def testRegister(self):\n \"\"\"Creates a user via an OAUTH user dictionary.\"\"\"\n u, dev = self._CreateUserAndDevice(user_dict={'user_id': 4,\n 'given_name': 'Spencer',\n 'family_name': 'Kimball',\n 'locale': 'en:US'},\n ident_dict={'key': 'Local:0_0.1',\n 'authority': 'Test'},\n device_dict={'device_id': 20,\n 'version': 'alpha-1.0',\n 'os': 'iOS 5.0.1',\n 'platform': 'iPhone 4S',\n 'country': 'US',\n 'language': 'en'})\n\n self.assertEqual(u.given_name, 'Spencer')\n self.assertEqual(u.family_name, 'Kimball')\n self.assertEqual(u.locale, 'en:US')\n\n self.assertTrue(dev.device_id > 0)\n self.assertTrue(dev.version, 'alpha-1.0')\n self.assertTrue(dev.os, 'iOS 5.0.1')\n self.assertTrue(dev.platform, 'iPhone 4S')\n self.assertTrue(dev.country, 'US')\n self.assertTrue(dev.language, 'en')\n\n # Try another registration with the same identity, but some different data and a different device.\n u2, dev2 = self._CreateUserAndDevice(user_dict={'user_id': 4,\n 'given_name': 'Brian',\n 'email': '[email protected]'},\n ident_dict={'key': 'Local:0_0.1',\n 'authority': 'Test'},\n device_dict={'device_id': 21,\n 'version': 'alpha-1.0',\n 'os': 'Android 4.0.3',\n 'platform': 'Samsung Galaxy S'})\n\n # On a second registration, the user id shouldn't change, new information should be added, but\n # changed information should be ignored.\n self.assertEqual(u.user_id, u2.user_id)\n self.assertEqual(u2.given_name, 'Spencer')\n self.assertEqual(u2.email, '[email protected]')\n\n self.assertTrue(dev.device_id != dev2.device_id)\n self.assertEqual(dev2.version, 'alpha-1.0')\n self.assertEqual(dev2.os, 'Android 4.0.3')\n self.assertEqual(dev2.platform, 'Samsung Galaxy S')\n\n # Try a registration with a different identity, same user. Use the original device, but change\n # the app version number.\n u3, dev3 = self._CreateUserAndDevice(user_dict={'user_id': u2.user_id,\n 'link': 'http://www.goviewfinder.com'},\n ident_dict={'key': 'Local:0_0.2',\n 'authority': 'Test'},\n device_dict={'device_id': dev.device_id,\n 'version': 'alpha-1.2'})\n\n self.assertEqual(u.user_id, u3.user_id)\n self.assertEqual(u3.link, 'http://www.goviewfinder.com')\n self.assertEqual(dev3.device_id, dev.device_id)\n self.assertEqual(dev3.os, dev.os)\n self.assertEqual(dev3.version, 'alpha-1.2')\n\n # Try a registration with an already-used identity.\n try:\n self._CreateUserAndDevice(user_dict={'user_id': 1000},\n ident_dict={'key': 'Local:0_0.1',\n 'authority': 'Test'},\n device_dict={'device_id': dev3.device_id})\n assert False, 'third identity should have failed with already-in-use'\n except Exception as e:\n assert e.message.startswith('the identity is already in use'), e\n identities = self._RunAsync(u3.QueryIdentities, self._client)\n keys = [i.key for i in identities]\n self.assertTrue('Local:0_0.1' in keys)\n self.assertTrue('Local:0_0.2' in keys)", "metadata": "root.UserTestCase.testRegister", "header": "['class', 'UserTestCase', '(', 'DBBaseTestCase', ')', ':', '___EOS___']", "index": 48 }, { "content": " def testRegisterViaWebApp(self):\n \"\"\"Register from web application.\"\"\"\n u, dev = self._CreateUserAndDevice(user_dict={'user_id': 4,\n 'name': 'Spencer Kimball'},\n ident_dict={'key': 'Test:1',\n 'authority': 'Test'},\n device_dict=None)\n self.assertEqual(u.name, 'Spencer Kimball')\n self.assertTrue(u.webapp_dev_id > 0)\n self.assertIsNone(dev)", "metadata": "root.UserTestCase.testRegisterViaWebApp", "header": "['class', 'UserTestCase', '(', 'DBBaseTestCase', ')', ':', '___EOS___']", "index": 125 }, { "content": " def testAddDevice(self):\n \"\"\"Register with no mobile device, then add one.\"\"\"\n u, dev = self._CreateUserAndDevice(user_dict={'user_id': 4,\n 'name': 'Spencer Kimball'},\n ident_dict={'key': 'Local:1',\n 'authority': 'Test'},\n device_dict=None)\n\n u2, dev2 = self._CreateUserAndDevice(user_dict={'user_id': 4},\n ident_dict={'key': 'Local:1',\n 'authority': 'Test'},\n device_dict={'device_id': 30})\n\n self.assertEqual(u2.user_id, u.user_id)\n self.assertIsNone(dev)\n self.assertIsNotNone(dev2)", "metadata": "root.UserTestCase.testAddDevice", "header": "['class', 'UserTestCase', '(', 'DBBaseTestCase', ')', ':', '___EOS___']", "index": 136 }, { "content": " def testQueryUpdate(self):\n \"\"\"Update a user.\"\"\"\n u, d = self._CreateDefaultUser()\n\n # Now update the user.\n u2, d2 = self._CreateUserAndDevice(user_dict={'user_id': u.user_id,\n 'email': '[email protected]'},\n ident_dict={'key': 'Email:[email protected]',\n 'authority': 'Facebook'},\n device_dict=None)\n self.assertEqual(u.email, u2.email)", "metadata": "root.UserTestCase.testQueryUpdate", "header": "['class', 'UserTestCase', '(', 'DBBaseTestCase', ')', ':', '___EOS___']", "index": 153 }, { "content": " def testAllocateAssetIds(self):\n \"\"\"Verify the per-device allocation of user ids.\"\"\"\n self._RunAsync(User.AllocateAssetIds, self._client, self._user.user_id, 5)\n user = self._RunAsync(User.Query, self._client, self._user.user_id, None)\n self.assertEqual(user.asset_id_seq, 6)\n\n self._RunAsync(User.AllocateAssetIds, self._client, self._user.user_id, 100)\n user = self._RunAsync(User.Query, self._client, self._user.user_id, None)\n self.assertEqual(user.asset_id_seq, 106)", "metadata": "root.UserTestCase.testAllocateAssetIds", "header": "['class', 'UserTestCase', '(', 'DBBaseTestCase', ')', ':', '___EOS___']", "index": 165 }, { "content": " def testPartialQuery(self):\n \"\"\"Test query of partial row data.\"\"\"\n u, dev = self._CreateDefaultUser()\n u2 = self._RunAsync(User.Query, self._client, u.user_id, ['given_name', 'family_name'])\n self.assertEqual(u2.email, None)\n self.assertEqual(u2.given_name, u.given_name)\n self.assertEqual(u2.family_name, u.family_name)", "metadata": "root.UserTestCase.testPartialQuery", "header": "['class', 'UserTestCase', '(', 'DBBaseTestCase', ')', ':', '___EOS___']", "index": 175 }, { "content": " def testMissing(self):\n \"\"\"Test query of a non-existent user.\"\"\"\n try:\n self._RunAsync(User.Query, self._client, 1L << 63, None)\n assert False, 'user query should fail with missing key'\n except Exception as e:\n pass", "metadata": "root.UserTestCase.testMissing", "header": "['class', 'UserTestCase', '(', 'DBBaseTestCase', ')', ':', '___EOS___']", "index": 183 } ]
[ { "span": "import logging", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 14 }, { "span": "import sys", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 10 }, { "span": "import time", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 11 }, { "span": "import unittest", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 15 }, { "span": "from functools import partial", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 29 }, { "span": "from tornado import stack_context", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 33 }, { "span": "from viewfinder.backend.base import util", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 40 }, { "span": "from viewfinder.backend.base.testing import async_test", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 54 }, { "span": "from viewfinder.backend.db.schema import Location", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 49 }, { "span": "from viewfinder.backend.db import device, viewpoint", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 51 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2011", " ", "View", "finde", "r", " ", "Inc", ".", " ", "All", " ", "Rig", "hts", " ", "Reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Test", "s", " ", "for", " ", "User", " ", "data", " ", "object", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "author\\u\\u_", "=_", "'", "spe", "nce", "r", "@", "email", "scrub", "bed", ".", "com", " ", "(", "Spe", "nce", "r", " ", "Ki", "mba", "ll", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "functools_", "import_", "partial_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tornado_", "import_", "stack", "\\u", "context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "view", "finder_", "._", "backend_", "._", "base_", "import_", "util_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "view", "finder_", "._", "backend_", "._", "base_", "._", "testing_", "import_", "async", "\\u", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "view", "finder_", "._", "backend_", "._", "db_", "._", "schema_", "import_", "Location_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "view", "finder_", "._", "backend_", "._", "db_", "import_", "device_", ",_", "view", "point_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "view", "finder_", "._", "backend_", "._", "db_", "._", "user_", "import_", "User_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "base", "\\u", "test_", "import_", "DB", "Base", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "User", "Test", "Case_", "(_", "DB", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "User", "Test", "Case_", "(_", "DB", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u", "Creat", "e", "Default", "User_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "Creat", "e", "User", "And", "Device_", "(_", "user", "\\u", "dict_", "=_", "{_", "'", "user", "\\u", "id", "'_", ":_", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "give", "n", "\\u", "name", "'_", ":_", "'", "Spe", "nce", "r", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "famil", "y", "\\u", "name", "'_", ":_", "'", "Ki", "mba", "ll", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "'", "spe", "nce", "r", "@", "email", "scrub", "bed", ".", "com", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ident", "\\u", "dict_", "=_", "{_", "'", "key", "'_", ":_", "'", "Ema", "il", ":", "spe", "nce", "r", "@", "email", "scrub", "bed", ".", "com", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "authori", "ty", "'_", ":_", "'", "Test", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "device", "\\u", "dict_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Test", "Case_", "(_", "DB", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Parti", "al", "Create_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Creat", "es", " ", "a", " ", "user", " ", "with", " ", "just", " ", "a", " ", "give", "n", " ", "name", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "dict_", "=_", "{_", "'", "user", "\\u", "id", "'_", ":_", "5_", ",_", "'", "give", "n", "\\u", "name", "'_", ":_", "'", "Spe", "nce", "r", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", ",_", "device_", "=_", "self_", "._", "\\u", "Creat", "e", "User", "And", "Device_", "(_", "user", "\\u", "dict_", "=_", "user", "\\u", "dict_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ident", "\\u", "dict_", "=_", "{_", "'", "key", "'_", ":_", "'", "Ema", "il", ":", "spe", "nce", "r", ".", "kim", "bal", "l", "@", "foo", ".", "com", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "authori", "ty", "'_", ":_", "'", "Test", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "device", "\\u", "dict_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "._", "\\u", "version_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "._", "signin", "g", "\\u", "key_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "dict_", "[_", "'", "labels", "'_", "]_", "=_", "[_", "User_", "._", "REGISTER", "ED_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "dict_", "[_", "'", "email", "'_", "]_", "=_", "'", "spe", "nce", "r", ".", "kim", "bal", "l", "@", "foo", ".", "com", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "dict_", "[_", "'", "private", "\\u", "vp", "\\u", "id", "'_", "]_", "=_", "'", "v", "-", "k", "-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "dict_", "[_", "'", "weba", "pp", "\\u", "dev", "\\u", "id", "'_", "]_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "dict_", "[_", "'", "asset", "\\u", "id", "\\u", "seq", "'_", "]_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "user_", "._", "\\u", "asd", "ict_", "(_", ")_", ",_", "user", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Test", "Case_", "(_", "DB", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Register_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Creat", "es", " ", "a", " ", "user", " ", "via", " ", "an", " ", "OAUTH", " ", "user", " ", "dictionar", "y", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", ",_", "dev_", "=_", "self_", "._", "\\u", "Creat", "e", "User", "And", "Device_", "(_", "user", "\\u", "dict_", "=_", "{_", "'", "user", "\\u", "id", "'_", ":_", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "give", "n", "\\u", "name", "'_", ":_", "'", "Spe", "nce", "r", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "famil", "y", "\\u", "name", "'_", ":_", "'", "Ki", "mba", "ll", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "locale", "'_", ":_", "'", "en", ":", "US", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ident", "\\u", "dict_", "=_", "{_", "'", "key", "'_", ":_", "'", "Local", ":", "0", "\\u", "0.", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "authori", "ty", "'_", ":_", "'", "Test", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "device", "\\u", "dict_", "=_", "{_", "'", "device", "\\u", "id", "'_", ":_", "20_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "version", "'_", ":_", "'", "alpha", "-1", ".0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "os", "'_", ":_", "'", "i", "OS", " ", "5.0", ".1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "platform", "'_", ":_", "'", "i", "Phone", " ", "4", "S", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "countr", "y", "'_", ":_", "'", "US", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "language", "'_", ":_", "'", "en", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "u_", "._", "give", "n", "\\u", "name_", ",_", "'", "Spe", "nce", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "u_", "._", "famil", "y", "\\u", "name_", ",_", "'", "Ki", "mba", "ll", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "u_", "._", "locale_", ",_", "'", "en", ":", "US", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "dev_", "._", "device", "\\u", "id_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "dev_", "._", "version_", ",_", "'", "alpha", "-1", ".0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "dev_", "._", "os_", ",_", "'", "i", "OS", " ", "5.0", ".1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "dev_", "._", "platform_", ",_", "'", "i", "Phone", " ", "4", "S", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "dev_", "._", "country_", ",_", "'", "US", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "dev_", "._", "language_", ",_", "'", "en", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tr", "y", " ", "anot", "her", " ", "registration", " ", "with", " ", "the", " ", "same", " ", "identi", "ty", ",", " ", "but", " ", "some", " ", "different", " ", "data", " ", "and", " ", "a", " ", "different", " ", "device", "._", "\\u\\u\\uNL\\u\\u\\u_", "u2_", ",_", "dev", "2_", "=_", "self_", "._", "\\u", "Creat", "e", "User", "And", "Device_", "(_", "user", "\\u", "dict_", "=_", "{_", "'", "user", "\\u", "id", "'_", ":_", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "give", "n", "\\u", "name", "'_", ":_", "'", "Brian", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "'", "spe", "nce", "r", "@", "email", "scrub", "bed", ".", "com", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ident", "\\u", "dict_", "=_", "{_", "'", "key", "'_", ":_", "'", "Local", ":", "0", "\\u", "0.", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "authori", "ty", "'_", ":_", "'", "Test", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "device", "\\u", "dict_", "=_", "{_", "'", "device", "\\u", "id", "'_", ":_", "21_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "version", "'_", ":_", "'", "alpha", "-1", ".0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "os", "'_", ":_", "'", "And", "roid", " ", "4.0", ".3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "platform", "'_", ":_", "'", "Sam", "sun", "g", " ", "Gal", "ax", "y", " ", "S", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "On", " ", "a", " ", "second", " ", "registration", ",", " ", "the", " ", "user", " ", "id", " ", "shou", "ld", "n", "'", "t", " ", "change", ",", " ", "new", " ", "informati", "on", " ", "shou", "ld", " ", "be", " ", "adde", "d", ",", " ", "but", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "change", "d", " ", "informati", "on", " ", "shou", "ld", " ", "be", " ", "ignore", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "u_", "._", "user", "\\u", "id_", ",_", "u2_", "._", "user", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "u2_", "._", "give", "n", "\\u", "name_", ",_", "'", "Spe", "nce", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "u2_", "._", "email_", ",_", "'", "spe", "nce", "r", "@", "email", "scrub", "bed", ".", "com", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "dev_", "._", "device", "\\u", "id_", "!=_", "dev", "2_", "._", "device", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "dev", "2_", "._", "version_", ",_", "'", "alpha", "-1", ".0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "dev", "2_", "._", "os_", ",_", "'", "And", "roid", " ", "4.0", ".3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "dev", "2_", "._", "platform_", ",_", "'", "Sam", "sun", "g", " ", "Gal", "ax", "y", " ", "S", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tr", "y", " ", "a", " ", "registration", " ", "with", " ", "a", " ", "different", " ", "identi", "ty", ",", " ", "same", " ", "user", ".", " ", "Us", "e", " ", "the", " ", "original", " ", "device", ",", " ", "but", " ", "change_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "app", " ", "version", " ", "number", "._", "\\u\\u\\uNL\\u\\u\\u_", "u", "3_", ",_", "dev", "3_", "=_", "self_", "._", "\\u", "Creat", "e", "User", "And", "Device_", "(_", "user", "\\u", "dict_", "=_", "{_", "'", "user", "\\u", "id", "'_", ":_", "u2_", "._", "user", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "'_", ":_", "'", "http", "://", "www", ".", "gov", "iew", "finde", "r", ".", "com", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ident", "\\u", "dict_", "=_", "{_", "'", "key", "'_", ":_", "'", "Local", ":", "0", "\\u", "0.", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "authori", "ty", "'_", ":_", "'", "Test", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "device", "\\u", "dict_", "=_", "{_", "'", "device", "\\u", "id", "'_", ":_", "dev_", "._", "device", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "version", "'_", ":_", "'", "alpha", "-1", ".2", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "u_", "._", "user", "\\u", "id_", ",_", "u", "3_", "._", "user", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "u", "3_", "._", "link_", ",_", "'", "http", "://", "www", ".", "gov", "iew", "finde", "r", ".", "com", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "dev", "3_", "._", "device", "\\u", "id_", ",_", "dev_", "._", "device", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "dev", "3_", "._", "os_", ",_", "dev_", "._", "os_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "dev", "3_", "._", "version_", ",_", "'", "alpha", "-1", ".2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tr", "y", " ", "a", " ", "registration", " ", "with", " ", "an", " ", "alr", "ead", "y", "-", "used", " ", "identi", "ty", "._", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "Creat", "e", "User", "And", "Device_", "(_", "user", "\\u", "dict_", "=_", "{_", "'", "user", "\\u", "id", "'_", ":_", "1000_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ident", "\\u", "dict_", "=_", "{_", "'", "key", "'_", ":_", "'", "Local", ":", "0", "\\u", "0.", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "authori", "ty", "'_", ":_", "'", "Test", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "device", "\\u", "dict_", "=_", "{_", "'", "device", "\\u", "id", "'_", ":_", "dev", "3_", "._", "device", "\\u", "id_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "False_", ",_", "'", "third", " ", "identi", "ty", " ", "shou", "ld", " ", "have", " ", "fail", "ed", " ", "with", " ", "alr", "ead", "y", "-", "in", "-", "use", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "e_", "._", "message_", "._", "startswith_", "(_", "'", "the", " ", "identi", "ty", " ", "is", " ", "alr", "ead", "y", " ", "in", " ", "use", "'_", ")_", ",_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "identities", "_", "=_", "self_", "._", "\\u", "Run", "Async", "_", "(_", "u", "3_", "._", "Query", "Ident", "ities_", ",_", "self_", "._", "\\u", "client_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keys_", "=_", "[_", "i_", "._", "key_", "for_", "i_", "in_", "identities", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "Local", ":", "0", "\\u", "0.", "1", "'_", "in_", "keys_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "Local", ":", "0", "\\u", "0.", "2", "'_", "in_", "keys_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Test", "Case_", "(_", "DB", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Register", "Via", "Web", "App_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Register", " ", "from", " ", "web", " ", "applica", "tion", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", ",_", "dev_", "=_", "self_", "._", "\\u", "Creat", "e", "User", "And", "Device_", "(_", "user", "\\u", "dict_", "=_", "{_", "'", "user", "\\u", "id", "'_", ":_", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "Spe", "nce", "r", " ", "Ki", "mba", "ll", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ident", "\\u", "dict_", "=_", "{_", "'", "key", "'_", ":_", "'", "Test", ":", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "authori", "ty", "'_", ":_", "'", "Test", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "device", "\\u", "dict_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "u_", "._", "name_", ",_", "'", "Spe", "nce", "r", " ", "Ki", "mba", "ll", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "u_", "._", "weba", "pp", "\\u", "dev", "\\u", "id_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "None_", "(_", "dev_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Test", "Case_", "(_", "DB", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Add", "Device_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Register", " ", "with", " ", "no", " ", "mobile", " ", "device", ",", " ", "then", " ", "add", " ", "one", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", ",_", "dev_", "=_", "self_", "._", "\\u", "Creat", "e", "User", "And", "Device_", "(_", "user", "\\u", "dict_", "=_", "{_", "'", "user", "\\u", "id", "'_", ":_", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "Spe", "nce", "r", " ", "Ki", "mba", "ll", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ident", "\\u", "dict_", "=_", "{_", "'", "key", "'_", ":_", "'", "Local", ":", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "authori", "ty", "'_", ":_", "'", "Test", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "device", "\\u", "dict_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "u2_", ",_", "dev", "2_", "=_", "self_", "._", "\\u", "Creat", "e", "User", "And", "Device_", "(_", "user", "\\u", "dict_", "=_", "{_", "'", "user", "\\u", "id", "'_", ":_", "4_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ident", "\\u", "dict_", "=_", "{_", "'", "key", "'_", ":_", "'", "Local", ":", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "authori", "ty", "'_", ":_", "'", "Test", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "device", "\\u", "dict_", "=_", "{_", "'", "device", "\\u", "id", "'_", ":_", "30_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "u2_", "._", "user", "\\u", "id_", ",_", "u_", "._", "user", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "None_", "(_", "dev_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not", "None_", "(_", "dev", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Test", "Case_", "(_", "DB", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Query", "Update_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Update", " ", "a", " ", "user", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", ",_", "d_", "=_", "self_", "._", "\\u", "Creat", "e", "Default", "User_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "update", " ", "the", " ", "user", "._", "\\u\\u\\uNL\\u\\u\\u_", "u2_", ",_", "d2_", "=_", "self_", "._", "\\u", "Creat", "e", "User", "And", "Device_", "(_", "user", "\\u", "dict_", "=_", "{_", "'", "user", "\\u", "id", "'_", ":_", "u_", "._", "user", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "'", "spe", "nce", "r", ".", "kim", "bal", "l", "@", "email", "scrub", "bed", ".", "com", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ident", "\\u", "dict_", "=_", "{_", "'", "key", "'_", ":_", "'", "Ema", "il", ":", "spe", "nce", "r", "@", "email", "scrub", "bed", ".", "com", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "authori", "ty", "'_", ":_", "'", "Face", "book", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "device", "\\u", "dict_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "u_", "._", "email_", ",_", "u2_", "._", "email_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Test", "Case_", "(_", "DB", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Allocate", "Asset", "Ids_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Verify", " ", "the", " ", "per", "-", "device", " ", "allocat", "ion", " ", "of", " ", "user", " ", "ids", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "Run", "Async", "_", "(_", "User_", "._", "Allocate", "Asset", "Ids_", ",_", "self_", "._", "\\u", "client_", ",_", "self_", "._", "\\u", "user_", "._", "user", "\\u", "id_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "=_", "self_", "._", "\\u", "Run", "Async", "_", "(_", "User_", "._", "Query_", ",_", "self_", "._", "\\u", "client_", ",_", "self_", "._", "\\u", "user_", "._", "user", "\\u", "id_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "user_", "._", "asset", "\\u", "id", "\\u", "seq_", ",_", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "Run", "Async", "_", "(_", "User_", "._", "Allocate", "Asset", "Ids_", ",_", "self_", "._", "\\u", "client_", ",_", "self_", "._", "\\u", "user_", "._", "user", "\\u", "id_", ",_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "=_", "self_", "._", "\\u", "Run", "Async", "_", "(_", "User_", "._", "Query_", ",_", "self_", "._", "\\u", "client_", ",_", "self_", "._", "\\u", "user_", "._", "user", "\\u", "id_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "user_", "._", "asset", "\\u", "id", "\\u", "seq_", ",_", "106_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Test", "Case_", "(_", "DB", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Parti", "al", "Query_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "query", " ", "of", " ", "partial", " ", "row", " ", "data", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", ",_", "dev_", "=_", "self_", "._", "\\u", "Creat", "e", "Default", "User_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u2_", "=_", "self_", "._", "\\u", "Run", "Async", "_", "(_", "User_", "._", "Query_", ",_", "self_", "._", "\\u", "client_", ",_", "u_", "._", "user", "\\u", "id_", ",_", "[_", "'", "give", "n", "\\u", "name", "'_", ",_", "'", "famil", "y", "\\u", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "u2_", "._", "email_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "u2_", "._", "give", "n", "\\u", "name_", ",_", "u_", "._", "give", "n", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "u2_", "._", "famil", "y", "\\u", "name_", ",_", "u_", "._", "famil", "y", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Test", "Case_", "(_", "DB", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Missing", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "query", " ", "of", " ", "a", " ", "non", "-", "existen", "t", " ", "user", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "Run", "Async", "_", "(_", "User_", "._", "Query_", ",_", "self_", "._", "\\u", "client_", ",_", "1_", "L_", "<<_", "63_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "False_", ",_", "'", "user", " ", "query", " ", "shou", "ld", " ", "fail", " ", "with", " ", "missi", "ng", " ", "key", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
allisson/flask-example/accounts/tests/test_views.py
[ { "content": " def test_form(self):\n # test empty form\n with self.captured_templates(self.app) as templates:\n resp = self.client.post(self.url)\n self.assertStatus(resp, 200)\n template, context = templates[0]\n form = context['form']\n self.assertTrue(\n u'This field is required.' in form.errors['username']\n )\n self.assertTrue(\n u'This field is required.' in form.errors['password']\n )\n\n # test validate username\n with self.captured_templates(self.app) as templates:\n resp = self.client.post(\n self.url,\n data=dict(username='user2')\n )\n self.assertStatus(resp, 200)\n template, context = templates[0]\n form = context['form']\n self.assertTrue(\n u'Login not found.' in form.errors['username']\n )\n\n # test validate password\n with self.captured_templates(self.app) as templates:\n resp = self.client.post(\n self.url,\n data=dict(username='user1', password='1234567')\n )\n self.assertStatus(resp, 200)\n template, context = templates[0]\n form = context['form']\n self.assertTrue(\n u'Incorrect password.' in form.errors['password']\n )\n\n # test valid form\n with self.app.test_client() as c:\n self.assertFalse('user_id' in session)\n resp = c.post(\n self.url,\n data=dict(username='user1', password='123456')\n )\n self.assertRedirects(resp, self.redirect_to)\n self.assertTrue('user_id' in session)\n\n # test valid form redirect\n with self.captured_templates(self.app) as templates:\n resp = self.client.post(\n self.url,\n data=dict(username='user1', password='123456'),\n follow_redirects=True\n )\n self.assertStatus(resp, 200)\n template, context = templates[0]\n self.assertTrue(context['g'].user)\n self.assertTrue(\n 'Login successfully' in resp.data\n )\n\n # test valid form redirect with next parameter\n resp = self.client.post(\n self.url,\n data=dict(\n username='user1',\n password='123456',\n next=self.redirect_to_about\n )\n )\n self.assertRedirects(resp, self.redirect_to_about)", "metadata": "root.LoginViewTest.test_form", "header": "['class', 'LoginViewTest', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 28 }, { "content": " def test_render(self):\n # test logout\n with self.app.test_client() as c:\n self.login(username='user1', password='123456', client=c)\n self.assertTrue('user_id' in session)\n resp = c.get(self.url)\n self.assertRedirects(resp, self.redirect_to)\n self.assertFalse('user_id' in session)\n\n # test logout with next parameter\n with self.app.test_client() as c:\n self.login(username='user1', password='123456', client=c)\n self.assertTrue('user_id' in session)\n resp = c.get(self.url + '?next=' + self.redirect_to_about)\n self.assertRedirects(resp, self.redirect_to_about)\n self.assertFalse('user_id' in session)", "metadata": "root.LogoutViewTest.test_render", "header": "['class', 'LogoutViewTest', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 119 }, { "content": " def test_form(self):\n # test empty form\n with self.captured_templates(self.app) as templates:\n resp = self.client.post(self.url)\n self.assertStatus(resp, 200)\n template, context = templates[0]\n form = context['form']\n self.assertTrue(\n u'This field is required.' in form.errors['email']\n )\n\n # test validate email\n with self.captured_templates(self.app) as templates:\n resp = self.client.post(\n self.url,\n data=dict(email='[email protected]')\n )\n self.assertStatus(resp, 200)\n template, context = templates[0]\n form = context['form']\n self.assertTrue(\n u'E-mail in use.' in form.errors['email']\n )\n\n # test valid form\n with mail.record_messages() as outbox:\n self.assertEquals(len(outbox), 0)\n resp = self.client.post(\n self.url,\n data=dict(email='[email protected]')\n )\n self.assertRedirects(resp, self.redirect_to)\n self.assertEquals(len(outbox), 1)\n self.assertEquals(\n outbox[0].subject,\n u'Confirm your account - Flask Example.'\n )\n\n # test valid form after redirect\n resp = self.client.post(\n self.url,\n data=dict(email='[email protected]'),\n follow_redirects=True\n )\n self.assertStatus(resp, 200)\n self.assertTrue(\n 'Check your email to confirm registration.' in resp.data\n )", "metadata": "root.SignupViewTest.test_form", "header": "['class', 'SignupViewTest', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 155 }, { "content": " def test_render(self):\n # test render with invalid token\n resp = self.client.get(self.url3)\n self.assertRedirects(resp, self.redirect_invalid)\n resp = self.client.get(self.url3, follow_redirects=True)\n self.assertTrue('Invalid activation Link.' in resp.data)\n\n # test render with registered email\n resp = self.client.get(self.url2)\n self.assertRedirects(resp, self.redirect_invalid)\n resp = self.client.get(self.url2, follow_redirects=True)\n self.assertTrue('E-mail in use.' in resp.data)\n\n # test render with valid token\n resp = self.client.get(self.url)\n self.assertStatus(resp, 200)", "metadata": "root.SignupConfirmViewTest.test_render", "header": "['class', 'SignupConfirmViewTest', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 232 }, { "content": " def test_form(self):\n # test empty form\n with self.captured_templates(self.app) as templates:\n resp = self.client.post(self.url)\n self.assertStatus(resp, 200)\n template, context = templates[0]\n form = context['form']\n self.assertTrue(\n u'This field is required.' in form.errors['name']\n )\n self.assertTrue(\n u'This field is required.' in form.errors['username']\n )\n self.assertTrue(\n u'This field is required.' in form.errors['password']\n )\n self.assertTrue(\n u'This field is required.' in form.errors['password_confirm']\n )\n\n # test validate username\n with self.captured_templates(self.app) as templates:\n resp = self.client.post(\n self.url,\n data=dict(username='user1')\n )\n self.assertStatus(resp, 200)\n template, context = templates[0]\n form = context['form']\n self.assertTrue(\n u'Login in use.' in form.errors['username']\n )\n\n # test validate password_confirm\n with self.captured_templates(self.app) as templates:\n resp = self.client.post(\n self.url,\n data=dict(password='123456', password_confirm='1234567')\n )\n self.assertStatus(resp, 200)\n template, context = templates[0]\n form = context['form']\n self.assertTrue(\n u'Incorrect password.' in form.errors['password_confirm']\n )\n\n # test valid form\n resp = self.client.post(\n self.url,\n data=dict(\n name='Allisson Azevedo',\n username='allisson',\n password='123456',\n password_confirm='123456'\n )\n )\n self.assertRedirects(resp, self.redirect_to)\n user = User.objects.get(username='allisson')\n user.delete()\n\n # test valid form with next\n resp = self.client.post(\n self.url,\n data=dict(\n name='Allisson Azevedo',\n username='allisson',\n password='123456',\n password_confirm='123456',\n next=self.redirect_to_about\n )\n )\n self.assertRedirects(resp, self.redirect_to_about)\n user = User.objects.get(username='allisson')\n user.delete()\n\n # test valid form after redirect\n resp = self.client.post(\n self.url,\n data=dict(\n name='Allisson Azevedo',\n username='allisson',\n password='123456',\n password_confirm='123456'\n ),\n follow_redirects=True\n )\n self.assertStatus(resp, 200)\n self.assertTrue(\n 'Account registered successfully.' in resp.data\n )\n user = User.objects.get(username='allisson')", "metadata": "root.SignupConfirmViewTest.test_form", "header": "['class', 'SignupConfirmViewTest', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 249 }, { "content": " def test_form(self):\n # test empty form\n with self.captured_templates(self.app) as templates:\n resp = self.client.post(self.url)\n self.assertStatus(resp, 200)\n template, context = templates[0]\n form = context['form']\n self.assertTrue(\n u'This field is required.' in form.errors['email']\n )\n\n # test validate email\n with self.captured_templates(self.app) as templates:\n resp = self.client.post(\n self.url,\n data=dict(email='[email protected]')\n )\n self.assertStatus(resp, 200)\n template, context = templates[0]\n form = context['form']\n self.assertTrue(\n u'E-mail not found.' in form.errors['email']\n )\n\n # test valid form\n with mail.record_messages() as outbox:\n self.assertEquals(len(outbox), 0)\n resp = self.client.post(\n self.url,\n data=dict(email='[email protected]')\n )\n self.assertRedirects(resp, self.redirect_to)\n self.assertEquals(len(outbox), 1)\n self.assertEquals(\n outbox[0].subject,\n u'Recover your password - Flask Example.'\n )\n\n # test valid form after redirect\n resp = self.client.post(\n self.url,\n data=dict(email='[email protected]'),\n follow_redirects=True\n )\n self.assertStatus(resp, 200)\n self.assertTrue(\n 'Check it out at your email instructions for setting a new password.' in resp.data\n )", "metadata": "root.RecoverPasswordViewTest.test_form", "header": "['class', 'RecoverPasswordViewTest', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 360 }, { "content": " def test_render(self):\n # test render with invalid token\n resp = self.client.get(self.url3)\n self.assertRedirects(resp, self.redirect_invalid)\n resp = self.client.get(self.url3, follow_redirects=True)\n self.assertTrue('Invalid Link.' in resp.data)\n\n # test render with registered email\n resp = self.client.get(self.url2)\n self.assertRedirects(resp, self.redirect_invalid)\n resp = self.client.get(self.url2, follow_redirects=True)\n self.assertTrue('E-mail not found.' in resp.data)\n\n # test render with valid token\n resp = self.client.get(self.url)\n self.assertStatus(resp, 200)", "metadata": "root.RecoverPasswordConfirmViewTest.test_render", "header": "['class', 'RecoverPasswordConfirmViewTest', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 436 }, { "content": " def test_form(self):\n # test empty form\n with self.captured_templates(self.app) as templates:\n resp = self.client.post(self.url)\n self.assertStatus(resp, 200)\n template, context = templates[0]\n form = context['form']\n self.assertTrue(\n u'This field is required.' in form.errors['password']\n )\n self.assertTrue(\n u'This field is required.' in form.errors['password_confirm']\n )\n\n # test validate password_confirm\n with self.captured_templates(self.app) as templates:\n resp = self.client.post(\n self.url,\n data=dict(password='123456', password_confirm='1234567')\n )\n self.assertStatus(resp, 200)\n template, context = templates[0]\n form = context['form']\n self.assertTrue(\n u'Incorrect password.' in form.errors['password_confirm']\n )\n\n # test valid form\n resp = self.client.post(\n self.url,\n data=dict(\n password='1234567',\n password_confirm='1234567'\n )\n )\n self.assertRedirects(resp, self.redirect_to)\n self.user = User.objects.get(pk=self.user.pk)\n self.assertTrue(self.user.check_password('1234567'))\n\n # test valid form after redirect\n resp = self.client.post(\n self.url,\n data=dict(\n password='12345678',\n password_confirm='12345678'\n ),\n follow_redirects=True\n )\n self.assertStatus(resp, 200)\n self.assertTrue(\n 'Password set successfully.' in resp.data\n )\n self.user = User.objects.get(pk=self.user.pk)\n self.assertTrue(self.user.check_password('12345678'))", "metadata": "root.RecoverPasswordConfirmViewTest.test_form", "header": "['class', 'RecoverPasswordConfirmViewTest', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 453 } ]
[ { "span": "self.assertTrue(\n u'This field is required.' in form.errors['username']\n )", "start_line": 35, "start_column": 12, "end_line": 37, "end_column": 13 }, { "span": "self.assertTrue(\n u'This field is required.' in form.errors['password']\n )", "start_line": 38, "start_column": 12, "end_line": 40, "end_column": 13 }, { "span": "self.assertTrue(\n u'Login not found.' in form.errors['username']\n )", "start_line": 51, "start_column": 12, "end_line": 53, "end_column": 13 }, { "span": "self.assertTrue(\n u'Incorrect password.' in form.errors['password']\n )", "start_line": 64, "start_column": 12, "end_line": 66, "end_column": 13 }, { "span": "self.assertFalse('user_id' in session)", "start_line": 70, "start_column": 12, "end_line": 70, "end_column": 50 }, { "span": "self.assertTrue('user_id' in session)", "start_line": 76, "start_column": 12, "end_line": 76, "end_column": 49 }, { "span": "self.assertTrue(\n 'Login successfully' in resp.data\n )", "start_line": 88, "start_column": 12, "end_line": 90, "end_column": 13 }, { "span": "self.assertTrue('user_id' in session)", "start_line": 123, "start_column": 12, "end_line": 123, "end_column": 49 }, { "span": "self.assertFalse('user_id' in session)", "start_line": 126, "start_column": 12, "end_line": 126, "end_column": 50 }, { "span": "self.assertTrue('user_id' in session)", "start_line": 131, "start_column": 12, "end_line": 131, "end_column": 49 }, { "span": "self.assertFalse('user_id' in session)", "start_line": 134, "start_column": 12, "end_line": 134, "end_column": 50 }, { "span": "self.assertTrue(\n u'This field is required.' in form.errors['email']\n )", "start_line": 162, "start_column": 12, "end_line": 164, "end_column": 13 }, { "span": "self.assertTrue(\n u'E-mail in use.' in form.errors['email']\n )", "start_line": 175, "start_column": 12, "end_line": 177, "end_column": 13 }, { "span": "self.assertTrue(\n 'Check your email to confirm registration.' in resp.data\n )", "start_line": 200, "start_column": 8, "end_line": 202, "end_column": 9 }, { "span": "self.assertTrue('Invalid activation Link.' in resp.data)", "start_line": 237, "start_column": 8, "end_line": 237, "end_column": 64 }, { "span": "self.assertTrue('E-mail in use.' in resp.data)", "start_line": 243, "start_column": 8, "end_line": 243, "end_column": 54 }, { "span": "self.assertTrue(\n u'This field is required.' in form.errors['name']\n )", "start_line": 256, "start_column": 12, "end_line": 258, "end_column": 13 }, { "span": "self.assertTrue(\n u'This field is required.' in form.errors['username']\n )", "start_line": 259, "start_column": 12, "end_line": 261, "end_column": 13 }, { "span": "self.assertTrue(\n u'This field is required.' in form.errors['password']\n )", "start_line": 262, "start_column": 12, "end_line": 264, "end_column": 13 }, { "span": "self.assertTrue(\n u'This field is required.' in form.errors['password_confirm']\n )", "start_line": 265, "start_column": 12, "end_line": 267, "end_column": 13 }, { "span": "self.assertTrue(\n u'Login in use.' in form.errors['username']\n )", "start_line": 278, "start_column": 12, "end_line": 280, "end_column": 13 }, { "span": "self.assertTrue(\n u'Incorrect password.' in form.errors['password_confirm']\n )", "start_line": 291, "start_column": 12, "end_line": 293, "end_column": 13 }, { "span": "self.assertTrue(\n 'Account registered successfully.' in resp.data\n )", "start_line": 336, "start_column": 8, "end_line": 338, "end_column": 9 }, { "span": "self.assertTrue(\n u'This field is required.' in form.errors['email']\n )", "start_line": 367, "start_column": 12, "end_line": 369, "end_column": 13 }, { "span": "self.assertTrue(\n u'E-mail not found.' in form.errors['email']\n )", "start_line": 380, "start_column": 12, "end_line": 382, "end_column": 13 }, { "span": "self.assertTrue(\n 'Check it out at your email instructions for setting a new password.' in resp.data\n )", "start_line": 405, "start_column": 8, "end_line": 407, "end_column": 9 }, { "span": "self.assertTrue('Invalid Link.' in resp.data)", "start_line": 441, "start_column": 8, "end_line": 441, "end_column": 53 }, { "span": "self.assertTrue('E-mail not found.' in resp.data)", "start_line": 447, "start_column": 8, "end_line": 447, "end_column": 57 }, { "span": "self.assertTrue(\n u'This field is required.' in form.errors['password']\n )", "start_line": 460, "start_column": 12, "end_line": 462, "end_column": 13 }, { "span": "self.assertTrue(\n u'This field is required.' in form.errors['password_confirm']\n )", "start_line": 463, "start_column": 12, "end_line": 465, "end_column": 13 }, { "span": "self.assertTrue(\n u'Incorrect password.' in form.errors['password_confirm']\n )", "start_line": 476, "start_column": 12, "end_line": 478, "end_column": 13 }, { "span": "self.assertTrue(\n 'Password set successfully.' in resp.data\n )", "start_line": 502, "start_column": 8, "end_line": 504, "end_column": 9 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Logi", "n", "View", "Test_", "(_", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "form_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "test", " ", "empty", " ", "form_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "self_", "._", "captured", "\\u", "templates_", "(_", "self_", "._", "app_", ")_", "as_", "templates_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "self_", "._", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Status_", "(_", "resp_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", ",_", "context_", "=_", "templates_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "context_", "[_", "'", "form", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Thi", "s", " ", "field", " ", "is", " ", "require", "d", ".'_", "in_", "form_", "._", "errors_", "[_", "'", "user", "name", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Thi", "s", " ", "field", " ", "is", " ", "require", "d", ".'_", "in_", "form_", "._", "errors_", "[_", "'", "password", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "validat", "e", " ", "username_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "captured", "\\u", "templates_", "(_", "self_", "._", "app_", ")_", "as_", "templates_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "username_", "=_", "'", "user", "2", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Status_", "(_", "resp_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", ",_", "context_", "=_", "templates_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "context_", "[_", "'", "form", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Logi", "n", " ", "not", " ", "found", ".'_", "in_", "form_", "._", "errors_", "[_", "'", "user", "name", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "validat", "e", " ", "password_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "captured", "\\u", "templates_", "(_", "self_", "._", "app_", ")_", "as_", "templates_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "username_", "=_", "'", "user", "1", "'_", ",_", "password_", "=_", "'", "1234567", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Status_", "(_", "resp_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", ",_", "context_", "=_", "templates_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "context_", "[_", "'", "form", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Inco", "rrect", " ", "password", ".'_", "in_", "form_", "._", "errors_", "[_", "'", "password", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "valid", " ", "form_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "app_", "._", "test\\u", "client_", "(_", ")_", "as_", "c_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "False_", "(_", "'", "user", "\\u", "id", "'_", "in_", "session_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "c_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "username_", "=_", "'", "user", "1", "'_", ",_", "password_", "=_", "'", "12345", "6", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Redirects_", "(_", "resp_", ",_", "self_", "._", "redirec", "t", "\\u", "to_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "user", "\\u", "id", "'_", "in_", "session_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "valid", " ", "form", " ", "redirect_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "captured", "\\u", "templates_", "(_", "self_", "._", "app_", ")_", "as_", "templates_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "username_", "=_", "'", "user", "1", "'_", ",_", "password_", "=_", "'", "12345", "6", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "follow", "\\u", "redirects_", "=_", "True_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Status_", "(_", "resp_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", ",_", "context_", "=_", "templates_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "context_", "[_", "'", "g", "'_", "]_", "._", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Logi", "n", " ", "success", "full", "y", "'_", "in_", "resp_", "._", "data_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "valid", " ", "form", " ", "redirec", "t", " ", "with", " ", "next", " ", "parameter_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "username_", "=_", "'", "user", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "password_", "=_", "'", "12345", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "next_", "=_", "self_", "._", "redirec", "t", "\\u", "to", "\\u", "about_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Redirects_", "(_", "resp_", ",_", "self_", "._", "redirec", "t", "\\u", "to", "\\u", "about_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Logo", "ut", "View", "Test_", "(_", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "render_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "test", " ", "logout_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "self_", "._", "app_", "._", "test\\u", "client_", "(_", ")_", "as_", "c_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "login_", "(_", "username_", "=_", "'", "user", "1", "'_", ",_", "password_", "=_", "'", "12345", "6", "'_", ",_", "client_", "=_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "user", "\\u", "id", "'_", "in_", "session_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "c_", "._", "get_", "(_", "self_", "._", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Redirects_", "(_", "resp_", ",_", "self_", "._", "redirec", "t", "\\u", "to_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "user", "\\u", "id", "'_", "in_", "session_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "logo", "ut", " ", "with", " ", "next", " ", "parameter_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "app_", "._", "test\\u", "client_", "(_", ")_", "as_", "c_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "login_", "(_", "username_", "=_", "'", "user", "1", "'_", ",_", "password_", "=_", "'", "12345", "6", "'_", ",_", "client_", "=_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "user", "\\u", "id", "'_", "in_", "session_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "c_", "._", "get_", "(_", "self_", "._", "url_", "+_", "'?", "next", "='_", "+_", "self_", "._", "redirec", "t", "\\u", "to", "\\u", "about_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Redirects_", "(_", "resp_", ",_", "self_", "._", "redirec", "t", "\\u", "to", "\\u", "about_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "user", "\\u", "id", "'_", "in_", "session_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sign", "up", "View", "Test_", "(_", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "form_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "test", " ", "empty", " ", "form_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "self_", "._", "captured", "\\u", "templates_", "(_", "self_", "._", "app_", ")_", "as_", "templates_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "self_", "._", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Status_", "(_", "resp_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", ",_", "context_", "=_", "templates_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "context_", "[_", "'", "form", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Thi", "s", " ", "field", " ", "is", " ", "require", "d", ".'_", "in_", "form_", "._", "errors_", "[_", "'", "email", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "validat", "e", " ", "email_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "captured", "\\u", "templates_", "(_", "self_", "._", "app_", ")_", "as_", "templates_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "email_", "=_", "'", "user", "1", "@", "email", ".", "com", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Status_", "(_", "resp_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", ",_", "context_", "=_", "templates_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "context_", "[_", "'", "form", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "E-", "mail", " ", "in", " ", "use", ".'_", "in_", "form_", "._", "errors_", "[_", "'", "email", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "valid", " ", "form_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "mail_", "._", "record", "\\u", "messages_", "(_", ")_", "as_", "outbox_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "outbox_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "email_", "=_", "'", "user", "2", "@", "email", ".", "com", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Redirects_", "(_", "resp_", ",_", "self_", "._", "redirec", "t", "\\u", "to_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "outbox_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "outbox_", "[_", "0_", "]_", "._", "subject_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Confirm", " ", "your", " ", "account", " ", "-", " ", "Fla", "sk", " ", "Exam", "ple", ".'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "valid", " ", "form", " ", "after", " ", "redirect_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "email_", "=_", "'", "user", "1", "@", "email", ".", "com", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "follow", "\\u", "redirects_", "=_", "True_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Status_", "(_", "resp_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Check", " ", "your", " ", "email", " ", "to", " ", "confirm", " ", "registration", ".'_", "in_", "resp_", "._", "data_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sign", "up", "Confirm", "View", "Test_", "(_", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "render_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "test", " ", "render", " ", "with", " ", "invalid", " ", "token_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "self_", "._", "client_", "._", "get_", "(_", "self_", "._", "url", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Redirects_", "(_", "resp_", ",_", "self_", "._", "redirec", "t", "\\u", "invalid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "get_", "(_", "self_", "._", "url", "3_", ",_", "follow", "\\u", "redirects_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "Inva", "lid", " ", "activation", " ", "Link", ".'_", "in_", "resp_", "._", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "render", " ", "with", " ", "register", "ed", " ", "email_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "get_", "(_", "self_", "._", "url2", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Redirects_", "(_", "resp_", ",_", "self_", "._", "redirec", "t", "\\u", "invalid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "get_", "(_", "self_", "._", "url2", "_", ",_", "follow", "\\u", "redirects_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "E-", "mail", " ", "in", " ", "use", ".'_", "in_", "resp_", "._", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "render", " ", "with", " ", "valid", " ", "token_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "get_", "(_", "self_", "._", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Status_", "(_", "resp_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sign", "up", "Confirm", "View", "Test_", "(_", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "form_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "test", " ", "empty", " ", "form_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "self_", "._", "captured", "\\u", "templates_", "(_", "self_", "._", "app_", ")_", "as_", "templates_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "self_", "._", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Status_", "(_", "resp_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", ",_", "context_", "=_", "templates_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "context_", "[_", "'", "form", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Thi", "s", " ", "field", " ", "is", " ", "require", "d", ".'_", "in_", "form_", "._", "errors_", "[_", "'", "name", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Thi", "s", " ", "field", " ", "is", " ", "require", "d", ".'_", "in_", "form_", "._", "errors_", "[_", "'", "user", "name", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Thi", "s", " ", "field", " ", "is", " ", "require", "d", ".'_", "in_", "form_", "._", "errors_", "[_", "'", "password", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Thi", "s", " ", "field", " ", "is", " ", "require", "d", ".'_", "in_", "form_", "._", "errors_", "[_", "'", "password", "\\u", "confirm", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "validat", "e", " ", "username_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "captured", "\\u", "templates_", "(_", "self_", "._", "app_", ")_", "as_", "templates_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "username_", "=_", "'", "user", "1", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Status_", "(_", "resp_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", ",_", "context_", "=_", "templates_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "context_", "[_", "'", "form", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Logi", "n", " ", "in", " ", "use", ".'_", "in_", "form_", "._", "errors_", "[_", "'", "user", "name", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "validat", "e", " ", "password", "\\u", "confirm_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "captured", "\\u", "templates_", "(_", "self_", "._", "app_", ")_", "as_", "templates_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "password_", "=_", "'", "12345", "6", "'_", ",_", "password", "\\u", "confirm_", "=_", "'", "1234567", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Status_", "(_", "resp_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", ",_", "context_", "=_", "templates_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "context_", "[_", "'", "form", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Inco", "rrect", " ", "password", ".'_", "in_", "form_", "._", "errors_", "[_", "'", "password", "\\u", "confirm", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "valid", " ", "form_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "All", "iss", "on", " ", "Az", "eve", "do", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "username_", "=_", "'", "alli", "sso", "n", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "password_", "=_", "'", "12345", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "password", "\\u", "confirm_", "=_", "'", "12345", "6", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Redirects_", "(_", "resp_", ",_", "self_", "._", "redirec", "t", "\\u", "to_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "=_", "User_", "._", "objects_", "._", "get_", "(_", "username_", "=_", "'", "alli", "sso", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "valid", " ", "form", " ", "with", " ", "next_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "All", "iss", "on", " ", "Az", "eve", "do", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "username_", "=_", "'", "alli", "sso", "n", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "password_", "=_", "'", "12345", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "password", "\\u", "confirm_", "=_", "'", "12345", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "next_", "=_", "self_", "._", "redirec", "t", "\\u", "to", "\\u", "about_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Redirects_", "(_", "resp_", ",_", "self_", "._", "redirec", "t", "\\u", "to", "\\u", "about_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "=_", "User_", "._", "objects_", "._", "get_", "(_", "username_", "=_", "'", "alli", "sso", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "valid", " ", "form", " ", "after", " ", "redirect_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "All", "iss", "on", " ", "Az", "eve", "do", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "username_", "=_", "'", "alli", "sso", "n", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "password_", "=_", "'", "12345", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "password", "\\u", "confirm_", "=_", "'", "12345", "6", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "follow", "\\u", "redirects_", "=_", "True_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Status_", "(_", "resp_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Account", " ", "register", "ed", " ", "success", "full", "y", ".'_", "in_", "resp_", "._", "data_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "=_", "User_", "._", "objects_", "._", "get_", "(_", "username_", "=_", "'", "alli", "sso", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Recover", "Passw", "ord", "View", "Test_", "(_", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "form_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "test", " ", "empty", " ", "form_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "self_", "._", "captured", "\\u", "templates_", "(_", "self_", "._", "app_", ")_", "as_", "templates_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "self_", "._", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Status_", "(_", "resp_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", ",_", "context_", "=_", "templates_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "context_", "[_", "'", "form", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Thi", "s", " ", "field", " ", "is", " ", "require", "d", ".'_", "in_", "form_", "._", "errors_", "[_", "'", "email", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "validat", "e", " ", "email_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "captured", "\\u", "templates_", "(_", "self_", "._", "app_", ")_", "as_", "templates_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "email_", "=_", "'", "user", "2", "@", "email", ".", "com", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Status_", "(_", "resp_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", ",_", "context_", "=_", "templates_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "context_", "[_", "'", "form", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "E-", "mail", " ", "not", " ", "found", ".'_", "in_", "form_", "._", "errors_", "[_", "'", "email", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "valid", " ", "form_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "mail_", "._", "record", "\\u", "messages_", "(_", ")_", "as_", "outbox_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "outbox_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "email_", "=_", "'", "user", "1", "@", "email", ".", "com", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Redirects_", "(_", "resp_", ",_", "self_", "._", "redirec", "t", "\\u", "to_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "outbox_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "outbox_", "[_", "0_", "]_", "._", "subject_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Recover", " ", "your", " ", "password", " ", "-", " ", "Fla", "sk", " ", "Exam", "ple", ".'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "valid", " ", "form", " ", "after", " ", "redirect_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "email_", "=_", "'", "user", "1", "@", "email", ".", "com", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "follow", "\\u", "redirects_", "=_", "True_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Status_", "(_", "resp_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Check", " ", "it", " ", "out", " ", "at", " ", "your", " ", "email", " ", "instruct", "ion", "s", " ", "for", " ", "setti", "ng", " ", "a", " ", "new", " ", "password", ".'_", "in_", "resp_", "._", "data_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Recover", "Passw", "ord", "Confirm", "View", "Test_", "(_", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "render_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "test", " ", "render", " ", "with", " ", "invalid", " ", "token_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "self_", "._", "client_", "._", "get_", "(_", "self_", "._", "url", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Redirects_", "(_", "resp_", ",_", "self_", "._", "redirec", "t", "\\u", "invalid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "get_", "(_", "self_", "._", "url", "3_", ",_", "follow", "\\u", "redirects_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "Inva", "lid", " ", "Link", ".'_", "in_", "resp_", "._", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "render", " ", "with", " ", "register", "ed", " ", "email_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "get_", "(_", "self_", "._", "url2", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Redirects_", "(_", "resp_", ",_", "self_", "._", "redirec", "t", "\\u", "invalid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "get_", "(_", "self_", "._", "url2", "_", ",_", "follow", "\\u", "redirects_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "E-", "mail", " ", "not", " ", "found", ".'_", "in_", "resp_", "._", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "render", " ", "with", " ", "valid", " ", "token_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "get_", "(_", "self_", "._", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Status_", "(_", "resp_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Recover", "Passw", "ord", "Confirm", "View", "Test_", "(_", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "form_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "test", " ", "empty", " ", "form_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "self_", "._", "captured", "\\u", "templates_", "(_", "self_", "._", "app_", ")_", "as_", "templates_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "self_", "._", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Status_", "(_", "resp_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", ",_", "context_", "=_", "templates_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "context_", "[_", "'", "form", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Thi", "s", " ", "field", " ", "is", " ", "require", "d", ".'_", "in_", "form_", "._", "errors_", "[_", "'", "password", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Thi", "s", " ", "field", " ", "is", " ", "require", "d", ".'_", "in_", "form_", "._", "errors_", "[_", "'", "password", "\\u", "confirm", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "validat", "e", " ", "password", "\\u", "confirm_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "captured", "\\u", "templates_", "(_", "self_", "._", "app_", ")_", "as_", "templates_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "password_", "=_", "'", "12345", "6", "'_", ",_", "password", "\\u", "confirm_", "=_", "'", "1234567", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Status_", "(_", "resp_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", ",_", "context_", "=_", "templates_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "context_", "[_", "'", "form", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Inco", "rrect", " ", "password", ".'_", "in_", "form_", "._", "errors_", "[_", "'", "password", "\\u", "confirm", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "valid", " ", "form_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "password_", "=_", "'", "1234567", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "password", "\\u", "confirm_", "=_", "'", "1234567", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Redirects_", "(_", "resp_", ",_", "self_", "._", "redirec", "t", "\\u", "to_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "user_", "=_", "User_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "self_", "._", "user_", "._", "pk_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "user_", "._", "check", "\\u", "password_", "(_", "'", "1234567", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "valid", " ", "form", " ", "after", " ", "redirect_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "password_", "=_", "'", "12345678", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "password", "\\u", "confirm_", "=_", "'", "12345678", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "follow", "\\u", "redirects_", "=_", "True_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Status_", "(_", "resp_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Passw", "ord", " ", "set", " ", "success", "full", "y", ".'_", "in_", "resp_", "._", "data_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "user_", "=_", "User_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "self_", "._", "user_", "._", "pk_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "user_", "._", "check", "\\u", "password_", "(_", "'", "12345678", "'_", ")_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
jeffknupp/flask_sandboy/docs/conf.py
[ { "content": "# -*- coding: utf-8 -*-\n#\n# Flask-Sandboy documentation build configuration file, created by\n# sphinx-quickstart on Tue May 6 10:22:22 2014.\n#\n# This file is execfile()d with the current directory set to its\n# containing dir.\n#\n# Note that not all possible configuration values are present in this\n# autogenerated file.\n#\n# All configuration values have a default; values that are commented out\n# serve to show the default.\n\nimport sys\nimport os\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\n#sys.path.insert(0, os.path.abspath('.'))\n\n# -- General configuration ------------------------------------------------\n\n# If your documentation needs a minimal Sphinx version, state it here.\n#needs_sphinx = '1.0'\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = [\n 'sphinx.ext.autodoc',\n 'sphinx.ext.doctest',\n 'sphinx.ext.coverage',\n]\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# The suffix of source filenames.\nsource_suffix = '.rst'\n\n# The encoding of source files.\n#source_encoding = 'utf-8-sig'\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = u'Flask-Sandboy'\ncopyright = u'2014, Jeff Knupp'\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\n#\n# The short X.Y version.\nversion = '0.0.2.2'\n# The full version, including alpha/beta/rc tags.\nrelease = '0.0.2.2'\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#language = None\n\n# There are two options for replacing |today|: either, you set today to some\n# non-false value, then it is used:\n#today = ''\n# Else, today_fmt is used as the format for a strftime call.\n#today_fmt = '%B %d, %Y'\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\nexclude_patterns = ['_build']\n\n# The reST default role (used for this markup: `text`) to use for all\n# documents.\n#default_role = None\n\n# If true, '()' will be appended to :func: etc. cross-reference text.\n#add_function_parentheses = True\n\n# If true, the current module name will be prepended to all description\n# unit titles (such as .. function::).\n#add_module_names = True\n\n# If true, sectionauthor and moduleauthor directives will be shown in the\n# output. They are ignored by default.\n#show_authors = False\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'sphinx'\n\n# A list of ignored prefixes for module index sorting.\n#modindex_common_prefix = []\n\n# If true, keep warnings as \"system message\" paragraphs in the built documents.\n#keep_warnings = False\n\n\n# -- Options for HTML output ----------------------------------------------\n\n# The theme to use for HTML and HTML Help pages. See the documentation for\n# a list of builtin themes.\nhtml_theme = 'default'\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further. For a list of options available for each theme, see the\n# documentation.\n#html_theme_options = {}\n\n# Add any paths that contain custom themes here, relative to this directory.\n#html_theme_path = []\n\n# The name for this set of Sphinx documents. If None, it defaults to\n# \"<project> v<release> documentation\".\n#html_title = None\n\n# A shorter title for the navigation bar. Default is the same as html_title.\n#html_short_title = None\n\n# The name of an image file (relative to this directory) to place at the top\n# of the sidebar.\n#html_logo = None\n\n# The name of an image file (within the static path) to use as favicon of the\n# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32\n# pixels large.\n#html_favicon = None\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = ['_static']\n\n# Add any extra paths that contain custom files (such as robots.txt or\n# .htaccess) here, relative to this directory. These files are copied\n# directly to the root of the documentation.\n#html_extra_path = []\n\n# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,\n# using the given strftime format.\n#html_last_updated_fmt = '%b %d, %Y'\n\n# If true, SmartyPants will be used to convert quotes and dashes to\n# typographically correct entities.\n#html_use_smartypants = True\n\n# Custom sidebar templates, maps document names to template names.\n#html_sidebars = {}\n\n# Additional templates that should be rendered to pages, maps page names to\n# template names.\n#html_additional_pages = {}\n\n# If false, no module index is generated.\n#html_domain_indices = True\n\n# If false, no index is generated.\n#html_use_index = True\n\n# If true, the index is split into individual pages for each letter.\n#html_split_index = False\n\n# If true, links to the reST sources are added to the pages.\n#html_show_sourcelink = True\n\n# If true, \"Created using Sphinx\" is shown in the HTML footer. Default is True.\n#html_show_sphinx = True\n\n# If true, \"(C) Copyright ...\" is shown in the HTML footer. Default is True.\n#html_show_copyright = True\n\n# If true, an OpenSearch description file will be output, and all pages will\n# contain a <link> tag referring to it. The value of this option must be the\n# base URL from which the finished HTML is served.\n#html_use_opensearch = ''\n\n# This is the file name suffix for HTML files (e.g. \".xhtml\").\n#html_file_suffix = None\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'Flask-Sandboydoc'\n\n\n# -- Options for LaTeX output ---------------------------------------------\n\nlatex_elements = {\n# The paper size ('letterpaper' or 'a4paper').\n#'papersize': 'letterpaper',\n\n# The font size ('10pt', '11pt' or '12pt').\n#'pointsize': '10pt',\n\n# Additional stuff for the LaTeX preamble.\n#'preamble': '',\n}\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title,\n# author, documentclass [howto, manual, or own class]).\nlatex_documents = [\n ('index', 'Flask-Sandboy.tex', u'Flask-Sandboy Documentation',\n u'Jeff Knupp', 'manual'),\n]\n\n# The name of an image file (relative to this directory) to place at the top of\n# the title page.\n#latex_logo = None\n\n# For \"manual\" documents, if this is true, then toplevel headings are parts,\n# not chapters.\n#latex_use_parts = False\n\n# If true, show page references after internal links.\n#latex_show_pagerefs = False\n\n# If true, show URL addresses after external links.\n#latex_show_urls = False\n\n# Documents to append as an appendix to all manuals.\n#latex_appendices = []\n\n# If false, no module index is generated.\n#latex_domain_indices = True\n\n\n# -- Options for manual page output ---------------------------------------\n\n# One entry per manual page. List of tuples\n# (source start file, name, description, authors, manual section).\nman_pages = [\n ('index', 'flask-sandboy', u'Flask-Sandboy Documentation',\n [u'Jeff Knupp'], 1)\n]\n\n# If true, show URL addresses after external links.\n#man_show_urls = False\n\n\n# -- Options for Texinfo output -------------------------------------------\n\n# Grouping the document tree into Texinfo files. List of tuples\n# (source start file, target name, title, author,\n# dir menu entry, description, category)\ntexinfo_documents = [\n ('index', 'Flask-Sandboy', u'Flask-Sandboy Documentation',\n u'Jeff Knupp', 'Flask-Sandboy', 'One line description of project.',\n 'Miscellaneous'),\n]\n\n# Documents to append as an appendix to all manuals.\n#texinfo_appendices = []\n\n# If false, no module index is generated.\n#texinfo_domain_indices = True\n\n# How to display URL addresses: 'footnote', 'no', or 'inline'.\n#texinfo_show_urls = 'footnote'\n\n# If true, do not generate a @detailmenu in the \"Top\" node's menu.\n#texinfo_no_detailmenu = False\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import sys", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 10 }, { "span": "import os", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 9 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fla", "sk", "-", "Sand", "boy", " ", "documentation", " ", "build", " ", "configura", "tion", " ", "file", ",", " ", "created", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sphinx", "-", "quicks", "tart", " ", "on", " ", "Tu", "e", " ", "Ma", "y", " ", " ", "6", " ", "10", ":", "2", "2", ":", "2", "2", " ", "2014", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "file", " ", "is", " ", "execfile", "()", "d", " ", "with", " ", "the", " ", "current", " ", "director", "y", " ", "set", " ", "to", " ", "its_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contain", "ing", " ", "dir", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Not", "e", " ", "tha", "t", " ", "not", " ", "all", " ", "possib", "le", " ", "configura", "tion", " ", "values", " ", "are", " ", "presen", "t", " ", "in", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "autogen", "erate", "d", " ", "file", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "configura", "tion", " ", "values", " ", "have", " ", "a", " ", "default", ";", " ", "values", " ", "tha", "t", " ", "are", " ", "commente", "d", " ", "out_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "serve", " ", "to", " ", "show", " ", "the", " ", "default", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "extensi", "ons", " ", "(", "or", " ", "module", "s", " ", "to", " ", "document", " ", "with", " ", "autod", "oc", ")", " ", "are", " ", "in", " ", "anot", "her", " ", "director", "y", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "these", " ", "director", "ies", " ", "to", " ", "sys", ".", "path", " ", "here", ".", " ", "If", " ", "the", " ", "director", "y", " ", "is", " ", "relative", " ", "to", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "documentation", " ", "root", ",", " ", "use", " ", "os", ".", "path", ".", "abs", "path", " ", "to", " ", "make", " ", "it", " ", "abs", "olute", ",", " ", "like", " ", "shown", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "sys", ".", "path", ".", "insert", "(", "0", ",", " ", "os", ".", "path", ".", "abs", "path", "('.", "'))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "General", " ", "configura", "tion", " ", "--------------", "--------------", "--------------", "------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "your", " ", "documentation", " ", "need", "s", " ", "a", " ", "minima", "l", " ", "Sph", "inx", " ", "version", ",", " ", "state", " ", "it", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "need", "s", "\\u", "sphinx", " ", "=", " ", "'", "1.0", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "Sph", "inx", " ", "extensi", "on", " ", "module", " ", "names", " ", "here", ",", " ", "as", " ", "string", "s", ".", " ", "The", "y", " ", "can", " ", "be_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "extensi", "ons", " ", "comi", "ng", " ", "with", " ", "Sph", "inx", " ", "(", "named", " ", "'", "sphinx", ".", "ext", ".*", "')", " ", "or", " ", "your", " ", "custom_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ones", "._", "\\u\\u\\uNL\\u\\u\\u_", "extensions_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sphinx", ".", "ext", ".", "autod", "oc", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sphinx", ".", "ext", ".", "docte", "st", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sphinx", ".", "ext", ".", "covera", "ge", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "template", "s", " ", "here", ",", " ", "relative", " ", "to", " ", "this", " ", "director", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "template", "s", "\\u", "path_", "=_", "[_", "'\\u", "template", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "suff", "ix", " ", "of", " ", "source", " ", "filename", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "source", "\\u", "suffix_", "=_", "'.", "rst", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "encoding", " ", "of", " ", "source", " ", "files", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "source", "\\u", "encoding", " ", "=", " ", "'", "utf", "-", "8", "-", "sig", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "master", " ", "toc", "tree", " ", "document", "._", "\\u\\u\\uNL\\u\\u\\u_", "master", "\\u", "doc_", "=_", "'", "index", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "General", " ", "informati", "on", " ", "abo", "ut", " ", "the", " ", "project", "._", "\\u\\u\\uNL\\u\\u\\u_", "project_", "=_", "u", "'", "Fla", "sk", "-", "Sand", "boy", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "copyright_", "=_", "u", "'", "2014", ",", " ", "Je", "ff", " ", "Kn", "upp", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "version", " ", "info", " ", "for", " ", "the", " ", "project", " ", "you", "'", "re", " ", "document", "ing", ",", " ", "acts", " ", "as", " ", "replace", "ment", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "|", "version", "|", " ", "and", " ", "|", "release", "|", ",", " ", "als", "o", " ", "used", " ", "in", " ", "vari", "ous", " ", "other", " ", "place", "s", " ", "through", "out", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bui", "lt", " ", "document", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "short", " ", "X", ".", "Y", " ", "version", "._", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "'", "0.", "0.", "2.2", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "full", " ", "version", ",", " ", "inclu", "ding", " ", "alpha", "/", "beta", "/", "rc", " ", "tags", "._", "\\u\\u\\uNL\\u\\u\\u_", "release_", "=_", "'", "0.", "0.", "2.2", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "language", " ", "for", " ", "content", " ", "autogen", "erate", "d", " ", "by", " ", "Sph", "inx", ".", " ", "Refer", " ", "to", " ", "documentation", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "a", " ", "list", " ", "of", " ", "support", "ed", " ", "language", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "language", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "There", " ", "are", " ", "two", " ", "options", " ", "for", " ", "repla", "cing", " ", "|", "toda", "y", "|", ":", " ", "eit", "her", ",", " ", "you", " ", "set", " ", "toda", "y", " ", "to", " ", "some", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "non", "-", "fal", "se", " ", "value", ",", " ", "then", " ", "it", " ", "is", " ", "used", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "toda", "y", " ", "=", " ", "''_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Else", ",", " ", "toda", "y", "\\u", "fmt", " ", "is", " ", "used", " ", "as", " ", "the", " ", "format", " ", "for", " ", "a", " ", "strf", "time", " ", "call", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "toda", "y", "\\u", "fmt", " ", "=", " ", "'%", "B", " ", "%", "d", ",", " ", "%", "Y", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "List", " ", "of", " ", "pattern", "s", ",", " ", "relative", " ", "to", " ", "source", " ", "director", "y", ",", " ", "tha", "t", " ", "match", " ", "files", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "director", "ies", " ", "to", " ", "ignore", " ", "whe", "n", " ", "look", "ing", " ", "for", " ", "source", " ", "files", "._", "\\u\\u\\uNL\\u\\u\\u_", "exclu", "de", "\\u", "patterns_", "=_", "[_", "'\\u", "build", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "re", "ST", " ", "default", " ", "role", " ", "(", "used", " ", "for", " ", "this", " ", "markup", ":", " ", "`", "text", "`)", " ", "to", " ", "use", " ", "for", " ", "all_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "document", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "default", "\\u", "role", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "'(", ")'", " ", "will", " ", "be", " ", "append", "ed", " ", "to", " ", ":", "func", ":", " ", "etc", ".", " ", "cross", "-", "reference", " ", "text", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "\\u", "function", "\\u", "parenthes", "es", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "the", " ", "current", " ", "module", " ", "name", " ", "will", " ", "be", " ", "prepend", "ed", " ", "to", " ", "all", " ", "description_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "unit", " ", "titles", " ", "(", "suc", "h", " ", "as", " ", "..", " ", "function", "::", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "\\u", "module", "\\u", "names", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "section", "author", " ", "and", " ", "module", "author", " ", "directive", "s", " ", "will", " ", "be", " ", "shown", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "output", ".", " ", "The", "y", " ", "are", " ", "ignore", "d", " ", "by", " ", "default", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "show", "\\u", "author", "s", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "the", " ", "Pyg", "ment", "s", " ", "(", "synta", "x", " ", "highlight", "ing", ")", " ", "style", " ", "to", " ", "use", "._", "\\u\\u\\uNL\\u\\u\\u_", "pyg", "ment", "s", "\\u", "style_", "=_", "'", "sphinx", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "list", " ", "of", " ", "ignore", "d", " ", "prefix", "es", " ", "for", " ", "module", " ", "index", " ", "sorting", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "modi", "nde", "x", "\\u", "common", "\\u", "prefix", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "keep", " ", "warn", "ings", " ", "as", " ", "\"", "system", " ", "message", "\"", " ", "paragraph", "s", " ", "in", " ", "the", " ", "bui", "lt", " ", "document", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "keep", "\\u", "warn", "ings", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "HTM", "L", " ", "output", " ", "--------------", "--------------", "--------------", "----", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "them", "e", " ", "to", " ", "use", " ", "for", " ", "HTM", "L", " ", "and", " ", "HTM", "L", " ", "Help", " ", "page", "s", ".", " ", " ", "See", " ", "the", " ", "documentation", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "list", " ", "of", " ", "bui", "lti", "n", " ", "themes", "._", "\\u\\u\\uNL\\u\\u\\u_", "html", "\\u", "theme_", "=_", "'", "default", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Them", "e", " ", "options", " ", "are", " ", "them", "e-", "specific", " ", "and", " ", "customize", " ", "the", " ", "look", " ", "and", " ", "feel", " ", "of", " ", "a", " ", "theme_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fur", "ther", ".", " ", " ", "For", " ", "a", " ", "list", " ", "of", " ", "options", " ", "avail", "able", " ", "for", " ", "each", " ", "them", "e", ",", " ", "see", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "documentation", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "them", "e\\u", "options", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "custom", " ", "themes", " ", "here", ",", " ", "relative", " ", "to", " ", "this", " ", "director", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "them", "e\\u", "path", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "for", " ", "this", " ", "set", " ", "of", " ", "Sph", "inx", " ", "document", "s", ".", " ", " ", "If", " ", "Non", "e", ",", " ", "it", " ", "default", "s", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"<", "project", ">", " ", "v", "<", "release", ">", " ", "documentation", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "title", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "shorter", " ", "title", " ", "for", " ", "the", " ", "navigation", " ", "bar", ".", " ", " ", "Default", " ", "is", " ", "the", " ", "same", " ", "as", " ", "html", "\\u", "title", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "short", "\\u", "title", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "an", " ", "image", " ", "file", " ", "(", "relative", " ", "to", " ", "this", " ", "director", "y", ")", " ", "to", " ", "place", " ", "at", " ", "the", " ", "top_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "the", " ", "sidebar", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "logo", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "an", " ", "image", " ", "file", " ", "(", "within", " ", "the", " ", "static", " ", "path", ")", " ", "to", " ", "use", " ", "as", " ", "fav", "icon", " ", "of", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "docs", ".", " ", " ", "Thi", "s", " ", "file", " ", "shou", "ld", " ", "be", " ", "a", " ", "Window", "s", " ", "icon", " ", "file", " ", "(.", "ico", ")", " ", "bei", "ng", " ", "16", "x1", "6", " ", "or", " ", "32", "x3", "2_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pixel", "s", " ", "large", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "fav", "icon", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "custom", " ", "static", " ", "files", " ", "(", "suc", "h", " ", "as", " ", "style", " ", "sheet", "s", ")", " ", "here", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "relative", " ", "to", " ", "this", " ", "director", "y", ".", " ", "The", "y", " ", "are", " ", "copie", "d", " ", "after", " ", "the", " ", "bui", "lti", "n", " ", "static", " ", "files", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "a", " ", "file", " ", "named", " ", "\"", "default", ".", "css", "\"", " ", "will", " ", "overwrit", "e", " ", "the", " ", "bui", "lti", "n", " ", "\"", "default", ".", "css", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "html", "\\u", "static", "\\u", "path_", "=_", "[_", "'\\u", "static", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "extra", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "custom", " ", "files", " ", "(", "suc", "h", " ", "as", " ", "robots", ".", "txt", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", ".", "hta", "ccess", ")", " ", "here", ",", " ", "relative", " ", "to", " ", "this", " ", "director", "y", ".", " ", "The", "se", " ", "files", " ", "are", " ", "copied_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "direct", "ly", " ", "to", " ", "the", " ", "root", " ", "of", " ", "the", " ", "documentation", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "extra", "\\u", "path", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "not", " ", "''", ",", " ", "a", " ", "'", "Las", "t", " ", "update", "d", " ", "on", ":'", " ", "timestamp", " ", "is", " ", "inserted", " ", "at", " ", "every", " ", "page", " ", "bottom", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "usi", "ng", " ", "the", " ", "give", "n", " ", "strf", "time", " ", "format", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "last", "\\u", "update", "d\\u", "fmt", " ", "=", " ", "'%", "b", " ", "%", "d", ",", " ", "%", "Y", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "Sma", "rty", "Pant", "s", " ", "will", " ", "be", " ", "used", " ", "to", " ", "convert", " ", "quote", "s", " ", "and", " ", "dashes", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "typo", "graphical", "ly", " ", "correct", " ", "entit", "ies", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "use", "\\u", "smart", "ypa", "nts", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Custom", " ", "sidebar", " ", "template", "s", ",", " ", "maps", " ", "document", " ", "names", " ", "to", " ", "template", " ", "names", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "sidebar", "s", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Addition", "al", " ", "template", "s", " ", "tha", "t", " ", "shou", "ld", " ", "be", " ", "render", "ed", " ", "to", " ", "page", "s", ",", " ", "maps", " ", "page", " ", "names", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "template", " ", "names", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "addition", "al", "\\u", "page", "s", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "module", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "domain", "\\u", "indice", "s", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "use", "\\u", "index", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "the", " ", "index", " ", "is", " ", "split", " ", "int", "o", " ", "individual", " ", "page", "s", " ", "for", " ", "each", " ", "letter", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "split", "\\u", "index", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "link", "s", " ", "to", " ", "the", " ", "re", "ST", " ", "source", "s", " ", "are", " ", "adde", "d", " ", "to", " ", "the", " ", "page", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "show", "\\u", "source", "link", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "\"", "Creat", "ed", " ", "usi", "ng", " ", "Sph", "inx", "\"", " ", "is", " ", "shown", " ", "in", " ", "the", " ", "HTM", "L", " ", "footer", ".", " ", "Default", " ", "is", " ", "Tru", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "show", "\\u", "sphinx", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "\"(", "C", ")", " ", "Copy", "right", " ", "...\"", " ", "is", " ", "shown", " ", "in", " ", "the", " ", "HTM", "L", " ", "footer", ".", " ", "Default", " ", "is", " ", "Tru", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "show", "\\u", "copyr", "ight", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "an", " ", "Open", "Sear", "ch", " ", "description", " ", "file", " ", "will", " ", "be", " ", "output", ",", " ", "and", " ", "all", " ", "page", "s", " ", "will", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contain", " ", "a", " ", "<", "link", ">", " ", "tag", " ", "refer", "ring", " ", "to", " ", "it", ".", " ", " ", "The", " ", "value", " ", "of", " ", "this", " ", "option", " ", "must", " ", "be", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "base", " ", "URL", " ", "from", " ", "whi", "ch", " ", "the", " ", "finish", "ed", " ", "HTM", "L", " ", "is", " ", "serve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "use", "\\u", "opens", "ear", "ch", " ", "=", " ", "''_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "the", " ", "file", " ", "name", " ", "suff", "ix", " ", "for", " ", "HTM", "L", " ", "files", " ", "(", "e", ".", "g", ".", " ", "\".", "xh", "tml", "\")", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "file", "\\u", "suff", "ix", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Output", " ", "file", " ", "base", " ", "name", " ", "for", " ", "HTM", "L", " ", "help", " ", "builde", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "html", "help", "\\u", "basename_", "=_", "'", "Fla", "sk", "-", "Sand", "boy", "doc", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "La", "Te", "X", " ", "output", " ", "--------------", "--------------", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "late", "x", "\\u", "elements_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "pape", "r", " ", "size", " ", "('", "letter", "pape", "r", "'", " ", "or", " ", "'", "a4", "pape", "r", "')", "._", "\\u\\u\\uNL\\u\\u\\u_", "#'", "papers", "ize", "':", " ", "'", "letter", "pape", "r", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "font", " ", "size", " ", "('", "10", "pt", "',", " ", "'", "11", "pt", "'", " ", "or", " ", "'", "1", "2p", "t", "')", "._", "\\u\\u\\uNL\\u\\u\\u_", "#'", "points", "ize", "':", " ", "'", "10", "pt", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Addition", "al", " ", "stu", "ff", " ", "for", " ", "the", " ", "La", "Te", "X", " ", "preamble", "._", "\\u\\u\\uNL\\u\\u\\u_", "#'", "preamble", "':", " ", "''", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Group", "ing", " ", "the", " ", "document", " ", "tree", " ", "int", "o", " ", "La", "Te", "X", " ", "files", ".", " ", "List", " ", "of", " ", "tuples_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "source", " ", "start", " ", "file", ",", " ", "target", " ", "name", ",", " ", "title", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "author", ",", " ", "document", "class", " ", "[", "how", "to", ",", " ", "manu", "al", ",", " ", "or", " ", "own", " ", "class", "])", "._", "\\u\\u\\uNL\\u\\u\\u_", "late", "x", "\\u", "documents_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "index", "'_", ",_", "'", "Fla", "sk", "-", "Sand", "boy", ".", "tex", "'_", ",_", "u", "'", "Fla", "sk", "-", "Sand", "boy", " ", "Document", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Je", "ff", " ", "Kn", "upp", "'_", ",_", "'", "manu", "al", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "an", " ", "image", " ", "file", " ", "(", "relative", " ", "to", " ", "this", " ", "director", "y", ")", " ", "to", " ", "place", " ", "at", " ", "the", " ", "top", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "title", " ", "page", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "logo", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "\"", "manu", "al", "\"", " ", "document", "s", ",", " ", "if", " ", "this", " ", "is", " ", "true", ",", " ", "then", " ", "toplevel", " ", "heading", "s", " ", "are", " ", "part", "s", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "not", " ", "chapters", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "use", "\\u", "part", "s", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "show", " ", "page", " ", "reference", "s", " ", "after", " ", "internal", " ", "link", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "show", "\\u", "pager", "ef", "s", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "show", " ", "URL", " ", "addresse", "s", " ", "after", " ", "external", " ", "link", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "show", "\\u", "urls", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Document", "s", " ", "to", " ", "append", " ", "as", " ", "an", " ", "appendi", "x", " ", "to", " ", "all", " ", "manu", "als", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "appendi", "ces", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "module", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "domain", "\\u", "indice", "s", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "manu", "al", " ", "page", " ", "output", " ", "--------------", "--------------", "-----------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "One", " ", "entry", " ", "per", " ", "manu", "al", " ", "page", ".", " ", "List", " ", "of", " ", "tuples_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "source", " ", "start", " ", "file", ",", " ", "name", ",", " ", "description", ",", " ", "author", "s", ",", " ", "manu", "al", " ", "section", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "man", "\\u", "pages_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "index", "'_", ",_", "'", "fla", "sk", "-", "sand", "boy", "'_", ",_", "u", "'", "Fla", "sk", "-", "Sand", "boy", " ", "Document", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "u", "'", "Je", "ff", " ", "Kn", "upp", "'_", "]_", ",_", "1_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "show", " ", "URL", " ", "addresse", "s", " ", "after", " ", "external", " ", "link", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "man", "\\u", "show", "\\u", "urls", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "Tex", "info", " ", "output", " ", "--------------", "--------------", "--------------", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Group", "ing", " ", "the", " ", "document", " ", "tree", " ", "int", "o", " ", "Tex", "info", " ", "files", ".", " ", "List", " ", "of", " ", "tuples_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "source", " ", "start", " ", "file", ",", " ", "target", " ", "name", ",", " ", "title", ",", " ", "author", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "dir", " ", "menu", " ", "entry", ",", " ", "description", ",", " ", "category", ")_", "\\u\\u\\uNL\\u\\u\\u_", "tex", "info", "\\u", "documents_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "index", "'_", ",_", "'", "Fla", "sk", "-", "Sand", "boy", "'_", ",_", "u", "'", "Fla", "sk", "-", "Sand", "boy", " ", "Document", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Je", "ff", " ", "Kn", "upp", "'_", ",_", "'", "Fla", "sk", "-", "Sand", "boy", "'_", ",_", "'", "One", " ", "line", " ", "description", " ", "of", " ", "project", ".'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mis", "cell", "ane", "ous", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Document", "s", " ", "to", " ", "append", " ", "as", " ", "an", " ", "appendi", "x", " ", "to", " ", "all", " ", "manu", "als", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "tex", "info", "\\u", "appendi", "ces", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "module", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "tex", "info", "\\u", "domain", "\\u", "indice", "s", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ho", "w", " ", "to", " ", "display", " ", "URL", " ", "addresse", "s", ":", " ", "'", "footnote", "',", " ", "'", "no", "',", " ", "or", " ", "'", "inline", "'.", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "tex", "info", "\\u", "show", "\\u", "urls", " ", "=", " ", "'", "footnote", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "do", " ", "not", " ", "generat", "e", " ", "a", " ", "@", "deta", "il",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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
First argument to super() is not enclosing class
dimagi/commcare-hq/corehq/apps/reminders/views.py
[ { "content": " @method_decorator(requires_privilege_with_fallback(privileges.OUTBOUND_SMS))\n @method_decorator(reminders_framework_permission)\n @use_bootstrap3\n def dispatch(self, *args, **kwargs):\n return super(BaseMessagingSectionView, self).dispatch(*args, **kwargs)", "metadata": "root.ScheduledRemindersCalendarView.dispatch", "header": "['class', 'ScheduledRemindersCalendarView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 105 }, { "content": " @method_decorator(requires_privilege_with_fallback(privileges.OUTBOUND_SMS))\n @use_bootstrap3\n def dispatch(self, *args, **kwargs):\n return super(BaseMessagingSectionView, self).dispatch(*args, **kwargs)", "metadata": "root.AddStructuredKeywordView.dispatch", "header": "['class', 'AddStructuredKeywordView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 513 }, { "content": " @method_decorator(requires_privilege_with_fallback(privileges.OUTBOUND_SMS))\n @use_bootstrap3\n @use_jquery_ui\n @use_timepicker\n def dispatch(self, *args, **kwargs):\n return super(BaseMessagingSectionView, self).dispatch(*args, **kwargs)", "metadata": "root.CreateBroadcastView.dispatch", "header": "['class', 'CreateBroadcastView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 719 }, { "content": " @method_decorator(requires_privilege_with_fallback(privileges.OUTBOUND_SMS))\n @use_bootstrap3\n @use_datatables\n def dispatch(self, *args, **kwargs):\n return super(BaseMessagingSectionView, self).dispatch(*args, **kwargs)", "metadata": "root.RemindersListView.dispatch", "header": "['class', 'RemindersListView', '(', 'BaseMessagingSectionView', ')', ':', '___EOS___']", "index": 887 }, { "content": " @method_decorator(requires_privilege_with_fallback(privileges.OUTBOUND_SMS))\n @use_bootstrap3\n @use_datatables\n def dispatch(self, *args, **kwargs):\n return super(BaseMessagingSectionView, self).dispatch(*args, **kwargs)", "metadata": "root.BroadcastListView.dispatch", "header": "['class', 'BroadcastListView', '(', 'BaseMessagingSectionView', ',', 'DataTablesAJAXPaginationMixin', ')', ':', '___EOS___']", "index": 982 }, { "content": " @method_decorator(requires_privilege_with_fallback(privileges.OUTBOUND_SMS))\n @use_bootstrap3\n def dispatch(self, *args, **kwargs):\n return super(BaseMessagingSectionView, self).dispatch(*args, **kwargs)", "metadata": "root.KeywordsListView.dispatch", "header": "['class', 'KeywordsListView', '(', 'BaseMessagingSectionView', ',', 'CRUDPaginatedViewMixin', ')', ':', '___EOS___']", "index": 1081 } ]
[ { "span": "super(BaseMessagingSectionView, self).", "start_line": 109, "start_column": 15, "end_line": 109, "end_column": 52 }, { "span": "super(BaseMessagingSectionView, self).", "start_line": 516, "start_column": 15, "end_line": 516, "end_column": 52 }, { "span": "super(BaseMessagingSectionView, self).", "start_line": 724, "start_column": 15, "end_line": 724, "end_column": 52 }, { "span": "super(BaseMessagingSectionView, self).", "start_line": 891, "start_column": 15, "end_line": 891, "end_column": 52 }, { "span": "super(BaseMessagingSectionView, self).", "start_line": 986, "start_column": 15, "end_line": 986, "end_column": 52 }, { "span": "super(BaseMessagingSectionView, self).", "start_line": 1084, "start_column": 15, "end_line": 1084, "end_column": 52 } ]
[]
1
true
[ "[CLS]_", "First_", "argument_", "to_", "super_", "(_", ")_", "is_", "not_", "encl", "osin", "g_", "class_", "[SEP]_", "class_", "Schedule", "d", "Remi", "nder", "s", "Cal", "enda", "r", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "method", "\\u", "decorator_", "(_", "require", "s", "\\u", "privilege", "\\u", "with", "\\u", "fallback_", "(_", "privilege", "s_", "._", "OUT", "BOUND", "\\u", "SMS", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "method", "\\u", "decorator_", "(_", "reminder", "s", "\\u", "frame", "work", "\\u", "permission_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "use", "\\u", "boots", "trap", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "dispatch_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "super_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "self_", ")_", "._", "dispatch_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Add", "Structur", "ed", "Key", "word", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "method", "\\u", "decorator_", "(_", "require", "s", "\\u", "privilege", "\\u", "with", "\\u", "fallback_", "(_", "privilege", "s_", "._", "OUT", "BOUND", "\\u", "SMS", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "use", "\\u", "boots", "trap", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "dispatch_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "super_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "self_", ")_", "._", "dispatch_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Broad", "cast", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "method", "\\u", "decorator_", "(_", "require", "s", "\\u", "privilege", "\\u", "with", "\\u", "fallback_", "(_", "privilege", "s_", "._", "OUT", "BOUND", "\\u", "SMS", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "use", "\\u", "boots", "trap", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "use", "\\u", "jq", "uer", "y", "\\u", "ui_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "use", "\\u", "timep", "ick", "er_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "dispatch_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "super_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "self_", ")_", "._", "dispatch_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Remi", "nder", "s", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "method", "\\u", "decorator_", "(_", "require", "s", "\\u", "privilege", "\\u", "with", "\\u", "fallback_", "(_", "privilege", "s_", "._", "OUT", "BOUND", "\\u", "SMS", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "use", "\\u", "boots", "trap", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "use", "\\u", "datata", "bles_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "dispatch_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "super_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "self_", ")_", "._", "dispatch_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Broad", "cast", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "Data", "Table", "s", "AJ", "AX", "Pagination", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "method", "\\u", "decorator_", "(_", "require", "s", "\\u", "privilege", "\\u", "with", "\\u", "fallback_", "(_", "privilege", "s_", "._", "OUT", "BOUND", "\\u", "SMS", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "use", "\\u", "boots", "trap", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "use", "\\u", "datata", "bles_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "dispatch_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "super_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "self_", ")_", "._", "dispatch_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Key", "words", "List", "View_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "CRUD", "Pagina", "ted", "View", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "method", "\\u", "decorator_", "(_", "require", "s", "\\u", "privilege", "\\u", "with", "\\u", "fallback_", "(_", "privilege", "s_", "._", "OUT", "BOUND", "\\u", "SMS", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "use", "\\u", "boots", "trap", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "dispatch_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "super_", "(_", "Base", "Messag", "ing", "Sect", "ion", "View_", ",_", "self_", ")_", "._", "dispatch_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
timonwong/OmniMarkupPreviewer/OmniMarkupLib/Common.py
[ { "content": " def __call__(self):\n with self.__cond:\n try:\n self.__result = self.__func(*self.__args, **self.__kwargs)\n except:\n self.__result = None\n self.__except = sys.exc_info()\n self.__done = True\n self.__cond.notify()", "metadata": "root.Future.__call__", "header": "['class', 'Future', '(', 'object', ')', ':', '___EOS___']", "index": 336 } ]
[ { "span": "except:", "start_line": 340, "start_column": 12, "end_line": 340, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Future_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "call\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "self_", "._", "\\u\\u", "cond_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "result_", "=_", "self_", "._", "\\u\\u", "func_", "(_", "*_", "self_", "._", "\\u\\u", "args_", ",_", "**_", "self_", "._", "\\u\\u", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "result_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "except_", "=_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u\\u", "done_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "cond_", "._", "notify_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
jma127/pyltr/pyltr/models/__init__.py
[ { "content": "\"\"\"\n\nVarious model classes.\n\n\"\"\"\n\nfrom _models import *\nfrom lambdamart import LambdaMART\nimport monitors\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from lambdamart import LambdaMART", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 33 }, { "span": "import monitors", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 15 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "\\", "10", ";", "Vari", "ous", " ", "model", " ", "classe", "s", ".", "\\", "10", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u", "models_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lambda", "mart", "_", "import_", "Lam", "bda", "MAR", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "monitors_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1 ]
Unused import
biocore/pyqi/pyqi/core/interfaces/optparse/__init__.py
[ { "content": "#!/usr/bin/env python\n\n#-----------------------------------------------------------------------------\n# Copyright (c) 2013, The BiPy Development Team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file COPYING.txt, distributed with this software.\n#-----------------------------------------------------------------------------\n\n__credits__ = [\"Greg Caporaso\", \"Daniel McDonald\", \"Gavin Huttley\",\n \"Rob Knight\", \"Doug Wendel\", \"Jai Ram Rideout\",\n \"Jose Antonio Navas Molina\"]\n\nimport os\nfrom copy import copy\nfrom glob import glob\nfrom os.path import abspath, exists, isdir, isfile, split\nfrom optparse import (Option, OptionParser, OptionGroup, OptionValueError,\n OptionError)\nfrom pyqi.core.interface import (Interface, InterfaceInputOption, \n InterfaceOutputOption, InterfaceUsageExample)\nfrom pyqi.core.factory import general_factory\nfrom pyqi.core.exception import IncompetentDeveloperError\nfrom pyqi.core.command import Parameter\n\n\n\n\n\n\n\n# Definition of PyqiOption option type, a subclass of Option that contains\n# specific types for filepaths and directory paths.\n#\n# This code was derived from PyCogent (http://www.pycogent.org) and QIIME\n# (http://www.qiime.org), where it was initally developed.\n#\n# QIIME and PyCogent are GPL projects, but we obtained permission from the\n# authors of this code to port it to pyqi (and keep it under pyqi's BSD\n# license).\n#\n# TODO: this code needs to be refactored to better fit the pyqi framework.\n# Should probably get added to the OptparseInterface class.\n\n\n\n\n\n \n \n \n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class OptparseResult(InterfaceOutputOption):\n", "metadata": "root.OptparseResult", "header": "['module', '___EOS___']", "index": 26 }, { "content": " def __init__(self, **kwargs):\n super(OptparseResult, self).__init__(**kwargs)", "metadata": "root.OptparseResult.__init__", "header": "['class', 'OptparseResult', '(', 'InterfaceOutputOption', ')', ':', '___EOS___']", "index": 27 }, { "content": " def _validate_option(self):\n pass", "metadata": "root.OptparseResult._validate_option", "header": "['class', 'OptparseResult', '(', 'InterfaceOutputOption', ')', ':', '___EOS___']", "index": 30 }, { "content": "class OptparseOption(InterfaceInputOption):\n \"\"\"An augmented option that expands a ``CommandIn`` into an Option\"\"\"\n\n\n\n", "metadata": "root.OptparseOption", "header": "['module', '___EOS___']", "index": 33 }, { "content": " def __init__(self, **kwargs):\n super(OptparseOption, self).__init__(**kwargs)", "metadata": "root.OptparseOption.__init__", "header": "['class', 'OptparseOption', '(', 'InterfaceInputOption', ')', ':', '___EOS___']", "index": 36 }, { "content": " def _validate_option(self):\n # optparse takes care of validating InputType, InputAction, and\n # ShortName, so we don't need any checks here.\n pass", "metadata": "root.OptparseOption._validate_option", "header": "['class', 'OptparseOption', '(', 'InterfaceInputOption', ')', ':', '___EOS___']", "index": 39 }, { "content": " def __str__(self):\n if self.ShortName is None:\n return '--%s' % self.Name\n else:\n return '-%s/--%s' % (self.ShortName, self.Name)", "metadata": "root.OptparseOption.__str__", "header": "['class', 'OptparseOption', '(', 'InterfaceInputOption', ')', ':', '___EOS___']", "index": 44 }, { "content": " def getOptparseOption(self):\n if self.Required:\n # If the option doesn't already end with [REQUIRED], add it.\n help_text = self.Help\n\n if not help_text.strip().endswith('[REQUIRED]'):\n help_text += ' [REQUIRED]'\n\n if self.ShortName is None:\n option = PyqiOption('--' + self.Name, type=self.Type,\n action=self.Action, help=help_text)\n else:\n option = PyqiOption('-' + self.ShortName,\n '--' + self.Name, type=self.Type,\n action=self.Action, help=help_text)\n else:\n if self.DefaultDescription is None:\n help_text = '%s [default: %%default]' % self.Help\n else:\n help_text = '%s [default: %s]' % (self.Help,\n self.DefaultDescription)\n\n if self.ShortName is None:\n option = PyqiOption('--' + self.Name, type=self.Type,\n action=self.Action, help=help_text,\n default=self.Default)\n else:\n option = PyqiOption('-' + self.ShortName,\n '--' + self.Name, type=self.Type,\n action=self.Action, help=help_text,\n default=self.Default)\n return option", "metadata": "root.OptparseOption.getOptparseOption", "header": "['class', 'OptparseOption', '(', 'InterfaceInputOption', ')', ':', '___EOS___']", "index": 50 }, { "content": "class OptparseUsageExample(InterfaceUsageExample):\n \"\"\"Provide structure to a usage example\"\"\"", "metadata": "root.OptparseUsageExample", "header": "['module', '___EOS___']", "index": 83 }, { "content": " def _validate_usage_example(self):\n if self.ShortDesc is None:\n raise IncompetentDeveloperError(\"Must define ShortDesc\")\n if self.LongDesc is None:\n raise IncompetentDeveloperError(\"Must define LongDesc\")\n if self.Ex is None:\n raise IncompetentDeveloperError(\"Must define Ex\")", "metadata": "root.OptparseUsageExample._validate_usage_example", "header": "['class', 'OptparseUsageExample', '(', 'InterfaceUsageExample', ')', ':', '___EOS___']", "index": 85 }, { "content": "class OptparseInterface(Interface):\n \"\"\"A command line interface\"\"\"\n DisallowPositionalArguments = True\n HelpOnNoArguments = True \n OptionalInputLine = '[] indicates optional input (order unimportant)'\n RequiredInputLine = '{} indicates required input (order unimportant)'\n \n\n\n\n\n\n\n", "metadata": "root.OptparseInterface", "header": "['module', '___EOS___']", "index": 93 }, { "content": " def __init__(self, **kwargs):\n super(OptparseInterface, self).__init__(**kwargs)", "metadata": "root.OptparseInterface.__init__", "header": "['class', 'OptparseInterface', '(', 'Interface', ')', ':', '___EOS___']", "index": 100 }, { "content": " def _validate_usage_examples(self, usage_examples):\n super(OptparseInterface, self)._validate_usage_examples(usage_examples)\n\n if len(usage_examples) < 1:\n raise IncompetentDeveloperError(\"There are no usage examples \"\n \"associated with this command.\")", "metadata": "root.OptparseInterface._validate_usage_examples", "header": "['class', 'OptparseInterface', '(', 'Interface', ')', ':', '___EOS___']", "index": 103 }, { "content": " def _the_in_validator(self, in_):\n \"\"\"Validate input coming from the command line\"\"\"\n if not isinstance(in_, list):\n raise IncompetentDeveloperError(\"Unsupported input '%r'. Input \"\n \"must be a list.\" % in_)", "metadata": "root.OptparseInterface._the_in_validator", "header": "['class', 'OptparseInterface', '(', 'Interface', ')', ':', '___EOS___']", "index": 110 }, { "content": " def _the_out_validator(self, out_):\n \"\"\"Validate output coming from the command call\"\"\"\n if not isinstance(out_, dict):\n raise IncompetentDeveloperError(\"Unsupported result '%r'. Result \"\n \"must be a dict.\" % out_)", "metadata": "root.OptparseInterface._the_out_validator", "header": "['class', 'OptparseInterface', '(', 'Interface', ')', ':', '___EOS___']", "index": 116 }, { "content": " def _input_handler(self, in_, *args, **kwargs):\n \"\"\"Parses command-line input.\"\"\"\n required_opts = [opt for opt in self._get_inputs() if opt.Required]\n optional_opts = [opt for opt in self._get_inputs() if not opt.Required]\n\n # Build the usage and version strings\n usage = self._build_usage_lines(required_opts)\n version = 'Version: %prog ' + self._get_version()\n\n # Instantiate the command line parser object\n parser = OptionParser(usage=usage, version=version)\n\n # If the command has required options and no input arguments were\n # provided, print the help string.\n if len(required_opts) > 0 and self.HelpOnNoArguments and len(in_) == 0:\n parser.print_usage()\n return parser.exit(-1)\n\n if required_opts:\n # Define an option group so all required options are grouped\n # together and under a common header.\n required = OptionGroup(parser, \"REQUIRED options\",\n \"The following options must be provided \"\n \"under all circumstances.\")\n for ro in required_opts:\n required.add_option(ro.getOptparseOption())\n parser.add_option_group(required)\n\n # Add the optional options.\n for oo in optional_opts:\n parser.add_option(oo.getOptparseOption())\n\n #####\n # THIS IS THE NATURAL BREAKING POINT FOR THIS FUNCTIONALITY\n #####\n\n # Parse our input.\n opts, args = parser.parse_args(in_)\n\n # If positional arguments are not allowed, and any were provided, raise\n # an error.\n if self.DisallowPositionalArguments and len(args) != 0:\n parser.error(\"Positional argument detected: %s\\n\" % str(args[0]) +\n \" Be sure all parameters are identified by their option name.\\n\" +\n \" (e.g.: include the '-i' in '-i INPUT_DIR')\")\n\n # Test that all required options were provided.\n if required_opts:\n # dest may be different from the original option name because\n # optparse converts names from dashed to underscored.\n required_option_ids = [(o.dest, o.get_opt_string())\n for o in required.option_list]\n for required_dest, required_name in required_option_ids:\n if getattr(opts, required_dest) is None:\n parser.error('Required option %s omitted.' % required_name)\n\n # Build up command input dictionary. This will be passed to\n # Command.__call__ as kwargs.\n self._optparse_input = opts.__dict__\n\n cmd_input_kwargs = {}\n for option in self._get_inputs():\n if option.Parameter is not None:\n param_name = option.getParameterName()\n optparse_clean_name = \\\n self._get_optparse_clean_name(option.Name)\n\n if option.Handler is None:\n value = self._optparse_input[optparse_clean_name]\n else:\n value = option.Handler(\n self._optparse_input[optparse_clean_name])\n\n cmd_input_kwargs[param_name] = value\n\n return cmd_input_kwargs", "metadata": "root.OptparseInterface._input_handler", "header": "['class', 'OptparseInterface', '(', 'Interface', ')', ':', '___EOS___']", "index": 122 }, { "content": " def _build_usage_lines(self, required_options):\n \"\"\" Build the usage string from components \"\"\"\n line1 = 'usage: %prog [options] ' + \\\n '{%s}' % ' '.join(['%s %s' % (str(rp),rp.Name.upper())\n for rp in required_options])\n\n formatted_usage_examples = []\n for usage_example in self._get_usage_examples():\n short_description = usage_example.ShortDesc.strip(':').strip()\n long_description = usage_example.LongDesc.strip(':').strip()\n example = usage_example.Ex.strip()\n\n if short_description:\n formatted_usage_examples.append('%s: %s\\n %s' % \n (short_description,\n long_description, example))\n else:\n formatted_usage_examples.append('%s\\n %s' %\n (long_description,example))\n\n formatted_usage_examples = '\\n\\n'.join(formatted_usage_examples)\n\n lines = (line1,\n '', # Blank line\n self.OptionalInputLine,\n self.RequiredInputLine,\n '', # Blank line\n self.CmdInstance.LongDescription,\n '', # Blank line\n 'Example usage: ',\n 'Print help message and exit',\n ' %prog -h\\n',\n formatted_usage_examples)\n\n return '\\n'.join(lines)", "metadata": "root.OptparseInterface._build_usage_lines", "header": "['class', 'OptparseInterface', '(', 'Interface', ')', ':', '___EOS___']", "index": 199 }, { "content": " def _output_handler(self, results):\n \"\"\"Deal with things in output if we know how\"\"\"\n handled_results = {}\n\n for output in self._get_outputs():\n rk = output.Name\n \n if output.InputName is None:\n handled_results[rk] = output.Handler(rk, results[rk])\n else:\n optparse_clean_name = \\\n self._get_optparse_clean_name(output.InputName)\n opt_value = self._optparse_input[optparse_clean_name]\n handled_results[rk] = output.Handler(rk, results[rk],\n opt_value)\n\n return handled_results", "metadata": "root.OptparseInterface._output_handler", "header": "['class', 'OptparseInterface', '(', 'Interface', ')', ':', '___EOS___']", "index": 235 }, { "content": " def _get_optparse_clean_name(self, name):\n # optparse converts dashes to underscores in long option names.\n return name.replace('-', '_')", "metadata": "root.OptparseInterface._get_optparse_clean_name", "header": "['class', 'OptparseInterface', '(', 'Interface', ')', ':', '___EOS___']", "index": 253 }, { "content": "def optparse_factory(command_constructor, usage_examples, inputs, outputs,\n version):\n \"\"\"Optparse command line interface factory\n \n command_constructor - a subclass of ``Command``\n usage_examples - usage examples for using ``command_constructor`` via a\n command line interface.\n inputs - config ``inputs`` or a list of ``OptparseOptions``\n outputs - config ``outputs`` or a list of ``OptparseResults`` \n version - config ``__version__`` (a version string)\n \"\"\"\n return general_factory(command_constructor, usage_examples, inputs,\n outputs, version, OptparseInterface)", "metadata": "root.optparse_factory", "header": "['module', '___EOS___']", "index": 257 }, { "content": "def optparse_main(interface_object, local_argv):\n \"\"\"Construct and execute an interface object\"\"\"\n optparse_cmd = interface_object()\n result = optparse_cmd(local_argv[1:])\n return 0", "metadata": "root.optparse_main", "header": "['module', '___EOS___']", "index": 271 }, { "content": "def check_existing_filepath(option, opt, value):\n if not exists(value):\n raise OptionValueError(\n \"option %s: file does not exist: %r\" % (opt, value))\n elif not isfile(value):\n raise OptionValueError(\n \"option %s: not a regular file (can't be a directory!): %r\" % (opt, value))\n else:\n return value", "metadata": "root.check_existing_filepath", "header": "['module', '___EOS___']", "index": 290 }, { "content": "def check_existing_filepaths(option, opt, value):\n paths = []\n for v in value.split(','):\n fps = glob(v)\n if len(fps) == 0:\n raise OptionValueError(\n \"No filepaths match pattern/name '%s'. \"\n \"All patterns must be matched at least once.\" % v)\n else:\n paths.extend(fps)\n values = []\n for v in paths:\n check_existing_filepath(option,opt,v)\n values.append(v)\n return values", "metadata": "root.check_existing_filepaths", "header": "['module', '___EOS___']", "index": 300 }, { "content": "def check_existing_dirpath(option, opt, value):\n if not exists(value):\n raise OptionValueError(\n \"option %s: directory does not exist: %r\" % (opt, value))\n elif not isdir(value):\n raise OptionValueError(\n \"option %s: not a directory (can't be a file!): %r\" % (opt, value))\n else:\n return value", "metadata": "root.check_existing_dirpath", "header": "['module', '___EOS___']", "index": 316 }, { "content": "def check_existing_dirpaths(option, opt, value):\n paths = []\n for v in value.split(','):\n dps = glob(v)\n if len(dps) == 0:\n raise OptionValueError(\n \"No dirpaths match pattern/name '%s'.\"\n \"All patterns must be matched at least once.\" % v)\n else:\n paths.extend(dps)\n values = []\n for v in paths:\n check_existing_dirpath(option, opt, v)\n values.append(v)\n return values", "metadata": "root.check_existing_dirpaths", "header": "['module', '___EOS___']", "index": 326 }, { "content": "def check_new_filepath(option, opt, value):\n if exists(value):\n if isdir(value):\n raise OptionValueError(\n \"option %s: output file exists and it is a directory: %r\" %(opt,\n value))\n return value", "metadata": "root.check_new_filepath", "header": "['module', '___EOS___']", "index": 342 }, { "content": "def check_new_dirpath(option, opt, value):\n if exists(value):\n if isfile(value):\n raise OptionValueError(\n \"option %s: output directory exists and it is a file: %r\" %(opt,\n value))\n return value", "metadata": "root.check_new_dirpath", "header": "['module', '___EOS___']", "index": 350 }, { "content": "def check_existing_path(option, opt, value):\n if not exists(value):\n raise OptionValueError(\n \"option %s: path does not exist: %r\" % (opt, value))\n return value", "metadata": "root.check_existing_path", "header": "['module', '___EOS___']", "index": 358 }, { "content": "def check_new_path(option, opt, value):\n return value", "metadata": "root.check_new_path", "header": "['module', '___EOS___']", "index": 364 }, { "content": "def check_multiple_choice(option, opt, value):\n values = value.split(option.split_char)\n for v in values:\n if v not in option.mchoices:\n choices = \",\".join(map(repr, option.mchoices))\n raise OptionValueError(\n \"option %s: invalid choice: %r (choose from %s)\"\n % (opt, v, choices))\n return values", "metadata": "root.check_multiple_choice", "header": "['module', '___EOS___']", "index": 367 }, { "content": "def check_blast_db(option, opt, value):\n db_dir, db_name = split(abspath(value))\n if not exists(db_dir):\n raise OptionValueError(\n \"option %s: path does not exists: %r\" % (opt, db_dir))\n elif not isdir(db_dir):\n raise OptionValueError(\n \"option %s: not a directory: %r\" % (opt, db_dir))\n return value", "metadata": "root.check_blast_db", "header": "['module', '___EOS___']", "index": 377 }, { "content": "class PyqiOption(Option):\n ATTRS = Option.ATTRS + ['mchoices','split_char']\n\n TYPES = Option.TYPES + (\"existing_path\",\n \"new_path\",\n \"existing_filepath\",\n \"existing_filepaths\",\n \"new_filepath\",\n \"existing_dirpath\",\n \"existing_dirpaths\",\n \"new_dirpath\",\n \"multiple_choice\",\n \"blast_db\")\n TYPE_CHECKER = copy(Option.TYPE_CHECKER)\n # for cases where the user specifies an existing file or directory\n # as input, but it can be either a dir or a file\n TYPE_CHECKER[\"existing_path\"] = check_existing_path\n # for cases where the user specifies a new file or directory\n # as output, but it can be either a dir or a file\n TYPE_CHECKER[\"new_path\"] = check_new_path\n # for cases where the user passes a single existing file\n TYPE_CHECKER[\"existing_filepath\"] = check_existing_filepath\n # for cases where the user passes one or more existing files\n # as a comma-separated list - paths are returned as a list\n TYPE_CHECKER[\"existing_filepaths\"] = check_existing_filepaths\n # for cases where the user is passing a new path to be \n # create (e.g., an output file)\n TYPE_CHECKER[\"new_filepath\"] = check_new_filepath\n # for cases where the user is passing an existing directory\n # (e.g., containing a set of input files)\n TYPE_CHECKER[\"existing_dirpath\"] = check_existing_dirpath\n # for cases where the user passes one or more existing directories\n # as a comma-separated list - paths are returned as a list\n TYPE_CHECKER[\"existing_dirpaths\"] = check_existing_dirpaths\n # for cases where the user is passing a new directory to be \n # create (e.g., an output dir which will contain many result files)\n TYPE_CHECKER[\"new_dirpath\"] = check_new_dirpath\n # for cases where the user is passing one or more values\n # as comma- or semicolon-separated list\n # choices are returned as a list\n TYPE_CHECKER[\"multiple_choice\"] = check_multiple_choice\n # for cases where the user is passing a blast database option\n # blast_db is returned as a string\n TYPE_CHECKER[\"blast_db\"] = check_blast_db\n\n\n CHECK_METHODS = Option.CHECK_METHODS + [_check_multiple_choice]", "metadata": "root.PyqiOption", "header": "['module', '___EOS___']", "index": 387 }, { "content": " def _check_multiple_choice(self):\n if self.type == \"multiple_choice\":\n if self.mchoices is None:\n raise OptionError(\n \"must supply a list of mchoices for type '%s'\" % self.type, self)\n elif type(self.mchoices) not in (tuple, list):\n raise OptionError(\n \"choices must be a list of strings ('%s' supplied)\"\n % str(type(self.mchoices)).split(\"'\")[1], self)\n if self.split_char is None:\n self.split_char = ','\n elif self.mchoices is not None:\n raise OptionError(\n \"must not supply mchoices for type %r\" % self.type, self)", "metadata": "root.PyqiOption._check_multiple_choice", "header": "['class', 'PyqiOption', '(', 'Option', ')', ':', '___EOS___']", "index": 432 } ]
[ { "span": "import os", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 9 }, { "span": "from pyqi.core.command import Parameter", "start_line": 24, "start_column": 0, "end_line": 24, "end_column": 39 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "------", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2013", ",", " ", "The", " ", "Bi", "Py", " ", "Dev", "elo", "pme", "nt", " ", "Tea", "m", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Distribut", "ed", " ", "under", " ", "the", " ", "term", "s", " ", "of", " ", "the", " ", "Modifie", "d", " ", "BS", "D", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "full", " ", "license", " ", "is", " ", "in", " ", "the", " ", "file", " ", "COPY", "ING", ".", "txt", ",", " ", "distributed", " ", "with", " ", "this", " ", "software", "._", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "credits\\u\\u_", "=_", "[_", "\"", "Gre", "g", " ", "Cap", "ora", "so", "\"_", ",_", "\"", "Dan", "iel", " ", "Mc", "Dona", "ld", "\"_", ",_", "\"", "Ga", "vin", " ", "Hu", "ttl", "ey", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Rob", " ", "Kn", "ight", "\"_", ",_", "\"", "Dou", "g", " ", "Wen", "del", "\"_", ",_", "\"", "Ja", "i", " ", "Ram", " ", "Rid", "eo", "ut", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Jos", "e", " ", "Ant", "oni", "o", " ", "Nav", "as", " ", "Mol", "ina", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "copy_", "import_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "glob_", "import_", "glob_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "os_", "._", "path_", "import_", "abspath_", ",_", "exists_", ",_", "isdir_", ",_", "isfile_", ",_", "split_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "optparse_", "import_", "(_", "Option_", ",_", "Optio", "n", "Parser_", ",_", "Optio", "n", "Group_", ",_", "Optio", "n", "Value", "Error_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Optio", "n", "Error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyq", "i_", "._", "core_", "._", "interface_", "import_", "(_", "Interface_", ",_", "Interface", "Inp", "ut", "Option_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Interface", "Output", "Option_", ",_", "Interface", "Us", "age", "Example_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyq", "i_", "._", "core_", "._", "factory_", "import_", "genera", "l\\u", "factory_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyq", "i_", "._", "core_", "._", "exception_", "import_", "Incomp", "ete", "nt", "Dev", "elope", "r", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyq", "i_", "._", "core_", "._", "command_", "import_", "Parameter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Definit", "ion", " ", "of", " ", "Py", "qi", "Optio", "n", " ", "option", " ", "type", ",", " ", "a", " ", "subclass", " ", "of", " ", "Optio", "n", " ", "tha", "t", " ", "contains_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "specific", " ", "types", " ", "for", " ", "filepath", "s", " ", "and", " ", "director", "y", " ", "path", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "code", " ", "was", " ", "derive", "d", " ", "from", " ", "Py", "Cog", "ent", " ", "(", "http", "://", "www", ".", "pyco", "gent", ".", "org", ")", " ", "and", " ", "QI", "IME", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "http", "://", "www", ".", "qi", "ime", ".", "org", "),", " ", "where", " ", "it", " ", "was", " ", "init", "ally", " ", "develop", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "QI", "IME", " ", "and", " ", "Py", "Cog", "ent", " ", "are", " ", "GP", "L", " ", "project", "s", ",", " ", "but", " ", "we", " ", "obtain", "ed", " ", "permissi", "on", " ", "from", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "author", "s", " ", "of", " ", "this", " ", "code", " ", "to", " ", "port", " ", "it", " ", "to", " ", "pyq", "i", " ", "(", "and", " ", "keep", " ", "it", " ", "under", " ", "pyq", "i", "'", "s", " ", "BS", "D_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "license", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "this", " ", "code", " ", "need", "s", " ", "to", " ", "be", " ", "refactor", "ed", " ", "to", " ", "bett", "er", " ", "fit", " ", "the", " ", "pyq", "i", " ", "frame", "work", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sho", "ul", "d", " ", "probab", "ly", " ", "get", " ", "adde", "d", " ", "to", " ", "the", " ", "Opt", "parse", "Interface", " ", "class", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Opt", "parse", "Result_", "(_", "Interface", "Output", "Option_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Opt", "parse", "Result_", "(_", "Interface", "Output", "Option_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Opt", "parse", "Result_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Opt", "parse", "Result_", "(_", "Interface", "Output", "Option_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "validat", "e\\u", "option_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Opt", "parse", "Option_", "(_", "Interface", "Inp", "ut", "Option_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "An", " ", "augmented", " ", "option", " ", "tha", "t", " ", "expand", "s", " ", "a", " ", "``", "Command", "In", "``", " ", "int", "o", " ", "an", " ", "Optio", "n", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Opt", "parse", "Option_", "(_", "Interface", "Inp", "ut", "Option_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Opt", "parse", "Option_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Opt", "parse", "Option_", "(_", "Interface", "Inp", "ut", "Option_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "validat", "e\\u", "option_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "optparse", " ", "take", "s", " ", "care", " ", "of", " ", "validat", "ing", " ", "Inp", "ut", "Type", ",", " ", "Inp", "ut", "Action", ",", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Short", "Name", ",", " ", "so", " ", "we", " ", "don", "'", "t", " ", "need", " ", "any", " ", "checks", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Opt", "parse", "Option_", "(_", "Interface", "Inp", "ut", "Option_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "Short", "Name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'--", "%", "s", "'_", "%_", "self_", "._", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'-", "%", "s", "/--", "%", "s", "'_", "%_", "(_", "self_", "._", "Short", "Name_", ",_", "self_", "._", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Opt", "parse", "Option_", "(_", "Interface", "Inp", "ut", "Option_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Opt", "parse", "Option_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "Required_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "option", " ", "doe", "sn", "'", "t", " ", "alr", "ead", "y", " ", "end", " ", "with", " ", "[", "REQUIRE", "D", "],", " ", "add", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "help", "\\u", "text_", "=_", "self_", "._", "Help_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "help", "\\u", "text_", "._", "strip_", "(_", ")_", "._", "endswith_", "(_", "'[", "REQUIRE", "D", "]'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "help", "\\u", "text_", "+=_", "'", " ", "[", "REQUIRE", "D", "]'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Short", "Name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "option_", "=_", "Py", "qi", "Option_", "(_", "'--'_", "+_", "self_", "._", "Name_", ",_", "type_", "=_", "self_", "._", "Type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "=_", "self_", "._", "Action_", ",_", "help_", "=_", "help", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "option_", "=_", "Py", "qi", "Option_", "(_", "'-'_", "+_", "self_", "._", "Short", "Name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'--'_", "+_", "self_", "._", "Name_", ",_", "type_", "=_", "self_", "._", "Type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "=_", "self_", "._", "Action_", ",_", "help_", "=_", "help", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "Default", "Description_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "help", "\\u", "text_", "=_", "'%", "s", " ", "[", "default", ":", " ", "%%", "default", "]'_", "%_", "self_", "._", "Help_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "help", "\\u", "text_", "=_", "'%", "s", " ", "[", "default", ":", " ", "%", "s", "]'_", "%_", "(_", "self_", "._", "Help_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "Default", "Description_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Short", "Name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "option_", "=_", "Py", "qi", "Option_", "(_", "'--'_", "+_", "self_", "._", "Name_", ",_", "type_", "=_", "self_", "._", "Type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "=_", "self_", "._", "Action_", ",_", "help_", "=_", "help", "\\u", "text_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "self_", "._", "Default_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "option_", "=_", "Py", "qi", "Option_", "(_", "'-'_", "+_", "self_", "._", "Short", "Name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'--'_", "+_", "self_", "._", "Name_", ",_", "type_", "=_", "self_", "._", "Type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "=_", "self_", "._", "Action_", ",_", "help_", "=_", "help", "\\u", "text_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "self_", "._", "Default_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "option_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Opt", "parse", "Us", "age", "Example_", "(_", "Interface", "Us", "age", "Example_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Prov", "ide", " ", "structure", " ", "to", " ", "a", " ", "usage", " ", "example", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Opt", "parse", "Us", "age", "Example_", "(_", "Interface", "Us", "age", "Example_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "validat", "e\\u", "usage", "\\u", "example_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "Short", "Desc_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Incomp", "ete", "nt", "Dev", "elope", "r", "Error_", "(_", "\"", "Mus", "t", " ", "defin", "e", " ", "Short", "Des", "c", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Long", "Desc_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Incomp", "ete", "nt", "Dev", "elope", "r", "Error_", "(_", "\"", "Mus", "t", " ", "defin", "e", " ", "Long", "Des", "c", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Ex_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Incomp", "ete", "nt", "Dev", "elope", "r", "Error_", "(_", "\"", "Mus", "t", " ", "defin", "e", " ", "Ex", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Opt", "parse", "Interface_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "command", " ", "line", " ", "interface", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Disa", "llow", "Position", "al", "Arguments_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Help", "On", "No", "Arguments_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Optio", "nal", "Inp", "ut", "Line_", "=_", "'[", "]", " ", "indicat", "es", " ", "option", "al", " ", "input", " ", "(", "order", " ", "unim", "porta", "nt", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Requ", "ired", "Inp", "ut", "Line_", "=_", "'{}", " ", "indicat", "es", " ", "require", "d", " ", "input", " ", "(", "order", " ", "unim", "porta", "nt", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Opt", "parse", "Interface_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Opt", "parse", "Interface_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Opt", "parse", "Interface_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "validat", "e\\u", "usage", "\\u", "examples_", "(_", "self_", ",_", "usage", "\\u", "examples_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Opt", "parse", "Interface_", ",_", "self_", ")_", "._", "\\u", "validat", "e\\u", "usage", "\\u", "examples_", "(_", "usage", "\\u", "examples_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "usage", "\\u", "examples_", ")_", "<_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Incomp", "ete", "nt", "Dev", "elope", "r", "Error_", "(_", "\"", "There", " ", "are", " ", "no", " ", "usage", " ", "example", "s", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "associate", "d", " ", "with", " ", "this", " ", "command", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Opt", "parse", "Interface_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "the", "\\u", "in", "\\u", "validator_", "(_", "self_", ",_", "in\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Validate", " ", "input", " ", "comi", "ng", " ", "from", " ", "the", " ", "command", " ", "line", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "in\\u_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Incomp", "ete", "nt", "Dev", "elope", "r", "Error_", "(_", "\"", "Unsu", "ppo", "rted", " ", "input", " ", "'%", "r", "'.", " ", "Inp", "ut", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "must", " ", "be", " ", "a", " ", "list", ".\"_", "%_", "in\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Opt", "parse", "Interface_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "the", "\\u", "out", "\\u", "validator_", "(_", "self_", ",_", "out", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Validate", " ", "output", " ", "comi", "ng", " ", "from", " ", "the", " ", "command", " ", "call", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "out", "\\u_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Incomp", "ete", "nt", "Dev", "elope", "r", "Error_", "(_", "\"", "Unsu", "ppo", "rted", " ", "result", " ", "'%", "r", "'.", " ", "Result", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "must", " ", "be", " ", "a", " ", "dict", ".\"_", "%_", "out", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Opt", "parse", "Interface_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "input", "\\u", "handler_", "(_", "self_", ",_", "in\\u_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Pars", "es", " ", "command", "-", "line", " ", "input", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "require", "d\\u", "opts_", "=_", "[_", "opt_", "for_", "opt_", "in_", "self_", "._", "\\u", "get", "\\u", "inputs_", "(_", ")_", "if_", "opt_", "._", "Required_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "option", "al", "\\u", "opts_", "=_", "[_", "opt_", "for_", "opt_", "in_", "self_", "._", "\\u", "get", "\\u", "inputs_", "(_", ")_", "if_", "not_", "opt_", "._", "Required_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Build", " ", "the", " ", "usage", " ", "and", " ", "version", " ", "strings_", "\\u\\u\\uNL\\u\\u\\u_", "usage_", "=_", "self_", "._", "\\u", "build", "\\u", "usage", "\\u", "lines_", "(_", "require", "d\\u", "opts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "version_", "=_", "'", "Version", ":", " ", "%", "prog", " ", "'_", "+_", "self_", "._", "\\u", "get", "\\u", "version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Instantiate", " ", "the", " ", "command", " ", "line", " ", "parser", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "=_", "Optio", "n", "Parser_", "(_", "usage_", "=_", "usage_", ",_", "version_", "=_", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "command", " ", "has", " ", "require", "d", " ", "options", " ", "and", " ", "no", " ", "input", " ", "argu", "ment", "s", " ", "wer", "e_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "provided", ",", " ", "print", " ", "the", " ", "help", " ", "string", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "require", "d\\u", "opts_", ")_", ">_", "0_", "and_", "self_", "._", "Help", "On", "No", "Arguments_", "and_", "len_", "(_", "in\\u_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "._", "print", "\\u", "usage_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "parser_", "._", "exit_", "(_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "require", "d\\u", "opts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Define", " ", "an", " ", "option", " ", "group", " ", "so", " ", "all", " ", "require", "d", " ", "options", " ", "are", " ", "grouped_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tog", "ether", " ", "and", " ", "under", " ", "a", " ", "common", " ", "header", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "required_", "=_", "Optio", "n", "Group_", "(_", "parser_", ",_", "\"", "REQUIRE", "D", " ", "options", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "The", " ", "follow", "ing", " ", "options", " ", "must", " ", "be", " ", "provided", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "under", " ", "all", " ", "circum", "stance", "s", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ro_", "in_", "require", "d\\u", "opts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "required_", "._", "add", "\\u", "option_", "(_", "ro_", "._", "get", "Opt", "parse", "Option_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "parser_", "._", "add", "\\u", "option", "\\u", "group_", "(_", "required_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "the", " ", "option", "al", " ", "options", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "oo_", "in_", "option", "al", "\\u", "opts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "._", "add", "\\u", "option_", "(_", "oo_", "._", "get", "Opt", "parse", "Option_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#####", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THIS", " ", "IS", " ", "THE", " ", "NAT", "URA", "L", " ", "BREAK", "ING", " ", "POINT", " ", "FOR", " ", "THIS", " ", "FUNC", "TIO", "NA", "LIT", "Y_", "\\u\\u\\uNL\\u\\u\\u_", "#####", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pars", "e", " ", "our", " ", "input", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "opts_", ",_", "args_", "=_", "parser_", "._", "parse", "\\u", "args_", "(_", "in\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "positional", " ", "argu", "ment", "s", " ", "are", " ", "not", " ", "allow", "ed", ",", " ", "and", " ", "any", " ", "wer", "e", " ", "provided", ",", " ", "raise_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "an", " ", "error", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "Disa", "llow", "Position", "al", "Arguments_", "and_", "len_", "(_", "args_", ")_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "._", "error_", "(_", "\"", "Position", "al", " ", "argu", "ment", " ", "detect", "ed", ":", " ", "%", "s", "\\\\", "n", "\"_", "%_", "str_", "(_", "args_", "[_", "0_", "]_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "Be", " ", "sure", " ", "all", " ", "parameter", "s", " ", "are", " ", "identifi", "ed", " ", "by", " ", "thei", "r", " ", "option", " ", "name", ".\\\\", "n", "\"_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "(", "e", ".", "g", ".:", " ", "include", " ", "the", " ", "'-", "i", "'", " ", "in", " ", "'-", "i", " ", "INPUT", "\\u", "DIR", "')\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "tha", "t", " ", "all", " ", "require", "d", " ", "options", " ", "wer", "e", " ", "provided", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "require", "d\\u", "opts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "dest", " ", "may", " ", "be", " ", "different", " ", "from", " ", "the", " ", "original", " ", "option", " ", "name", " ", "bec", "aus", "e_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "optparse", " ", "convert", "s", " ", "names", " ", "from", " ", "dashed", " ", "to", " ", "underscore", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "require", "d\\u", "option", "\\u", "ids_", "=_", "[_", "(_", "o_", "._", "dest_", ",_", "o_", "._", "get", "\\u", "opt", "\\u", "string_", "(_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "o_", "in_", "required_", "._", "option", "\\u", "list_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "require", "d\\u", "dest_", ",_", "require", "d\\u", "name_", "in_", "require", "d\\u", "option", "\\u", "ids_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "getattr_", "(_", "opts_", ",_", "require", "d\\u", "dest_", ")_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "parser_", "._", "error_", "(_", "'", "Requ", "ired", " ", "option", " ", "%", "s", " ", "omit", "ted", ".'_", "%_", "require", "d\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Build", " ", "up", " ", "command", " ", "input", " ", "dictionar", "y", ".", " ", "Thi", "s", " ", "will", " ", "be", " ", "pass", "ed", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Command", ".\\u", "\\u", "call", "\\u\\u", " ", "as", " ", "kwarg", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "optparse", "\\u", "input_", "=_", "opts_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cmd", "\\u", "input", "\\u", "kwargs_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "option_", "in_", "self_", "._", "\\u", "get", "\\u", "inputs_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "option_", "._", "Parameter_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "param", "\\u", "name_", "=_", "option_", "._", "get", "Parameter", "Name_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "optparse", "\\u", "clean", "\\u", "name_", "=_", "self_", "._", "\\u", "get", "\\u", "optparse", "\\u", "clean", "\\u", "name_", "(_", "option_", "._", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "option_", "._", "Handler_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "value_", "=_", "self_", "._", "\\u", "optparse", "\\u", "input_", "[_", "optparse", "\\u", "clean", "\\u", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "value_", "=_", "option_", "._", "Handler_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "optparse", "\\u", "input_", "[_", "optparse", "\\u", "clean", "\\u", "name_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cmd", "\\u", "input", "\\u", "kwargs_", "[_", "param", "\\u", "name_", "]_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "cmd", "\\u", "input", "\\u", "kwargs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Opt", "parse", "Interface_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "build", "\\u", "usage", "\\u", "lines_", "(_", "self_", ",_", "require", "d\\u", "options_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Build", " ", "the", " ", "usage", " ", "string", " ", "from", " ", "component", "s", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line1_", "=_", "'", "usage", ":", " ", "%", "prog", " ", "[", "options", "]", " ", "'_", "+_", "'{", "%", "s", "}'_", "%_", "'", " ", "'_", "._", "join_", "(_", "[_", "'%", "s", " ", "%", "s", "'_", "%_", "(_", "str_", "(_", "rp_", ")_", ",_", "rp_", "._", "Name_", "._", "upper_", "(_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "rp_", "in_", "require", "d\\u", "options_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "format", "ted", "\\u", "usage", "\\u", "examples_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "usage", "\\u", "example_", "in_", "self_", "._", "\\u", "get", "\\u", "usage", "\\u", "examples_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "short", "\\u", "description_", "=_", "usage", "\\u", "example_", "._", "Short", "Desc_", "._", "strip_", "(_", "':'_", ")_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "long", "\\u", "description_", "=_", "usage", "\\u", "example_", "._", "Long", "Desc_", "._", "strip_", "(_", "':'_", ")_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "example_", "=_", "usage", "\\u", "example_", "._", "Ex_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "short", "\\u", "description_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "format", "ted", "\\u", "usage", "\\u", "examples_", "._", "append_", "(_", "'%", "s", ":", " ", "%", "s", "\\\\", "n", " ", "%", "s", "'_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "short", "\\u", "description_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "long", "\\u", "description_", ",_", "example_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "format", "ted", "\\u", "usage", "\\u", "examples_", "._", "append_", "(_", "'%", "s", "\\\\", "n", " ", "%", "s", "'_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "long", "\\u", "description_", ",_", "example_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "format", "ted", "\\u", "usage", "\\u", "examples_", "=_", "'\\\\", "n", "\\\\", "n", "'_", "._", "join_", "(_", "format", "ted", "\\u", "usage", "\\u", "examples_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "lines_", "=_", "(_", "line1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "''_", ",_", "#", " ", "Blan", "k", " ", "line_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "Optio", "nal", "Inp", "ut", "Line_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "Requ", "ired", "Inp", "ut", "Line_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "''_", ",_", "#", " ", "Blan", "k", " ", "line_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "Cmd", "Instance_", "._", "Long", "Description_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "''_", ",_", "#", " ", "Blan", "k", " ", "line_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Exam", "ple", " ", "usage", ":", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Print", " ", "help", " ", "message", " ", "and", " ", "exit", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", " ", "%", "prog", " ", "-", "h", "\\\\", "n", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "format", "ted", "\\u", "usage", "\\u", "examples_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "'\\\\", "n", "'_", "._", "join_", "(_", "lines_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Opt", "parse", "Interface_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "output", "\\u", "handler_", "(_", "self_", ",_", "results_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Deal", " ", "with", " ", "thing", "s", " ", "in", " ", "output", " ", "if", " ", "we", " ", "know", " ", "how", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handle", "d\\u", "results_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "output_", "in_", "self_", "._", "\\u", "get", "\\u", "outputs_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rk_", "=_", "output_", "._", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "output_", "._", "Inp", "ut", "Name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "handle", "d\\u", "results_", "[_", "rk_", "]_", "=_", "output_", "._", "Handler_", "(_", "rk_", ",_", "results_", "[_", "rk_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "optparse", "\\u", "clean", "\\u", "name_", "=_", "self_", "._", "\\u", "get", "\\u", "optparse", "\\u", "clean", "\\u", "name_", "(_", "output_", "._", "Inp", "ut", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opt", "\\u", "value_", "=_", "self_", "._", "\\u", "optparse", "\\u", "input_", "[_", "optparse", "\\u", "clean", "\\u", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handle", "d\\u", "results_", "[_", "rk_", "]_", "=_", "output_", "._", "Handler_", "(_", "rk_", ",_", "results_", "[_", "rk_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "opt", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "handle", "d\\u", "results_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Opt", "parse", "Interface_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "optparse", "\\u", "clean", "\\u", "name_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "optparse", " ", "convert", "s", " ", "dashes", " ", "to", " ", "underscore", "s", " ", "in", " ", "long", " ", "option", " ", "names", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "name_", "._", "replace_", "(_", "'-'_", ",_", "'\\u'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "optparse", "\\u", "factory_", "(_", "command", "\\u", "constructor_", ",_", "usage", "\\u", "examples_", ",_", "inputs_", ",_", "outputs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Opt", "parse", " ", "command", " ", "line", " ", "interface", " ", "factor", "y", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "command", "\\u", "construct", "or", " ", "-", " ", "a", " ", "subclass", " ", "of", " ", "``", "Command", "``", "\\", "10", ";", " ", " ", " ", " ", "usage", "\\u", "example", "s", " ", "-", " ", "usage", " ", "example", "s", " ", "for", " ", "usi", "ng", " ", "``", "command", "\\u", "construct", "or", "``", " ", "via", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "command", " ", "line", " ", "interface", ".", "\\", "10", ";", " ", " ", " ", " ", "inputs", " ", " ", "-", " ", "config", " ", "``", "inputs", "``", " ", "or", " ", "a", " ", "list", " ", "of", " ", "``", "Opt", "parse", "Optio", "ns", "``", "\\", "10", ";", " ", " ", " ", " ", "output", "s", " ", "-", " ", "config", " ", "``", "output", "s", "``", " ", "or", " ", "a", " ", "list", " ", "of", " ", "``", "Opt", "parse", "Result", "s", "``", " ", "\\", "10", ";", " ", " ", " ", " ", "version", " ", "-", " ", "config", " ", "``", "\\u\\u", "version", "\\u\\u``", " ", "(", "a", " ", "version", " ", "string", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "genera", "l\\u", "factory_", "(_", "command", "\\u", "constructor_", ",_", "usage", "\\u", "examples_", ",_", "inputs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", ",_", "version_", ",_", "Opt", "parse", "Interface_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "optparse", "\\u", "main_", "(_", "interface", "\\u", "object_", ",_", "local", "\\u", "argv_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Construct", " ", "and", " ", "execute", " ", "an", " ", "interface", " ", "object", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "optparse", "\\u", "cmd_", "=_", "interface", "\\u", "object_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "optparse", "\\u", "cmd_", "(_", "local", "\\u", "argv_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check", "\\u", "exist", "ing", "\\u", "filepath_", "(_", "option_", ",_", "opt_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "exists_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Optio", "n", "Value", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "option", " ", "%", "s", ":", " ", "file", " ", "doe", "s", " ", "not", " ", "exist", ":", " ", "%", "r", "\"_", "%_", "(_", "opt_", ",_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "isfile_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Optio", "n", "Value", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "option", " ", "%", "s", ":", " ", "not", " ", "a", " ", "regular", " ", "file", " ", "(", "can", "'", "t", " ", "be", " ", "a", " ", "director", "y", "!)", ":", " ", "%", "r", "\"_", "%_", "(_", "opt_", ",_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check", "\\u", "exist", "ing", "\\u", "filepaths_", "(_", "option_", ",_", "opt_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "paths_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "v_", "in_", "value_", "._", "split_", "(_", "','_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fps_", "=_", "glob_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "fps_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Optio", "n", "Value", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "No", " ", "filepath", "s", " ", "match", " ", "pattern", "/", "name", " ", "'%", "s", "'.", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "All", " ", "pattern", "s", " ", "must", " ", "be", " ", "matche", "d", " ", "at", " ", "leas", "t", " ", "onc", "e", ".\"_", "%_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "paths_", "._", "extend_", "(_", "fps_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "values_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "v_", "in_", "paths_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "check", "\\u", "exist", "ing", "\\u", "filepath_", "(_", "option_", ",_", "opt_", ",_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "._", "append_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check", "\\u", "exist", "ing", "\\u", "dirpath_", "(_", "option_", ",_", "opt_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "exists_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Optio", "n", "Value", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "option", " ", "%", "s", ":", " ", "director", "y", " ", "doe", "s", " ", "not", " ", "exist", ":", " ", "%", "r", "\"_", "%_", "(_", "opt_", ",_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "isdir_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Optio", "n", "Value", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "option", " ", "%", "s", ":", " ", "not", " ", "a", " ", "director", "y", " ", "(", "can", "'", "t", " ", "be", " ", "a", " ", "file", "!)", ":", " ", "%", "r", "\"_", "%_", "(_", "opt_", ",_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check", "\\u", "exist", "ing", "\\u", "dir", "paths_", "(_", "option_", ",_", "opt_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "paths_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "v_", "in_", "value_", "._", "split_", "(_", "','_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dps", "_", "=_", "glob_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "dps", "_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Optio", "n", "Value", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "No", " ", "dir", "path", "s", " ", "match", " ", "pattern", "/", "name", " ", "'%", "s", "'.\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "All", " ", "pattern", "s", " ", "must", " ", "be", " ", "matche", "d", " ", "at", " ", "leas", "t", " ", "onc", "e", ".\"_", "%_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "paths_", "._", "extend_", "(_", "dps", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "values_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "v_", "in_", "paths_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "check", "\\u", "exist", "ing", "\\u", "dirpath_", "(_", "option_", ",_", "opt_", ",_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "._", "append_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check", "\\u", "new", "\\u", "filepath_", "(_", "option_", ",_", "opt_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "exists_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isdir_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Optio", "n", "Value", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "option", " ", "%", "s", ":", " ", "output", " ", "file", " ", "exist", "s", " ", "and", " ", "it", " ", "is", " ", "a", " ", "director", "y", ":", " ", "%", "r", "\"_", "%_", "(_", "opt_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check", "\\u", "new", "\\u", "dirpath_", "(_", "option_", ",_", "opt_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "exists_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isfile_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Optio", "n", "Value", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "option", " ", "%", "s", ":", " ", "output", " ", "director", "y", " ", "exist", "s", " ", "and", " ", "it", " ", "is", " ", "a", " ", "file", ":", " ", "%", "r", "\"_", "%_", "(_", "opt_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check", "\\u", "exist", "ing", "\\u", "path_", "(_", "option_", ",_", "opt_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "exists_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Optio", "n", "Value", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "option", " ", "%", "s", ":", " ", "path", " ", "doe", "s", " ", "not", " ", "exist", ":", " ", "%", "r", "\"_", "%_", "(_", "opt_", ",_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check", "\\u", "new", "\\u", "path_", "(_", "option_", ",_", "opt_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check", "\\u", "multiple", "\\u", "choice_", "(_", "option_", ",_", "opt_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values_", "=_", "value_", "._", "split_", "(_", "option_", "._", "split", "\\u", "char_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "v_", "in_", "values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "v_", "not_", "in_", "option_", "._", "mc", "hoi", "ces_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "choices_", "=_", "\",\"_", "._", "join_", "(_", "map_", "(_", "repr_", ",_", "option_", "._", "mc", "hoi", "ces_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Optio", "n", "Value", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "option", " ", "%", "s", ":", " ", "invalid", " ", "choice", ":", " ", "%", "r", " ", "(", "choose", " ", "from", " ", "%", "s", ")\"_", "\\u\\u\\uNL\\u\\u\\u_", "%_", "(_", "opt_", ",_", "v_", ",_", "choices_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check", "\\u", "blast", "\\u", "db_", "(_", "option_", ",_", "opt_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db", "\\u", "dir_", ",_", "db", "\\u", "name_", "=_", "split_", "(_", "abspath_", "(_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "exists_", "(_", "db", "\\u", "dir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Optio", "n", "Value", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "option", " ", "%", "s", ":", " ", "path", " ", "doe", "s", " ", "not", " ", "exist", "s", ":", " ", "%", "r", "\"_", "%_", "(_", "opt_", ",_", "db", "\\u", "dir_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "isdir_", "(_", "db", "\\u", "dir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Optio", "n", "Value", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "option", " ", "%", "s", ":", " ", "not", " ", "a", " ", "director", "y", ":", " ", "%", "r", "\"_", "%_", "(_", "opt_", ",_", "db", "\\u", "dir_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Py", "qi", "Option_", "(_", "Option_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ATTRS", "_", "=_", "Option_", "._", "ATTRS", "_", "+_", "[_", "'", "mc", "hoi", "ces", "'_", ",_", "'", "split", "\\u", "char", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "TYPES_", "=_", "Option_", "._", "TYPES_", "+_", "(_", "\"", "exist", "ing", "\\u", "path", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "new", "\\u", "path", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "exist", "ing", "\\u", "filepath", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "exist", "ing", "\\u", "filepath", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "new", "\\u", "filepath", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "exist", "ing", "\\u", "dir", "path", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "exist", "ing", "\\u", "dir", "path", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "new", "\\u", "dir", "path", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "multiple", "\\u", "choice", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "blast", "\\u", "db", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TYPE", "\\u", "CHECK", "ER_", "=_", "copy_", "(_", "Option_", "._", "TYPE", "\\u", "CHECK", "ER_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "case", "s", " ", "where", " ", "the", " ", "user", " ", "speci", "fie", "s", " ", "an", " ", "exist", "ing", " ", "file", " ", "or", " ", "directory_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "as", " ", "input", ",", " ", "but", " ", "it", " ", "can", " ", "be", " ", "eit", "her", " ", "a", " ", "dir", " ", "or", " ", "a", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "TYPE", "\\u", "CHECK", "ER_", "[_", "\"", "exist", "ing", "\\u", "path", "\"_", "]_", "=_", "check", "\\u", "exist", "ing", "\\u", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "case", "s", " ", "where", " ", "the", " ", "user", " ", "speci", "fie", "s", " ", "a", " ", "new", " ", "file", " ", "or", " ", "directory_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "as", " ", "output", ",", " ", "but", " ", "it", " ", "can", " ", "be", " ", "eit", "her", " ", "a", " ", "dir", " ", "or", " ", "a", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "TYPE", "\\u", "CHECK", "ER_", "[_", "\"", "new", "\\u", "path", "\"_", "]_", "=_", "check", "\\u", "new", "\\u", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "case", "s", " ", "where", " ", "the", " ", "user", " ", "pass", "es", " ", "a", " ", "single", " ", "exist", "ing", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "TYPE", "\\u", "CHECK", "ER_", "[_", "\"", "exist", "ing", "\\u", "filepath", "\"_", "]_", "=_", "check", "\\u", "exist", "ing", "\\u", "filepath_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "case", "s", " ", "where", " ", "the", " ", "user", " ", "pass", "es", " ", "one", " ", "or", " ", "more", " ", "exist", "ing", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "as", " ", "a", " ", "comma", "-", "separate", "d", " ", "list", " ", "-", " ", "path", "s", " ", "are", " ", "return", "ed", " ", "as", " ", "a", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "TYPE", "\\u", "CHECK", "ER_", "[_", "\"", "exist", "ing", "\\u", "filepath", "s", "\"_", "]_", "=_", "check", "\\u", "exist", "ing", "\\u", "filepaths_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "case", "s", " ", "where", " ", "the", " ", "user", " ", "is", " ", "passi", "ng", " ", "a", " ", "new", " ", "path", " ", "to", " ", "be", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "(", "e", ".", "g", ".,", " ", "an", " ", "output", " ", "file", ")_", "\\u\\u\\uNL\\u\\u\\u_", "TYPE", "\\u", "CHECK", "ER_", "[_", "\"", "new", "\\u", "filepath", "\"_", "]_", "=_", "check", "\\u", "new", "\\u", "filepath_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "case", "s", " ", "where", " ", "the", " ", "user", " ", "is", " ", "passi", "ng", " ", "an", " ", "exist", "ing", " ", "directory_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "e", ".", "g", ".,", " ", "contain", "ing", " ", "a", " ", "set", " ", "of", " ", "input", " ", "files", ")_", "\\u\\u\\uNL\\u\\u\\u_", "TYPE", "\\u", "CHECK", "ER_", "[_", "\"", "exist", "ing", "\\u", "dir", "path", "\"_", "]_", "=_", "check", "\\u", "exist", "ing", "\\u", "dirpath_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "case", "s", " ", "where", " ", "the", " ", "user", " ", "pass", "es", " ", "one", " ", "or", " ", "more", " ", "exist", "ing", " ", "directories_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "as", " ", "a", " ", "comma", "-", "separate", "d", " ", "list", " ", "-", " ", "path", "s", " ", "are", " ", "return", "ed", " ", "as", " ", "a", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "TYPE", "\\u", "CHECK", "ER_", "[_", "\"", "exist", "ing", "\\u", "dir", "path", "s", "\"_", "]_", "=_", "check", "\\u", "exist", "ing", "\\u", "dir", "paths_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "case", "s", " ", "where", " ", "the", " ", "user", " ", "is", " ", "passi", "ng", " ", "a", " ", "new", " ", "director", "y", " ", "to", " ", "be", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "(", "e", ".", "g", ".,", " ", "an", " ", "output", " ", "dir", " ", "whi", "ch", " ", "will", " ", "contain", " ", "many", " ", "result", " ", "files", ")_", "\\u\\u\\uNL\\u\\u\\u_", "TYPE", "\\u", "CHECK", "ER_", "[_", "\"", "new", "\\u", "dir", "path", "\"_", "]_", "=_", "check", "\\u", "new", "\\u", "dirpath_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "case", "s", " ", "where", " ", "the", " ", "user", " ", "is", " ", "passi", "ng", " ", "one", " ", "or", " ", "more", " ", "values_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "as", " ", "comma", "-", " ", "or", " ", "semico", "lon", "-", "separate", "d", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "choice", "s", " ", "are", " ", "return", "ed", " ", "as", " ", "a", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "TYPE", "\\u", "CHECK", "ER_", "[_", "\"", "multiple", "\\u", "choice", "\"_", "]_", "=_", "check", "\\u", "multiple", "\\u", "choice_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "case", "s", " ", "where", " ", "the", " ", "user", " ", "is", " ", "passi", "ng", " ", "a", " ", "blast", " ", "databa", "se", " ", "option_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "blast", "\\u", "db", " ", "is", " ", "return", "ed", " ", "as", " ", "a", " ", "string_", "\\u\\u\\uNL\\u\\u\\u_", "TYPE", "\\u", "CHECK", "ER_", "[_", "\"", "blast", "\\u", "db", "\"_", "]_", "=_", "check", "\\u", "blast", "\\u", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "CHECK", "\\u", "METHODS_", "=_", "Option_", "._", "CHECK", "\\u", "METHODS_", "+_", "[_", "\\u", "check", "\\u", "multiple", "\\u", "choice_", "]_", "[SEP]_", "class_", "Py", "qi", "Option_", "(_", "Option_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "check", "\\u", "multiple", "\\u", "choice_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "type_", "==_", "\"", "multiple", "\\u", "choice", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "mc", "hoi", "ces_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Optio", "n", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "must", " ", "supply", " ", "a", " ", "list", " ", "of", " ", "mc", "hoi", "ces", " ", "for", " ", "type", " ", "'%", "s", "'\"_", "%_", "self_", "._", "type_", ",_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type_", "(_", "self_", "._", "mc", "hoi", "ces_", ")_", "not_", "in_", "(_", "tuple_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Optio", "n", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "choice", "s", " ", "must", " ", "be", " ", "a", " ", "list", " ", "of", " ", "string", "s", " ", "('", "%", "s", "'", " ", "supplie", "d", ")\"_", "\\u\\u\\uNL\\u\\u\\u_", "%_", "str_", "(_", "type_", "(_", "self_", "._", "mc", "hoi", "ces_", ")_", ")_", "._", "split_", "(_", "\"'\"_", ")_", "[_", "1_", "]_", ",_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "split", "\\u", "char_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "split", "\\u", "char_", "=_", "','_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "mc", "hoi", "ces_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Optio", "n", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "must", " ", "not", " ", "supply", " ", "mc", "hoi", "ces", " ", "for", " ", "type", " ", "%", "r", "\"_", "%_", "self_", "._", "type_", ",_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
couchbase/couchbase-python-client/couchbase/tests/cases/get_t.py
[ { "content": " def test_multi_mixed(self):\n kv_missing = self.gen_kv_dict(amount=3, prefix='multi_missing_mixed')\n kv_existing = self.gen_kv_dict(amount=3, prefix='multi_existing_mixed')\n\n self.cb.remove_multi(list(kv_missing.keys()) + list(kv_existing.keys()),\n quiet=True)\n\n self.cb.upsert_multi(kv_existing)\n\n rvs = self.cb.get_multi(\n list(kv_existing.keys()) + list(kv_missing.keys()),\n quiet=True)\n\n\n self.assertFalse(rvs.all_ok)\n\n for k, v in kv_missing.items():\n self.assertTrue(k in rvs)\n self.assertFalse(rvs[k].success)\n self.assertTrue(rvs[k].value is None)\n self.assertTrue(NotFoundError._can_derive(rvs[k].rc))\n\n for k, v in kv_existing.items():\n self.assertTrue(k in rvs)\n self.assertTrue(rvs[k].success)\n self.assertEqual(rvs[k].value, kv_existing[k])\n self.assertEqual(rvs[k].rc, 0)\n\n # Try this again, but without quiet\n cb_exc = None\n try:\n self.cb.get_multi(list(kv_existing.keys()) + list(kv_missing.keys()))\n except NotFoundError as e:\n cb_exc = e\n\n self.assertTrue(cb_exc)\n all_res = cb_exc.all_results\n self.assertTrue(all_res)\n self.assertFalse(all_res.all_ok)\n\n for k, v in kv_existing.items():\n self.assertTrue(k in all_res)\n self.assertTrue(all_res[k].success)\n self.assertEqual(all_res[k].value, v)\n self.assertEqual(all_res[k].rc, 0)\n\n for k, v in kv_missing.items():\n self.assertTrue(k in all_res)\n self.assertFalse(all_res[k].success)\n self.assertTrue(all_res[k].value is None)\n\n del cb_exc", "metadata": "root.GetTest.test_multi_mixed", "header": "['class', 'GetTest', '(', 'ConnectionTestCase', ')', ':', '___EOS___']", "index": 68 }, { "content": " def test_extended_get(self):\n key = self.gen_key(prefix='key_extended')\n orig_cas1 = self.cb.upsert(key, 'value1').cas\n rv = self.cb.get(key)\n val1, flags1, cas1 = rv.value, rv.flags, rv.cas\n self.assertEqual(val1, 'value1')\n self.assertEqual(flags1, FMT_JSON)\n self.assertEqual(cas1, orig_cas1)\n\n # Test named tuples\n result1 = self.cb.get(key)\n self.assertEqual(result1.value, 'value1')\n self.assertEqual(result1.flags, FMT_JSON)\n self.assertEqual(result1.cas, orig_cas1)\n\n # Single get as array\n result2 = self.cb.get_multi([key])\n self.assertIsInstance(result2, self.cls_MultiResult)\n self.assertTrue(key in result2)\n self.assertEqual(result2[key].value, 'value1')\n self.assertEqual(result2[key].flags, FMT_JSON)\n self.assertEqual(result2[key].cas, orig_cas1)\n\n key2 = self.gen_key('key_extended_2')\n cas2 = self.cb.upsert(key2, 'value2').cas\n\n key3 = self.gen_key('key_extended_3')\n cas3 = self.cb.upsert(key3, 'value3').cas\n results = self.cb.get_multi([key2, key3])\n\n self.assertEqual(results[key3].value, 'value3')\n self.assertEqual(results[key3].flags, FMT_JSON)\n self.assertEqual(results[key3].cas, cas3)\n\n rv = self.cb.get('missing_key', quiet=True)\n val4, flags4, cas4 = rv.value, rv.flags, rv.cas\n self.assertEqual(val4, None)\n self.assertEqual(flags4, 0x00)\n self.assertEqual(cas4, 0)", "metadata": "root.GetTest.test_extended_get", "header": "['class', 'GetTest', '(', 'ConnectionTestCase', ')', ':', '___EOS___']", "index": 122 }, { "content": " @attr('slow')\n def test_get_multi_ttl(self):\n kvs = self.gen_kv_dict(amount=2, prefix='get_multi_ttl')\n\n self.cb.upsert_multi(kvs)\n rvs = self.cb.get_multi(list(kvs.keys()), ttl=1)\n for k, v in rvs.items():\n self.assertEqual(v.value, kvs[k])\n\n sleep(2)\n rvs = self.cb.get_multi(list(kvs.keys()), quiet=True)\n for k, v in rvs.items():\n self.assertFalse(v.success)\n self.assertTrue(k in kvs)\n self.assertTrue(NotFoundError._can_derive(v.rc))", "metadata": "root.GetTest.test_get_multi_ttl", "header": "['class', 'GetTest', '(', 'ConnectionTestCase', ')', ':', '___EOS___']", "index": 174 } ]
[ { "span": "self.assertTrue(k in rvs)", "start_line": 85, "start_column": 12, "end_line": 85, "end_column": 37 }, { "span": "self.assertTrue(rvs[k].value is None)", "start_line": 87, "start_column": 12, "end_line": 87, "end_column": 49 }, { "span": "self.assertTrue(k in rvs)", "start_line": 91, "start_column": 12, "end_line": 91, "end_column": 37 }, { "span": "self.assertTrue(k in all_res)", "start_line": 109, "start_column": 12, "end_line": 109, "end_column": 41 }, { "span": "self.assertTrue(k in all_res)", "start_line": 115, "start_column": 12, "end_line": 115, "end_column": 41 }, { "span": "self.assertTrue(all_res[k].value is None)", "start_line": 117, "start_column": 12, "end_line": 117, "end_column": 53 }, { "span": "self.assertTrue(key in result2)", "start_line": 140, "start_column": 8, "end_line": 140, "end_column": 39 }, { "span": "self.assertTrue(k in kvs)", "start_line": 187, "start_column": 12, "end_line": 187, "end_column": 37 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Get", "Test_", "(_", "Connect", "ion", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "multi", "\\u", "mixed", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kv", "\\u", "missing_", "=_", "self_", "._", "gen", "\\u", "kv", "\\u", "dict_", "(_", "amount_", "=_", "3_", ",_", "prefix_", "=_", "'", "multi", "\\u", "missi", "ng", "\\u", "mixed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kv", "\\u", "existing_", "=_", "self_", "._", "gen", "\\u", "kv", "\\u", "dict_", "(_", "amount_", "=_", "3_", ",_", "prefix_", "=_", "'", "multi", "\\u", "exist", "ing", "\\u", "mixed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cb_", "._", "remove", "\\u", "multi_", "(_", "list_", "(_", "kv", "\\u", "missing_", "._", "keys_", "(_", ")_", ")_", "+_", "list_", "(_", "kv", "\\u", "existing_", "._", "keys_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "quiet_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cb_", "._", "upse", "rt", "\\u", "multi_", "(_", "kv", "\\u", "existing_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rvs_", "=_", "self_", "._", "cb_", "._", "get", "\\u", "multi_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "list_", "(_", "kv", "\\u", "existing_", "._", "keys_", "(_", ")_", ")_", "+_", "list_", "(_", "kv", "\\u", "missing_", "._", "keys_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "quiet_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "rvs_", "._", "all", "\\u", "ok_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "kv", "\\u", "missing_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "k_", "in_", "rvs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "rvs_", "[_", "k_", "]_", "._", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rvs_", "[_", "k_", "]_", "._", "value_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "Not", "Foun", "d", "Error_", "._", "\\u", "can", "\\u", "derive", "_", "(_", "rvs_", "[_", "k_", "]_", "._", "rc_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "kv", "\\u", "existing_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "k_", "in_", "rvs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "rvs_", "[_", "k_", "]_", "._", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "rvs_", "[_", "k_", "]_", "._", "value_", ",_", "kv", "\\u", "existing_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "rvs_", "[_", "k_", "]_", "._", "rc_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tr", "y", " ", "this", " ", "again", ",", " ", "but", " ", "with", "out", " ", "quiet_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cb", "\\u", "exc_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "cb_", "._", "get", "\\u", "multi_", "(_", "list_", "(_", "kv", "\\u", "existing_", "._", "keys_", "(_", ")_", ")_", "+_", "list_", "(_", "kv", "\\u", "missing_", "._", "keys_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Not", "Foun", "d", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cb", "\\u", "exc_", "=_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "cb", "\\u", "exc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "res_", "=_", "cb", "\\u", "exc_", "._", "all", "\\u", "results_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all", "\\u", "res_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "all", "\\u", "res_", "._", "all", "\\u", "ok_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "kv", "\\u", "existing_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "k_", "in_", "all", "\\u", "res_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all", "\\u", "res_", "[_", "k_", "]_", "._", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "all", "\\u", "res_", "[_", "k_", "]_", "._", "value_", ",_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "all", "\\u", "res_", "[_", "k_", "]_", "._", "rc_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "kv", "\\u", "missing_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "k_", "in_", "all", "\\u", "res_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "all", "\\u", "res_", "[_", "k_", "]_", "._", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all", "\\u", "res_", "[_", "k_", "]_", "._", "value_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "del_", "cb", "\\u", "exc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Test_", "(_", "Connect", "ion", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "extend", "ed", "\\u", "get_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "self_", "._", "gen", "\\u", "key_", "(_", "prefix_", "=_", "'", "key", "\\u", "extend", "ed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "orig", "\\u", "cas", "1_", "=_", "self_", "._", "cb_", "._", "upsert_", "(_", "key_", ",_", "'", "value", "1", "'_", ")_", "._", "cas_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", "=_", "self_", "._", "cb_", "._", "get_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "val1_", ",_", "flags", "1_", ",_", "cas", "1_", "=_", "rv_", "._", "value_", ",_", "rv_", "._", "flags_", ",_", "rv_", "._", "cas_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "val1_", ",_", "'", "value", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "flags", "1_", ",_", "FMT", "\\u", "JSON_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "cas", "1_", ",_", "orig", "\\u", "cas", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "named", " ", "tuples_", "\\u\\u\\uNL\\u\\u\\u_", "result1_", "=_", "self_", "._", "cb_", "._", "get_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result1_", "._", "value_", ",_", "'", "value", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result1_", "._", "flags_", ",_", "FMT", "\\u", "JSON_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result1_", "._", "cas_", ",_", "orig", "\\u", "cas", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sing", "le", " ", "get", " ", "as", " ", "array_", "\\u\\u\\uNL\\u\\u\\u_", "result2_", "=_", "self_", "._", "cb_", "._", "get", "\\u", "multi_", "(_", "[_", "key_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "result2_", ",_", "self_", "._", "cls", "\\u", "Multi", "Result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "key_", "in_", "result2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result2_", "[_", "key_", "]_", "._", "value_", ",_", "'", "value", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result2_", "[_", "key_", "]_", "._", "flags_", ",_", "FMT", "\\u", "JSON_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result2_", "[_", "key_", "]_", "._", "cas_", ",_", "orig", "\\u", "cas", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "key2_", "=_", "self_", "._", "gen", "\\u", "key_", "(_", "'", "key", "\\u", "extend", "ed", "\\u", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cas", "2_", "=_", "self_", "._", "cb_", "._", "upsert_", "(_", "key2_", ",_", "'", "value", "2", "'_", ")_", "._", "cas_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "key", "3_", "=_", "self_", "._", "gen", "\\u", "key_", "(_", "'", "key", "\\u", "extend", "ed", "\\u", "3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cas", "3_", "=_", "self_", "._", "cb_", "._", "upsert_", "(_", "key", "3_", ",_", "'", "value", "3", "'_", ")_", "._", "cas_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "self_", "._", "cb_", "._", "get", "\\u", "multi_", "(_", "[_", "key2_", ",_", "key", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "results_", "[_", "key", "3_", "]_", "._", "value_", ",_", "'", "value", "3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "results_", "[_", "key", "3_", "]_", "._", "flags_", ",_", "FMT", "\\u", "JSON_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "results_", "[_", "key", "3_", "]_", "._", "cas_", ",_", "cas", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rv_", "=_", "self_", "._", "cb_", "._", "get_", "(_", "'", "missi", "ng", "\\u", "key", "'_", ",_", "quiet_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "val", "4_", ",_", "flags", "4_", ",_", "cas", "4_", "=_", "rv_", "._", "value_", ",_", "rv_", "._", "flags_", ",_", "rv_", "._", "cas_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "val", "4_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "flags", "4_", ",_", "0x00_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "cas", "4_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Get", "Test_", "(_", "Connect", "ion", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "attr_", "(_", "'", "slow", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "multi", "\\u", "ttl_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kvs", "_", "=_", "self_", "._", "gen", "\\u", "kv", "\\u", "dict_", "(_", "amount_", "=_", "2_", ",_", "prefix_", "=_", "'", "get", "\\u", "multi", "\\u", "ttl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cb_", "._", "upse", "rt", "\\u", "multi_", "(_", "kvs", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rvs_", "=_", "self_", "._", "cb_", "._", "get", "\\u", "multi_", "(_", "list_", "(_", "kvs", "_", "._", "keys_", "(_", ")_", ")_", ",_", "ttl_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "rvs_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "v_", "._", "value_", ",_", "kvs", "_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sleep_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rvs_", "=_", "self_", "._", "cb_", "._", "get", "\\u", "multi_", "(_", "list_", "(_", "kvs", "_", "._", "keys_", "(_", ")_", ")_", ",_", "quiet_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "rvs_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "False_", "(_", "v_", "._", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "k_", "in_", "kvs", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "Not", "Foun", "d", "Error_", "._", "\\u", "can", "\\u", "derive", "_", "(_", "v_", "._", "rc_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
StevenBlack/hosts/updateHostsFile.py
[ { "content": "#!/usr/bin/env python\n\n# Script by Ben Limmer\n# https://github.com/l1m5\n#\n# This Python script will combine all the host files you provide\n# as sources into one, unique host file to keep you internet browsing happy.\n\n# pylint: disable=invalid-name\n# pylint: disable=bad-whitespace\n\n# Making Python 2 compatible with Python 3\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nimport os\nimport platform\nimport re\nimport shutil\nimport string\nimport subprocess\nimport sys\nimport tempfile\nimport time\nimport glob\nimport argparse\nimport socket\nimport json\n\n# zip files are not used actually, support deleted\n# StringIO is not needed in Python 3\n# Python 3 works differently with urlopen\n\n# Supporting urlopen in Python 2 and Python 3\ntry:\n from urllib.parse import urlparse, urlencode\n from urllib.request import urlopen, Request\n from urllib.error import HTTPError\nexcept ImportError:\n from urlparse import urlparse\n from urllib import urlencode\n from urllib2 import urlopen, Request, HTTPError\n\n# Detecting Python 3 for version-dependent implementations\nPython3 = sys.version_info >= (3,0)\n\n# This function handles both Python 2 and Python 3\n\n# In Python 3 \"print\" is a function, braces are added everywhere\n\n# This function works in both Python 2 and Python 3\n\n# Cross-python writing function\n\n# This function doesn't list hidden files\n\n# Project Settings\nBASEDIR_PATH = os.path.dirname(os.path.realpath(__file__))\n\ndefaults = {\n \"numberofrules\" : 0,\n \"datapath\" : os.path.join(BASEDIR_PATH, \"data\"),\n \"freshen\" : True,\n \"replace\" : False,\n \"backup\" : False,\n \"skipstatichosts\": False,\n \"extensionspath\" : os.path.join(BASEDIR_PATH, \"extensions\"),\n \"extensions\" : [],\n \"outputsubfolder\" : \"\",\n \"datafilenames\" : \"hosts\",\n \"targetip\" : \"0.0.0.0\",\n \"updateurlfilename\" : \"update.info\",\n \"readmefilename\" : \"readme.md\",\n \"readmetemplate\" : os.path.join(BASEDIR_PATH, \"readme_template.md\"),\n \"readmedata\" : {},\n \"readmedatafilename\" : os.path.join(BASEDIR_PATH, \"readmeData.json\"),\n \"exclusionpattern\" : \"([a-zA-Z\\d-]+\\.){0,}\",\n \"exclusionregexs\" : [],\n \"exclusions\" : [],\n \"commonexclusions\" : [\"hulu.com\"],\n \"whitelistfile\" : os.path.join(BASEDIR_PATH, \"whitelist\")}\n\n\n# Prompt the User\n\n\n\n# End Prompt the User\n\n# Exclusion logic\n\n\n\n# End Exclusion Logic\n\n# Update Logic\n\n# End Update Logic\n\n\n# End Update Logic\n\n# File Logic\n\n\n\n\n# Some sources put comments around their rules, for accuracy we need to strip them\n# the comments are preserved in the output hosts file\n\n\n\n\n\n# End File Logic\n\n# Helper Functions\n## {{{ http://code.activestate.com/recipes/577058/ (r2)\n## end of http://code.activestate.com/recipes/577058/ }}}\n\n\n# Colors\n\n\n\n# End Helper Functions\n\nif __name__ == \"__main__\":\n main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def getFileByUrl(url):\n try:\n f = urlopen(url)\n return f.read().decode(\"UTF-8\")\n except:\n print (\"Problem getting file: \", url)\n # raise", "metadata": "root.getFileByUrl", "header": "['module', '___EOS___']", "index": 46 }, { "content": "def myInput(msg = \"\"):\n if Python3:\n return input(msg)\n else:\n return raw_input(msg)", "metadata": "root.myInput", "header": "['module', '___EOS___']", "index": 57 }, { "content": "def writeData(f, data):\n if Python3:\n f.write(bytes(data, \"UTF-8\"))\n else:\n f.write(str(data).encode(\"UTF-8\"))", "metadata": "root.writeData", "header": "['module', '___EOS___']", "index": 64 }, { "content": "def listdir_nohidden(path):\n return glob.glob(os.path.join(path, \"*\"))", "metadata": "root.listdir_nohidden", "header": "['module', '___EOS___']", "index": 71 }, { "content": "def main():\n\n parser = argparse.ArgumentParser(description=\"Creates a unified hosts file from hosts stored in data subfolders.\")\n parser.add_argument(\"--auto\", \"-a\", dest=\"auto\", default=False, action=\"store_true\", help=\"Run without prompting.\")\n parser.add_argument(\"--backup\", \"-b\", dest=\"backup\", default=False, action=\"store_true\", help=\"Backup the hosts files before they are overridden.\")\n parser.add_argument(\"--extensions\", \"-e\", dest=\"extensions\", default=[], nargs=\"*\", help=\"Host extensions to include in the final hosts file.\")\n parser.add_argument(\"--ip\", \"-i\", dest=\"targetip\", default=\"0.0.0.0\", help=\"Target IP address. Default is 0.0.0.0.\")\n parser.add_argument(\"--noupdate\", \"-n\", dest=\"noupdate\", default=False, action=\"store_true\", help=\"Don't update from host data sources.\")\n parser.add_argument(\"--skipstatichosts\", \"-s\", dest=\"skipstatichosts\", default=False, action=\"store_true\", help=\"Skip static localhost entries in the final hosts file.\")\n parser.add_argument(\"--output\", \"-o\", dest=\"outputsubfolder\", default=\"\", help=\"Output subfolder for generated hosts file.\")\n parser.add_argument(\"--replace\", \"-r\", dest=\"replace\", default=False, action=\"store_true\", help=\"Replace your active hosts file with this new hosts file.\")\n\n global settings\n\n options = vars(parser.parse_args())\n\n options[\"outputpath\"] = os.path.join(BASEDIR_PATH, options[\"outputsubfolder\"])\n options[\"freshen\"] = not options[\"noupdate\"]\n\n settings = {}\n settings.update(defaults)\n settings.update(options)\n\n settings[\"sources\"] = listdir_nohidden(settings[\"datapath\"])\n settings[\"extensionsources\"] = listdir_nohidden(settings[\"extensionspath\"])\n\n\n # All our extensions folders...\n settings[\"extensions\"] = [os.path.basename(item) for item in listdir_nohidden(settings[\"extensionspath\"])]\n # ... intersected with the extensions passed-in as arguments, then sorted.\n settings[\"extensions\"] = sorted( list(set(options[\"extensions\"]).intersection(settings[\"extensions\"])) )\n\n with open(settings[\"readmedatafilename\"], \"r\") as f:\n settings[\"readmedata\"] = json.load(f)\n\n promptForUpdate()\n promptForExclusions()\n mergeFile = createInitialFile()\n removeOldHostsFile()\n finalFile = removeDupsAndExcl(mergeFile)\n finalizeFile(finalFile)\n updateReadmeData()\n printSuccess(\"Success! The hosts file has been saved in folder \" + settings[\"outputsubfolder\"] + \"\\nIt contains \" +\n \"{:,}\".format(settings[\"numberofrules\"]) + \" unique entries.\")\n\n promptForMove(finalFile)", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 100 }, { "content": "def promptForUpdate():\n # Create hosts file if it doesn't exists\n if not os.path.isfile(os.path.join(BASEDIR_PATH, \"hosts\")):\n try:\n open(os.path.join(BASEDIR_PATH, \"hosts\"), \"w+\").close()\n except:\n printFailure(\"ERROR: No 'hosts' file in the folder, try creating one manually\")\n\n if not settings[\"freshen\"]:\n return\n\n response = \"yes\" if settings[\"auto\"] else query_yes_no(\"Do you want to update all data sources?\")\n if response == \"yes\":\n updateAllSources()\n else:\n if not settings[\"auto\"]:\n print (\"OK, we'll stick with what we've got locally.\")", "metadata": "root.promptForUpdate", "header": "['module', '___EOS___']", "index": 148 }, { "content": "def promptForExclusions():\n response = \"no\" if settings[\"auto\"] else query_yes_no(\"Do you want to exclude any domains?\\n\" +\n \"For example, hulu.com video streaming must be able to access \" +\n \"its tracking and ad servers in order to play video.\")\n if response == \"yes\":\n displayExclusionOptions()\n else:\n if not settings[\"auto\"]:\n print (\"OK, we'll only exclude domains in the whitelist.\")", "metadata": "root.promptForExclusions", "header": "['module', '___EOS___']", "index": 166 }, { "content": "def promptForMoreCustomExclusions(question=\"Do you have more domains you want to enter?\"):\n return query_yes_no(question) == \"yes\"", "metadata": "root.promptForMoreCustomExclusions", "header": "['module', '___EOS___']", "index": 176 }, { "content": "def promptForMove(finalFile):\n\n if settings[\"replace\"] and not settings[\"skipstatichosts\"]:\n response = \"yes\"\n else:\n response = \"no\" if settings[\"auto\"] or settings[\"skipstatichosts\"] else query_yes_no(\"Do you want to replace your existing hosts file \" +\n \"with the newly generated file?\")\n if response == \"yes\":\n moveHostsFileIntoPlace(finalFile)\n else:\n return False", "metadata": "root.promptForMove", "header": "['module', '___EOS___']", "index": 179 }, { "content": "def displayExclusionOptions():\n for exclusionOption in settings[\"commonexclusions\"]:\n response = query_yes_no(\"Do you want to exclude the domain \" + exclusionOption + \" ?\")\n if response == \"yes\":\n excludeDomain(exclusionOption)\n else:\n continue\n response = query_yes_no(\"Do you want to exclude any other domains?\")\n if response == \"yes\":\n gatherCustomExclusions()", "metadata": "root.displayExclusionOptions", "header": "['module', '___EOS___']", "index": 193 }, { "content": "def gatherCustomExclusions():\n while True:\n # Cross-python Input\n domainFromUser = myInput(\"Enter the domain you want to exclude (e.g. facebook.com): \")\n if isValidDomainFormat(domainFromUser):\n excludeDomain(domainFromUser)\n if not promptForMoreCustomExclusions():\n return", "metadata": "root.gatherCustomExclusions", "header": "['module', '___EOS___']", "index": 204 }, { "content": "def excludeDomain(domain):\n settings[\"exclusionregexs\"].append(re.compile(settings[\"exclusionpattern\"] + domain))", "metadata": "root.excludeDomain", "header": "['module', '___EOS___']", "index": 213 }, { "content": "def matchesExclusions(strippedRule):\n strippedDomain = strippedRule.split()[1]\n for exclusionRegex in settings[\"exclusionregexs\"]:\n if exclusionRegex.search(strippedDomain):\n return True\n return False", "metadata": "root.matchesExclusions", "header": "['module', '___EOS___']", "index": 216 }, { "content": "def updateAllSources():\n allsources = list(set(settings[\"sources\"]) | set(settings[\"extensionsources\"]))\n for source in allsources:\n if os.path.isdir(source):\n for updateURL in getUpdateURLsFromFile(source):\n print (\"Updating source \" + os.path.basename(source) + \" from \" + updateURL)\n # Cross-python call\n updatedFile = getFileByUrl(updateURL)\n try:\n updatedFile = updatedFile.replace(\"\\r\", \"\") #get rid of carriage-return symbols\n # This is cross-python code\n dataFile = open(os.path.join(settings[\"datapath\"], source, settings[\"datafilenames\"]), \"wb\")\n writeData(dataFile, updatedFile)\n dataFile.close()\n except:\n print (\"Skipping.\")", "metadata": "root.updateAllSources", "header": "['module', '___EOS___']", "index": 225 }, { "content": "def getUpdateURLsFromFile(source):\n pathToUpdateFile = os.path.join(settings[\"datapath\"], source, settings[\"updateurlfilename\"])\n if os.path.exists(pathToUpdateFile):\n updateFile = open(pathToUpdateFile, \"r\")\n retURLs = updateFile.readlines()\n # .strip()\n updateFile.close()\n else:\n retURL = None\n printFailure(\"Warning: Can't find the update file for source \" + source + \"\\n\" +\n \"Make sure that there's a file at \" + pathToUpdateFile)\n return retURLs", "metadata": "root.getUpdateURLsFromFile", "header": "['module', '___EOS___']", "index": 242 }, { "content": "def getUpdateURLFromFile(source):\n pathToUpdateFile = os.path.join(settings[\"datapath\"], source, settings[\"updateurlfilename\"])\n if os.path.exists(pathToUpdateFile):\n with open(pathToUpdateFile, \"r\") as updateFile:\n return updateFile.readline().strip()\n printFailure(\"Warning: Can't find the update file for source \" + source + \"\\n\" +\n \"Make sure that there's a file at \" + pathToUpdateFile)\n return None", "metadata": "root.getUpdateURLFromFile", "header": "['module', '___EOS___']", "index": 257 }, { "content": "def createInitialFile():\n mergeFile = tempfile.NamedTemporaryFile()\n for source in settings[\"sources\"]:\n filename = os.path.join(settings[\"datapath\"], source, settings[\"datafilenames\"])\n with open(filename, \"r\") as curFile:\n #Done in a cross-python way\n writeData(mergeFile, curFile.read())\n\n for source in settings[\"extensions\"]:\n filename = os.path.join(settings[\"extensionspath\"], source, settings[\"datafilenames\"])\n with open(filename, \"r\") as curFile:\n #Done in a cross-python way\n writeData(mergeFile, curFile.read())\n\n return mergeFile", "metadata": "root.createInitialFile", "header": "['module', '___EOS___']", "index": 268 }, { "content": "def removeDupsAndExcl(mergeFile):\n numberOfRules = settings[\"numberofrules\"]\n if os.path.isfile(settings[\"whitelistfile\"]):\n with open(settings[\"whitelistfile\"], \"r\") as ins:\n for line in ins:\n line = line.strip(\" \\t\\n\\r\")\n if line and not line.startswith(\"#\"):\n settings[\"exclusions\"].append(line)\n\n if not os.path.exists(settings[\"outputpath\"]):\n os.makedirs(settings[\"outputpath\"])\n\n # Another mode is required to read and write the file in Python 3\n finalFile = open(os.path.join(settings[\"outputpath\"], \"hosts\"),\n \"w+b\" if Python3 else \"w+\")\n\n mergeFile.seek(0) # reset file pointer\n hostnames = set()\n hostnames.add(\"localhost\")\n hostnames.add(\"localhost.localdomain\")\n hostnames.add(\"local\")\n hostnames.add(\"broadcasthost\")\n exclusions = settings[\"exclusions\"]\n for line in mergeFile.readlines():\n write = \"true\"\n # Explicit encoding\n line = line.decode(\"UTF-8\")\n # replace tabs with space\n line = line.replace(\"\\t+\", \" \")\n # Trim trailing whitespace\n line = line.rstrip() + \"\\n\"\n # Testing the first character doesn't require startswith\n if line[0] == \"#\" or re.match(r'^\\s*$', line[0]):\n # Cross-python write\n writeData(finalFile, line)\n continue\n if \"::1\" in line:\n continue\n\n strippedRule = stripRule(line) #strip comments\n if not strippedRule or matchesExclusions(strippedRule):\n continue\n hostname, normalizedRule = normalizeRule(strippedRule) # normalize rule\n for exclude in exclusions:\n if exclude in line:\n write = \"false\"\n break\n if normalizedRule and (hostname not in hostnames) and (write == \"true\"):\n writeData(finalFile, normalizedRule)\n hostnames.add(hostname)\n numberOfRules += 1\n\n\n settings[\"numberofrules\"] = numberOfRules\n mergeFile.close()\n\n return finalFile", "metadata": "root.removeDupsAndExcl", "header": "['module', '___EOS___']", "index": 284 }, { "content": "def normalizeRule(rule):\n result = re.search(r'^[ \\t]*(\\d+\\.\\d+\\.\\d+\\.\\d+)\\s+([\\w\\.-]+)(.*)', rule)\n if result:\n hostname, suffix = result.group(2,3)\n hostname = hostname.lower().strip() # explicitly lowercase and trim the hostname\n if suffix:\n # add suffix as comment only, not as a separate host\n return hostname, \"%s %s #%s\\n\" % (settings[\"targetip\"], hostname, suffix)\n else:\n return hostname, \"%s %s\\n\" % (settings[\"targetip\"], hostname)\n print (\"==>%s<==\" % rule)\n return None, None", "metadata": "root.normalizeRule", "header": "['module', '___EOS___']", "index": 342 }, { "content": "def finalizeFile(finalFile):\n writeOpeningHeader(finalFile)\n finalFile.close()", "metadata": "root.finalizeFile", "header": "['module', '___EOS___']", "index": 355 }, { "content": "def stripRule(line):\n splitLine = line.split()\n if len(splitLine) < 2 :\n # just return blank\n return \"\"\n else:\n return splitLine[0] + \" \" + splitLine[1]", "metadata": "root.stripRule", "header": "['module', '___EOS___']", "index": 361 }, { "content": "def writeOpeningHeader(finalFile):\n finalFile.seek(0) #reset file pointer\n fileContents = finalFile.read() #save content\n finalFile.seek(0) #write at the top\n writeData(finalFile, \"# This hosts file is a merged collection of hosts from reputable sources,\\n\")\n writeData(finalFile, \"# with a dash of crowd sourcing via Github\\n#\\n\")\n writeData(finalFile, \"# Date: \" + time.strftime(\"%B %d %Y\", time.gmtime()) + \"\\n\")\n if settings[\"extensions\"]:\n writeData(finalFile, \"# Extensions added to this file: \" + \", \".join(settings[\"extensions\"]) + \"\\n\")\n writeData(finalFile, \"# Number of unique domains: \" + \"{:,}\\n#\\n\".format(settings[\"numberofrules\"]))\n writeData(finalFile, \"# Fetch the latest version of this file: https://raw.githubusercontent.com/StevenBlack/hosts/master/\"+ os.path.join(settings[\"outputsubfolder\"],\"\") + \"hosts\\n\")\n writeData(finalFile, \"# Project home page: https://github.com/StevenBlack/hosts\\n#\\n\")\n writeData(finalFile, \"# ===============================================================\\n\")\n writeData(finalFile, \"\\n\")\n\n if not settings[\"skipstatichosts\"]:\n writeData(finalFile, \"127.0.0.1 localhost\\n\")\n writeData(finalFile, \"127.0.0.1 localhost.localdomain\\n\")\n writeData(finalFile, \"127.0.0.1 local\\n\")\n writeData(finalFile, \"255.255.255.255 broadcasthost\\n\")\n writeData(finalFile, \"::1 localhost\\n\")\n writeData(finalFile, \"fe80::1%lo0 localhost\\n\")\n if platform.system() == \"Linux\":\n writeData(finalFile, \"127.0.1.1 \" + socket.gethostname() + \"\\n\")\n writeData(finalFile, \"\\n\")\n\n preamble = os.path.join(BASEDIR_PATH, \"myhosts\")\n if os.path.isfile(preamble):\n with open(preamble, \"r\") as f:\n writeData(finalFile, f.read())\n\n finalFile.write(fileContents)", "metadata": "root.writeOpeningHeader", "header": "['module', '___EOS___']", "index": 369 }, { "content": "def updateReadmeData():\n extensionsKey = \"base\"\n hostsLocation = \"\"\n if settings[\"extensions\"]:\n extensionsKey = \"-\".join(settings[\"extensions\"])\n\n generationData = {\"location\": os.path.join(settings[\"outputsubfolder\"], \"\"),\n \"entries\": settings[\"numberofrules\"]}\n settings[\"readmedata\"][extensionsKey] = generationData\n with open(settings[\"readmedatafilename\"], \"w\") as f:\n json.dump(settings[\"readmedata\"], f)", "metadata": "root.updateReadmeData", "header": "['module', '___EOS___']", "index": 402 }, { "content": "def moveHostsFileIntoPlace(finalFile):\n if os.name == \"posix\":\n dnsCacheFound = False\n print (\"Moving the file requires administrative privileges. \" +\n \"You might need to enter your password.\")\n if subprocess.call([\"/usr/bin/sudo\", \"cp\", os.path.abspath(finalFile.name), \"/etc/hosts\"]):\n printFailure(\"Moving the file failed.\")\n print (\"Flushing the DNS Cache to utilize new hosts file...\")\n if platform.system() == \"Darwin\":\n dnsCacheFound = True\n if subprocess.call([\"/usr/bin/sudo\", \"killall\", \"-HUP\", \"mDNSResponder\"]):\n printFailure(\"Flushing the DNS Cache failed.\")\n else:\n if os.path.isfile(\"/etc/rc.d/init.d/nscd\"):\n dnsCacheFound = True\n if subprocess.call([\"/usr/bin/sudo\", \"/etc/rc.d/init.d/nscd\", \"restart\"]):\n printFailure(\"Flushing the DNS Cache failed.\")\n else:\n printSuccess(\"Flushing DNS by restarting nscd succeeded\")\n if os.path.isfile(\"/usr/lib/systemd/system/NetworkManager.service\"):\n dnsCacheFound = True\n if subprocess.call([\"/usr/bin/sudo\", \"/usr/bin/systemctl\", \"restart\", \"NetworkManager.service\"]):\n printFailure(\"Flushing the DNS Cache failed.\")\n else:\n printSuccess(\"Flushing DNS by restarting NetworkManager succeeded\")\n if os.path.isfile(\"/usr/lib/systemd/system/wicd.service\"):\n dnsCacheFound = True\n if subprocess.call([\"/usr/bin/sudo\", \"/usr/bin/systemctl\", \"restart\", \"wicd.service\"]):\n printFailure(\"Flushing the DNS Cache failed.\")\n else:\n printSuccess(\"Flushing DNS by restarting wicd succeeded\")\n if os.path.isfile(\"/usr/lib/systemd/system/dnsmasq.service\"):\n dnsCacheFound = True\n if subprocess.call([\"/usr/bin/sudo\", \"/usr/bin/systemctl\", \"restart\", \"dnsmasq.service\"]):\n printFailure(\"Flushing the DNS Cache failed.\")\n else:\n printSuccess(\"Flushing DNS by restarting dnsmasq succeeded\")\n if os.path.isfile(\"/usr/lib/systemd/system/networking.service\"):\n dnsCacheFound = True\n if subprocess.call([\"/usr/bin/sudo\", \"/usr/bin/systemctl\", \"restart\", \"networking.service\"]):\n printFailure(\"Flushing the DNS Cache failed.\")\n else:\n printSuccess(\"Flushing DNS by restarting networking.service succeeded\")\n if not dnsCacheFound:\n printFailure(\"Unable to determine DNS management tool.\")\n elif os.name == \"nt\":\n print (\"Automatically moving the hosts file in place is not yet supported.\")\n print (\"Please move the generated file to %SystemRoot%\\system32\\drivers\\etc\\hosts\")", "metadata": "root.moveHostsFileIntoPlace", "header": "['module', '___EOS___']", "index": 414 }, { "content": "def removeOldHostsFile(): # hotfix since merging with an already existing hosts file leads to artefacts and duplicates\n oldFilePath = os.path.join(BASEDIR_PATH, \"hosts\")\n open(oldFilePath, \"a\").close() # create if already removed, so remove wont raise an error\n\n if settings[\"backup\"]:\n backupFilePath = os.path.join(BASEDIR_PATH, \"hosts-{}\".format(time.strftime(\"%Y-%m-%d-%H-%M-%S\")))\n shutil.copy(oldFilePath, backupFilePath) # make a backup copy, marking the date in which the list was updated\n\n os.remove(oldFilePath)\n open(oldFilePath, \"a\").close() # create new empty hostsfile", "metadata": "root.removeOldHostsFile", "header": "['module', '___EOS___']", "index": 463 }, { "content": "def query_yes_no(question, default = \"yes\"):\n \"\"\"Ask a yes/no question via raw_input() and return their answer.\n\n \"question\" is a string that is presented to the user.\n \"default\" is the presumed answer if the user just hits <Enter>.\n It must be \"yes\" (the default), \"no\" or None (meaning\n an answer is required of the user).\n\n The \"answer\" return value is one of \"yes\" or \"no\".\n \"\"\"\n valid = {\"yes\":\"yes\", \"y\":\"yes\", \"ye\":\"yes\",\n \"no\":\"no\", \"n\":\"no\"}\n if default is None:\n prompt = \" [y/n] \"\n elif default == \"yes\":\n prompt = \" [Y/n] \"\n elif default == \"no\":\n prompt = \" [y/N] \"\n else:\n raise ValueError(\"invalid default answer: '%s'\" % default)\n\n while 1:\n sys.stdout.write(colorize(question, colors.PROMPT) + prompt)\n # Changed to be cross-python\n choice = myInput().lower()\n if default is not None and choice == \"\":\n return default\n elif choice in valid.keys():\n return valid[choice]\n else:\n printFailure(\"Please respond with 'yes' or 'no' \"\\\n \"(or 'y' or 'n').\\n\")", "metadata": "root.query_yes_no", "header": "['module', '___EOS___']", "index": 478 }, { "content": "def isValidDomainFormat(domain):\n if domain == \"\":\n print (\"You didn't enter a domain. Try again.\")\n return False\n domainRegex = re.compile(\"www\\d{0,3}[.]|https?\")\n if domainRegex.match(domain):\n print (\"The domain \" + domain + \" is not valid. \" +\n \"Do not include www.domain.com or http(s)://domain.com. Try again.\")\n return False\n else:\n return True", "metadata": "root.isValidDomainFormat", "header": "['module', '___EOS___']", "index": 512 }, { "content": "class colors:\n PROMPT = \"\\033[94m\"\n SUCCESS = \"\\033[92m\"\n FAIL = \"\\033[91m\"\n ENDC = \"\\033[0m\"", "metadata": "root.colors", "header": "['module', '___EOS___']", "index": 525 }, { "content": "def colorize(text, color):\n return color + text + colors.ENDC", "metadata": "root.colorize", "header": "['module', '___EOS___']", "index": 531 }, { "content": "def printSuccess(text):\n print (colorize(text, colors.SUCCESS))", "metadata": "root.printSuccess", "header": "['module', '___EOS___']", "index": 534 }, { "content": "def printFailure(text):\n print (colorize(text, colors.FAIL))", "metadata": "root.printFailure", "header": "['module', '___EOS___']", "index": 537 } ]
[ { "span": "import string", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 13 }, { "span": "from urllib.parse import urlparse, urlencode", "start_line": 34, "start_column": 4, "end_line": 34, "end_column": 48 }, { "span": "from urllib.request import urlopen, Request", "start_line": 35, "start_column": 4, "end_line": 35, "end_column": 47 }, { "span": "from urllib.error import HTTPError", "start_line": 36, "start_column": 4, "end_line": 36, "end_column": 38 }, { "span": "from urlparse import urlparse", "start_line": 38, "start_column": 4, "end_line": 38, "end_column": 33 }, { "span": "from urllib2 import urlopen, Request, HTTPError", "start_line": 40, "start_column": 4, "end_line": 40, "end_column": 51 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Script", " ", "by", " ", "Ben", " ", "Lim", "mer_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "https", "://", "git", "hub", ".", "com", "/", "l1", "m", "5_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "Pyth", "on", " ", "script", " ", "will", " ", "combin", "e", " ", "all", " ", "the", " ", "host", " ", "files", " ", "you", " ", "provide", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "as", " ", "source", "s", " ", "int", "o", " ", "one", ",", " ", "unique", " ", "host", " ", "file", " ", "to", " ", "keep", " ", "you", " ", "interne", "t", " ", "brow", "sing", " ", "happy", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pylint", ":", " ", "disable", "=", "invalid", "-", "name_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pylint", ":", " ", "disable", "=", "bad", "-", "whitespace_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Maki", "ng", " ", "Pyth", "on", " ", "2", " ", "compatible", " ", "with", " ", "Pyth", "on", " ", "3_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "abs", "olute", "\\u", "import_", ",_", "division_", ",_", "print", "\\u", "function_", ",_", "unicode", "\\u", "literals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "platform_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "shutil_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "glob_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "argparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "socket_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "zip", " ", "files", " ", "are", " ", "not", " ", "used", " ", "actual", "ly", ",", " ", "support", " ", "deleted_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "String", "IO", " ", "is", " ", "not", " ", "need", "ed", " ", "in", " ", "Pyth", "on", " ", "3_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "3", " ", "works", " ", "different", "ly", " ", "with", " ", "urlopen_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Supp", "ort", "ing", " ", "urlo", "pen", " ", "in", " ", "Pyth", "on", " ", "2", " ", "and", " ", "Pyth", "on", " ", "3_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "urllib_", "._", "parse_", "import_", "urlparse_", ",_", "urlencode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "urllib_", "._", "request_", "import_", "urlopen_", ",_", "Request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "urllib_", "._", "error_", "import_", "HTTP", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "urlparse_", "import_", "urlparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "urllib_", "import_", "urlencode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "urllib2_", "import_", "urlopen_", ",_", "Request_", ",_", "HTTP", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Detect", "ing", " ", "Pyth", "on", " ", "3", " ", "for", " ", "version", "-", "dependent", " ", "implementation", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Pyth", "on", "3_", "=_", "sys_", "._", "version", "\\u", "info_", ">=_", "(_", "3_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "function", " ", "handle", "s", " ", "bot", "h", " ", "Pyth", "on", " ", "2", " ", "and", " ", "Pyth", "on", " ", "3_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "In", " ", "Pyth", "on", " ", "3", " ", " ", " ", "\"", "print", "\"", " ", "is", " ", "a", " ", "function", ",", " ", "braces", " ", "are", " ", "adde", "d", " ", "every", "where_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "function", " ", "works", " ", "in", " ", "bot", "h", " ", "Pyth", "on", " ", "2", " ", "and", " ", "Pyth", "on", " ", "3_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Cross", "-", "python", " ", "writ", "ing", " ", "function_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "function", " ", "doe", "sn", "'", "t", " ", "list", " ", "hidden", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Project", " ", "Settings_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "BASED", "IR", "\\u", "PATH_", "=_", "os_", "._", "path_", "._", "dirname_", "(_", "os_", "._", "path_", "._", "realpath_", "(_", "\\u\\u", "file\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "defaults_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "number", "of", "rule", "s", "\"_", ":_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "datapath", "\"_", ":_", "os_", "._", "path_", "._", "join_", "(_", "BASED", "IR", "\\u", "PATH_", ",_", "\"", "data", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fresh", "en", "\"_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "replace", "\"_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "backup", "\"_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "skips", "tati", "chos", "ts", "\"_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "extensi", "ons", "path", "\"_", ":_", "os_", "._", "path_", "._", "join_", "(_", "BASED", "IR", "\\u", "PATH_", ",_", "\"", "extensi", "ons", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "extensi", "ons", "\"_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "output", "subfolder", "\"_", ":_", "\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "datafile", "names", "\"_", ":_", "\"", "host", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "targeti", "p", "\"_", ":_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "update", "urlf", "ilen", "ame", "\"_", ":_", "\"", "update", ".", "info", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "readme", "filename", "\"_", ":_", "\"", "readme", ".", "md", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "readme", "template", "\"_", ":_", "os_", "._", "path_", "._", "join_", "(_", "BASED", "IR", "\\u", "PATH_", ",_", "\"", "readme", "\\u", "template", ".", "md", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "readme", "data", "\"_", ":_", "{_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "readme", "datafile", "name", "\"_", ":_", "os_", "._", "path_", "._", "join_", "(_", "BASED", "IR", "\\u", "PATH_", ",_", "\"", "readme", "Data", ".", "json", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "exclusion", "pattern", "\"_", ":_", "\"([", "a", "-", "z", "A", "-", "Z", "\\\\", "d", "-]+", "\\\\.)", "{", "0", ",}", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "exclusion", "regex", "s", "\"_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "exclusions", "\"_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "common", "exclusions", "\"_", ":_", "[_", "\"", "hu", "lu", ".", "com", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "whitelist", "file", "\"_", ":_", "os_", "._", "path_", "._", "join_", "(_", "BASED", "IR", "\\u", "PATH_", ",_", "\"", "whitelist", "\"_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Prom", "pt", " ", "the", " ", "User_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "End", " ", "Prom", "pt", " ", "the", " ", "User_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Exclu", "sion", " ", "logic_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "End", " ", "Exclu", "sion", " ", "Logic_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Update", " ", "Logic_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "End", " ", "Update", " ", "Logic_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "End", " ", "Update", " ", "Logic_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "File", " ", "Logic_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Some", " ", "source", "s", " ", "put", " ", "comment", "s", " ", "aro", "und", " ", "thei", "r", " ", "rule", "s", ",", " ", "for", " ", "accu", "rac", "y", " ", "we", " ", "need", " ", "to", " ", "strip", " ", "them", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "comment", "s", " ", "are", " ", "preserved", " ", "in", " ", "the", " ", "output", " ", "host", "s", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "End", " ", "File", " ", "Logic_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Help", "er", " ", "Functions_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "{{", "{", " ", "http", "://", "code", ".", "active", "state", ".", "com", "/", "recip", "es", "/", "577", "058", "/", " ", "(", "r2", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "##", " ", "end", " ", "of", " ", "http", "://", "code", ".", "active", "state", ".", "com", "/", "recip", "es", "/", "577", "058", "/", " ", "}}}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Colors_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "End", " ", "Help", "er", " ", "Functions_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "File", "By", "Url_", "(_", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "urlopen_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "f_", "._", "read_", "(_", ")_", "._", "decode_", "(_", "\"", "UT", "F", "-", "8", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Prob", "lem", " ", "getti", "ng", " ", "file", ":", " ", "\"_", ",_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "raise_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "my", "Input_", "(_", "msg_", "=_", "\"\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "Pyth", "on", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "input_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "raw", "\\u", "input_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "Data_", "(_", "f_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "Pyth", "on", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "._", "write_", "(_", "bytes_", "(_", "data_", ",_", "\"", "UT", "F", "-", "8", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "._", "write_", "(_", "str_", "(_", "data_", ")_", "._", "encode_", "(_", "\"", "UT", "F", "-", "8", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "listd", "ir", "\\u", "noh", "idd", "en_", "(_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "glob_", "._", "glob_", "(_", "os_", "._", "path_", "._", "join_", "(_", "path_", ",_", "\"*\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "=_", "argparse_", "._", "Arg", "ument", "Parser_", "(_", "description_", "=_", "\"", "Creat", "es", " ", "a", " ", "unifie", "d", " ", "host", "s", " ", "file", " ", "from", " ", "host", "s", " ", "store", "d", " ", "in", " ", "data", " ", "subfolder", "s", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"--", "auto", "\"_", ",_", "\"-", "a", "\"_", ",_", "dest_", "=_", "\"", "auto", "\"_", ",_", "default_", "=_", "False_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "help_", "=_", "\"", "Run", " ", "with", "out", " ", "prompt", "ing", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"--", "backup", "\"_", ",_", "\"-", "b", "\"_", ",_", "dest_", "=_", "\"", "backup", "\"_", ",_", "default_", "=_", "False_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "help_", "=_", "\"", "Back", "up", " ", "the", " ", "host", "s", " ", "files", " ", "bef", "ore", " ", "the", "y", " ", "are", " ", "overrid", "den", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"--", "extensi", "ons", "\"_", ",_", "\"-", "e", "\"_", ",_", "dest_", "=_", "\"", "extensi", "ons", "\"_", ",_", "default_", "=_", "[_", "]_", ",_", "nargs_", "=_", "\"*\"_", ",_", "help_", "=_", "\"", "Host", " ", "extensi", "ons", " ", "to", " ", "include", " ", "in", " ", "the", " ", "final", " ", "host", "s", " ", "file", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"--", "ip", "\"_", ",_", "\"-", "i", "\"_", ",_", "dest_", "=_", "\"", "targeti", "p", "\"_", ",_", "default_", "=_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "help_", "=_", "\"", "Target", " ", "IP", " ", "address", ".", " ", "Default", " ", "is", " ", "0.", "0.", "0.", "0.", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"--", "nou", "pdat", "e", "\"_", ",_", "\"-", "n", "\"_", ",_", "dest_", "=_", "\"", "nou", "pdat", "e", "\"_", ",_", "default_", "=_", "False_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "help_", "=_", "\"", "Don", "'", "t", " ", "update", " ", "from", " ", "host", " ", "data", " ", "source", "s", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"--", "skips", "tati", "chos", "ts", "\"_", ",_", "\"-", "s", "\"_", ",_", "dest_", "=_", "\"", "skips", "tati", "chos", "ts", "\"_", ",_", "default_", "=_", "False_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "help_", "=_", "\"", "Ski", "p", " ", "static", " ", "local", "host", " ", "entri", "es", " ", "in", " ", "the", " ", "final", " ", "host", "s", " ", "file", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"--", "output", "\"_", ",_", "\"-", "o", "\"_", ",_", "dest_", "=_", "\"", "output", "subfolder", "\"_", ",_", "default_", "=_", "\"\"_", ",_", "help_", "=_", "\"", "Output", " ", "subfolder", " ", "for", " ", "generat", "ed", " ", "host", "s", " ", "file", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"--", "replace", "\"_", ",_", "\"-", "r", "\"_", ",_", "dest_", "=_", "\"", "replace", "\"_", ",_", "default_", "=_", "False_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "help_", "=_", "\"", "Replace", " ", "your", " ", "active", " ", "host", "s", " ", "file", " ", "with", " ", "this", " ", "new", " ", "host", "s", " ", "file", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "global_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "options_", "=_", "vars_", "(_", "parser_", "._", "parse", "\\u", "args_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "options_", "[_", "\"", "output", "path", "\"_", "]_", "=_", "os_", "._", "path_", "._", "join_", "(_", "BASED", "IR", "\\u", "PATH_", ",_", "options_", "[_", "\"", "output", "subfolder", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "options_", "[_", "\"", "fresh", "en", "\"_", "]_", "=_", "not_", "options_", "[_", "\"", "nou", "pdat", "e", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "settings_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "settings_", "._", "update_", "(_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "settings_", "._", "update_", "(_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "settings_", "[_", "\"", "source", "s", "\"_", "]_", "=_", "listd", "ir", "\\u", "noh", "idd", "en_", "(_", "settings_", "[_", "\"", "datapath", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "settings_", "[_", "\"", "extensi", "ons", "ource", "s", "\"_", "]_", "=_", "listd", "ir", "\\u", "noh", "idd", "en_", "(_", "settings_", "[_", "\"", "extensi", "ons", "path", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "our", " ", "extensi", "ons", " ", "folder", "s", "..._", "\\u\\u\\uNL\\u\\u\\u_", "settings_", "[_", "\"", "extensi", "ons", "\"_", "]_", "=_", "[_", "os_", "._", "path_", "._", "basename_", "(_", "item_", ")_", "for_", "item_", "in_", "listd", "ir", "\\u", "noh", "idd", "en_", "(_", "settings_", "[_", "\"", "extensi", "ons", "path", "\"_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "...", " ", "intersect", "ed", " ", "with", " ", "the", " ", "extensi", "ons", " ", "pass", "ed", "-", "in", " ", "as", " ", "argu", "ment", "s", ",", " ", "then", " ", "sorte", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "settings_", "[_", "\"", "extensi", "ons", "\"_", "]_", "=_", "sorted_", "(_", "list_", "(_", "set_", "(_", "options_", "[_", "\"", "extensi", "ons", "\"_", "]_", ")_", "._", "intersection_", "(_", "settings_", "[_", "\"", "extensi", "ons", "\"_", "]_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "open_", "(_", "settings_", "[_", "\"", "readme", "datafile", "name", "\"_", "]_", ",_", "\"", "r", "\"_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "settings_", "[_", "\"", "readme", "data", "\"_", "]_", "=_", "json_", "._", "load_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prompt", "For", "Update_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prompt", "For", "Exclu", "sions_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "merge", "File_", "=_", "create", "Initial", "File_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "remove", "Old", "Host", "s", "File_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "final", "File_", "=_", "remove", "Dup", "s", "And", "Exc", "l_", "(_", "merge", "File_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finalize", "File_", "(_", "final", "File_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update", "Read", "me", "Data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print", "Success_", "(_", "\"", "Success", "!", " ", "The", " ", "host", "s", " ", "file", " ", "has", " ", "bee", "n", " ", "saved", " ", "in", " ", "folder", " ", "\"_", "+_", "settings_", "[_", "\"", "output", "subfolder", "\"_", "]_", "+_", "\"\\\\", "n", "It", " ", "contain", "s", " ", "\"_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "\"{:", ",}", "\"_", "._", "format_", "(_", "settings_", "[_", "\"", "number", "of", "rule", "s", "\"_", "]_", ")_", "+_", "\"", " ", "unique", " ", "entri", "es", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "prompt", "For", "Move_", "(_", "final", "File_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "prompt", "For", "Update_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Creat", "e", " ", "host", "s", " ", "file", " ", "if", " ", "it", " ", "doe", "sn", "'", "t", " ", "exists_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "os_", "._", "path_", "._", "isfile_", "(_", "os_", "._", "path_", "._", "join_", "(_", "BASED", "IR", "\\u", "PATH_", ",_", "\"", "host", "s", "\"_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "BASED", "IR", "\\u", "PATH_", ",_", "\"", "host", "s", "\"_", ")_", ",_", "\"", "w", "+\"_", ")_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print", "Failure_", "(_", "\"", "ERROR", ":", " ", "No", " ", "'", "host", "s", "'", " ", "file", " ", "in", " ", "the", " ", "folder", ",", " ", "try", " ", "creati", "ng", " ", "one", " ", "manu", "ally", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "settings_", "[_", "\"", "fresh", "en", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "response_", "=_", "\"", "ye", "s", "\"_", "if_", "settings_", "[_", "\"", "auto", "\"_", "]_", "else_", "query", "\\u", "ye", "s", "\\u", "no_", "(_", "\"", "Do", " ", "you", " ", "want", " ", "to", " ", "update", " ", "all", " ", "data", " ", "source", "s", "?\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "response_", "==_", "\"", "ye", "s", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "update", "All", "Sources_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "settings_", "[_", "\"", "auto", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "OK", ",", " ", "we", "'", "ll", " ", "stick", " ", "with", " ", "what", " ", "we", "'", "ve", " ", " ", "got", " ", "local", "ly", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "prompt", "For", "Exclu", "sions_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "\"", "no", "\"_", "if_", "settings_", "[_", "\"", "auto", "\"_", "]_", "else_", "query", "\\u", "ye", "s", "\\u", "no_", "(_", "\"", "Do", " ", "you", " ", "want", " ", "to", " ", "exclu", "de", " ", "any", " ", "domains", "?\\\\", "n", "\"_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "For", " ", "example", ",", " ", "hu", "lu", ".", "com", " ", "video", " ", "stream", "ing", " ", "must", " ", "be", " ", "able", " ", "to", " ", "access", " ", "\"_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "its", " ", "track", "ing", " ", "and", " ", "ad", " ", "server", "s", " ", "in", " ", "order", " ", "to", " ", "play", " ", "video", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "response_", "==_", "\"", "ye", "s", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "display", "Exclu", "sion", "Options_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "settings_", "[_", "\"", "auto", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "OK", ",", " ", "we", "'", "ll", " ", "only", " ", "exclu", "de", " ", "domains", " ", "in", " ", "the", " ", "whitelist", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "prompt", "For", "Mor", "e", "Custom", "Exclu", "sions_", "(_", "question_", "=_", "\"", "Do", " ", "you", " ", "have", " ", "more", " ", "domains", " ", "you", " ", "want", " ", "to", " ", "enter", "?\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "query", "\\u", "ye", "s", "\\u", "no_", "(_", "question_", ")_", "==_", "\"", "ye", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "prompt", "For", "Move_", "(_", "final", "File_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "settings_", "[_", "\"", "replace", "\"_", "]_", "and_", "not_", "settings_", "[_", "\"", "skips", "tati", "chos", "ts", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "\"", "ye", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "\"", "no", "\"_", "if_", "settings_", "[_", "\"", "auto", "\"_", "]_", "or_", "settings_", "[_", "\"", "skips", "tati", "chos", "ts", "\"_", "]_", "else_", "query", "\\u", "ye", "s", "\\u", "no_", "(_", "\"", "Do", " ", "you", " ", "want", " ", "to", " ", "replace", " ", "your", " ", "exist", "ing", " ", "host", "s", " ", "file", " ", "\"_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "with", " ", "the", " ", "newl", "y", " ", "generat", "ed", " ", "file", "?\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "response_", "==_", "\"", "ye", "s", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "move", "Host", "s", "File", "Int", "o", "Place_", "(_", "final", "File_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "display", "Exclu", "sion", "Options_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "exclusion", "Option_", "in_", "settings_", "[_", "\"", "common", "exclusions", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "query", "\\u", "ye", "s", "\\u", "no_", "(_", "\"", "Do", " ", "you", " ", "want", " ", "to", " ", "exclu", "de", " ", "the", " ", "domain", " ", "\"_", "+_", "exclusion", "Option_", "+_", "\"", " ", "?\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "response_", "==_", "\"", "ye", "s", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exclu", "de", "Domain_", "(_", "exclusion", "Option_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "response_", "=_", "query", "\\u", "ye", "s", "\\u", "no_", "(_", "\"", "Do", " ", "you", " ", "want", " ", "to", " ", "exclu", "de", " ", "any", " ", "other", " ", "domains", "?\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "response_", "==_", "\"", "ye", "s", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gather", "Custom", "Exclu", "sions_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "gather", "Custom", "Exclu", "sions_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Cross", "-", "python", " ", "Input_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "domain", "Fro", "m", "User_", "=_", "my", "Input_", "(_", "\"", "Enter", " ", "the", " ", "domain", " ", "you", " ", "want", " ", "to", " ", "exclu", "de", " ", "(", "e", ".", "g", ".", " ", "facebook", ".", "com", "):", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "is", "Valid", "Doma", "in", "Format_", "(_", "domain", "Fro", "m", "User_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exclu", "de", "Domain_", "(_", "domain", "Fro", "m", "User_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "prompt", "For", "Mor", "e", "Custom", "Exclu", "sions_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "exclu", "de", "Domain_", "(_", "domain_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "settings_", "[_", "\"", "exclusion", "regex", "s", "\"_", "]_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "settings_", "[_", "\"", "exclusion", "pattern", "\"_", "]_", "+_", "domain_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "matche", "s", "Exclu", "sions_", "(_", "strip", "ped", "Rule_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "strip", "ped", "Domain_", "=_", "strip", "ped", "Rule_", "._", "split_", "(_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "exclusion", "Regex_", "in_", "settings_", "[_", "\"", "exclusion", "regex", "s", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "exclusion", "Regex_", "._", "search_", "(_", "strip", "ped", "Domain_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update", "All", "Sources_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "alls", "ource", "s_", "=_", "list_", "(_", "set_", "(_", "settings_", "[_", "\"", "source", "s", "\"_", "]_", ")_", "|_", "set_", "(_", "settings_", "[_", "\"", "extensi", "ons", "ource", "s", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "source_", "in_", "alls", "ource", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "os_", "._", "path_", "._", "isdir_", "(_", "source_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "update", "URL_", "in_", "get", "Update", "URL", "s", "Fro", "m", "File_", "(_", "source_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Up", "dati", "ng", " ", "source", " ", "\"_", "+_", "os_", "._", "path_", "._", "basename_", "(_", "source_", ")_", "+_", "\"", " ", "from", " ", "\"_", "+_", "update", "URL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Cross", "-", "python", " ", "call_", "\\u\\u\\uNL\\u\\u\\u_", "update", "d", "File_", "=_", "get", "File", "By", "Url_", "(_", "update", "URL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "update", "d", "File_", "=_", "update", "d", "File_", "._", "replace_", "(_", "\"\\\\", "r", "\"_", ",_", "\"\"_", ")_", "#", "get", " ", "rid", " ", "of", " ", "carri", "age", "-", "return", " ", "symbols_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "cross", "-", "python", " ", "code_", "\\u\\u\\uNL\\u\\u\\u_", "data", "File_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "settings_", "[_", "\"", "datapath", "\"_", "]_", ",_", "source_", ",_", "settings_", "[_", "\"", "datafile", "names", "\"_", "]_", ")_", ",_", "\"", "wb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "Data_", "(_", "data", "File_", ",_", "update", "d", "File_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data", "File_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "(_", "\"", "Ski", "ppi", "ng", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Update", "URL", "s", "Fro", "m", "File_", "(_", "source_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path", "To", "Update", "File_", "=_", "os_", "._", "path_", "._", "join_", "(_", "settings_", "[_", "\"", "datapath", "\"_", "]_", ",_", "source_", ",_", "settings_", "[_", "\"", "update", "urlf", "ilen", "ame", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "path", "To", "Update", "File_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "update", "File_", "=_", "open_", "(_", "path", "To", "Update", "File_", ",_", "\"", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret", "URL", "s_", "=_", "update", "File_", "._", "readlines_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", ".", "strip", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "update", "File_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ret", "URL_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print", "Failure_", "(_", "\"", "Warn", "ing", ":", " ", "Can", "'", "t", " ", "find", " ", "the", " ", "update", " ", "file", " ", "for", " ", "source", " ", "\"_", "+_", "source_", "+_", "\"\\\\", "n", "\"_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Make", " ", "sure", " ", "tha", "t", " ", "there", "'", "s", " ", "a", " ", "file", " ", "at", " ", "\"_", "+_", "path", "To", "Update", "File_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "ret", "URL", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Update", "URL", "Fro", "m", "File_", "(_", "source_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path", "To", "Update", "File_", "=_", "os_", "._", "path_", "._", "join_", "(_", "settings_", "[_", "\"", "datapath", "\"_", "]_", ",_", "source_", ",_", "settings_", "[_", "\"", "update", "urlf", "ilen", "ame", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "path", "To", "Update", "File_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "path", "To", "Update", "File_", ",_", "\"", "r", "\"_", ")_", "as_", "update", "File_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "update", "File_", "._", "readline_", "(_", ")_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print", "Failure_", "(_", "\"", "Warn", "ing", ":", " ", "Can", "'", "t", " ", "find", " ", "the", " ", "update", " ", "file", " ", "for", " ", "source", " ", "\"_", "+_", "source_", "+_", "\"\\\\", "n", "\"_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Make", " ", "sure", " ", "tha", "t", " ", "there", "'", "s", " ", "a", " ", "file", " ", "at", " ", "\"_", "+_", "path", "To", "Update", "File_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "Initial", "File_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "merge", "File_", "=_", "tempfile_", "._", "Name", "d", "Tempora", "ry", "File_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "source_", "in_", "settings_", "[_", "\"", "source", "s", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "os_", "._", "path_", "._", "join_", "(_", "settings_", "[_", "\"", "datapath", "\"_", "]_", ",_", "source_", ",_", "settings_", "[_", "\"", "datafile", "names", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "filename_", ",_", "\"", "r", "\"_", ")_", "as_", "cur", "File_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Don", "e", " ", "in", " ", "a", " ", "cross", "-", "python", " ", "way_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "write", "Data_", "(_", "merge", "File_", ",_", "cur", "File_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "source_", "in_", "settings_", "[_", "\"", "extensi", "ons", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "os_", "._", "path_", "._", "join_", "(_", "settings_", "[_", "\"", "extensi", "ons", "path", "\"_", "]_", ",_", "source_", ",_", "settings_", "[_", "\"", "datafile", "names", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "filename_", ",_", "\"", "r", "\"_", ")_", "as_", "cur", "File_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Don", "e", " ", "in", " ", "a", " ", "cross", "-", "python", " ", "way_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "write", "Data_", "(_", "merge", "File_", ",_", "cur", "File_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "merge", "File_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "remove", "Dup", "s", "And", "Exc", "l_", "(_", "merge", "File_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "number", "Of", "Rules_", "=_", "settings_", "[_", "\"", "number", "of", "rule", "s", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "settings_", "[_", "\"", "whitelist", "file", "\"_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "settings_", "[_", "\"", "whitelist", "file", "\"_", "]_", ",_", "\"", "r", "\"_", ")_", "as_", "ins_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "line_", "in_", "ins_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "=_", "line_", "._", "strip_", "(_", "\"", " ", "\\\\", "t", "\\\\", "n", "\\\\", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "line_", "and_", "not_", "line_", "._", "startswith_", "(_", "\"#\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "settings_", "[_", "\"", "exclusions", "\"_", "]_", "._", "append_", "(_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "settings_", "[_", "\"", "output", "path", "\"_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "makedirs_", "(_", "settings_", "[_", "\"", "output", "path", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ano", "ther", " ", "mode", " ", "is", " ", "require", "d", " ", "to", " ", "read", " ", "and", " ", "write", " ", "the", " ", "file", " ", "in", " ", "Pyth", "on", " ", "3_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "final", "File_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "settings_", "[_", "\"", "output", "path", "\"_", "]_", ",_", "\"", "host", "s", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "w", "+", "b", "\"_", "if_", "Pyth", "on", "3_", "else_", "\"", "w", "+\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "merge", "File_", "._", "seek_", "(_", "0_", ")_", "#", " ", "reset", " ", "file", " ", "pointer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hostnames", "_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hostnames", "_", "._", "add_", "(_", "\"", "local", "host", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hostnames", "_", "._", "add_", "(_", "\"", "local", "host", ".", "locald", "omain", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hostnames", "_", "._", "add_", "(_", "\"", "local", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hostnames", "_", "._", "add_", "(_", "\"", "broadcast", "host", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exclusions", "_", "=_", "settings_", "[_", "\"", "exclusions", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "merge", "File_", "._", "readlines_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "write_", "=_", "\"", "true", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Exp", "licit", " ", "encoding_", "\\u\\u\\uNL\\u\\u\\u_", "line_", "=_", "line_", "._", "decode_", "(_", "\"", "UT", "F", "-", "8", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "replace", " ", "tabs", " ", "with", " ", "space_", "\\u\\u\\uNL\\u\\u\\u_", "line_", "=_", "line_", "._", "replace_", "(_", "\"\\\\", "t", "+\"_", ",_", "\"", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Trim", " ", "trail", "ing", " ", "whitespace_", "\\u\\u\\uNL\\u\\u\\u_", "line_", "=_", "line_", "._", "rstrip_", "(_", ")_", "+_", "\"\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Test", "ing", " ", "the", " ", "first", " ", "character", " ", "doe", "sn", "'", "t", " ", "require", " ", "startswith_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "line_", "[_", "0_", "]_", "==_", "\"#\"_", "or_", "re_", "._", "match_", "(_", "r", "'", "^", "\\\\", "s", "*$'_", ",_", "line_", "[_", "0_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Cross", "-", "python", " ", "write_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "write", "Data_", "(_", "final", "File_", ",_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\":", ":", "1", "\"_", "in_", "line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "strip", "ped", "Rule_", "=_", "strip", "Rule_", "(_", "line_", ")_", "#", "strip", " ", "comments_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "strip", "ped", "Rule_", "or_", "matche", "s", "Exclu", "sions_", "(_", "strip", "ped", "Rule_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "hostname_", ",_", "normali", "zed", "Rule_", "=_", "normali", "ze", "Rule_", "(_", "strip", "ped", "Rule_", ")_", "#", " ", "normali", "ze", " ", "rule_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "exclude_", "in_", "exclusions", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "exclude_", "in_", "line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "write_", "=_", "\"", "fal", "se", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "normali", "zed", "Rule_", "and_", "(_", "hostname_", "not_", "in_", "hostnames", "_", ")_", "and_", "(_", "write_", "==_", "\"", "true", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "write", "Data_", "(_", "final", "File_", ",_", "normali", "zed", "Rule_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hostnames", "_", "._", "add_", "(_", "hostname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "number", "Of", "Rules_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "settings_", "[_", "\"", "number", "of", "rule", "s", "\"_", "]_", "=_", "number", "Of", "Rules_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "merge", "File_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "final", "File_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "normali", "ze", "Rule_", "(_", "rule_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "re_", "._", "search_", "(_", "r", "'", "^", "[", " ", "\\\\", "t", "]*(", "\\\\", "d", "+\\\\.", "\\\\", "d", "+\\\\.", "\\\\", "d", "+\\\\.", "\\\\", "d", "+)\\\\", "s", "+([", "\\\\", "w", "\\\\.", "-]+)", "(.*)", "'_", ",_", "rule_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hostname_", ",_", "suffix_", "=_", "result_", "._", "group_", "(_", "2_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hostname_", "=_", "hostname_", "._", "lower_", "(_", ")_", "._", "strip_", "(_", ")_", "#", " ", "explicit", "ly", " ", "lower", "case", " ", "and", " ", "trim", " ", "the", " ", "hostname_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "suffix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "suff", "ix", " ", "as", " ", "comment", " ", "only", ",", " ", "not", " ", "as", " ", "a", " ", "separate", " ", "host_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "hostname_", ",_", "\"%", "s", " ", "%", "s", " ", "#", "%", "s", "\\\\", "n", "\"_", "%_", "(_", "settings_", "[_", "\"", "targeti", "p", "\"_", "]_", ",_", "hostname_", ",_", "suffix_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "hostname_", ",_", "\"%", "s", " ", "%", "s", "\\\\", "n", "\"_", "%_", "(_", "settings_", "[_", "\"", "targeti", "p", "\"_", "]_", ",_", "hostname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "\"==", ">", "%", "s", "<=", "=\"_", "%_", "rule_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", ",_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "finalize", "File_", "(_", "final", "File_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "write", "Open", "ing", "Header_", "(_", "final", "File_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "final", "File_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "strip", "Rule_", "(_", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "split", "Line_", "=_", "line_", "._", "split_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "split", "Line_", ")_", "<_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "just", " ", "return", " ", "blank_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "split", "Line_", "[_", "0_", "]_", "+_", "\"", " ", "\"_", "+_", "split", "Line_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "Open", "ing", "Header_", "(_", "final", "File_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "final", "File_", "._", "seek_", "(_", "0_", ")_", "#", "reset", " ", "file", " ", "pointer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "Contents_", "=_", "final", "File_", "._", "read_", "(_", ")_", "#", "save", " ", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "final", "File_", "._", "seek_", "(_", "0_", ")_", "#", "write", " ", "at", " ", "the", " ", "top_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "Data_", "(_", "final", "File_", ",_", "\"#", " ", "Thi", "s", " ", "host", "s", " ", "file", " ", "is", " ", "a", " ", "merge", "d", " ", "collection", " ", "of", " ", "host", "s", " ", "from", " ", "repu", "table", " ", "source", "s", ",\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "Data_", "(_", "final", "File_", ",_", "\"#", " ", "with", " ", "a", " ", "dash", " ", "of", " ", "crowd", " ", "sou", "rci", "ng", " ", "via", " ", "Git", "hub", "\\\\", "n", "#", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "Data_", "(_", "final", "File_", ",_", "\"#", " ", "Date", ":", " ", "\"_", "+_", "time_", "._", "strftime_", "(_", "\"%", "B", " ", "%", "d", " ", "%", "Y", "\"_", ",_", "time_", "._", "gmtime_", "(_", ")_", ")_", "+_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "settings_", "[_", "\"", "extensi", "ons", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "write", "Data_", "(_", "final", "File_", ",_", "\"#", " ", "Ext", "ensi", "ons", " ", "adde", "d", " ", "to", " ", "this", " ", "file", ":", " ", "\"_", "+_", "\",", " ", "\"_", "._", "join_", "(_", "settings_", "[_", "\"", "extensi", "ons", "\"_", "]_", ")_", "+_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "write", "Data_", "(_", "final", "File_", ",_", "\"#", " ", "Number", " ", "of", " ", "unique", " ", "domains", ":", " ", "\"_", "+_", "\"{:", ",}", "\\\\", "n", "#", "\\\\", "n", "\"_", "._", "format_", "(_", "settings_", "[_", "\"", "number", "of", "rule", "s", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "Data_", "(_", "final", "File_", ",_", "\"#", " ", "Fe", "tch", " ", "the", " ", "late", "st", " ", "version", " ", "of", " ", "this", " ", "file", ":", " ", "https", "://", "raw", ".", "git", "hub", "userco", "ntent", ".", "com", "/", "Ste", "ven", "Black", "/", "host", "s", "/", "master", "/\"_", "+_", "os_", "._", "path_", "._", "join_", "(_", "settings_", "[_", "\"", "output", "subfolder", "\"_", "]_", ",_", "\"\"_", ")_", "+_", "\"", "host", "s", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "Data_", "(_", "final", "File_", ",_", "\"#", " ", "Project", " ", "home", " ", "page", ":", " ", "https", "://", "git", "hub", ".", "com", "/", "Ste", "ven", "Black", "/", "host", "s", "\\\\", "n", "#", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "Data_", "(_", "final", "File_", ",_", "\"#", " ", "==============", "==============", "==============", "==============", "=======", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "Data_", "(_", "final", "File_", ",_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "settings_", "[_", "\"", "skips", "tati", "chos", "ts", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "write", "Data_", "(_", "final", "File_", ",_", "\"", "127", ".0", ".0", ".1", " ", "local", "host", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "Data_", "(_", "final", "File_", ",_", "\"", "127", ".0", ".0", ".1", " ", "local", "host", ".", "locald", "omain", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "Data_", "(_", "final", "File_", ",_", "\"", "127", ".0", ".0", ".1", " ", "local", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "Data_", "(_", "final", "File_", ",_", "\"", "255.", "255.", "255.", "255", " ", "broadcast", "host", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "Data_", "(_", "final", "File_", ",_", "\":", ":", "1", " ", "local", "host", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "Data_", "(_", "final", "File_", ",_", "\"", "fe", "80", "::", "1", "%", "lo", "0", " ", "local", "host", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "platform_", "._", "system_", "(_", ")_", "==_", "\"", "Lin", "ux", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "write", "Data_", "(_", "final", "File_", ",_", "\"", "127", ".0", ".1", ".1", " ", "\"_", "+_", "socket_", "._", "gethostname_", "(_", ")_", "+_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "write", "Data_", "(_", "final", "File_", ",_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "preamble_", "=_", "os_", "._", "path_", "._", "join_", "(_", "BASED", "IR", "\\u", "PATH_", ",_", "\"", "myh", "ost", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "preamble_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "preamble_", ",_", "\"", "r", "\"_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "write", "Data_", "(_", "final", "File_", ",_", "f_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "final", "File_", "._", "write_", "(_", "file", "Contents_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update", "Read", "me", "Data_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "extensi", "ons", "Key_", "=_", "\"", "base", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "host", "s", "Location_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "settings_", "[_", "\"", "extensi", "ons", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "extensi", "ons", "Key_", "=_", "\"-\"_", "._", "join_", "(_", "settings_", "[_", "\"", "extensi", "ons", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "generat", "ion", "Data_", "=_", "{_", "\"", "location", "\"_", ":_", "os_", "._", "path_", "._", "join_", "(_", "settings_", "[_", "\"", "output", "subfolder", "\"_", "]_", ",_", "\"\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "entri", "es", "\"_", ":_", "settings_", "[_", "\"", "number", "of", "rule", "s", "\"_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "settings_", "[_", "\"", "readme", "data", "\"_", "]_", "[_", "extensi", "ons", "Key_", "]_", "=_", "generat", "ion", "Data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "settings_", "[_", "\"", "readme", "datafile", "name", "\"_", "]_", ",_", "\"", "w", "\"_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "json_", "._", "dump_", "(_", "settings_", "[_", "\"", "readme", "data", "\"_", "]_", ",_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "move", "Host", "s", "File", "Int", "o", "Place_", "(_", "final", "File_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "os_", "._", "name_", "==_", "\"", "posix", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dns", "Cache", "Found_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "Movi", "ng", " ", "the", " ", "file", " ", "require", "s", " ", "administrati", "ve", " ", "privilege", "s", ".", " ", "\"_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "You", " ", "mig", "ht", " ", "need", " ", "to", " ", "enter", " ", "your", " ", "password", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "subprocess_", "._", "call_", "(_", "[_", "\"/", "usr", "/", "bin", "/", "sudo", "\"_", ",_", "\"", "cp", "\"_", ",_", "os_", "._", "path_", "._", "abspath_", "(_", "final", "File_", "._", "name_", ")_", ",_", "\"/", "etc", "/", "host", "s", "\"_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print", "Failure_", "(_", "\"", "Movi", "ng", " ", "the", " ", "file", " ", "fail", "ed", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "\"", "Flu", "shing", " ", "the", " ", "DNS", " ", "Cache", " ", "to", " ", "utiliz", "e", " ", "new", " ", "host", "s", " ", "file", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "platform_", "._", "system_", "(_", ")_", "==_", "\"", "Dar", "win", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dns", "Cache", "Found_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "subprocess_", "._", "call_", "(_", "[_", "\"/", "usr", "/", "bin", "/", "sudo", "\"_", ",_", "\"", "kill", "all", "\"_", ",_", "\"-", "HU", "P", "\"_", ",_", "\"", "m", "DNS", "Responde", "r", "\"_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print", "Failure_", "(_", "\"", "Flu", "shing", " ", "the", " ", "DNS", " ", "Cache", " ", "fail", "ed", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "\"/", "etc", "/", "rc", ".", "d", "/", "init", ".", "d", "/", "nsc", "d", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dns", "Cache", "Found_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "subprocess_", "._", "call_", "(_", "[_", "\"/", "usr", "/", "bin", "/", "sudo", "\"_", ",_", "\"/", "etc", "/", "rc", ".", "d", "/", "init", ".", "d", "/", "nsc", "d", "\"_", ",_", "\"", "restart", "\"_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print", "Failure_", "(_", "\"", "Flu", "shing", " ", "the", " ", "DNS", " ", "Cache", " ", "fail", "ed", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print", "Success_", "(_", "\"", "Flu", "shing", " ", "DNS", " ", "by", " ", "restart", "ing", " ", "nsc", "d", " ", "succe", "eded", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "\"/", "usr", "/", "lib", "/", "system", "d", "/", "system", "/", "Network", "Manager", ".", "service", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dns", "Cache", "Found_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "subprocess_", "._", "call_", "(_", "[_", "\"/", "usr", "/", "bin", "/", "sudo", "\"_", ",_", "\"/", "usr", "/", "bin", "/", "system", "ctl", "\"_", ",_", "\"", "restart", "\"_", ",_", "\"", "Network", "Manager", ".", "service", "\"_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print", "Failure_", "(_", "\"", "Flu", "shing", " ", "the", " ", "DNS", " ", "Cache", " ", "fail", "ed", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print", "Success_", "(_", "\"", "Flu", "shing", " ", "DNS", " ", "by", " ", "restart", "ing", " ", "Network", "Manager", " ", "succe", "eded", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "\"/", "usr", "/", "lib", "/", "system", "d", "/", "system", "/", "wic", "d", ".", "service", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dns", "Cache", "Found_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "subprocess_", "._", "call_", "(_", "[_", "\"/", "usr", "/", "bin", "/", "sudo", "\"_", ",_", "\"/", "usr", "/", "bin", "/", "system", "ctl", "\"_", ",_", "\"", "restart", "\"_", ",_", "\"", "wic", "d", ".", "service", "\"_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print", "Failure_", "(_", "\"", "Flu", "shing", " ", "the", " ", "DNS", " ", "Cache", " ", "fail", "ed", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print", "Success_", "(_", "\"", "Flu", "shing", " ", "DNS", " ", "by", " ", "restart", "ing", " ", "wic", "d", " ", "succe", "eded", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "\"/", "usr", "/", "lib", "/", "system", "d", "/", "system", "/", "dnsm", "asq", ".", "service", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dns", "Cache", "Found_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "subprocess_", "._", "call_", "(_", "[_", "\"/", "usr", "/", "bin", "/", "sudo", "\"_", ",_", "\"/", "usr", "/", "bin", "/", "system", "ctl", "\"_", ",_", "\"", "restart", "\"_", ",_", "\"", "dnsm", "asq", ".", "service", "\"_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print", "Failure_", "(_", "\"", "Flu", "shing", " ", "the", " ", "DNS", " ", "Cache", " ", "fail", "ed", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print", "Success_", "(_", "\"", "Flu", "shing", " ", "DNS", " ", "by", " ", "restart", "ing", " ", "dnsm", "asq", " ", "succe", "eded", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "\"/", "usr", "/", "lib", "/", "system", "d", "/", "system", "/", "networking", ".", "service", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dns", "Cache", "Found_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "subprocess_", "._", "call_", "(_", "[_", "\"/", "usr", "/", "bin", "/", "sudo", "\"_", ",_", "\"/", "usr", "/", "bin", "/", "system", "ctl", "\"_", ",_", "\"", "restart", "\"_", ",_", "\"", "networking", ".", "service", "\"_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print", "Failure_", "(_", "\"", "Flu", "shing", " ", "the", " ", "DNS", " ", "Cache", " ", "fail", "ed", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print", "Success_", "(_", "\"", "Flu", "shing", " ", "DNS", " ", "by", " ", "restart", "ing", " ", "networking", ".", "service", " ", "succe", "eded", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "dns", "Cache", "Found_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print", "Failure_", "(_", "\"", "Una", "ble", " ", "to", " ", "dete", "rmin", "e", " ", "DNS", " ", "manage", "ment", " ", "tool", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "os_", "._", "name_", "==_", "\"", "nt", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Automat", "ical", "ly", " ", "movin", "g", " ", "the", " ", "host", "s", " ", "file", " ", "in", " ", "place", " ", "is", " ", "not", " ", "ye", "t", " ", "support", "ed", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "Ple", "ase", " ", "move", " ", "the", " ", "generat", "ed", " ", "file", " ", "to", " ", "%", "System", "Roo", "t", "%\\", "\\", "system", "32", "\\\\", "driver", "s", "\\\\", "etc", "\\\\", "host", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "remove", "Old", "Host", "s", "File_", "(_", ")_", ":_", "#", " ", "hot", "fix", " ", "sinc", "e", " ", "mer", "ging", " ", "with", " ", "an", " ", "alr", "ead", "y", " ", "exist", "ing", " ", "host", "s", " ", "file", " ", "leads", " ", "to", " ", "arte", "fact", "s", " ", "and", " ", "duplicates_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old", "File", "Path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "BASED", "IR", "\\u", "PATH_", ",_", "\"", "host", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "open_", "(_", "old", "File", "Path_", ",_", "\"", "a", "\"_", ")_", "._", "close_", "(_", ")_", "#", " ", "create", " ", "if", " ", "alr", "ead", "y", " ", "remove", "d", ",", " ", "so", " ", "remove", " ", "won", "t", " ", "raise", " ", "an", " ", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "settings_", "[_", "\"", "backup", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "backup", "File", "Path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "BASED", "IR", "\\u", "PATH_", ",_", "\"", "host", "s", "-{}", "\"_", "._", "format_", "(_", "time_", "._", "strftime_", "(_", "\"%", "Y", "-%", "m", "-%", "d", "-%", "H", "-%", "M", "-%", "S", "\"_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shutil_", "._", "copy_", "(_", "old", "File", "Path_", ",_", "backup", "File", "Path_", ")_", "#", " ", "make", " ", "a", " ", "backup", " ", "copy", ",", " ", "marking", " ", "the", " ", "date", " ", "in", " ", "whi", "ch", " ", "the", " ", "list", " ", "was", " ", "updated_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "os_", "._", "remove_", "(_", "old", "File", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "open_", "(_", "old", "File", "Path_", ",_", "\"", "a", "\"_", ")_", "._", "close_", "(_", ")_", "#", " ", "create", " ", "new", " ", "empty", " ", "host", "sfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "query", "\\u", "ye", "s", "\\u", "no_", "(_", "question_", ",_", "default_", "=_", "\"", "ye", "s", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "As", "k", " ", "a", " ", "ye", "s", "/", "no", " ", "question", " ", "via", " ", "raw", "\\u", "input", "()", " ", "and", " ", "return", " ", "thei", "r", " ", "answer", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"", "question", "\"", " ", "is", " ", "a", " ", "string", " ", "tha", "t", " ", "is", " ", "presente", "d", " ", "to", " ", "the", " ", "user", ".", "\\", "10", ";", " ", " ", " ", " ", "\"", "default", "\"", " ", "is", " ", "the", " ", "presu", "med", " ", "answer", " ", "if", " ", "the", " ", "user", " ", "just", " ", "hits", " ", "<", "Enter", ">.", "\\", "10", ";", " ", " ", " ", " ", "It", " ", "must", " ", "be", " ", "\"", "ye", "s", "\"", " ", "(", "the", " ", "default", "),", " ", "\"", "no", "\"", " ", "or", " ", "Non", "e", " ", "(", "meaning", "\\", "10", ";", " ", " ", " ", " ", "an", " ", "answer", " ", "is", " ", "require", "d", " ", "of", " ", "the", " ", "user", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "\"", "answer", "\"", " ", "return", " ", "value", " ", "is", " ", "one", " ", "of", " ", "\"", "ye", "s", "\"", " ", "or", " ", "\"", "no", "\".\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "valid_", "=_", "{_", "\"", "ye", "s", "\"_", ":_", "\"", "ye", "s", "\"_", ",_", "\"", "y", "\"_", ":_", "\"", "ye", "s", "\"_", ",_", "\"", "ye", "\"_", ":_", "\"", "ye", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "no", "\"_", ":_", "\"", "no", "\"_", ",_", "\"", "n", "\"_", ":_", "\"", "no", "\"_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "default_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prompt_", "=_", "\"", " ", "[", "y", "/", "n", "]", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "default_", "==_", "\"", "ye", "s", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prompt_", "=_", "\"", " ", "[", "Y", "/", "n", "]", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "default_", "==_", "\"", "no", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prompt_", "=_", "\"", " ", "[", "y", "/", "N", "]", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "invalid", " ", "default", " ", "answer", ":", " ", "'%", "s", "'\"_", "%_", "default_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stdout_", "._", "write_", "(_", "colorize_", "(_", "question_", ",_", "colors_", "._", "PROMPT", "_", ")_", "+_", "prompt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Change", "d", " ", "to", " ", "be", " ", "cross", "-", "python_", "\\u\\u\\uNL\\u\\u\\u_", "choice_", "=_", "my", "Input_", "(_", ")_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "default_", "is_", "not_", "None_", "and_", "choice_", "==_", "\"\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "choice_", "in_", "valid_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "valid_", "[_", "choice_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print", "Failure_", "(_", "\"", "Ple", "ase", " ", "respond", " ", "with", " ", "'", "ye", "s", "'", " ", "or", " ", "'", "no", "'", " ", "\"_", "\"(", "or", " ", "'", "y", "'", " ", "or", " ", "'", "n", "')", ".\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "Valid", "Doma", "in", "Format_", "(_", "domain_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "domain_", "==_", "\"\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "You", " ", "did", "n", "'", "t", " ", "enter", " ", "a", " ", "domain", ".", " ", "Tr", "y", " ", "again", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "domain", "Regex_", "=_", "re_", "._", "compile_", "(_", "\"", "www", "\\\\", "d", "{", "0", ",", "3", "}[", ".]", "|", "https", "?\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "domain", "Regex_", "._", "match_", "(_", "domain_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "The", " ", "domain", " ", "\"_", "+_", "domain_", "+_", "\"", " ", "is", " ", "not", " ", "valid", ".", " ", "\"_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Do", " ", "not", " ", "include", " ", "www", ".", "domain", ".", "com", " ", "or", " ", "http", "(", "s", "):", "//", "domain", ".", "com", ".", " ", "Tr", "y", " ", "again", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "colors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "PROMPT", "_", "=_", "\"\\\\", "033", "[", "9", "4", "m", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SUCCESS_", "=_", "\"\\\\", "033", "[", "9", "2m", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FAIL_", "=_", "\"\\\\", "033", "[", "9", "1", "m", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ENDC_", "=_", "\"\\\\", "033", "[", "0", "m", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "colorize_", "(_", "text_", ",_", "color_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "color_", "+_", "text_", "+_", "colors_", "._", "ENDC_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "print", "Success_", "(_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "colorize_", "(_", "text_", ",_", "colors_", "._", "SUCCESS_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "print", "Failure_", "(_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "colorize_", "(_", "text_", ",_", "colors_", "._", "FAIL_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
numba/numba/numba/cuda/tests/cudadrv/test_cuda_memory.py
[ { "content": " def test_c_contiguous_array(self):\n ary = numpy.arange(100)\n arysz = ary.dtype.itemsize * ary.size\n s, e = driver.host_memory_extents(ary)\n self.assertTrue(ary.ctypes.data == s)\n self.assertTrue(arysz == driver.host_memory_size(ary))", "metadata": "root.TestMVExtent.test_c_contiguous_array", "header": "['class', 'TestMVExtent', '(', 'CUDATestCase', ')', ':', '___EOS___']", "index": 89 }, { "content": " def test_f_contiguous_array(self):\n ary = numpy.asfortranarray(numpy.arange(100).reshape(2, 50))\n arysz = ary.dtype.itemsize * numpy.prod(ary.shape)\n s, e = driver.host_memory_extents(ary)\n self.assertTrue(ary.ctypes.data == s)\n self.assertTrue(arysz == driver.host_memory_size(ary))", "metadata": "root.TestMVExtent.test_f_contiguous_array", "header": "['class', 'TestMVExtent', '(', 'CUDATestCase', ')', ':', '___EOS___']", "index": 96 }, { "content": " def test_single_element_array(self):\n ary = numpy.asarray(numpy.uint32(1234))\n arysz = ary.dtype.itemsize\n s, e = driver.host_memory_extents(ary)\n self.assertTrue(ary.ctypes.data == s)\n self.assertTrue(arysz == driver.host_memory_size(ary))", "metadata": "root.TestMVExtent.test_single_element_array", "header": "['class', 'TestMVExtent', '(', 'CUDATestCase', ')', ':', '___EOS___']", "index": 103 }, { "content": " def test_ctypes_struct(self):\n class mystruct(ctypes.Structure):\n _fields_ = [('x', ctypes.c_int), ('y', ctypes.c_int)]\n\n data = mystruct(x=123, y=432)\n sz = driver.host_memory_size(data)\n self.assertTrue(ctypes.sizeof(data) == sz)", "metadata": "root.TestMVExtent.test_ctypes_struct", "header": "['class', 'TestMVExtent', '(', 'CUDATestCase', ')', ':', '___EOS___']", "index": 110 }, { "content": " def test_ctypes_double(self):\n data = ctypes.c_double(1.234)\n sz = driver.host_memory_size(data)\n self.assertTrue(ctypes.sizeof(data) == sz)", "metadata": "root.TestMVExtent.test_ctypes_double", "header": "['class', 'TestMVExtent', '(', 'CUDATestCase', ')', ':', '___EOS___']", "index": 118 } ]
[ { "span": "self.assertTrue(ary.ctypes.data == s)", "start_line": 93, "start_column": 8, "end_line": 93, "end_column": 45 }, { "span": "self.assertTrue(arysz == driver.host_memory_size(ary))", "start_line": 94, "start_column": 8, "end_line": 94, "end_column": 62 }, { "span": "self.assertTrue(ary.ctypes.data == s)", "start_line": 100, "start_column": 8, "end_line": 100, "end_column": 45 }, { "span": "self.assertTrue(arysz == driver.host_memory_size(ary))", "start_line": 101, "start_column": 8, "end_line": 101, "end_column": 62 }, { "span": "self.assertTrue(ary.ctypes.data == s)", "start_line": 107, "start_column": 8, "end_line": 107, "end_column": 45 }, { "span": "self.assertTrue(arysz == driver.host_memory_size(ary))", "start_line": 108, "start_column": 8, "end_line": 108, "end_column": 62 }, { "span": "self.assertTrue(ctypes.sizeof(data) == sz)", "start_line": 116, "start_column": 8, "end_line": 116, "end_column": 50 }, { "span": "self.assertTrue(ctypes.sizeof(data) == sz)", "start_line": 121, "start_column": 8, "end_line": 121, "end_column": 50 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "MV", "Extent_", "(_", "CU", "DAT", "est", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "c\\u", "contiguous", "\\u", "array_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ary_", "=_", "numpy_", "._", "arange_", "(_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ary", "sz_", "=_", "ary_", "._", "dtype_", "._", "itemsize_", "*_", "ary_", "._", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", ",_", "e_", "=_", "driver_", "._", "host", "\\u", "memory", "\\u", "extents_", "(_", "ary_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ary_", "._", "ctypes_", "._", "data_", "==_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ary", "sz_", "==_", "driver_", "._", "host", "\\u", "memory", "\\u", "size_", "(_", "ary_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "MV", "Extent_", "(_", "CU", "DAT", "est", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "f", "\\u", "contiguous", "\\u", "array_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ary_", "=_", "numpy_", "._", "asf", "ort", "ran", "array_", "(_", "numpy_", "._", "arange_", "(_", "100_", ")_", "._", "reshape_", "(_", "2_", ",_", "50_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ary", "sz_", "=_", "ary_", "._", "dtype_", "._", "itemsize_", "*_", "numpy_", "._", "prod_", "(_", "ary_", "._", "shape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", ",_", "e_", "=_", "driver_", "._", "host", "\\u", "memory", "\\u", "extents_", "(_", "ary_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ary_", "._", "ctypes_", "._", "data_", "==_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ary", "sz_", "==_", "driver_", "._", "host", "\\u", "memory", "\\u", "size_", "(_", "ary_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "MV", "Extent_", "(_", "CU", "DAT", "est", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "single", "\\u", "element", "\\u", "array_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ary_", "=_", "numpy_", "._", "asarray_", "(_", "numpy_", "._", "uint32_", "(_", "1234_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ary", "sz_", "=_", "ary_", "._", "dtype_", "._", "itemsize_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", ",_", "e_", "=_", "driver_", "._", "host", "\\u", "memory", "\\u", "extents_", "(_", "ary_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ary_", "._", "ctypes_", "._", "data_", "==_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ary", "sz_", "==_", "driver_", "._", "host", "\\u", "memory", "\\u", "size_", "(_", "ary_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "MV", "Extent_", "(_", "CU", "DAT", "est", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "ctype", "s", "\\u", "struct_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "myst", "ruct", "_", "(_", "ctypes_", "._", "Structure_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "fields\\u_", "=_", "[_", "(_", "'", "x", "'_", ",_", "ctypes_", "._", "c\\u", "int_", ")_", ",_", "(_", "'", "y", "'_", ",_", "ctypes_", "._", "c\\u", "int_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "=_", "myst", "ruct", "_", "(_", "x_", "=_", "123_", ",_", "y_", "=_", "432", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sz_", "=_", "driver_", "._", "host", "\\u", "memory", "\\u", "size_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ctypes_", "._", "sizeof_", "(_", "data_", ")_", "==_", "sz_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "MV", "Extent_", "(_", "CU", "DAT", "est", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "ctype", "s", "\\u", "double_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "ctypes_", "._", "c\\u", "double_", "(_", "1.23", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sz_", "=_", "driver_", "._", "host", "\\u", "memory", "\\u", "size_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ctypes_", "._", "sizeof_", "(_", "data_", ")_", "==_", "sz_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Flask app is run in debug mode
peterhudec/authomatic/examples/flask/flask_authomatic/main.py
[ { "content": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated by Mark Steve Samson http://marksteve.com\n\"\"\"\n\nimport logging\n\nfrom authomatic.extras.flask import FlaskAuthomatic\nfrom authomatic.providers import oauth2\nfrom flask import Flask, jsonify\n\nlogger = logging.getLogger('authomatic.core')\nlogger.addHandler(logging.StreamHandler())\n\n\napp = Flask(__name__)\napp.config['SECRET_KEY'] = 'some random secret string'\n\nfa = FlaskAuthomatic(\n config={\n 'fb': {\n 'class_': oauth2.Facebook,\n 'consumer_key': '336906656437864',\n 'consumer_secret': '2924e6a3a736a99ed5c273532fb55c6b',\n 'scope': ['user_about_me', 'email'],\n },\n },\n secret=app.config['SECRET_KEY'],\n debug=True,\n)\n\n\n\n\nif __name__ == '__main__':\n app.run(debug=True)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "app.run(debug=True)", "start_line": 47, "start_column": 4, "end_line": 47, "end_column": 23 } ]
[]
1
false
[ "[CLS]_", "Flask_", "app_", "is_", "run_", "in_", "debug_", "mode_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Creat", "ed", " ", "by", " ", "Mark", " ", "Ste", "ve", " ", "Sam", "son", " ", "http", "://", "mark", "ste", "ve", ".", "com", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "auth", "oma", "tic_", "._", "extras_", "._", "flask_", "import_", "Fla", "sk", "Auth", "oma", "tic_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "auth", "oma", "tic_", "._", "providers_", "import_", "oauth2", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "flask_", "import_", "Flask_", ",_", "jsonify_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "'", "auth", "oma", "tic", ".", "core", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "add", "Handler_", "(_", "logging_", "._", "Stream", "Handler_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "app_", "=_", "Flask_", "(_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "._", "config_", "[_", "'", "SEC", "RET", "\\u", "KEY", "'_", "]_", "=_", "'", "some", " ", "random", " ", "secret", " ", "string", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fa_", "=_", "Fla", "sk", "Auth", "oma", "tic_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "config_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fb", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "class", "\\u'_", ":_", "oauth2", "_", "._", "Face", "book_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "consume", "r", "\\u", "key", "'_", ":_", "'", "336", "906", "656", "437", "864", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "consume", "r", "\\u", "secret", "'_", ":_", "'", "292", "4e", "6a", "3a", "736", "a9", "9e", "d5", "c2", "735", "32", "fb", "5", "5c", "6b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "scope", "'_", ":_", "[_", "'", "user", "\\u", "abo", "ut", "\\u", "me", "'_", ",_", "'", "email", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "secret_", "=_", "app_", "._", "config_", "[_", "'", "SEC", "RET", "\\u", "KEY", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "debug_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2 ]
Imprecise assert
AcademicsToday/py-academicstoday/academicstoday_project/teacher/tests/test_policy.py
[ { "content": " def test_policy_page_with_pdf_file(self):\n kwargs = {'HTTP_X_REQUESTED_WITH':'XMLHttpRequest'}\n client = self.get_logged_in_client()\n file_path = settings.MEDIA_ROOT + '/sample.pdf'\n with open(file_path, 'rb') as fp:\n self.assertTrue(fp is not None)\n response = client.post('/teacher/course/1/save_policy',{\n 'file': fp,\n }, **kwargs)\n self.assertEqual(response.status_code, 200)\n response = client.post('/teacher/course/1/policy')\n self.assertEqual(response.status_code, 200)\n self.assertIn(b'Comics Book Course',response.content)\n self.assertIn(b'ajax_delete_policy',response.content)\n self.assertIn(b'PDF RESULT',response.content)\n\n try:\n Policy.objects.get(policy_id=1).delete()\n except Policy.DoesNotExist:\n pass\n try:\n Policy.objects.get(policy_id=2).delete()\n except Policy.DoesNotExist:\n pass\n try:\n Policy.objects.get(policy_id=3).delete()\n except Policy.DoesNotExist:\n pass", "metadata": "root.PolicyTestCase.test_policy_page_with_pdf_file", "header": "['class', 'PolicyTestCase', '(', 'TestCase', ')', ':', '___EOS___']", "index": 101 }, { "content": " def test_save_policy(self):\n kwargs = {'HTTP_X_REQUESTED_WITH':'XMLHttpRequest'}\n client = self.get_logged_in_client()\n file_path = settings.MEDIA_ROOT + '/sample.pdf'\n with open(file_path, 'rb') as fp:\n self.assertTrue(fp is not None)\n response = client.post('/teacher/course/1/save_policy',{\n 'file': fp,\n }, **kwargs)\n self.assertEqual(response.status_code, 200)\n json_string = response.content.decode(encoding='UTF-8')\n array = json.loads(json_string)\n self.assertEqual(array['message'], 'saved')\n self.assertEqual(array['status'], 'success')\n \n try:\n Policy.objects.get(policy_id=1).delete()\n except Policy.DoesNotExist:\n pass\n try:\n Policy.objects.get(policy_id=2).delete()\n except Policy.DoesNotExist:\n pass\n try:\n Policy.objects.get(policy_id=3).delete()\n except Policy.DoesNotExist:\n pass", "metadata": "root.PolicyTestCase.test_save_policy", "header": "['class', 'PolicyTestCase', '(', 'TestCase', ')', ':', '___EOS___']", "index": 130 }, { "content": " def test_delete_policy_with_submission_and_correct_user(self):\n kwargs = {'HTTP_X_REQUESTED_WITH':'XMLHttpRequest'}\n client = self.get_logged_in_client()\n file_path = settings.MEDIA_ROOT + '/sample.pdf'\n with open(file_path, 'rb') as fp:\n self.assertTrue(fp is not None)\n response = client.post('/teacher/course/1/save_policy',{\n 'file': fp,\n }, **kwargs)\n self.assertEqual(response.status_code, 200)\n json_string = response.content.decode(encoding='UTF-8')\n array = json.loads(json_string)\n self.assertEqual(array['message'], 'saved')\n self.assertEqual(array['status'], 'success')\n \n response = client.post('/teacher/course/1/delete_policy',{\n 'policy_id': 1,\n }, **kwargs)\n self.assertEqual(response.status_code, 200)\n json_string = response.content.decode(encoding='UTF-8')\n array = json.loads(json_string)\n self.assertEqual(array['message'], 'deleted')\n self.assertEqual(array['status'], 'success')", "metadata": "root.PolicyTestCase.test_delete_policy_with_submission_and_correct_user", "header": "['class', 'PolicyTestCase', '(', 'TestCase', ')', ':', '___EOS___']", "index": 158 }, { "content": " def test_delete_policy_with_submission_and_correct_user(self):\n kwargs = {'HTTP_X_REQUESTED_WITH':'XMLHttpRequest'}\n client = self.get_logged_in_client()\n file_path = settings.MEDIA_ROOT + '/sample.pdf'\n with open(file_path, 'rb') as fp:\n self.assertTrue(fp is not None)\n response = client.post('/teacher/course/1/save_policy',{\n 'file': fp,\n }, **kwargs)\n self.assertEqual(response.status_code, 200)\n json_string = response.content.decode(encoding='UTF-8')\n array = json.loads(json_string)\n self.assertEqual(array['message'], 'saved')\n self.assertEqual(array['status'], 'success')\n \n client.logout()\n client = self.get_logged_in_trudy_client()\n response = client.post('/teacher/course/1/delete_policy',{\n 'policy_id': 1,\n }, **kwargs)\n self.assertEqual(response.status_code, 200)\n json_string = response.content.decode(encoding='UTF-8')\n array = json.loads(json_string)\n self.assertEqual(array['message'], 'unauthorized deletion')\n self.assertEqual(array['status'], 'failed')", "metadata": "root.PolicyTestCase.test_delete_policy_with_submission_and_correct_user", "header": "['class', 'PolicyTestCase', '(', 'TestCase', ')', ':', '___EOS___']", "index": 182 } ]
[ { "span": "self.assertTrue(fp is not None)", "start_line": 106, "start_column": 12, "end_line": 106, "end_column": 43 }, { "span": "self.assertTrue(fp is not None)", "start_line": 135, "start_column": 12, "end_line": 135, "end_column": 43 }, { "span": "self.assertTrue(fp is not None)", "start_line": 163, "start_column": 12, "end_line": 163, "end_column": 43 }, { "span": "self.assertTrue(fp is not None)", "start_line": 187, "start_column": 12, "end_line": 187, "end_column": 43 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Polic", "y", "Test", "Case_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "policy", "\\u", "page", "\\u", "with", "\\u", "pdf", "\\u", "file_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "=_", "{_", "'", "HTTP", "\\u", "X", "\\u", "REQUEST", "ED", "\\u", "WITH", "'_", ":_", "'", "XML", "Http", "Request", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "=_", "self_", "._", "get", "\\u", "logged", "\\u", "in", "\\u", "client_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "path_", "=_", "settings_", "._", "MEDIA", "\\u", "ROOT_", "+_", "'/", "sample", ".", "pdf", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "file", "\\u", "path_", ",_", "'", "rb", "'_", ")_", "as_", "fp_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "fp_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "client_", "._", "post_", "(_", "'/", "teacher", "/", "course", "/", "1", "/", "save", "\\u", "policy", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "file", "'_", ":_", "fp_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "response_", "=_", "client_", "._", "post_", "(_", "'/", "teacher", "/", "course", "/", "1", "/", "policy", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "b", "'", "Com", "ics", " ", "Boo", "k", " ", "Cour", "se", "'_", ",_", "response_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "b", "'", "aja", "x", "\\u", "delete", "\\u", "policy", "'_", ",_", "response_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "b", "'", "PD", "F", " ", "RESU", "LT", "'_", ",_", "response_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Policy_", "._", "objects_", "._", "get_", "(_", "policy", "\\u", "id_", "=_", "1_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Policy_", "._", "Do", "es", "Not", "Exist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Policy_", "._", "objects_", "._", "get_", "(_", "policy", "\\u", "id_", "=_", "2_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Policy_", "._", "Do", "es", "Not", "Exist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Policy_", "._", "objects_", "._", "get_", "(_", "policy", "\\u", "id_", "=_", "3_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Policy_", "._", "Do", "es", "Not", "Exist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Polic", "y", "Test", "Case_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "save", "\\u", "policy_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "=_", "{_", "'", "HTTP", "\\u", "X", "\\u", "REQUEST", "ED", "\\u", "WITH", "'_", ":_", "'", "XML", "Http", "Request", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "=_", "self_", "._", "get", "\\u", "logged", "\\u", "in", "\\u", "client_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "path_", "=_", "settings_", "._", "MEDIA", "\\u", "ROOT_", "+_", "'/", "sample", ".", "pdf", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "file", "\\u", "path_", ",_", "'", "rb", "'_", ")_", "as_", "fp_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "fp_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "client_", "._", "post_", "(_", "'/", "teacher", "/", "course", "/", "1", "/", "save", "\\u", "policy", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "file", "'_", ":_", "fp_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "string_", "=_", "response_", "._", "content_", "._", "decode_", "(_", "encoding_", "=_", "'", "UT", "F", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "array_", "=_", "json_", "._", "loads_", "(_", "json", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "array_", "[_", "'", "message", "'_", "]_", ",_", "'", "saved", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "array_", "[_", "'", "status", "'_", "]_", ",_", "'", "success", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Policy_", "._", "objects_", "._", "get_", "(_", "policy", "\\u", "id_", "=_", "1_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Policy_", "._", "Do", "es", "Not", "Exist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Policy_", "._", "objects_", "._", "get_", "(_", "policy", "\\u", "id_", "=_", "2_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Policy_", "._", "Do", "es", "Not", "Exist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Policy_", "._", "objects_", "._", "get_", "(_", "policy", "\\u", "id_", "=_", "3_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Policy_", "._", "Do", "es", "Not", "Exist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Polic", "y", "Test", "Case_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "delete", "\\u", "policy", "\\u", "with", "\\u", "subm", "ission", "\\u", "and", "\\u", "correct", "\\u", "user_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "=_", "{_", "'", "HTTP", "\\u", "X", "\\u", "REQUEST", "ED", "\\u", "WITH", "'_", ":_", "'", "XML", "Http", "Request", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "=_", "self_", "._", "get", "\\u", "logged", "\\u", "in", "\\u", "client_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "path_", "=_", "settings_", "._", "MEDIA", "\\u", "ROOT_", "+_", "'/", "sample", ".", "pdf", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "file", "\\u", "path_", ",_", "'", "rb", "'_", ")_", "as_", "fp_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "fp_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "client_", "._", "post_", "(_", "'/", "teacher", "/", "course", "/", "1", "/", "save", "\\u", "policy", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "file", "'_", ":_", "fp_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "string_", "=_", "response_", "._", "content_", "._", "decode_", "(_", "encoding_", "=_", "'", "UT", "F", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "array_", "=_", "json_", "._", "loads_", "(_", "json", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "array_", "[_", "'", "message", "'_", "]_", ",_", "'", "saved", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "array_", "[_", "'", "status", "'_", "]_", ",_", "'", "success", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "response_", "=_", "client_", "._", "post_", "(_", "'/", "teacher", "/", "course", "/", "1", "/", "delete", "\\u", "policy", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "policy", "\\u", "id", "'_", ":_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "string_", "=_", "response_", "._", "content_", "._", "decode_", "(_", "encoding_", "=_", "'", "UT", "F", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "array_", "=_", "json_", "._", "loads_", "(_", "json", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "array_", "[_", "'", "message", "'_", "]_", ",_", "'", "delete", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "array_", "[_", "'", "status", "'_", "]_", ",_", "'", "success", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Polic", "y", "Test", "Case_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "delete", "\\u", "policy", "\\u", "with", "\\u", "subm", "ission", "\\u", "and", "\\u", "correct", "\\u", "user_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "=_", "{_", "'", "HTTP", "\\u", "X", "\\u", "REQUEST", "ED", "\\u", "WITH", "'_", ":_", "'", "XML", "Http", "Request", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "=_", "self_", "._", "get", "\\u", "logged", "\\u", "in", "\\u", "client_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "path_", "=_", "settings_", "._", "MEDIA", "\\u", "ROOT_", "+_", "'/", "sample", ".", "pdf", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "file", "\\u", "path_", ",_", "'", "rb", "'_", ")_", "as_", "fp_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "fp_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "client_", "._", "post_", "(_", "'/", "teacher", "/", "course", "/", "1", "/", "save", "\\u", "policy", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "file", "'_", ":_", "fp_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "string_", "=_", "response_", "._", "content_", "._", "decode_", "(_", "encoding_", "=_", "'", "UT", "F", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "array_", "=_", "json_", "._", "loads_", "(_", "json", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "array_", "[_", "'", "message", "'_", "]_", ",_", "'", "saved", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "array_", "[_", "'", "status", "'_", "]_", ",_", "'", "success", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "client_", "._", "logout_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "=_", "self_", "._", "get", "\\u", "logged", "\\u", "in", "\\u", "tru", "dy", "\\u", "client_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "client_", "._", "post_", "(_", "'/", "teacher", "/", "course", "/", "1", "/", "delete", "\\u", "policy", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "policy", "\\u", "id", "'_", ":_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "string_", "=_", "response_", "._", "content_", "._", "decode_", "(_", "encoding_", "=_", "'", "UT", "F", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "array_", "=_", "json_", "._", "loads_", "(_", "json", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "array_", "[_", "'", "message", "'_", "]_", ",_", "'", "unauthorized", " ", "deletion", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "array_", "[_", "'", "status", "'_", "]_", ",_", "'", "fail", "ed", "'_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Illegal raise
open-cloud/xos/xos/synchronizers/monitoring_channel/steps/sync_sflowtenant.py
[ { "content": " def get_sflow_service(self, o):\n sflows = SFlowService.get_service_objects().filter(id=o.provider_service.id)\n if not sflows:\n raise \"No associated SFlow service\"\n\n return sflows[0]", "metadata": "root.SyncSFlowTenant.get_sflow_service", "header": "['class', 'SyncSFlowTenant', '(', 'SyncInstanceUsingAnsible', ')', ':', '___EOS___']", "index": 42 } ]
[ { "span": "raise \"No associated SFlow service\"", "start_line": 45, "start_column": 11, "end_line": 45, "end_column": 46 } ]
[]
1
true
[ "[CLS]_", "Il", "lega", "l_", "raise_", "[SEP]_", "class_", "Sync", "SF", "low", "Ten", "ant_", "(_", "Sync", "Insta", "nce", "Us", "ing", "Ans", "ible_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "sfl", "ow", "\\u", "service_", "(_", "self_", ",_", "o_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sfl", "ows_", "=_", "SF", "low", "Service_", "._", "get", "\\u", "service", "\\u", "objects_", "(_", ")_", "._", "filter_", "(_", "id_", "=_", "o_", "._", "provide", "r", "\\u", "service_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "sfl", "ows_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\"", "No", " ", "associate", "d", " ", "SF", "low", " ", "service", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "sfl", "ows_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
argoroots/Entu/app/main/db.py
[ { "content": "from tornado import locale\n\nfrom datetime import datetime\nfrom decimal import Decimal\nfrom operator import itemgetter\n\nimport dateutil\nimport hashlib\nimport logging\nimport math\nimport os\nimport random\nimport re\nimport string\nimport time\n\nfrom helper import *\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Entity():\n \"\"\"\n Entity class.\n\n \"\"\"\n __translation = None\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n # def formula_properties(self, entity_id):\n # sql = \"\"\"\n # SELECT *\n # FROM property p\n # WHERE p.entity_id = %s\n # AND p.value_formula is not null\n # AND p.is_deleted = 0\n # ORDER BY p.id\n # ;\"\"\" % entity_id\n # # logging.debug(sql)\n # return self.db_query(sql)\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.Entity", "header": "['module', '___EOS___']", "index": 19 }, { "content": " @property\n def __user_id(self):\n if not self.current_user:\n return None\n if not self.current_user.get('id'):\n return None\n return self.current_user.get('id')", "metadata": "root.Entity.__user_id", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 26 }, { "content": " @property\n def __language(self):\n return self.get_user_locale().code", "metadata": "root.Entity.__language", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 34 }, { "content": " def __get_system_translation(self, field, entity_definition_keyname='', property_definition_keyname=''):\n if not self.__translation:\n self.__translation = {}\n for t in self.db_query('SELECT field, value, IFNULL(entity_definition_keyname, \\'\\') AS entity_definition_keyname, IFNULL(property_definition_keyname, \\'\\') AS property_definition_keyname FROM translation WHERE language = %s OR language IS NULL ORDER BY language;', self.get_user_locale().code):\n self.__translation['%s|%s|%s' % (t.get('entity_definition_keyname'), t.get('property_definition_keyname'), t.get('field'))] = t.get('value')\n return self.__translation.get('%s|%s|%s' % (entity_definition_keyname, property_definition_keyname, field), None)", "metadata": "root.Entity.__get_system_translation", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 38 }, { "content": " def create_entity(self, entity_definition_keyname, parent_entity_id=None, ignore_user=False):\n \"\"\"\n Creates new Entity and returns its ID.\n\n \"\"\"\n\n if ignore_user == True:\n user_id = None\n else:\n if not self.__user_id:\n return\n user_id = self.__user_id\n\n # logging.debug('creating %s under entity %s' % (entity_definition_keyname, parent_entity_id))\n if not entity_definition_keyname:\n return\n\n # Create entity\n sql = \"\"\"\n INSERT INTO entity SET\n entity_definition_keyname = %s,\n created_by = %s,\n created = NOW();\n \"\"\"\n # logging.debug(sql)\n entity_id = self.db_execute_lastrowid(sql, entity_definition_keyname, user_id)\n\n if not parent_entity_id:\n return entity_id\n\n # Propagate sharing\n parent = self.db_get('SELECT sharing FROM entity WHERE id = %s LIMIT 1;', parent_entity_id)\n self.db_execute('UPDATE entity SET sharing = %s WHERE id = %s LIMIT 1;', parent.get('sharing'), entity_id)\n\n # Insert child relationship and/or default parent child relationship\n sql = \"\"\"\n INSERT INTO relationship (\n relationship_definition_keyname,\n entity_id,\n related_entity_id,\n created_by,\n created\n ) SELECT /* SQL_NO_CACHE */\n 'child',\n r.related_entity_id,\n %s,\n %s,\n NOW()\n FROM relationship AS r\n WHERE r.relationship_definition_keyname = 'default-parent'\n AND r.is_deleted = 0\n AND r.entity_definition_keyname = %s\n UNION SELECT\n 'child',\n %s,\n %s,\n %s,\n NOW();\n \"\"\"\n # logging.debug(sql)\n self.db_execute(sql, entity_id, user_id, entity_definition_keyname, parent_entity_id, entity_id, user_id)\n\n # Insert or update \"contains\" information\n for row in self.db_query(\"SELECT entity_id FROM relationship r WHERE r.is_deleted = 0 AND r.relationship_definition_keyname = 'child' AND r.related_entity_id = %s\" , entity_id):\n self.db_execute('INSERT INTO dag_entity SET entity_id = %s, related_entity_id = %s ON DUPLICATE KEY UPDATE distance=1;', row.get('entity_id'), entity_id)\n self.db_execute('INSERT INTO dag_entity SELECT de.entity_id, %s, de.distance+1 FROM dag_entity AS de WHERE de.related_entity_id = %s ON DUPLICATE KEY UPDATE distance = LEAST(dag_entity.distance, de.distance+1);', entity_id, row.get('entity_id'))\n\n # Copy user rights\n sql = \"\"\"\n INSERT INTO relationship (\n relationship_definition_keyname,\n entity_id,\n related_entity_id,\n created_by,\n created\n ) SELECT /* SQL_NO_CACHE */\n rr.relationship_definition_keyname,\n %s,\n rr.related_entity_id,\n %s,\n NOW()\n FROM relationship r\n LEFT JOIN relationship rr ON rr.entity_id = r.entity_id\n WHERE r.is_deleted = 0\n AND r.related_entity_id = %s\n AND r.relationship_definition_keyname = 'child'\n AND rr.is_deleted = 0\n AND rr.relationship_definition_keyname IN ('viewer', 'expander', 'editor', 'owner');\n \"\"\"\n # logging.debug(sql)\n self.db_execute(sql, entity_id, user_id, entity_id)\n\n # set creator to owner\n if user_id:\n self.set_rights(entity_id=entity_id, related_entity_id=user_id, right='owner')\n\n # Populate default values\n for default_value in self.db_query('SELECT keyname, defaultvalue FROM property_definition WHERE entity_definition_keyname = %s AND defaultvalue IS NOT null', entity_definition_keyname):\n self.set_property(entity_id=entity_id, property_definition_keyname=default_value.get('keyname'), value=default_value.get('defaultvalue'))\n\n # Propagate properties\n sql = \"\"\"\n INSERT INTO property (\n entity_id,\n property_definition_keyname,\n language,\n value_string,\n value_text,\n value_integer,\n value_decimal,\n value_boolean,\n value_datetime,\n value_entity,\n value_reference,\n value_file,\n value_counter,\n created_by,\n created\n ) SELECT /* SQL_NO_CACHE */\n %s,\n r.related_property_definition_keyname,\n p.language,\n p.value_string,\n p.value_text,\n p.value_integer,\n p.value_decimal,\n p.value_boolean,\n p.value_datetime,\n p.value_entity,\n p.value_reference,\n p.value_file,\n p.value_counter,\n %s,\n NOW()\n FROM\n relationship AS r,\n property AS p\n WHERE p.property_definition_keyname = r.property_definition_keyname\n AND p.entity_id = %s\n AND r.relationship_definition_keyname = 'propagated-property'\n AND p.is_deleted = 0\n AND r.is_deleted = 0\n ;\n \"\"\"\n # logging.debug(sql)\n self.db_execute(sql, entity_id, user_id, parent_entity_id)\n\n self.db_execute(\"\"\"\n INSERT INTO property (property_definition_keyname, entity_id, value_display, value_datetime, created_by, created)\n SELECT keyname, %s, NOW(), NOW(), %s, NOW()\n FROM property_definition\n WHERE dataproperty = 'entu-created-at'\n AND entity_definition_keyname = %s;\n \"\"\", entity_id, user_id, entity_definition_keyname)\n\n if user_id:\n self.db_execute(\"\"\"\n INSERT INTO property (property_definition_keyname, entity_id, value_reference, created_by, created)\n SELECT keyname, %s, %s, %s, NOW()\n FROM property_definition\n WHERE dataproperty = 'entu-created-by'\n AND entity_definition_keyname = %s;\n \"\"\", entity_id, user_id, user_id, entity_definition_keyname)\n\n return entity_id", "metadata": "root.Entity.create_entity", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 45 }, { "content": " def duplicate_entity(self, entity_id, copies=1, skip_property_definition_keyname=None):\n if not entity_id:\n return\n\n if skip_property_definition_keyname:\n if type(skip_property_definition_keyname) is not list:\n skip_property_definition_keyname = [skip_property_definition_keyname]\n properties_sql = 'AND property_definition_keyname NOT IN (%s)' % ','.join(['\\'%s\\'' % x for x in map(str, skip_property_definition_keyname)])\n else:\n properties_sql = ''\n\n for x in range(int(copies)):\n new_entity_id = self.db_execute_lastrowid(\"\"\"\n INSERT INTO entity (\n entity_definition_keyname,\n sharing,\n created,\n created_by\n ) SELECT\n entity_definition_keyname,\n sharing,\n NOW(),\n %s\n FROM entity\n WHERE id = %s;\n \"\"\" , self.__user_id, entity_id)\n\n self.db_execute(\"\"\"\n INSERT INTO property (\n property_definition_keyname,\n entity_id,\n ordinal,\n language,\n value_display,\n value_formula,\n value_string,\n value_text,\n value_integer,\n value_decimal,\n value_boolean,\n value_datetime,\n value_entity,\n value_reference,\n value_file,\n value_counter,\n created,\n created_by\n ) SELECT\n property_definition_keyname,\n %s,\n ordinal,\n language,\n value_display,\n value_formula,\n value_string,\n value_text,\n value_integer,\n value_decimal,\n value_boolean,\n value_datetime,\n value_entity,\n value_reference,\n value_file,\n value_counter,\n NOW(),\n %s\n FROM property\n WHERE entity_id = %s\n %s\n AND is_deleted = 0;\n \"\"\" % (new_entity_id, self.__user_id, entity_id, properties_sql))\n\n self.db_execute(\"\"\"\n INSERT INTO relationship (\n relationship_definition_keyname,\n entity_id,\n related_entity_id,\n created,\n created_by\n ) SELECT\n relationship_definition_keyname,\n %s,\n related_entity_id,\n NOW(),\n %s\n FROM relationship\n WHERE entity_id = %s\n AND relationship_definition_keyname IN ('viewer', 'expander', 'editor', 'owner')\n AND is_deleted = 0;\n \"\"\", new_entity_id, self.__user_id, entity_id)\n\n self.db_execute(\"\"\"\n INSERT INTO relationship (\n relationship_definition_keyname,\n entity_id,\n related_entity_id,\n created,\n created_by\n ) SELECT\n relationship_definition_keyname,\n entity_id,\n %s,\n NOW(),\n %s\n FROM relationship\n WHERE related_entity_id = %s\n AND relationship_definition_keyname IN ('child', 'viewer', 'expander', 'editor', 'owner')\n AND is_deleted = 0;\n \"\"\", new_entity_id, self.__user_id, entity_id)\n\n self.db_execute(\"\"\"\n INSERT INTO property (property_definition_keyname, entity_id, value_display, value_datetime, created_by, created)\n SELECT keyname, %s, NOW(), NOW(), %s, NOW()\n FROM property_definition\n WHERE dataproperty = 'entu-created-at'\n AND entity_definition_keyname = (SELECT entity_definition_keyname FROM entity WHERE id = %s LIMIT 1);\n \"\"\", new_entity_id, self.__user_id, new_entity_id)\n\n self.db_execute(\"\"\"\n INSERT INTO property (property_definition_keyname, entity_id, value_reference, created_by, created)\n SELECT keyname, %s, %s, %s, NOW()\n FROM property_definition\n WHERE dataproperty = 'entu-created-by'\n AND entity_definition_keyname = (SELECT entity_definition_keyname FROM entity WHERE id = %s LIMIT 1);\n \"\"\", new_entity_id, self.__user_id, self.__user_id, new_entity_id)", "metadata": "root.Entity.duplicate_entity", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 211 }, { "content": " def delete_entity(self, entity_id):\n if not self.db_get(\"\"\"\n SELECT entity_id\n FROM relationship\n WHERE relationship_definition_keyname IN ('owner')\n AND entity_id = %s\n AND related_entity_id = %s\n AND is_deleted = 0;\n \"\"\",\n entity_id,\n self.__user_id\n ):\n return\n\n for child_id in self.get_relatives(ids_only=True, entity_id=entity_id, relationship_definition_keyname='child'):\n self.delete_entity(child_id)\n\n self.db_execute('UPDATE entity SET deleted = NOW(), is_deleted = 1, deleted_by = %s WHERE id = %s;', self.__user_id, entity_id)\n\n # remove \"contains\" information\n self.db_execute('DELETE FROM dag_entity WHERE entity_id = %s OR related_entity_id = %s;', entity_id, entity_id)\n\n return True", "metadata": "root.Entity.delete_entity", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 337 }, { "content": " def set_property(self, entity_id=None, relationship_id=None, property_definition_keyname=None, value=None, old_property_id=None, uploaded_file=None, ignore_user=False):\n \"\"\"\n Saves property value. Creates new one if old_property_id = None. Returns new_property_id.\n\n \"\"\"\n if not entity_id:\n return\n\n if ignore_user == True:\n user_id = None\n else:\n if not self.__user_id:\n return\n user_id = self.__user_id\n\n # property_definition_keyname is preferred because it could change for existing property\n if old_property_id:\n definition = self.db_get('SELECT pd.keyname, pd.datatype, pd.formula FROM property p, property_definition pd WHERE pd.keyname = p.property_definition_keyname AND p.id = %s LIMIT 1;', old_property_id)\n elif property_definition_keyname:\n definition = self.db_get('SELECT keyname, datatype, formula FROM property_definition WHERE keyname = %s LIMIT 1;', property_definition_keyname)\n else:\n return\n\n if not definition:\n return\n\n if old_property_id:\n self.db_execute('UPDATE property SET deleted = NOW(), is_deleted = 1, deleted_by = %s WHERE id = %s;', user_id, old_property_id)\n self.db_execute('UPDATE entity SET changed = NOW(), changed_by = %s WHERE id = %s;', user_id, entity_id)\n\n if self.db_get(\"\"\"\n SELECT property.id\n FROM property, property_definition\n WHERE property_definition.keyname = property.property_definition_keyname\n AND property.entity_id = %s\n AND property_definition.dataproperty = 'entu-changed-at'\n LIMIT 1;\n \"\"\", entity_id):\n self.db_execute(\"\"\"\n UPDATE property, property_definition\n SET property.value_display = NOW(), property.value_datetime = NOW(), property.created_by = %s, property.created = NOW()\n WHERE property_definition.keyname = property.property_definition_keyname\n AND property.entity_id = %s\n AND property_definition.dataproperty = 'entu-changed-at';\n \"\"\", user_id, entity_id)\n else:\n self.db_execute(\"\"\"\n INSERT INTO property (property_definition_keyname, entity_id, value_display, value_datetime, created_by, created)\n SELECT keyname, %s, NOW(), NOW(), %s, NOW()\n FROM property_definition\n WHERE dataproperty = 'entu-changed-at'\n AND entity_definition_keyname = (SELECT entity_definition_keyname FROM entity WHERE id = %s LIMIT 1);\n \"\"\", entity_id, user_id, entity_id)\n\n if user_id:\n if self.db_get(\"\"\"\n SELECT property.id\n FROM property, property_definition\n WHERE property_definition.keyname = property.property_definition_keyname\n AND property.entity_id = %s\n AND property_definition.dataproperty = 'entu-changed-by'\n LIMIT 1;\n \"\"\", entity_id):\n self.db_execute(\"\"\"\n UPDATE property, property_definition\n SET property.value_display = NULL, property.value_reference = %s, property.created_by = %s, property.created = NOW()\n WHERE property_definition.keyname = property.property_definition_keyname\n AND property.entity_id = %s\n AND property_definition.dataproperty = 'entu-changed-by';\n \"\"\", user_id, user_id, entity_id)\n else:\n self.db_execute(\"\"\"\n INSERT INTO property (property_definition_keyname, entity_id, value_reference, created_by, created)\n SELECT keyname, %s, %s, %s, NOW()\n FROM property_definition\n WHERE dataproperty = 'entu-changed-by'\n AND entity_definition_keyname = (SELECT entity_definition_keyname FROM entity WHERE id = %s LIMIT 1);\n \"\"\", entity_id, user_id, user_id, entity_id)\n\n # If no value, then property is deleted, return\n if not value:\n self.set_mongodb_entity(entity_id)\n return\n\n value_display = None\n\n if definition.get('formula') == 1:\n field = 'value_formula'\n elif definition.get('datatype') == 'text':\n field = 'value_text'\n value_display = '%s' % value\n value_display = value_display[:500]\n elif definition.get('datatype') == 'integer':\n field = 'value_integer'\n value_display = '%s' % value\n elif definition.get('datatype') == 'decimal':\n field = 'value_decimal'\n value = value.replace(',', '.')\n value = float(re.sub(r'[^\\.0-9:]', '', value))\n value_display = round(value, 2)\n elif definition.get('datatype') == 'date':\n field = 'value_datetime'\n value_display = '%s' % value\n elif definition.get('datatype') == 'datetime':\n field = 'value_datetime'\n value_display = '%s' % value\n elif definition.get('datatype') == 'reference':\n field = 'value_reference'\n r = self.__get_properties(entity_id=value)\n if r:\n value_display = self.__get_properties(entity_id=value)[0]['displayname']\n elif definition.get('datatype') == 'file':\n uploaded_file = value\n field = 'value_file'\n value_display = uploaded_file['filename'][:500]\n\n if uploaded_file.get('url'):\n value = self.db_execute_lastrowid('INSERT INTO file SET url = %s, filename = %s, created_by = %s, created = NOW();', uploaded_file.get('url', ''), uploaded_file.get('filename', ''), user_id)\n elif uploaded_file.get('s3key'):\n value = self.db_execute_lastrowid('INSERT INTO file SET s3_key = %s, filename = %s, filesize = %s, created_by = %s, created = NOW();', uploaded_file.get('s3key', ''), uploaded_file.get('filename', ''), uploaded_file.get('filesize', ''), user_id)\n else:\n md5 = hashlib.md5(uploaded_file.get('body')).hexdigest()\n directory = os.path.join('/', 'entu', 'files', self.app_settings('database-name'), md5[0])\n filename = os.path.join(directory, md5)\n\n if not os.path.exists(directory):\n os.makedirs(directory)\n f = open(filename, 'w')\n f.write(uploaded_file.get('body', ''))\n f.close()\n\n value = self.db_execute_lastrowid('INSERT INTO file SET md5 = %s, filename = %s, filesize = %s, created_by = %s, created = NOW();', md5, uploaded_file.get('filename', ''), len(uploaded_file.get('body', '')), user_id)\n\n elif definition.get('datatype') == 'boolean':\n field = 'value_boolean'\n value = 1 if value.lower() == 'true' else 0\n value_display = '%s' % bool(value)\n elif definition.get('datatype') == 'counter':\n field = 'value_counter'\n value_display = '%s' % value\n else:\n field = 'value_string'\n value = value[:500]\n value_display = '%s' % value\n\n new_property_id = self.db_execute_lastrowid(\"\"\"\n INSERT INTO property SET\n entity_id = %%s,\n property_definition_keyname = %%s,\n %s = %%s,\n value_display = %%s,\n created = NOW(),\n created_by = %%s;\n \"\"\" % field,\n entity_id,\n definition.get('keyname'),\n value,\n value_display,\n user_id\n )\n\n if definition.get('datatype') == 'file' and uploaded_file.get('s3key'):\n self.db_execute('UPDATE file SET s3_key = CONCAT(s3_key, \\'/\\', %s) WHERE id = %s LIMIT 1;', new_property_id, value)\n\n self.db_execute('UPDATE entity SET changed = NOW(), changed_by = %s WHERE id = %s;', user_id, entity_id)\n\n self.set_mongodb_entity(entity_id)\n\n return new_property_id", "metadata": "root.Entity.set_property", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 361 }, { "content": " def set_mongodb_entity(self, entity_id):\n sql = \"\"\"\n SELECT\n REPLACE(REPLACE(e.entity_definition_keyname, '_', '-'), '.', '-') AS entity_definition,\n e.id AS entity_id,\n e.sharing AS entity_sharing,\n e.created AS entity_created,\n IF(CAST(e.created_by AS UNSIGNED) > 0, CAST(e.created_by AS UNSIGNED), NULL) AS entity_created_by,\n e.changed AS entity_changed,\n IF(CAST(e.changed_by AS UNSIGNED) > 0, CAST(e.changed_by AS UNSIGNED), NULL) AS entity_changed_by,\n e.deleted AS entity_deleted,\n IF(CAST(e.deleted_by AS UNSIGNED) > 0, CAST(e.deleted_by AS UNSIGNED), NULL) AS entity_deleted_by,\n e.is_deleted AS entity_is_deleted,\n e.old_id AS entity_old_id\n FROM\n entity AS e\n WHERE e.id = %s\n LIMIT 1;\n \"\"\"\n\n r = self.db_get(sql, entity_id)\n\n mysql_id = r.get('entity_id')\n\n e = {}\n e['_mid'] = mysql_id\n e['_definition'] = r.get('entity_definition')\n e['_sharing'] = r.get('entity_sharing')\n\n if r.get('entity_created'):\n e.setdefault('_created', {})['at'] = r.get('entity_created')\n if r.get('entity_created_by'):\n e.setdefault('_created', {})['by'] = r.get('entity_created_by')\n if e.get('_created'):\n e['_created']['type'] = 'action'\n e['_created'] = [e.get('_created')]\n\n if r.get('entity_changed'):\n e.setdefault('_changed', {})['at'] = r.get('entity_changed')\n if r.get('entity_changed_by'):\n e.setdefault('_changed', {})['by'] = r.get('entity_changed_by')\n if e.get('_changed'):\n e['_changed']['type'] = 'action'\n e['_changed'] = [e.get('_changed')]\n\n if r.get('entity_is_deleted') and r.get('entity_deleted'):\n e.setdefault('_deleted', {})['at'] = r.get('entity_deleted')\n if r.get('entity_is_deleted') and r.get('entity_deleted_by'):\n e.setdefault('_deleted', {})['by'] = r.get('entity_deleted_by')\n if e.get('_deleted'):\n e['_deleted']['type'] = 'action'\n e['_deleted'] = [e.get('_deleted')]\n\n viewers = self.__get_mongodb_right(mysql_id, ['viewer', 'expander', 'editor', 'owner'])\n if viewers:\n e['_viewer'] = [{'reference': x, 'type': 'reference'} for x in list(set(viewers))]\n\n expanders = self.__get_mongodb_right(mysql_id, ['expander', 'editor', 'owner'])\n if expanders:\n e['_expander'] = [{'reference': x, 'type': 'reference'} for x in list(set(expanders))]\n\n editors = self.__get_mongodb_right(mysql_id, ['editor', 'owner'])\n if editors:\n e['_editor'] = [{'reference': x, 'type': 'reference'} for x in list(set(editors))]\n\n owners = self.__get_mongodb_right(mysql_id, ['owner'])\n if owners:\n e['_owner'] = [{'reference': x, 'type': 'reference'} for x in list(set(owners))]\n\n parent = self.__get_mongodb_parent(entity_id=mysql_id, recursive=False)\n if parent:\n e['_parent'] = [{'reference': x, 'type': 'reference'} for x in list(set(parent))]\n\n ancestor = self.__get_mongodb_parent(entity_id=mysql_id, recursive=True)\n if ancestor:\n e['_ancestor'] = [{'reference': x, 'type': 'reference'} for x in list(set(ancestor))]\n\n sql = \"\"\"\n SELECT\n p.id AS property_id,\n REPLACE(REPLACE(pd.dataproperty, '-', '_'), '.', '_') AS property_dataproperty,\n pd.datatype AS property_datatype,\n pd.formula AS property_formula,\n pd.search AS property_search,\n IF(pd.multilingual = 1, IF(p.language = 'english', 'en', 'et'), NULL) AS property_language,\n TRIM(p.value_formula) AS value_formula,\n TRIM(p.value_string) AS value_string,\n TRIM(p.value_text) AS value_text,\n TRIM(p.value_display) AS value_display,\n p.value_integer,\n p.value_decimal,\n p.value_boolean,\n p.value_datetime,\n p.value_reference,\n p.value_file,\n IF(pd.datatype = 'file', (SELECT s3_key FROM file WHERE id = p.value_file AND deleted IS NULL LIMIT 1), NULL) AS value_file_s3,\n IF(pd.datatype = 'file', (SELECT md5 FROM file WHERE id = p.value_file AND deleted IS NULL LIMIT 1), NULL) AS value_file_md5,\n IF(pd.datatype = 'file', (SELECT filename FROM file WHERE id = p.value_file AND deleted IS NULL LIMIT 1), NULL) AS value_file_name,\n IF(pd.datatype = 'file', (SELECT filesize FROM file WHERE id = p.value_file AND deleted IS NULL LIMIT 1), NULL) AS value_file_size,\n IF(pd.datatype = 'file', (SELECT url FROM file WHERE id = p.value_file AND deleted IS NULL LIMIT 1), NULL) AS value_file_url,\n p.value_counter,\n p.created,\n IF(CAST(p.created_by AS UNSIGNED) > 0, CAST(p.created_by AS UNSIGNED), NULL) AS created_by,\n p.is_deleted,\n p.deleted,\n IF(CAST(p.deleted_by AS UNSIGNED) > 0, CAST(p.deleted_by AS UNSIGNED), NULL) AS deleted_by\n FROM\n property AS p,\n property_definition AS pd\n WHERE pd.keyname = p.property_definition_keyname\n AND p.entity_id = %s\n AND p.is_deleted = 0\n AND pd.dataproperty NOT IN ('entu-changed-by', 'entu-changed-at', 'entu-created-by', 'entu-created-at')\n AND pd.dataproperty NOT LIKE 'auth_%%'\n AND pd.datatype NOT IN ('counter')\n AND pd.formula = 0;\n \"\"\"\n\n properties = {}\n for r2 in self.db_query(sql, mysql_id):\n value = {}\n\n if r2.get('property_datatype') == 'string' and r2.get('value_string'):\n value['value'] = r2.get('value_string')\n elif r2.get('property_datatype') == 'text' and r2.get('value_text'):\n value['value'] = r2.get('value_text')\n elif r2.get('property_datatype') == 'integer' and r2.get('value_integer') != None:\n value['value'] = r2.get('value_integer')\n elif r2.get('property_datatype') == 'decimal' and r2.get('value_decimal') != None:\n value['value'] = float(r2.get('value_decimal'))\n elif r2.get('property_datatype') == 'boolean' and r2.get('value_boolean') != None:\n value['value'] = bool(r2.get('value_boolean'))\n elif r2.get('property_datatype') in ['date', 'datetime'] and r2.get('value_datetime') != None:\n value['value'] = r2.get('value_datetime')\n elif r2.get('property_datatype') == 'reference' and r2.get('value_reference'):\n value['reference'] = r2.get('value_reference')\n elif r2.get('property_datatype') == 'counter-value' and r2.get('value_string'):\n value['value'] = r2.get('value_string')\n elif r2.get('property_datatype') == 'file' and r2.get('value_file'):\n value['value'] = r2.get('value_file_name')\n if r2.get('value_file_url'):\n value['url'] = r2.get('file')\n else:\n value['size'] = r2.get('value_file_size')\n if r2.get('value_file_md5', None):\n value['md5'] = r2.get('value_file_md5')\n if r2.get('value_file_s3', None):\n value['s3'] = r2.get('value_file_s3')\n\n if not value:\n continue\n\n value['_mid'] = r2.get('property_id')\n value['type'] = r2.get('property_datatype')\n\n if r2.get('property_language'):\n value['language'] = r2.get('property_language')\n\n # if r2.get('created'):\n # value.setdefault('created', {})['at'] = r2.get('created')\n # if r2.get('created_by'):\n # value.setdefault('created', {})['by'] = r2.get('created_by')\n #\n # if r2.get('is_deleted') and r2.get('deleted'):\n # value.setdefault('deleted', {})['at'] = r2.get('deleted')\n # if r2.get('is_deleted') and r2.get('deleted_by'):\n # value.setdefault('deleted', {})['by'] = r2.get('deleted_by')\n\n e.setdefault(r2.get('property_dataproperty'), []).append(value)\n\n # if r2.get('value_display') and r2.get('property_search') == 1:\n # if r2.get('property_language'):\n # e.setdefault('_search', {}).setdefault(r2.get('property_language'), []).append(r2.get('value_display').lower())\n # else:\n # e.setdefault('_search', {}).setdefault('et', []).append(r2.get('value_display').lower())\n # e.setdefault('_search', {}).setdefault('en', []).append(r2.get('value_display').lower())\n\n # for l in ['et', 'en']:\n # if l in e.get('_search', {}):\n # e['_search'][l] = list(set(e['_search'][l]))\n\n #Create or replace Mongo object\n try:\n mongo_entity_version = self.mongodb().entityVersion.find_one({'_mid': mysql_id}, {'_id': False, '_entity': True})\n if mongo_entity_version:\n e['_entity'] = mongo_entity_version.get('_entity')\n else:\n e['_entity'] = self.mongodb().entity.insert_one({}).inserted_id\n self.mongodb().entityVersion.insert_one(e)\n except Exception, err:\n self.captureException()\n logging.error('MongoDb error: %s - %s' % (err, e))", "metadata": "root.Entity.set_mongodb_entity", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 531 }, { "content": " def __get_mongodb_parent(self, entity_id, recursive=False):\n sql = \"\"\"\n SELECT entity_id\n FROM relationship\n WHERE relationship_definition_keyname = 'child'\n AND is_deleted = 0\n AND entity_id IS NOT NULL\n AND related_entity_id = %s\n \"\"\" % entity_id\n\n entities = []\n for r in self.db_query(sql):\n entities.append(r.get('entity_id'))\n if recursive:\n entities = entities + self.__get_mongodb_parent(entity_id=r.get('entity_id'), recursive=True)\n\n return entities", "metadata": "root.Entity.__get_mongodb_parent", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 724 }, { "content": " def __get_mongodb_right(self, entity_id, rights):\n sql = \"\"\"\n SELECT related_entity_id\n FROM relationship\n WHERE relationship_definition_keyname IN (%s)\n AND is_deleted = 0\n AND related_entity_id IS NOT NULL\n AND entity_id = %s\n \"\"\" % (', '.join(['\\'%s\\'' % x for x in rights]), entity_id)\n\n entities = []\n for r in self.db_query(sql):\n entities.append(r.get('related_entity_id'))\n\n return entities", "metadata": "root.Entity.__get_mongodb_right", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 742 }, { "content": " def set_counter(self, entity_id):\n \"\"\"\n Sets counter property.\n Counter mechanics is real hack. It will soon be obsoleted by formula field.\n \"\"\"\n if not entity_id:\n return\n\n #Vastuskirja hack\n if self.db_get('SELECT entity_definition_keyname FROM entity WHERE id = %s', entity_id).get('entity_definition_keyname') == 'reply':\n parent = self.get_relatives(related_entity_id=entity_id, relationship_definition_keyname='child', reverse_relation=True, limit=1).values()[0][0]\n childs = self.get_relatives(entity_id=parent.get('id',None), relationship_definition_keyname='child').values()\n if childs:\n childs_count = len([y.get('id', 0) for y in childs[0] if y.get('properties', {}).get('registry-number', {}).get('values', None)])+1\n else:\n childs_count = 1\n parent_number = ''.join(['%s' % x['value'] for x in parent.get('properties', {}).get('registry-number', {}).get('values', []) if x['value']])\n counter_value = '%s-%s' % (parent_number, childs_count)\n self.set_property(entity_id=entity_id, property_definition_keyname='reply-registry-number', value=counter_value)\n return counter_value\n\n\n property_id = self.db_execute_lastrowid(\"\"\"\n INSERT INTO property (\n entity_id,\n property_definition_keyname,\n value_string,\n created_by,\n created\n ) SELECT /* SQL_NO_CACHE */\n %(entity_id)s,\n property_definition2.keyname,\n CONCAT(\n IFNULL((\n SELECT\n value_string\n FROM\n property,\n property_definition,\n entity\n WHERE property_definition.keyname = property.property_definition_keyname\n AND entity.entity_definition_keyname = property_definition.entity_definition_keyname\n AND entity.id = property.entity_id\n AND property_definition.dataproperty = 'series'\n AND entity.id IN (SELECT entity_id FROM relationship WHERE related_entity_id = %(entity_id)s AND relationship_definition_keyname = 'child')\n AND entity.is_deleted = 0\n AND property.is_deleted = 0\n LIMIT 1\n ), ''),\n IFNULL((\n SELECT\n value_string\n FROM\n property,\n property_definition,\n entity\n WHERE property_definition.keyname = property.property_definition_keyname\n AND entity.entity_definition_keyname = property_definition.entity_definition_keyname\n AND entity.id = property.entity_id\n AND property_definition.dataproperty='prefix'\n AND entity.id IN (SELECT entity_id FROM relationship WHERE related_entity_id = %(entity_id)s AND relationship_definition_keyname = 'child')\n AND entity.is_deleted = 0\n AND property.is_deleted = 0\n LIMIT 1\n ), ''),\n counter.value+counter.increment) AS value,\n '%(user_id)s',\n NOW()\n FROM\n property,\n property_definition,\n relationship,\n property_definition AS property_definition2,\n counter\n WHERE property_definition.keyname = property.property_definition_keyname\n AND relationship.property_definition_keyname = property_definition.keyname\n AND property_definition2.keyname = relationship.related_property_definition_keyname\n AND counter.id = property.value_counter\n AND property.entity_id IN (SELECT entity_id FROM relationship WHERE related_entity_id = %(entity_id)s AND relationship_definition_keyname = 'child')\n AND property_definition.datatype= 'counter'\n AND property_definition2.datatype = 'counter-value'\n AND relationship.relationship_definition_keyname = 'target-property'\n AND property_definition2.entity_definition_keyname = (SELECT entity_definition_keyname FROM entity WHERE id = %(entity_id)s LIMIT 1)\n AND relationship.is_deleted = 0\n AND property.is_deleted = 0\n AND counter.type = 'increment';\n \"\"\" % {'entity_id': entity_id, 'user_id': self.__user_id})\n\n self.db_execute(\"\"\"\n UPDATE\n counter,\n (\n SELECT\n counter.id\n FROM\n property,\n property_definition,\n relationship,\n property_definition AS property_definition2,\n counter\n WHERE property_definition.keyname = property.property_definition_keyname\n AND relationship.property_definition_keyname = property_definition.keyname\n AND property_definition2.keyname = relationship.related_property_definition_keyname\n AND counter.id = property.value_counter\n AND property.entity_id IN (SELECT entity_id FROM relationship WHERE related_entity_id = %(entity_id)s AND relationship_definition_keyname = 'child')\n AND property_definition.datatype= 'counter'\n AND property_definition2.datatype = 'counter-value'\n AND relationship.relationship_definition_keyname = 'target-property'\n AND property_definition2.entity_definition_keyname = (SELECT entity_definition_keyname FROM entity WHERE id = %(entity_id)s LIMIT 1)\n AND counter.type = 'increment'\n AND relationship.is_deleted = 0\n AND property.is_deleted = 0\n ) X\n SET\n counter.value = counter.value + counter.increment,\n counter.changed_by = '%(user_id)s',\n counter.changed = NOW()\n WHERE counter.id = X.id;\n \"\"\" % {'entity_id': entity_id, 'user_id': self.__user_id})\n\n self.db_execute('UPDATE property SET value_display = value_string WHERE id = %s', property_id)\n\n return self.db_get('SELECT value_string FROM property WHERE id = %s', property_id).get('value_string')", "metadata": "root.Entity.set_counter", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 758 }, { "content": " def set_relations(self, entity_id, related_entity_id, relationship_definition_keyname, delete=False, update=False):\n \"\"\"\n Adds or removes Entity relations. entity_id, related_entity_id, relationship_definition_keyname can be single value or list of values.\n\n \"\"\"\n\n if type(entity_id) is not list:\n entity_id = [entity_id]\n\n if type(related_entity_id) is not list:\n related_entity_id = [related_entity_id]\n\n if type(relationship_definition_keyname) is not list:\n relationship_definition_keyname = [relationship_definition_keyname]\n\n for e in entity_id:\n for r in related_entity_id:\n for t in relationship_definition_keyname:\n self.db_execute('UPDATE entity SET changed = NOW() WHERE entity.id = %s;', r if t == 'child' else e)\n if delete == True:\n sql = \"\"\"\n UPDATE relationship SET\n deleted_by = %s,\n deleted = NOW(),\n is_deleted = 1\n WHERE relationship_definition_keyname = '%s'\n AND entity_id = %s\n AND related_entity_id = %s;\n \"\"\" % (self.__user_id, t, e, r)\n # logging.debug(sql)\n self.db_execute(sql)\n elif update == True:\n sql = \"\"\"\n UPDATE relationship SET\n deleted_by = NULL,\n deleted = NULL,\n changed_by = %s,\n changed = NOW()\n WHERE relationship_definition_keyname = '%s'\n AND entity_id = %s\n AND related_entity_id = %s;\n \"\"\" % (self.__user_id, t, e, r)\n # logging.debug(sql)\n old = self.db_execute_rowcount(sql)\n if not old:\n sql = \"\"\"\n INSERT INTO relationship SET\n relationship_definition_keyname = '%s',\n entity_id = %s,\n related_entity_id = %s,\n created_by = %s,\n created = NOW();\n \"\"\" % (t, e, r, self.__user_id)\n # logging.debug(sql)\n self.db_execute(sql)\n else:\n sql = \"\"\"\n SELECT id\n FROM relationship\n WHERE relationship_definition_keyname = '%s'\n AND entity_id = %s\n AND related_entity_id = %s\n AND is_deleted = 0;\n \"\"\" % (t, e, r)\n old = self.db_get(sql)\n # logging.debug(sql)\n if not old:\n sql = \"\"\"\n INSERT INTO relationship SET\n relationship_definition_keyname = '%s',\n entity_id = %s,\n related_entity_id = %s,\n created_by = %s,\n created = NOW();\n \"\"\" % (t, e, r, self.__user_id)\n # logging.debug(sql)\n self.db_execute(sql)", "metadata": "root.Entity.set_relations", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 882 }, { "content": " def get_rights(self, entity_id):\n if not entity_id:\n return\n\n rights = {}\n for right in ['viewer', 'expander', 'editor', 'owner']:\n sql = \"\"\"\n SELECT related_entity_id\n FROM relationship\n WHERE is_deleted = 0\n AND relationship_definition_keyname = %s\n AND entity_id = %s\n \"\"\"\n\n relationship = self.db_query(sql, right, entity_id)\n if not relationship:\n continue\n\n ids = [x.get('related_entity_id') for x in relationship if x.get('related_entity_id')]\n if ids:\n entities = self.__get_properties(entity_id=ids, full_definition=False, only_public=False)\n if entities:\n rights[right] = entities\n\n return rights", "metadata": "root.Entity.get_rights", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 960 }, { "content": " def set_rights(self, entity_id, related_entity_id, right=None, ignore_user=False):\n if not entity_id or not related_entity_id:\n return\n\n if ignore_user == True:\n user_id = None\n else:\n if not self.__user_id:\n return\n user_id = self.__user_id\n\n if type(entity_id) is not list:\n entity_id = [entity_id]\n\n if type(related_entity_id) is not list:\n related_entity_id = [related_entity_id]\n\n sql = \"\"\"\n UPDATE relationship SET\n deleted = NOW(),\n is_deleted = 1,\n deleted_by = %%s\n WHERE is_deleted = 0\n AND relationship_definition_keyname IN ('viewer', 'expander', 'editor', 'owner')\n AND entity_id IN (%s)\n AND related_entity_id IN (%s);\n \"\"\" % (','.join(map(str, entity_id)), ','.join(map(str, related_entity_id)))\n self.db_execute(sql, user_id)\n\n if right in ['viewer', 'expander', 'editor', 'owner']:\n for e in entity_id:\n for re in related_entity_id:\n self.db_execute('INSERT INTO relationship SET relationship_definition_keyname = %s, entity_id = %s, related_entity_id = %s, created = NOW(), created_by = %s;', right, int(e), int(re), user_id)\n\n self.db_execute('UPDATE entity SET changed = NOW() WHERE entity.id IN (%s);' % ','.join(map(str, entity_id)))", "metadata": "root.Entity.set_rights", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 986 }, { "content": " def set_sharing(self, entity_id, sharing):\n if not entity_id or not sharing:\n return\n\n if type(entity_id) is not list:\n entity_id = [entity_id]\n\n sql = \"\"\"\n UPDATE entity SET\n sharing = %%s,\n changed = NOW(),\n changed_by = %%s\n WHERE id IN (%s);\n \"\"\" % ','.join(map(str, entity_id))\n\n self.db_execute(sql, sharing, self.__user_id)", "metadata": "root.Entity.set_sharing", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 1022 }, { "content": " def set_sharing_key(self, entity_id, generate=False):\n if not entity_id:\n return\n\n if generate:\n sharing_key = ''.join(random.choice(string.ascii_letters + string.digits) for x in range(64))\n else:\n sharing_key = None\n\n if type(entity_id) is not list:\n entity_id = [entity_id]\n\n sql = \"\"\"\n UPDATE entity SET\n sharing_key = %%s,\n changed = NOW(),\n changed_by = %%s\n WHERE id IN (%s);\n \"\"\" % ','.join(map(str, entity_id))\n\n self.db_execute(sql, sharing_key, self.__user_id)\n\n return sharing_key", "metadata": "root.Entity.set_sharing_key", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 1039 }, { "content": " def get_users(self, search=None):\n \"\"\"\n To return list of entities that have\n 'entu-user' or 'entu-api-key' property.\n \"\"\"\n\n query_re = ''\n if search != None:\n join_parts = []\n for s in search.split(' ')[:5]:\n if not s:\n continue\n join_parts.append('AND sp.value_display REGEXP(\\'%(qs)s\\')' % {'qs': s})\n query_re = ' '.join(join_parts)\n\n sql = \"\"\"\n SELECT DISTINCT e.id AS id, sp.value_display, spd.*\n FROM entity AS e\n LEFT JOIN relationship AS r ON r.entity_id = e.id\n LEFT JOIN property AS p ON p.entity_id = e.id\n RIGHT JOIN property_definition AS pd ON p.property_definition_keyname = pd.keyname\n AND pd.dataproperty IN ('entu-user','entu-api-key')\n LEFT JOIN property AS sp ON sp.entity_id = e.id\n %(query_re)s\n LEFT JOIN property_definition AS spd ON spd.keyname = sp.property_definition_keyname\n AND spd.is_deleted = 0\n AND spd.search = 1\n WHERE e.is_deleted = 0\n AND r.is_deleted = 0\n AND p.is_deleted = 0\n AND sp.is_deleted = 0\n AND ( r.related_entity_id = %(user_id)i AND r.relationship_definition_keyname IN ('viewer', 'expander', 'editor', 'owner')\n OR e.sharing IN ('domain', 'public')\n ) ORDER BY e.sort, e.created DESC;\n \"\"\" % {'user_id': self.__user_id, 'query_re': query_re}\n # logging.debug(sql)\n ids = self.db_query(sql)\n # logging.debug(ids)\n\n entities = self.__get_properties(entity_id=[x.get('id') for x in ids])\n if not entities:\n return []\n\n return entities", "metadata": "root.Entity.get_users", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 1063 }, { "content": " def get_entities(self, ids_only=False, entity_id=None, search=None, entity_definition_keyname=None, dataproperty=None, limit=None, full_definition=False, only_public=False, sharing_key=None):\n \"\"\"\n If ids_only = True, then returns list of Entity IDs. Else returns list of Entities (with properties) as dictionary. entity_id, entity_definition and dataproperty can be single value or list of values.\n If limit = 1, then returns Entity (not list).\n If full_definition = True ,then returns also empty properties.\n\n \"\"\"\n ids = self.__get_id_list(entity_id=entity_id, search=search, entity_definition_keyname=entity_definition_keyname, limit=limit, only_public=only_public, sharing_key=sharing_key)\n if ids_only == True:\n return ids\n\n entities = self.__get_properties(entity_id=ids, entity_definition_keyname=entity_definition_keyname, dataproperty=dataproperty, full_definition=full_definition, only_public=only_public, sharing_key=sharing_key)\n if not entities and full_definition == False and entity_definition_keyname == None:\n return\n\n if limit == 1 and len(entities) > 0:\n return entities[0]\n\n return entities", "metadata": "root.Entity.get_entities", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 1108 }, { "content": " def __get_id_list(self, entity_id=None, search=None, entity_definition_keyname=None, limit=None, only_public=False, sharing_key=None):\n \"\"\"\n Get list of Entity IDs. entity_id, entity_definition_keyname and user_id can be single ID or list of IDs.\n\n \"\"\"\n\n select_parts = ['e.id AS id']\n join_parts = []\n where_parts = ['e.is_deleted = 0']\n sql_parts = []\n\n if search != None:\n i = 0\n for s in search.split(' ')[:5]:\n if not s:\n continue\n i += 1\n join_parts.append('RIGHT JOIN property AS p%(idx)i ON p%(idx)i.entity_id = e.id RIGHT JOIN property_definition AS ppd%(idx)i ON ppd%(idx)i.keyname = p%(idx)i.property_definition_keyname AND ppd%(idx)i.search = 1' % {'idx': i})\n\n if not self.__user_id or only_public == True:\n join_parts.append('LEFT JOIN property_definition AS pd%i ON pd%i.keyname = p%i.property_definition_keyname' % (i, i, i))\n\n where_parts.append('p%i.value_display LIKE \\'%%%%%s%%%%\\'' % (i, s))\n where_parts.append('p%i.is_deleted = 0' % i)\n\n if entity_definition_keyname != None:\n if type(entity_definition_keyname) is not list:\n entity_definition_keyname = [entity_definition_keyname]\n where_parts.append('e.entity_definition_keyname IN (%s)' % ','.join(['\\'%s\\'' % x for x in map(str, entity_definition_keyname)]))\n\n if entity_id != None:\n if type(entity_id) is not list:\n entity_id = [entity_id]\n where_parts.append('e.id IN (%s)' % ','.join(map(str, entity_id)))\n\n if self.__user_id and only_public == False:\n where_parts.append('r.is_deleted = 0')\n join_parts.append('RIGHT JOIN relationship AS r ON r.entity_id = e.id')\n where_parts.append('(r.related_entity_id = %s AND r.relationship_definition_keyname IN (\\'viewer\\', \\'expander\\', \\'editor\\', \\'owner\\') OR e.sharing IN (\\'domain\\', \\'public\\'))' % self.__user_id)\n elif sharing_key:\n where_parts.append('e.sharing_key = \\'%s\\'' % sharing_key)\n else:\n where_parts.append('e.sharing = \\'public\\'')\n i = 0\n if search != None:\n for s in search.split(' '):\n i += 1\n where_parts.append('pd%i.public = 1' % i)\n\n if len(select_parts) > 0:\n sql_parts.append('SELECT DISTINCT %s' % ', '.join(select_parts))\n\n sql_parts.append(' FROM entity AS e')\n\n if len(join_parts) > 0:\n sql_parts.append(' %s' % ' '.join(join_parts))\n\n if len(where_parts) > 0:\n sql_parts.append(' WHERE %s' % ' AND '.join(where_parts))\n\n if limit:\n limit = ' LIMIT %s' % limit\n else:\n limit = ''\n\n sql_parts.append(' ORDER BY e.sort, e.created DESC%s;' % limit)\n\n sql = ''.join(sql_parts)\n # logging.debug(sql)\n\n items = self.db_query(sql)\n if not items:\n return []\n return [x.get('id') for x in items]", "metadata": "root.Entity.__get_id_list", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 1128 }, { "content": " def __get_properties(self, entity_id=None, entity_definition_keyname=None, dataproperty=None, full_definition=False, only_public=False, sharing_key=None):\n \"\"\"\n Get Entity properties. entity_id can be single ID or list of IDs.\n * full_definition - All metadata for entity and properties is fetched, if True\n \"\"\"\n items = None\n if entity_id:\n if type(entity_id) is not list:\n entity_id = [entity_id]\n\n if self.__user_id and only_public == False:\n rights = '(SELECT relationship_definition_keyname FROM relationship WHERE entity_id = entity.id AND is_deleted = 0 AND related_entity_id = %s AND relationship_definition_keyname IN (\\'viewer\\', \\'expander\\', \\'editor\\', \\'owner\\') LIMIT 1)' % self.__user_id\n public = ''\n elif sharing_key:\n rights = 'FALSE'\n public = 'AND entity.sharing_key = \\'%s\\'' % sharing_key\n else:\n rights = 'FALSE'\n public = 'AND entity.sharing = \\'public\\' AND property_definition.public = 1'\n\n datapropertysql = ''\n if dataproperty:\n if type(dataproperty) is not list:\n dataproperty = [dataproperty]\n datapropertysql = 'AND property_definition.dataproperty IN (%s)' % ','.join(['\\'%s\\'' % x for x in dataproperty])\n\n sql = \"\"\"\n SELECT\n entity_definition.keyname AS entity_definition_keyname,\n entity.id AS entity_id,\n entity.created AS entity_created,\n entity.changed AS entity_changed,\n entity.sharing AS entity_sharing,\n entity.sharing_key AS entity_sharing_key,\n %(rights)s AS entity_right,\n entity.sort AS entity_sort_value,\n property_definition.keyname AS property_keyname,\n property_definition.ordinal AS property_ordinal,\n property_definition.formula AS property_formula,\n property_definition.executable AS property_executable,\n property_definition.datatype AS property_datatype,\n property_definition.dataproperty AS property_dataproperty,\n property_definition.mandatory AS property_mandatory,\n property_definition.multilingual AS property_multilingual,\n property_definition.multiplicity AS property_multiplicity,\n property_definition.public AS property_public,\n property_definition.readonly AS property_readonly,\n property_definition.visible AS property_visible,\n property.id AS value_id,\n property.id AS value_ordinal,\n property.created AS value_created,\n property.created_by AS value_created_by,\n property.value_display AS value_display,\n property.value_formula AS value_formula,\n property.value_string AS value_string,\n property.value_text AS value_text,\n property.value_integer AS value_integer,\n property.value_decimal AS value_decimal,\n property.value_boolean AS value_boolean,\n property.value_datetime AS value_datetime,\n property.value_entity AS value_entity,\n property.value_counter AS value_counter,\n property.value_reference AS value_reference,\n property.value_file AS value_file\n FROM\n entity,\n entity_definition,\n property,\n property_definition\n WHERE property.entity_id = entity.id\n AND entity_definition.keyname = entity.entity_definition_keyname\n AND property_definition.keyname = property.property_definition_keyname\n AND entity_definition.keyname = property_definition.entity_definition_keyname\n AND (property.language = '%(language)s' OR property.language IS NULL)\n AND entity.id IN (%(idlist)s)\n AND entity.is_deleted = 0\n AND property.is_deleted = 0\n %(public)s\n %(datapropertysql)s\n ORDER BY\n entity_definition.keyname,\n entity.created DESC;\n \"\"\" % {'language': self.get_user_locale().code, 'public': public, 'idlist': ','.join(map(str, entity_id)), 'datapropertysql': datapropertysql, 'rights': rights}\n # logging.debug(sql)\n\n items = {}\n for row in self.db_query(sql):\n if row.get('entity_sharing') == 'private' and not row.get('entity_right') and not sharing_key:\n continue\n if row.get('entity_sharing') in ['domain', 'public'] and row.get('entity_right') not in ['viewer', 'expander', 'editor', 'owner'] and row.get('property_public') != 1 and not sharing_key:\n continue\n\n #Entity\n items.setdefault('item_%s' % row.get('entity_id'), {})['definition_keyname'] = row.get('entity_definition_keyname')\n items.setdefault('item_%s' % row.get('entity_id'), {})['id'] = row.get('entity_id')\n items.setdefault('item_%s' % row.get('entity_id'), {})['label'] = self.__get_system_translation(field='label', entity_definition_keyname=row.get('entity_definition_keyname'))\n items.setdefault('item_%s' % row.get('entity_id'), {})['label_plural'] = self.__get_system_translation(field='label_plural', entity_definition_keyname=row.get('entity_definition_keyname'))\n items.setdefault('item_%s' % row.get('entity_id'), {})['description'] = self.__get_system_translation(field='description', entity_definition_keyname=row.get('entity_definition_keyname'))\n items.setdefault('item_%s' % row.get('entity_id'), {})['sort'] = self.__get_system_translation(field='sort', entity_definition_keyname=row.get('entity_definition_keyname'))\n items.setdefault('item_%s' % row.get('entity_id'), {})['sort_value'] = row.get('entity_sort_value')\n items.setdefault('item_%s' % row.get('entity_id'), {})['created'] = row.get('entity_created')\n items.setdefault('item_%s' % row.get('entity_id'), {})['changed'] = row.get('entity_changed')\n items.setdefault('item_%s' % row.get('entity_id'), {})['displayname'] = self.__get_system_translation(field='displayname', entity_definition_keyname=row.get('entity_definition_keyname'))\n items.setdefault('item_%s' % row.get('entity_id'), {})['displayinfo'] = self.__get_system_translation(field='displayinfo', entity_definition_keyname=row.get('entity_definition_keyname'))\n items.setdefault('item_%s' % row.get('entity_id'), {})['displaytable'] = self.__get_system_translation(field='displaytable', entity_definition_keyname=row.get('entity_definition_keyname'))\n items.setdefault('item_%s' % row.get('entity_id'), {})['sharing'] = row.get('entity_sharing')\n items.setdefault('item_%s' % row.get('entity_id'), {})['sharing_key'] = row.get('entity_sharing_key')\n items.setdefault('item_%s' % row.get('entity_id'), {})['right'] = row.get('entity_right')\n items.setdefault('item_%s' % row.get('entity_id'), {})['ordinal'] = row.get('entity_created') if row.get('entity_created') else datetime.datetime.now()\n\n #Property\n items.setdefault('item_%s' % row.get('entity_id'), {}).setdefault('properties', {}).setdefault('%s' % row.get('property_dataproperty'), {})['keyname'] = row.get('property_keyname')\n items.setdefault('item_%s' % row.get('entity_id'), {}).setdefault('properties', {}).setdefault('%s' % row.get('property_dataproperty'), {})['fieldset'] = self.__get_system_translation(field='fieldset', property_definition_keyname=row.get('property_keyname'))\n items.setdefault('item_%s' % row.get('entity_id'), {}).setdefault('properties', {}).setdefault('%s' % row.get('property_dataproperty'), {})['label'] = self.__get_system_translation(field='label', property_definition_keyname=row.get('property_keyname'))\n items.setdefault('item_%s' % row.get('entity_id'), {}).setdefault('properties', {}).setdefault('%s' % row.get('property_dataproperty'), {})['label_plural'] = self.__get_system_translation(field='label_plural', property_definition_keyname=row.get('property_keyname'))\n items.setdefault('item_%s' % row.get('entity_id'), {}).setdefault('properties', {}).setdefault('%s' % row.get('property_dataproperty'), {})['description'] = self.__get_system_translation(field='description', property_definition_keyname=row.get('property_keyname'))\n items.setdefault('item_%s' % row.get('entity_id'), {}).setdefault('properties', {}).setdefault('%s' % row.get('property_dataproperty'), {})['datatype'] = row.get('property_datatype')\n items.setdefault('item_%s' % row.get('entity_id'), {}).setdefault('properties', {}).setdefault('%s' % row.get('property_dataproperty'), {})['dataproperty'] = row.get('property_dataproperty')\n items.setdefault('item_%s' % row.get('entity_id'), {}).setdefault('properties', {}).setdefault('%s' % row.get('property_dataproperty'), {})['mandatory'] = bool(row.get('property_mandatory'))\n items.setdefault('item_%s' % row.get('entity_id'), {}).setdefault('properties', {}).setdefault('%s' % row.get('property_dataproperty'), {})['multilingual'] = bool(row.get('property_multilingual'))\n items.setdefault('item_%s' % row.get('entity_id'), {}).setdefault('properties', {}).setdefault('%s' % row.get('property_dataproperty'), {})['multiplicity'] = row.get('property_multiplicity')\n items.setdefault('item_%s' % row.get('entity_id'), {}).setdefault('properties', {}).setdefault('%s' % row.get('property_dataproperty'), {})['ordinal'] = row.get('property_ordinal')\n items.setdefault('item_%s' % row.get('entity_id'), {}).setdefault('properties', {}).setdefault('%s' % row.get('property_dataproperty'), {})['formula'] = bool(row.get('property_formula'))\n items.setdefault('item_%s' % row.get('entity_id'), {}).setdefault('properties', {}).setdefault('%s' % row.get('property_dataproperty'), {})['executable'] = bool(row.get('property_executable'))\n items.setdefault('item_%s' % row.get('entity_id'), {}).setdefault('properties', {}).setdefault('%s' % row.get('property_dataproperty'), {})['public'] = bool(row.get('property_public'))\n items.setdefault('item_%s' % row.get('entity_id'), {}).setdefault('properties', {}).setdefault('%s' % row.get('property_dataproperty'), {})['readonly'] = bool(row.get('property_readonly'))\n items.setdefault('item_%s' % row.get('entity_id'), {}).setdefault('properties', {}).setdefault('%s' % row.get('property_dataproperty'), {})['visible'] = bool(row.get('property_visible'))\n\n #Value\n value = row.get('value_display') if row.get('value_display') else ''\n\n if row.get('property_formula') == 1:\n db_value = row.get('value_formula')\n elif row.get('property_datatype') == 'string':\n db_value = row.get('value_string')\n elif row.get('property_datatype') == 'text':\n db_value = row.get('value_text')\n value = row.get('value_text') if row.get('value_text') else ''\n elif row.get('property_datatype') == 'integer':\n db_value = row.get('value_integer')\n elif row.get('property_datatype') == 'decimal':\n db_value = row.get('value_decimal')\n elif row.get('property_datatype') == 'date':\n db_value = row.get('value_datetime')\n elif row.get('property_datatype') == 'datetime':\n db_value = row.get('value_datetime')\n elif row.get('property_datatype') == 'reference':\n db_value = row.get('value_reference')\n elif row.get('property_datatype') == 'file':\n db_value = row.get('value_file')\n elif row.get('property_datatype') == 'boolean':\n db_value = row.get('value_boolean')\n elif row.get('property_datatype') == 'counter':\n db_value = row.get('value_counter')\n elif row.get('property_datatype') == 'counter-value':\n db_value = row.get('value_string')\n else:\n db_value = ''\n value = 'X'\n\n items.setdefault('item_%s' % row.get('entity_id'), {}).setdefault('properties', {}).setdefault('%s' % row.get('property_dataproperty'), {}).setdefault('values', {}).setdefault('value_%s' % row.get('value_id'), {})['id'] = row.get('value_id')\n items.setdefault('item_%s' % row.get('entity_id'), {}).setdefault('properties', {}).setdefault('%s' % row.get('property_dataproperty'), {}).setdefault('values', {}).setdefault('value_%s' % row.get('value_id'), {})['ordinal'] = row.get('value_ordinal')\n items.setdefault('item_%s' % row.get('entity_id'), {}).setdefault('properties', {}).setdefault('%s' % row.get('property_dataproperty'), {}).setdefault('values', {}).setdefault('value_%s' % row.get('value_id'), {})['value'] = value\n items.setdefault('item_%s' % row.get('entity_id'), {}).setdefault('properties', {}).setdefault('%s' % row.get('property_dataproperty'), {}).setdefault('values', {}).setdefault('value_%s' % row.get('value_id'), {})['db_value'] = db_value\n items.setdefault('item_%s' % row.get('entity_id'), {}).setdefault('properties', {}).setdefault('%s' % row.get('property_dataproperty'), {}).setdefault('values', {}).setdefault('value_%s' % row.get('value_id'), {})['created'] = row.get('value_created')\n items.setdefault('item_%s' % row.get('entity_id'), {}).setdefault('properties', {}).setdefault('%s' % row.get('property_dataproperty'), {}).setdefault('values', {}).setdefault('value_%s' % row.get('value_id'), {})['created_by'] = row.get('value_created_by')\n\n if not items:\n if not full_definition:\n return []\n\n if entity_definition_keyname:\n if type(entity_definition_keyname) is not list:\n entity_definition_keyname = [entity_definition_keyname]\n\n items = {}\n for e in entity_definition_keyname:\n items.setdefault('item_%s' % e, {})['definition_keyname'] = e\n items.setdefault('item_%s' % e, {})['ordinal'] = 'X'\n\n for key, value in items.iteritems():\n if value.get('id', None):\n items[key] = dict(items[key].items() + self.__get_displayfields(value).items())\n items[key]['displaypicture'] = self.__get_picture_url(value['id'], value['definition_keyname'])\n\n items[key]['completed'] = True\n for d in self.get_definition(entity_definition_keyname=value['definition_keyname']):\n if not value.get('id', None):\n items[key]['displayname'] = d['entity_label']\n items[key].setdefault('properties', {}).setdefault('%s' % d['property_dataproperty'], {})['keyname'] = d['property_keyname']\n items[key].setdefault('properties', {}).setdefault('%s' % d['property_dataproperty'], {})['fieldset'] = d['property_fieldset']\n items[key].setdefault('properties', {}).setdefault('%s' % d['property_dataproperty'], {})['label'] = d['property_label']\n items[key].setdefault('properties', {}).setdefault('%s' % d['property_dataproperty'], {})['label_plural'] = d['property_label_plural']\n items[key].setdefault('properties', {}).setdefault('%s' % d['property_dataproperty'], {})['description'] = d['property_description']\n items[key].setdefault('properties', {}).setdefault('%s' % d['property_dataproperty'], {})['datatype'] = d['property_datatype']\n items[key].setdefault('properties', {}).setdefault('%s' % d['property_dataproperty'], {})['dataproperty'] = d['property_dataproperty']\n items[key].setdefault('properties', {}).setdefault('%s' % d['property_dataproperty'], {})['mandatory'] = d['property_mandatory']\n items[key].setdefault('properties', {}).setdefault('%s' % d['property_dataproperty'], {})['multilingual'] = d['property_multilingual']\n items[key].setdefault('properties', {}).setdefault('%s' % d['property_dataproperty'], {})['multiplicity'] = d['property_multiplicity']\n items[key].setdefault('properties', {}).setdefault('%s' % d['property_dataproperty'], {})['ordinal'] = d['property_ordinal']\n items[key].setdefault('properties', {}).setdefault('%s' % d['property_dataproperty'], {})['public'] = d['property_public']\n items[key].setdefault('properties', {}).setdefault('%s' % d['property_dataproperty'], {})['readonly'] = d['property_readonly']\n items[key].setdefault('properties', {}).setdefault('%s' % d['property_dataproperty'], {})['visible'] = d['property_visible']\n\n if d['property_mandatory'] and len(value.get('properties', {}).get('%s' % d['property_dataproperty'], {}).get('values', {}).values()) < 1:\n items[key]['completed'] = False\n\n if full_definition:\n if not d['property_multiplicity'] or d['property_multiplicity'] > len(value.get('properties', {}).get('%s' % d['property_dataproperty'], {}).get('values', {}).values()):\n items[key].setdefault('properties', {}).setdefault('%s' % d['property_dataproperty'], {}).setdefault('values', {})['value_new'] = {'id': '', 'ordinal': 'X', 'value': '', 'db_value': ''}\n if not d['property_multiplicity'] or d['property_multiplicity'] > len(value.get('properties', {}).get('%s' % d['property_dataproperty'], {}).get('values', {}).values()):\n items[key].setdefault('properties', {}).setdefault('%s' % d['property_dataproperty'], {})['can_add_new'] = True\n else:\n items[key].setdefault('properties', {}).setdefault('%s' % d['property_dataproperty'], {})['can_add_new'] = False\n\n if d['property_classifier_id'] and d['property_datatype'] != 'reference':\n for c in self.get_entities(entity_definition_keyname=d['property_classifier_id'], only_public=True):\n if c.get('id', None):\n items[key].setdefault('properties', {}).setdefault('%s' % d['property_dataproperty'], {}).setdefault('select', []).append({'id': c.get('id', ''), 'label': c.get('displayname', '')})\n\n for p_key, p_value in value.get('properties', {}).iteritems():\n if p_value.get('values'):\n items[key]['properties'][p_key]['values'] = sorted(p_value.get('values', {}).values(), key=itemgetter('ordinal'))\n if p_value['datatype'] == 'reference':\n reference_definition = self.db_get('SELECT classifying_entity_definition_keyname FROM property_definition WHERE keyname = %s LIMIT 1;', p_value['keyname'])\n if reference_definition:\n if reference_definition.get('classifying_entity_definition_keyname'):\n items[key]['properties'][p_key]['reference_definition'] = reference_definition.get('classifying_entity_definition_keyname')\n if p_value['datatype'] == 'file':\n for f_key, f_value in enumerate(p_value.get('values', {})):\n if not f_value.get('db_value'):\n continue\n file_result = self.db_get('SELECT md5, filesize, created FROM file WHERE id = %s;', f_value.get('db_value'))\n if not file_result:\n continue\n items[key]['properties'][p_key]['values'][f_key]['md5'] = file_result.get('md5')\n items[key]['properties'][p_key]['values'][f_key]['filesize'] = file_result.get('filesize')\n items[key]['properties'][p_key]['values'][f_key]['created'] = file_result.get('created')\n\n return items.values()", "metadata": "root.Entity.__get_properties", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 1215 }, { "content": " def __get_displayfields(self, entity_dict):\n \"\"\"\n Returns Entity displayname, displayinfo, displaytable fields.\n\n \"\"\"\n result = {}\n for displayfield in ['displayname', 'displayinfo', 'displaytable', 'sort']:\n result[displayfield] = entity_dict.get(displayfield, '') if entity_dict.get(displayfield, '') else None\n for data_property in findTags(entity_dict.get(displayfield, ''), '@', '@'):\n dataproperty_dict = entity_dict.get('properties', {}).get(data_property, {})\n result[displayfield] = result[displayfield].replace('@%s@' % data_property, ', '.join(['%s' % x['value'] for x in dataproperty_dict.get('values', {}).values()])).replace('\\n', ' ')\n\n result['displaytable_labels'] = self.__get_system_translation(field='displaytableheader', entity_definition_keyname=entity_dict.get('definition_keyname'))\n if not result['displaytable_labels']:\n result['displaytable_labels'] = entity_dict.get('displaytable', '') if entity_dict.get('displaytable', '') else None\n for data_property in findTags(entity_dict.get('displaytable', ''), '@', '@'):\n result['displaytable_labels'] = result['displaytable_labels'].replace('@%s@' % data_property, entity_dict.get('properties', {}).get(data_property, {}).get('label', ''))\n\n result['displaytable'] = result['displaytable'].split('|') if result['displaytable'] else None\n result['displaytable_labels'] = result['displaytable_labels'].split('|') if result['displaytable_labels'] else None\n\n if entity_dict.get('id', None) and entity_dict.get('sort_value', None) != result['sort']:\n self.db_execute('UPDATE entity SET sort = LEFT(%s, 100) WHERE id = %s', result['sort'], entity_dict.get('id'))\n\n return result", "metadata": "root.Entity.__get_displayfields", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 1456 }, { "content": " def __get_picture_url(self, entity_id, entity_definition_keyname):\n \"\"\"\n Returns Entity picture.\n\n \"\"\"\n sql = \"\"\"\n SELECT\n f.id\n FROM\n property,\n property_definition,\n file f\n WHERE property_definition.keyname=property.property_definition_keyname\n AND f.id = property.value_file\n AND property_definition.dataproperty='photo'\n AND property.entity_id = %s\n AND property.is_deleted = 0\n LIMIT 1;\n \"\"\"\n f = self.db_get(sql, entity_id)\n if f:\n return '/api2/entity-%s/picture' % entity_id\n elif entity_definition_keyname in ['audiovideo', 'book', 'methodical', 'periodical', 'textbook', 'workbook']:\n return '/photo-by-isbn?entity=%s' % entity_id\n elif entity_definition_keyname == 'person':\n return 'https://secure.gravatar.com/avatar/%s?d=wavatar&s=150' % (hashlib.md5(str(entity_id)).hexdigest())\n else:\n return 'https://secure.gravatar.com/avatar/%s?d=identicon&s=150' % (hashlib.md5(str(entity_id)).hexdigest())", "metadata": "root.Entity.__get_picture_url", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 1482 }, { "content": " def get_definition(self, entity_definition_keyname):\n \"\"\"\n Returns Entity definition (with property definitions).\n\n \"\"\"\n if not entity_definition_keyname:\n return\n\n if type(entity_definition_keyname) is not list:\n entity_definition_keyname = [entity_definition_keyname]\n\n sql = \"\"\"\n SELECT\n entity_definition.keyname AS entity_definition_keyname,\n property_definition.keyname AS property_keyname,\n property_definition.formula AS property_formula,\n property_definition.datatype AS property_datatype,\n property_definition.dataproperty AS property_dataproperty,\n property_definition.mandatory AS property_mandatory,\n property_definition.multilingual AS property_multilingual,\n property_definition.multiplicity AS property_multiplicity,\n property_definition.ordinal AS property_ordinal,\n property_definition.public AS property_public,\n property_definition.readonly AS property_readonly,\n property_definition.visible AS property_visible,\n property_definition.classifying_entity_definition_keyname AS property_classifier_id\n FROM\n entity_definition,\n property_definition\n WHERE entity_definition.keyname = property_definition.entity_definition_keyname\n AND entity_definition.keyname IN (%s)\n \"\"\" % ','.join(['\\'%s\\'' % x for x in map(str, entity_definition_keyname)])\n # logging.debug(sql)\n\n defs = []\n for r in self.db_query(sql):\n defs.append({\n 'entity_definition_keyname': r.get('entity_definition_keyname'),\n 'entity_label': self.__get_system_translation(field='label', entity_definition_keyname=r.get('entity_definition_keyname')),\n 'entity_label_plural': self.__get_system_translation(field='label_plural', entity_definition_keyname=r.get('entity_definition_keyname')),\n 'entity_description': self.__get_system_translation(field='description', entity_definition_keyname=r.get('entity_definition_keyname')),\n 'entity_displayname': self.__get_system_translation(field='displayname', entity_definition_keyname=r.get('entity_definition_keyname')),\n 'entity_displayinfo': self.__get_system_translation(field='displayinfo', entity_definition_keyname=r.get('entity_definition_keyname')),\n 'entity_displaytable': self.__get_system_translation(field='displaytable', entity_definition_keyname=r.get('entity_definition_keyname')),\n 'property_keyname': r.get('property_keyname'),\n 'property_fieldset': self.__get_system_translation(field='fieldset', property_definition_keyname=r.get('property_keyname')),\n 'property_label': self.__get_system_translation(field='label', property_definition_keyname=r.get('property_keyname')),\n 'property_label_plural': self.__get_system_translation(field='label_plural', property_definition_keyname=r.get('property_keyname')),\n 'property_description': self.__get_system_translation(field='description', property_definition_keyname=r.get('property_keyname')),\n 'property_datatype': r.get('property_datatype'),\n 'property_dataproperty': r.get('property_dataproperty'),\n 'property_mandatory': bool(r.get('property_mandatory')),\n 'property_multilingual': bool(r.get('property_multilingual')),\n 'property_multiplicity': r.get('property_multiplicity'),\n 'property_ordinal': r.get('property_ordinal'),\n 'property_public': bool(r.get('property_public')),\n 'property_readonly': bool(r.get('property_readonly')),\n 'property_visible': bool(r.get('property_visible')),\n 'property_classifier_id': r.get('property_classifier_id'),\n })\n\n return defs", "metadata": "root.Entity.get_definition", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 1511 }, { "content": " def get_entity_definition(self, entity_definition_keyname):\n \"\"\"\n Returns entity_definition.\n\n \"\"\"\n if entity_definition_keyname:\n if type(entity_definition_keyname) is not list:\n entity_definition_keyname = [entity_definition_keyname]\n\n sql = \"\"\"\n SELECT\n keyname,\n open_after_add,\n ordinal,\n actions_add\n FROM\n entity_definition\n WHERE keyname IN (%s);\n \"\"\" % ','.join(['\\'%s\\'' % x for x in map(str, entity_definition_keyname)])\n # logging.debug(sql)\n\n defs = []\n for d in self.db_query(sql):\n defs.append({\n 'keyname': d.get('keyname'),\n 'label': self.__get_system_translation(field='label', entity_definition_keyname=d.get('keyname')),\n 'label_plural': self.__get_system_translation(field='label_plural', entity_definition_keyname=d.get('keyname')),\n 'description': self.__get_system_translation(field='description', entity_definition_keyname=d.get('keyname')),\n 'menugroup': self.__get_system_translation(field='menu', entity_definition_keyname=d.get('keyname')),\n 'open_after_add': d.get('open_after_add'),\n 'ordinal': d.get('ordinal'),\n 'actions_add': d.get('actions_add')\n })\n\n return defs", "metadata": "root.Entity.get_entity_definition", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 1574 }, { "content": " def get_relatives(self, ids_only=False, relationship_ids_only=False, entity_id=None, related_entity_id=None, relationship_definition_keyname=None, reverse_relation=False, entity_definition_keyname=None, full_definition=False, limit=None, only_public=False):\n \"\"\"\n Get Entity relatives.\n * ids_only, relationship_ids_only - return only respective id's if True; return full info by default (False, False).\n (True, True) is interpreted as (True, False)\n * entity_id - find only relations for these entities\n * related_entity_id - find only relations for these related entities\n * relationship_definition_keyname - find only relations with these relationship types\n * reverse_relation - obsolete. Just give related_entity_id instead of entity_id\n * entity_definition_keyname - find only relations with entities of these entity types\n * full_definition - parameter gets forwarded to Entity.__get_properties\n * limit - MySQL-specific limit\n * only_public - if True then only public entities are fetched, othervise user rights are checked. Also gets forwarded to Entity.__get_properties\n \"\"\"\n if entity_id:\n if type(entity_id) is not list:\n entity_id = [entity_id]\n\n if related_entity_id:\n if type(related_entity_id) is not list:\n related_entity_id = [related_entity_id]\n\n if relationship_definition_keyname:\n if type(relationship_definition_keyname) is not list:\n relationship_definition_keyname = [relationship_definition_keyname]\n\n if entity_definition_keyname:\n if type(entity_definition_keyname) is not list:\n entity_definition_keyname = [entity_definition_keyname]\n\n unionsql = ''\n\n if reverse_relation == True:\n sql = \"\"\"\n SELECT DISTINCT\n r.id AS relationship_id,\n r.entity_id AS id,\n e.sort,\n e.created\n FROM\n entity AS e,\n relationship AS r,\n relationship AS rights\n WHERE r.entity_id = e.id\n AND rights.entity_id = e.id\n AND r.is_deleted = 0\n AND rights.is_deleted = 0\n AND e.is_deleted = 0\n \"\"\"\n else:\n sql = \"\"\"\n SELECT DISTINCT\n r.id AS relationship_id,\n r.related_entity_id AS id,\n e.sort,\n e.created\n FROM\n entity AS e,\n relationship AS r,\n relationship AS rights\n WHERE r.related_entity_id = e.id\n AND rights.entity_id = e.id\n AND r.is_deleted = 0\n AND rights.is_deleted = 0\n AND e.is_deleted = 0\n \"\"\"\n if not ids_only:\n unionsql = \"\"\"\n UNION SELECT DISTINCT\n NULL AS relationship_id,\n up.entity_id AS id,\n ue.sort,\n ue.created\n FROM\n property up,\n entity ue,\n relationship AS urights\n WHERE ue.id = up.entity_id\n AND urights.entity_id = ue.id\n AND up.is_deleted = 0\n AND ue.is_deleted = 0\n AND urights.is_deleted = 0\n \"\"\"\n\n if entity_id:\n sql += ' AND r.entity_id IN (%s)' % ','.join(map(str, entity_id))\n\n if related_entity_id:\n sql += ' AND r.related_entity_id IN (%s)' % ','.join(map(str, related_entity_id))\n\n if self.__user_id and only_public == False:\n sql += ' AND (rights.related_entity_id = %s AND rights.relationship_definition_keyname IN (\\'viewer\\', \\'expander\\', \\'editor\\', \\'owner\\') OR e.sharing IN (\\'domain\\', \\'public\\'))' % self.__user_id\n else:\n sql += ' AND e.sharing = \\'public\\''\n\n if relationship_definition_keyname:\n sql += ' AND r.relationship_definition_keyname IN (%s)' % ','.join(['\\'%s\\'' % x for x in relationship_definition_keyname])\n\n if entity_definition_keyname:\n sql += ' AND e.entity_definition_keyname IN (%s)' % ','.join(['\\'%s\\'' % x for x in entity_definition_keyname])\n\n if unionsql:\n sql += unionsql\n\n if entity_id:\n sql += ' AND up.value_reference IN (%s)' % ','.join(map(str, entity_id))\n\n if self.__user_id and only_public == False:\n sql += ' AND (urights.related_entity_id = %s AND urights.relationship_definition_keyname IN (\\'viewer\\', \\'expander\\', \\'editor\\', \\'owner\\') OR ue.sharing IN (\\'domain\\', \\'public\\'))' % self.__user_id\n else:\n sql += ' AND ue.sharing = \\'public\\''\n\n if entity_definition_keyname:\n sql += ' AND ue.entity_definition_keyname IN (%s)' % ','.join(['\\'%s\\'' % x for x in entity_definition_keyname])\n\n sql += ' ORDER BY sort, created DESC'\n\n if limit:\n sql += ' LIMIT %d' % limit\n\n sql += ';'\n # logging.debug(sql)\n\n if ids_only == True:\n items = []\n for item in self.db_query(sql):\n items.append(item.get('id'))\n elif relationship_ids_only == True:\n items = []\n for item in self.db_query(sql):\n items.append(item.get('relationship_id'))\n else:\n items = {}\n for item in self.db_query(sql):\n ent = self.__get_properties(entity_id=item.get('id'), full_definition=full_definition, entity_definition_keyname=entity_definition_keyname, only_public=only_public)\n if not ent:\n continue\n ent = ent[0]\n items.setdefault('%s' % ent.get('label_plural', ''), []).append(ent)\n return items", "metadata": "root.Entity.get_relatives", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 1610 }, { "content": " def get_file(self, file_id, sharing_key=None):\n \"\"\"\n Returns file object. File properties are id, file, filename.\n\n \"\"\"\n\n if type(file_id) is not list:\n file_id = [file_id]\n\n if self.__user_id:\n user_where = \"\"\"\n AND p.entity_id IN (\n SELECT entity_id\n FROM relationship\n WHERE relationship_definition_keyname IN ('viewer', 'expander', 'editor', 'owner')\n AND is_deleted = 0\n AND related_entity_id = %s\n UNION SELECT id\n FROM entity\n WHERE sharing IN ('domain', 'public')\n AND is_deleted = 0\n )\n \"\"\" % self.__user_id\n elif sharing_key:\n user_where = 'AND p.entity_id IN (SELECT id FROM entity WHERE sharing_key = \\'%s\\')' % sharing_key\n else:\n user_where = 'AND pd.public = 1'\n\n sql = \"\"\"\n SELECT DISTINCT\n f.id,\n f.md5,\n f.filename,\n f.s3_key,\n f.url,\n f.created\n FROM\n file AS f,\n property AS p,\n property_definition AS pd\n WHERE p.value_file = f.id\n AND pd.keyname = p.property_definition_keyname\n AND f.id IN (%(file_id)s)\n %(user_where)s\n AND p.is_deleted = 0\n \"\"\" % {'file_id': ','.join(map(str, file_id)), 'user_where': user_where}\n # logging.debug(sql)\n\n result = []\n for f in self.db_query(sql):\n if f.get('md5'):\n filename = os.path.join('/', 'entu', 'files', self.app_settings('database-name'), f.get('md5')[0], f.get('md5'))\n if os.path.isfile(filename):\n with open(filename, 'r') as myfile:\n filecontent = myfile.read()\n else:\n filecontent = None\n else:\n filecontent = None\n\n result.append({\n 'id': f.get('id'),\n 'created': f.get('created'),\n 'file': filecontent,\n 'filename': f.get('filename'),\n 's3key': f.get('s3_key'),\n 'url': f.get('url')\n })\n\n return result", "metadata": "root.Entity.get_file", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 1751 }, { "content": " def get_allowed_childs(self, entity_id):\n \"\"\"\n Returns allowed child definitions.\n\n \"\"\"\n\n if not self.db_get('SELECT id FROM relationship WHERE relationship_definition_keyname iN (\\'expander\\', \\'editor\\', \\'owner\\') AND entity_id = %s AND related_entity_id = %s AND is_deleted = 0 LIMIT 1;', entity_id, self.__user_id):\n return []\n\n sql = \"\"\"\n SELECT DISTINCT\n entity_definition.keyname\n FROM\n relationship\n LEFT JOIN entity_definition ON relationship.related_entity_definition_keyname = entity_definition.keyname\n WHERE relationship.relationship_definition_keyname = 'allowed-child'\n AND relationship.entity_id = %s\n AND relationship.is_deleted = 0\n ORDER BY entity_definition.keyname\n \"\"\" % entity_id\n # logging.debug(sql)\n result = self.db_query(sql)\n\n if not result:\n sql = \"\"\"\n SELECT DISTINCT\n entity_definition.keyname\n FROM\n entity_definition,\n relationship\n WHERE relationship.related_entity_definition_keyname = entity_definition.keyname\n AND relationship.relationship_definition_keyname = 'allowed-child'\n AND relationship.entity_definition_keyname = (SELECT entity_definition_keyname FROM entity WHERE id = %s LIMIT 1)\n AND relationship.is_deleted = 0\n \"\"\" % entity_id\n # logging.debug(sql)\n result = self.db_query(sql)\n\n defs = []\n for d in result:\n defs.append({\n 'keyname': d.get('keyname'),\n 'label': self.__get_system_translation(field='label', entity_definition_keyname=d.get('keyname')),\n 'label_plural': self.__get_system_translation(field='label_plural', entity_definition_keyname=d.get('keyname')),\n 'description': self.__get_system_translation(field='description', entity_definition_keyname=d.get('keyname')),\n 'menugroup': self.__get_system_translation(field='menu', entity_definition_keyname=d.get('keyname')),\n })\n\n return defs", "metadata": "root.Entity.get_allowed_childs", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 1822 }, { "content": " def get_allowed_parents(self, entity_id):\n \"\"\"\n Returns allowed parent definitions.\n\n \"\"\"\n\n sql = \"\"\"\n SELECT DISTINCT IF(entity_id, (SELECT entity_definition_keyname FROM entity WHERE id = relationship.entity_id LIMIT 1), entity_definition_keyname) AS keyname\n FROM relationship\n WHERE relationship_definition_keyname = 'allowed-child'\n AND related_entity_definition_keyname = (SELECT entity_definition_keyname FROM entity WHERE id = %s LIMIT 1)\n AND is_deleted = 0;\n \"\"\" % entity_id\n # logging.debug(sql)\n result = self.db_query(sql)\n\n defs = []\n for d in self.db_query(sql):\n defs.append({\n 'keyname': d.get('keyname'),\n 'label': self.__get_system_translation(field='label', entity_definition_keyname=d.get('keyname')),\n 'label_plural': self.__get_system_translation(field='label_plural', entity_definition_keyname=d.get('keyname')),\n 'description': self.__get_system_translation(field='description', entity_definition_keyname=d.get('keyname')),\n 'menugroup': self.__get_system_translation(field='menu', entity_definition_keyname=d.get('keyname')),\n })\n\n return defs", "metadata": "root.Entity.get_allowed_parents", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 1872 }, { "content": " def get_definitions_with_optional_parent(self, entity_definition_keyname):\n \"\"\"\n Returns allowed entity definitions what have default parent.\n\n \"\"\"\n if not entity_definition_keyname:\n return {}\n\n if entity_definition_keyname:\n if type(entity_definition_keyname) is not list:\n entity_definition_keyname = [entity_definition_keyname]\n\n sql = \"\"\"\n SELECT DISTINCT\n entity_definition.keyname,\n relationship.related_entity_id\n FROM\n entity_definition,\n relationship,\n relationship AS rights\n WHERE relationship.entity_definition_keyname = entity_definition.keyname\n AND rights.entity_id = relationship.related_entity_id\n AND relationship.relationship_definition_keyname = 'optional-parent'\n AND rights.relationship_definition_keyname iN ('expander', 'editor', 'owner')\n AND rights.related_entity_id = %s\n AND rights.is_deleted = 0\n AND entity_definition.keyname IN (%s)\n AND relationship.is_deleted = 0\n \"\"\" % (self.__user_id, ','.join(['\\'%s\\'' % x for x in map(str, entity_definition_keyname)]))\n # logging.debug(sql)\n\n defs = []\n for d in self.db_query(sql):\n related_entity = self.get_entities(entity_id=d.get('related_entity_id'), limit=1)\n defs.append({\n 'keyname': d.get('keyname'),\n 'label': self.__get_system_translation(field='label', entity_definition_keyname=d.get('keyname')),\n 'label_plural': self.__get_system_translation(field='label_plural', entity_definition_keyname=d.get('keyname')),\n 'description': self.__get_system_translation(field='description', entity_definition_keyname=d.get('keyname')),\n 'menugroup': self.__get_system_translation(field='menu', entity_definition_keyname=d.get('keyname')),\n 'related_entity_id': d.get('related_entity_id'),\n 'related_entity_label': related_entity.get('displayname') if related_entity else '',\n })\n\n return defs", "metadata": "root.Entity.get_definitions_with_optional_parent", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 1900 }, { "content": " def get_public_paths(self):\n \"\"\"\n Returns public paths with labels\n\n \"\"\"\n\n paths = {}\n for i in self.db_query('SELECT DISTINCT keyname, public_path FROM entity_definition WHERE public_path IS NOT NULL ORDER BY public_path;'):\n paths[i.get('public_path')] = self.__get_system_translation(field='public', entity_definition_keyname=i.get('keyname'))\n return paths", "metadata": "root.Entity.get_public_paths", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 1946 }, { "content": " def get_public_path(self, entity_id):\n \"\"\"\n Returns public path for entity\n Returns False, if public path does not exist\n\n \"\"\"\n\n path = self.db_query(\"\"\"\n SELECT ed.public_path\n FROM entity e\n LEFT JOIN entity_definition ed ON ed.keyname = e.entity_definition_keyname\n WHERE e.id = %s\n AND e.is_deleted = 0\n AND ed.is_deleted = 0\n AND e.sharing = 'public'\n AND ed.public_path IS NOT NULL\n \"\"\" % entity_id)\n return path", "metadata": "root.Entity.get_public_path", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 1957 }, { "content": " def get_menu(self):\n \"\"\"\n Returns user menu.\n\n \"\"\"\n\n if self.__user_id:\n user_select = \"\"\"\n SELECT\n t.entity_definition_keyname,\n t.field,\n t.value,\n (\n SELECT entity.id\n FROM entity\n WHERE entity.entity_definition_keyname = t.entity_definition_keyname\n AND entity.is_deleted = 0\n AND entity.sharing IN ('domain', 'public')\n LIMIT 1\n ) AS x\n FROM\n translation AS t\n WHERE t.field IN ('menu', 'label', 'label_plural')\n AND IFNULL(t.language, '%(language)s') = '%(language)s'\n HAVING x IS NOT NULL\n UNION SELECT\n t.entity_definition_keyname,\n t.field,\n t.value,\n (\n SELECT entity.id\n FROM entity, relationship\n WHERE relationship.entity_id = entity.id\n AND entity.entity_definition_keyname = t.entity_definition_keyname\n AND entity.is_deleted = 0\n AND relationship.is_deleted = 0\n AND relationship.relationship_definition_keyname IN ('viewer', 'expander', 'editor', 'owner')\n AND relationship.related_entity_id = %(user_id)s\n LIMIT 1\n ) AS x\n FROM\n translation AS t\n WHERE t.field IN ('menu', 'label', 'label_plural')\n AND IFNULL(t.language, '%(language)s') = '%(language)s'\n HAVING x IS NOT NULL\n \"\"\" % {'user_id': self.__user_id, 'language': self.__language}\n else:\n user_select = \"\"\"\n SELECT\n t.entity_definition_keyname,\n t.field,\n t.value,\n (\n SELECT entity.id\n FROM entity\n WHERE entity.entity_definition_keyname = t.entity_definition_keyname\n AND entity.is_deleted = 0\n AND entity.sharing = 'public'\n LIMIT 1\n ) AS x\n FROM\n translation AS t\n WHERE t.field IN ('menu', 'label', 'label_plural')\n AND IFNULL(t.language, '%(language)s') = '%(language)s'\n HAVING x IS NOT NULL\n \"\"\" % {'language': self.__language}\n\n\n sql = \"\"\"\n SELECT\n entity_definition_keyname AS definition,\n MAX(IF(field='menu', value, NULL)) AS menu,\n MAX(IF(field='label', value, NULL)) AS label,\n MAX(IF(field='label_plural', value, NULL)) AS label_plural\n FROM (\n %s\n ) AS x\n GROUP BY definition\n HAVING menu IS NOT NULL\n ORDER BY\n menu,\n label_plural;\n \"\"\" % user_select\n # logging.debug(sql)\n\n menu = {}\n for m in self.db_query(sql):\n menu.setdefault(m.get('menu'), {})['label'] = m.get('menu')\n menu.setdefault(m.get('menu'), {}).setdefault('items', []).append({'keyname': m.get('definition'), 'title': m.get('label_plural')})\n\n return sorted(menu.values(), key=itemgetter('label'))", "metadata": "root.Entity.get_menu", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 1976 }, { "content": "def findTags(s, beginning, end):\n \"\"\"\n Finds and returns list of tags from string.\n\n \"\"\"\n if not s:\n return []\n return re.compile('%s(.*?)%s' % (beginning, end), re.DOTALL).findall(s)", "metadata": "root.findTags", "header": "['module', '___EOS___']", "index": 2069 } ]
[ { "span": "from tornado import locale", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 26 }, { "span": "from decimal import Decimal", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 27 }, { "span": "import dateutil", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 15 }, { "span": "import math", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 11 }, { "span": "import time", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 11 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "tornado_", "import_", "locale_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "datetime_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "decimal_", "import_", "Decimal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "operator_", "import_", "itemgetter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "dateutil_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "hashlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "math_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "helper_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Entit", "y", " ", "class", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "translation_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "formula", "\\u", "proper", "ties", "(", "self", ",", " ", "entity", "\\u", "id", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sql", " ", "=", " ", "\"\"\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "SELECT", " ", "*_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "FROM", " ", "property", " ", "p_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "WHE", "RE", " ", "p", ".", "entity", "\\u", "id", " ", "=", " ", "%", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "AND", " ", "p", ".", "value", "\\u", "formula", " ", "is", " ", "not", " ", "null_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "AND", " ", "p", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "ORDE", "R", " ", "BY", " ", "p", ".", "id_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", ";", "\"\"\"", " ", "%", " ", "entity", "\\u", "id_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "logg", "ing", ".", "debug", "(", "sql", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "return", " ", "self", ".", "db", "\\u", "query", "(", "sql", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "user", "\\u", "id_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "current", "\\u", "user_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "self_", "._", "current", "\\u", "user_", "._", "get_", "(_", "'", "id", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "current", "\\u", "user_", "._", "get_", "(_", "'", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "language_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get", "\\u", "user", "\\u", "locale_", "(_", ")_", "._", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "self_", ",_", "field_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "''_", ",_", "property", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "\\u\\u", "translation_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "translation_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "t_", "in_", "self_", "._", "db", "\\u", "query_", "(_", "'", "SELECT", " ", "field", ",", " ", "value", ",", " ", "IF", "NULL", "(", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", " ", "\\\\'\\\\", "')", " ", "AS", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", " ", "IF", "NULL", "(", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", " ", "\\\\'\\\\", "')", " ", "AS", " ", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "FROM", " ", "translatio", "n", " ", "WHE", "RE", " ", "language", " ", "=", " ", "%", "s", " ", "OR", " ", "language", " ", "IS", " ", "NULL", " ", "ORDE", "R", " ", "BY", " ", "language", ";'_", ",_", "self_", "._", "get", "\\u", "user", "\\u", "locale_", "(_", ")_", "._", "code_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "translation_", "[_", "'%", "s", "|", "%", "s", "|", "%", "s", "'_", "%_", "(_", "t_", "._", "get_", "(_", "'", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "'_", ")_", ",_", "t_", "._", "get_", "(_", "'", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", "'_", ")_", ",_", "t_", "._", "get_", "(_", "'", "field", "'_", ")_", ")_", "]_", "=_", "t_", "._", "get_", "(_", "'", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u\\u", "translation_", "._", "get_", "(_", "'%", "s", "|", "%", "s", "|", "%", "s", "'_", "%_", "(_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ",_", "property", "\\u", "definit", "ion", "\\u", "keyname_", ",_", "field_", ")_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "entity_", "(_", "self_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ",_", "parent", "\\u", "entity", "\\u", "id_", "=_", "None_", ",_", "ignore", "\\u", "user_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Creat", "es", " ", "new", " ", "Entit", "y", " ", "and", " ", "return", "s", " ", "its", " ", "ID", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "ignore", "\\u", "user_", "==_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "id_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "\\u\\u", "user", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "user", "\\u", "id_", "=_", "self_", "._", "\\u\\u", "user", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "logg", "ing", ".", "debug", "('", "creati", "ng", " ", "%", "s", " ", "under", " ", "entity", " ", "%", "s", "'", " ", "%", " ", "(", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", " ", "parent", "\\u", "entity", "\\u", "id", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "entity_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "INSERT", " ", "INT", "O", " ", "entity", " ", "SET", "\\", "10", ";", " ", " ", " ", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "%", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "created", "\\u", "by", " ", "=", " ", "%", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "created", " ", "=", " ", "NOW", "();", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logg", "ing", ".", "debug", "(", "sql", ")_", "\\u\\u\\uNL\\u\\u\\u_", "entity", "\\u", "id_", "=_", "self_", "._", "db", "\\u", "execute", "\\u", "lastr", "owi", "d_", "(_", "sql_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ",_", "user", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "parent", "\\u", "entity", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "entity", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Propag", "ate", " ", "shar", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "parent_", "=_", "self_", "._", "db", "\\u", "get_", "(_", "'", "SELECT", " ", "shar", "ing", " ", "FROM", " ", "entity", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "s", " ", "LIMIT", " ", "1", ";'_", ",_", "parent", "\\u", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db", "\\u", "execute_", "(_", "'", "UPDATE", " ", "entity", " ", "SET", " ", "shar", "ing", " ", "=", " ", "%", "s", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "s", " ", "LIMIT", " ", "1", ";'_", ",_", "parent_", "._", "get_", "(_", "'", "shar", "ing", "'_", ")_", ",_", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Insert", " ", "child", " ", "relation", "ship", " ", "and", "/", "or", " ", "default", " ", "parent", " ", "child", " ", "relationship_", "\\u\\u\\uNL\\u\\u\\u_", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "INSERT", " ", "INT", "O", " ", "relation", "ship", " ", "(", "\\", "10", ";", " ", " ", " ", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", "\\", "10", ";", " ", " ", " ", " ", "entity", "\\u", "id", ",", "\\", "10", ";", " ", " ", " ", " ", "relate", "d\\u", "entity", "\\u", "id", ",", "\\", "10", ";", " ", " ", " ", " ", "created", "\\u", "by", ",", "\\", "10", ";", " ", " ", " ", " ", "created", "\\", "10", ";", " ", " ", " ", " ", ")", " ", "SELECT", " ", "/*", " ", "SQL", "\\u", "NO", "\\u", "CACHE", " ", "*/", "\\", "10", ";", " ", " ", " ", " ", "'", "child", "',", "\\", "10", ";", " ", " ", " ", " ", "r", ".", "relate", "d\\u", "entity", "\\u", "id", ",", "\\", "10", ";", " ", " ", " ", " ", "%", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "%", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "NOW", "()", "\\", "10", ";", " ", " ", " ", " ", "FROM", " ", "relation", "ship", " ", "AS", " ", "r", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "r", ".", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "'", "default", "-", "parent", "'", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "r", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "r", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "UNION", " ", "SELECT", "\\", "10", ";", " ", " ", " ", " ", "'", "child", "',", "\\", "10", ";", " ", " ", " ", " ", "%", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "%", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "%", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "NOW", "();", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logg", "ing", ".", "debug", "(", "sql", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "db", "\\u", "execute_", "(_", "sql_", ",_", "entity", "\\u", "id_", ",_", "user", "\\u", "id_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ",_", "parent", "\\u", "entity", "\\u", "id_", ",_", "entity", "\\u", "id_", ",_", "user", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Insert", " ", "or", " ", "update", " ", "\"", "contain", "s", "\"", " ", "information_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "row_", "in_", "self_", "._", "db", "\\u", "query_", "(_", "\"", "SELECT", " ", "entity", "\\u", "id", " ", "FROM", " ", "relation", "ship", " ", "r", " ", "WHE", "RE", " ", "r", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", " ", "AND", " ", "r", ".", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "'", "child", "'", " ", "AND", " ", "r", ".", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "s", "\"_", ",_", "entity", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "db", "\\u", "execute_", "(_", "'", "INSERT", " ", "INT", "O", " ", "dag", "\\u", "entity", " ", "SET", " ", "entity", "\\u", "id", " ", "=", " ", "%", "s", ",", " ", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "s", " ", "ON", " ", "DUPL", "ICAT", "E", " ", "KEY", " ", "UPDATE", " ", "distance", "=", "1", ";'_", ",_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db", "\\u", "execute_", "(_", "'", "INSERT", " ", "INT", "O", " ", "dag", "\\u", "entity", " ", "SELECT", " ", "de", ".", "entity", "\\u", "id", ",", " ", "%", "s", ",", " ", "de", ".", "distance", "+", "1", " ", "FROM", " ", "dag", "\\u", "entity", " ", "AS", " ", "de", " ", "WHE", "RE", " ", "de", ".", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "s", " ", "ON", " ", "DUPL", "ICAT", "E", " ", "KEY", " ", "UPDATE", " ", "distance", " ", "=", " ", "LEA", "ST", "(", "dag", "\\u", "entity", ".", "distance", ",", " ", "de", ".", "distance", "+", "1", ");'_", ",_", "entity", "\\u", "id_", ",_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", " ", "user", " ", "rights_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "INSERT", " ", "INT", "O", " ", "relation", "ship", " ", "(", "\\", "10", ";", " ", " ", " ", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", "\\", "10", ";", " ", " ", " ", " ", "entity", "\\u", "id", ",", "\\", "10", ";", " ", " ", " ", " ", "relate", "d\\u", "entity", "\\u", "id", ",", "\\", "10", ";", " ", " ", " ", " ", "created", "\\u", "by", ",", "\\", "10", ";", " ", " ", " ", " ", "created", "\\", "10", ";", " ", " ", " ", " ", ")", " ", "SELECT", " ", "/*", " ", "SQL", "\\u", "NO", "\\u", "CACHE", " ", "*/", "\\", "10", ";", " ", " ", " ", " ", "rr", ".", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", "\\", "10", ";", " ", " ", " ", " ", "%", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "rr", ".", "relate", "d\\u", "entity", "\\u", "id", ",", "\\", "10", ";", " ", " ", " ", " ", "%", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "NOW", "()", "\\", "10", ";", " ", " ", " ", " ", "FROM", " ", " ", "relation", "ship", " ", "r", "\\", "10", ";", " ", " ", " ", " ", "LEF", "T", " ", "JOIN", " ", "relation", "ship", " ", "rr", " ", "ON", " ", "rr", ".", "entity", "\\u", "id", " ", "=", " ", "r", ".", "entity", "\\u", "id", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "r", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", " ", " ", "r", ".", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", " ", " ", "r", ".", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "'", "child", "'", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", " ", " ", "rr", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", " ", " ", "rr", ".", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "IN", " ", "('", "viewer", "',", " ", "'", "expander", "',", " ", "'", "editor", "',", " ", "'", "owner", "');", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logg", "ing", ".", "debug", "(", "sql", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "db", "\\u", "execute_", "(_", "sql_", ",_", "entity", "\\u", "id_", ",_", "user", "\\u", "id_", ",_", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "set", " ", "creat", "or", " ", "to", " ", "owner_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "user", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "rights_", "(_", "entity", "\\u", "id_", "=_", "entity", "\\u", "id_", ",_", "relate", "d\\u", "entity", "\\u", "id_", "=_", "user", "\\u", "id_", ",_", "right_", "=_", "'", "owner", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Populate", " ", "default", " ", "values_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "default", "\\u", "value_", "in_", "self_", "._", "db", "\\u", "query_", "(_", "'", "SELECT", " ", "keyn", "ame", ",", " ", "default", "value", " ", "FROM", " ", "property", "\\u", "definit", "ion", " ", "WHE", "RE", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "%", "s", " ", "AND", " ", "default", "value", " ", "IS", " ", "NOT", " ", "null", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "property_", "(_", "entity", "\\u", "id_", "=_", "entity", "\\u", "id_", ",_", "property", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "default", "\\u", "value_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ",_", "value_", "=_", "default", "\\u", "value_", "._", "get_", "(_", "'", "default", "value", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Propag", "ate", " ", "properties_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "INSERT", " ", "INT", "O", " ", "property", " ", "(", "\\", "10", ";", " ", " ", " ", " ", "entity", "\\u", "id", ",", "\\", "10", ";", " ", " ", " ", " ", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", "\\", "10", ";", " ", " ", " ", " ", "language", ",", "\\", "10", ";", " ", " ", " ", " ", "value", "\\u", "string", ",", "\\", "10", ";", " ", " ", " ", " ", "value", "\\u", "text", ",", "\\", "10", ";", " ", " ", " ", " ", "value", "\\u", "integ", "er", ",", "\\", "10", ";", " ", " ", " ", " ", "value", "\\u", "decima", "l", ",", "\\", "10", ";", " ", " ", " ", " ", "value", "\\u", "boolean", ",", "\\", "10", ";", " ", " ", " ", " ", "value", "\\u", "datetime", ",", "\\", "10", ";", " ", " ", " ", " ", "value", "\\u", "entity", ",", "\\", "10", ";", " ", " ", " ", " ", "value", "\\u", "reference", ",", "\\", "10", ";", " ", " ", " ", " ", "value", "\\u", "file", ",", "\\", "10", ";", " ", " ", " ", " ", "value", "\\u", "counter", ",", "\\", "10", ";", " ", " ", " ", " ", "created", "\\u", "by", ",", "\\", "10", ";", " ", " ", " ", " ", "created", "\\", "10", ";", " ", " ", " ", " ", ")", " ", "SELECT", " ", "/*", " ", "SQL", "\\u", "NO", "\\u", "CACHE", " ", "*/", "\\", "10", ";", " ", " ", " ", " ", "%", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "r", ".", "relate", "d\\u", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "language", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "value", "\\u", "string", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "value", "\\u", "text", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "value", "\\u", "integ", "er", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "value", "\\u", "decima", "l", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "value", "\\u", "boolean", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "value", "\\u", "datetime", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "value", "\\u", "entity", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "value", "\\u", "reference", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "value", "\\u", "file", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "value", "\\u", "counter", ",", "\\", "10", ";", " ", " ", " ", " ", "%", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "NOW", "()", "\\", "10", ";", " ", " ", " ", " ", "FROM", "\\", "10", ";", " ", " ", " ", " ", "relation", "ship", " ", "AS", " ", "r", ",", "\\", "10", ";", " ", " ", " ", " ", "property", " ", "AS", " ", "p", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "p", ".", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "r", ".", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "p", ".", "entity", "\\u", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "r", ".", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "'", "propagate", "d", "-", "property", "'", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "p", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "r", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logg", "ing", ".", "debug", "(", "sql", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "db", "\\u", "execute_", "(_", "sql_", ",_", "entity", "\\u", "id_", ",_", "user", "\\u", "id_", ",_", "parent", "\\u", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "db", "\\u", "execute_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "INSERT", " ", "INT", "O", " ", "property", " ", "(", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", " ", "entity", "\\u", "id", ",", " ", "value", "\\u", "display", ",", " ", "value", "\\u", "datetime", ",", " ", "created", "\\u", "by", ",", " ", "created", ")", "\\", "10", ";", " ", " ", " ", " ", "SELECT", " ", "keyn", "ame", ",", " ", "%", "s", ",", " ", "NOW", "()", ",", " ", "NOW", "()", ",", " ", "%", "s", ",", " ", "NOW", "()", "\\", "10", ";", " ", " ", " ", " ", "FROM", " ", "property", "\\u", "definit", "ion", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "datapro", "pert", "y", " ", "=", " ", "'", "ent", "u", "-", "created", "-", "at", "'", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "%", "s", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ",_", "entity", "\\u", "id_", ",_", "user", "\\u", "id_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "user", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "db", "\\u", "execute_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "INSERT", " ", "INT", "O", " ", "property", " ", "(", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", " ", "entity", "\\u", "id", ",", " ", "value", "\\u", "reference", ",", " ", "created", "\\u", "by", ",", " ", "created", ")", "\\", "10", ";", " ", " ", " ", " ", "SELECT", " ", "keyn", "ame", ",", " ", "%", "s", ",", " ", "%", "s", ",", " ", "%", "s", ",", " ", "NOW", "()", "\\", "10", ";", " ", " ", " ", " ", "FROM", " ", "property", "\\u", "definit", "ion", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "datapro", "pert", "y", " ", "=", " ", "'", "ent", "u", "-", "created", "-", "by", "'", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "%", "s", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ",_", "entity", "\\u", "id_", ",_", "user", "\\u", "id_", ",_", "user", "\\u", "id_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "entity", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "duplicat", "e\\u", "entity_", "(_", "self_", ",_", "entity", "\\u", "id_", ",_", "copie", "s_", "=_", "1_", ",_", "skip", "\\u", "property", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "entity", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "skip", "\\u", "property", "\\u", "definit", "ion", "\\u", "keyname_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "skip", "\\u", "property", "\\u", "definit", "ion", "\\u", "keyname_", ")_", "is_", "not_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "skip", "\\u", "property", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "[_", "skip", "\\u", "property", "\\u", "definit", "ion", "\\u", "keyname_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "proper", "ties", "\\u", "sql_", "=_", "'", "AND", " ", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "NOT", " ", "IN", " ", "(%", "s", ")'_", "%_", "','_", "._", "join_", "(_", "[_", "'\\\\'", "%", "s", "\\\\''_", "%_", "x_", "for_", "x_", "in_", "map_", "(_", "str_", ",_", "skip", "\\u", "property", "\\u", "definit", "ion", "\\u", "keyname_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "proper", "ties", "\\u", "sql_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "x_", "in_", "range_", "(_", "int_", "(_", "copie", "s_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "entity", "\\u", "id_", "=_", "self_", "._", "db", "\\u", "execute", "\\u", "lastr", "owi", "d_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "INSERT", " ", "INT", "O", " ", "entity", " ", "(", "\\", "10", ";", " ", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", "\\", "10", ";", " ", " ", "shar", "ing", ",", "\\", "10", ";", " ", " ", "created", ",", "\\", "10", ";", " ", " ", "created", "\\u", "by", "\\", "10", ";", " ", " ", " ", " ", ")", " ", "SELECT", "\\", "10", ";", " ", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", "\\", "10", ";", " ", " ", "shar", "ing", ",", "\\", "10", ";", " ", " ", "NOW", "()", ",", "\\", "10", ";", " ", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "FROM", " ", "entity", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "s", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ",_", "self_", "._", "\\u\\u", "user", "\\u", "id_", ",_", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "db", "\\u", "execute_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "INSERT", " ", "INT", "O", " ", "property", " ", "(", "\\", "10", ";", " ", " ", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", "\\", "10", ";", " ", " ", "entity", "\\u", "id", ",", "\\", "10", ";", " ", " ", "ordinal", ",", "\\", "10", ";", " ", " ", "language", ",", "\\", "10", ";", " ", " ", "value", "\\u", "display", ",", "\\", "10", ";", " ", " ", "value", "\\u", "formula", ",", "\\", "10", ";", " ", " ", "value", "\\u", "string", ",", "\\", "10", ";", " ", " ", "value", "\\u", "text", ",", "\\", "10", ";", " ", " ", "value", "\\u", "integ", "er", ",", "\\", "10", ";", " ", " ", "value", "\\u", "decima", "l", ",", "\\", "10", ";", " ", " ", "value", "\\u", "boolean", ",", "\\", "10", ";", " ", " ", "value", "\\u", "datetime", ",", "\\", "10", ";", " ", " ", "value", "\\u", "entity", ",", "\\", "10", ";", " ", " ", "value", "\\u", "reference", ",", "\\", "10", ";", " ", " ", "value", "\\u", "file", ",", "\\", "10", ";", " ", " ", "value", "\\u", "counter", ",", "\\", "10", ";", " ", " ", "created", ",", "\\", "10", ";", " ", " ", "created", "\\u", "by", "\\", "10", ";", " ", " ", " ", " ", ")", " ", "SELECT", "\\", "10", ";", " ", " ", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", "\\", "10", ";", " ", " ", "%", "s", ",", "\\", "10", ";", " ", " ", "ordinal", ",", "\\", "10", ";", " ", " ", "language", ",", "\\", "10", ";", " ", " ", "value", "\\u", "display", ",", "\\", "10", ";", " ", " ", "value", "\\u", "formula", ",", "\\", "10", ";", " ", " ", "value", "\\u", "string", ",", "\\", "10", ";", " ", " ", "value", "\\u", "text", ",", "\\", "10", ";", " ", " ", "value", "\\u", "integ", "er", ",", "\\", "10", ";", " ", " ", "value", "\\u", "decima", "l", ",", "\\", "10", ";", " ", " ", "value", "\\u", "boolean", ",", "\\", "10", ";", " ", " ", "value", "\\u", "datetime", ",", "\\", "10", ";", " ", " ", "value", "\\u", "entity", ",", "\\", "10", ";", " ", " ", "value", "\\u", "reference", ",", "\\", "10", ";", " ", " ", "value", "\\u", "file", ",", "\\", "10", ";", " ", " ", "value", "\\u", "counter", ",", "\\", "10", ";", " ", " ", "NOW", "()", ",", "\\", "10", ";", " ", " ", "%", "s", "\\", "10", ";", " ", " ", "FROM", " ", "property", "\\", "10", ";", " ", " ", "WHE", "RE", " ", "entity", "\\u", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", "%", "s", "\\", "10", ";", " ", " ", "AND", " ", "is", "\\u", "delete", "d", " ", "=", " ", "0", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "(_", "new", "\\u", "entity", "\\u", "id_", ",_", "self_", "._", "\\u\\u", "user", "\\u", "id_", ",_", "entity", "\\u", "id_", ",_", "proper", "ties", "\\u", "sql_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "db", "\\u", "execute_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "INSERT", " ", "INT", "O", " ", "relation", "ship", " ", "(", "\\", "10", ";", " ", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", "\\", "10", ";", " ", " ", "entity", "\\u", "id", ",", "\\", "10", ";", " ", " ", "relate", "d\\u", "entity", "\\u", "id", ",", "\\", "10", ";", " ", " ", "created", ",", "\\", "10", ";", " ", " ", "created", "\\u", "by", "\\", "10", ";", " ", " ", " ", " ", ")", " ", "SELECT", "\\", "10", ";", " ", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", "\\", "10", ";", " ", " ", "%", "s", ",", "\\", "10", ";", " ", " ", "relate", "d\\u", "entity", "\\u", "id", ",", "\\", "10", ";", " ", " ", "NOW", "()", ",", "\\", "10", ";", " ", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "FROM", " ", "relation", "ship", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "entity", "\\u", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "IN", " ", "('", "viewer", "',", " ", "'", "expander", "',", " ", "'", "editor", "',", " ", "'", "owner", "')", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "is", "\\u", "delete", "d", " ", "=", " ", "0", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ",_", "new", "\\u", "entity", "\\u", "id_", ",_", "self_", "._", "\\u\\u", "user", "\\u", "id_", ",_", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "db", "\\u", "execute_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "INSERT", " ", "INT", "O", " ", "relation", "ship", " ", "(", "\\", "10", ";", " ", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", "\\", "10", ";", " ", " ", "entity", "\\u", "id", ",", "\\", "10", ";", " ", " ", "relate", "d\\u", "entity", "\\u", "id", ",", "\\", "10", ";", " ", " ", "created", ",", "\\", "10", ";", " ", " ", "created", "\\u", "by", "\\", "10", ";", " ", " ", " ", " ", ")", " ", "SELECT", "\\", "10", ";", " ", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", "\\", "10", ";", " ", " ", "entity", "\\u", "id", ",", "\\", "10", ";", " ", " ", "%", "s", ",", "\\", "10", ";", " ", " ", "NOW", "()", ",", "\\", "10", ";", " ", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "FROM", " ", "relation", "ship", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "IN", " ", "('", "child", "',", " ", "'", "viewer", "',", " ", "'", "expander", "',", " ", "'", "editor", "',", " ", "'", "owner", "')", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "is", "\\u", "delete", "d", " ", "=", " ", "0", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ",_", "new", "\\u", "entity", "\\u", "id_", ",_", "self_", "._", "\\u\\u", "user", "\\u", "id_", ",_", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "db", "\\u", "execute_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "INSERT", " ", "INT", "O", " ", "property", " ", "(", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", " ", "entity", "\\u", "id", ",", " ", "value", "\\u", "display", ",", " ", "value", "\\u", "datetime", ",", " ", "created", "\\u", "by", ",", " ", "created", ")", "\\", "10", ";", " ", " ", " ", " ", "SELECT", " ", "keyn", "ame", ",", " ", "%", "s", ",", " ", "NOW", "()", ",", " ", "NOW", "()", ",", " ", "%", "s", ",", " ", "NOW", "()", "\\", "10", ";", " ", " ", " ", " ", "FROM", " ", "property", "\\u", "definit", "ion", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "datapro", "pert", "y", " ", "=", " ", "'", "ent", "u", "-", "created", "-", "at", "'", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "(", "SELECT", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "FROM", " ", "entity", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "s", " ", "LIMIT", " ", "1", ");", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ",_", "new", "\\u", "entity", "\\u", "id_", ",_", "self_", "._", "\\u\\u", "user", "\\u", "id_", ",_", "new", "\\u", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "db", "\\u", "execute_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "INSERT", " ", "INT", "O", " ", "property", " ", "(", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", " ", "entity", "\\u", "id", ",", " ", "value", "\\u", "reference", ",", " ", "created", "\\u", "by", ",", " ", "created", ")", "\\", "10", ";", " ", " ", " ", " ", "SELECT", " ", "keyn", "ame", ",", " ", "%", "s", ",", " ", "%", "s", ",", " ", "%", "s", ",", " ", "NOW", "()", "\\", "10", ";", " ", " ", " ", " ", "FROM", " ", "property", "\\u", "definit", "ion", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "datapro", "pert", "y", " ", "=", " ", "'", "ent", "u", "-", "created", "-", "by", "'", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "(", "SELECT", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "FROM", " ", "entity", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "s", " ", "LIMIT", " ", "1", ");", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ",_", "new", "\\u", "entity", "\\u", "id_", ",_", "self_", "._", "\\u\\u", "user", "\\u", "id_", ",_", "self_", "._", "\\u\\u", "user", "\\u", "id_", ",_", "new", "\\u", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "\\u", "entity_", "(_", "self_", ",_", "entity", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "db", "\\u", "get_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", " ", "entity", "\\u", "id", "\\", "10", ";", " ", " ", " ", " ", "FROM", " ", "relation", "ship", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "IN", " ", "('", "owner", "')", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "entity", "\\u", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "is", "\\u", "delete", "d", " ", "=", " ", "0", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "entity", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "user", "\\u", "id_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "child", "\\u", "id_", "in_", "self_", "._", "get", "\\u", "relative", "s_", "(_", "ids", "\\u", "only_", "=_", "True_", ",_", "entity", "\\u", "id_", "=_", "entity", "\\u", "id_", ",_", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "'", "child", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "delete", "\\u", "entity_", "(_", "child", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "db", "\\u", "execute_", "(_", "'", "UPDATE", " ", "entity", " ", "SET", " ", "delete", "d", " ", "=", " ", "NOW", "()", ",", " ", "is", "\\u", "delete", "d", " ", "=", " ", "1", ",", " ", "delete", "d\\u", "by", " ", "=", " ", "%", "s", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "s", ";'_", ",_", "self_", "._", "\\u\\u", "user", "\\u", "id_", ",_", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "remove", " ", "\"", "contain", "s", "\"", " ", "information_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "db", "\\u", "execute_", "(_", "'", "DELET", "E", " ", "FROM", " ", "dag", "\\u", "entity", " ", "WHE", "RE", " ", "entity", "\\u", "id", " ", "=", " ", "%", "s", " ", "OR", " ", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "s", ";'_", ",_", "entity", "\\u", "id_", ",_", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "property_", "(_", "self_", ",_", "entity", "\\u", "id_", "=_", "None_", ",_", "relation", "ship", "\\u", "id_", "=_", "None_", ",_", "property", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "None_", ",_", "value_", "=_", "None_", ",_", "old", "\\u", "property", "\\u", "id_", "=_", "None_", ",_", "uploade", "d\\u", "file_", "=_", "None_", ",_", "ignore", "\\u", "user_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Save", "s", " ", "property", " ", "value", ".", " ", "Creat", "es", " ", "new", " ", "one", " ", "if", " ", "old", "\\u", "property", "\\u", "id", " ", "=", " ", "Non", "e", ".", " ", "Return", "s", " ", "new", "\\u", "property", "\\u", "id", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "entity", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ignore", "\\u", "user_", "==_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "id_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "\\u\\u", "user", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "user", "\\u", "id_", "=_", "self_", "._", "\\u\\u", "user", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "is", " ", "prefer", "red", " ", "bec", "aus", "e", " ", "it", " ", "coul", "d", " ", "change", " ", "for", " ", "exist", "ing", " ", "property_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "old", "\\u", "property", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "definition_", "=_", "self_", "._", "db", "\\u", "get_", "(_", "'", "SELECT", " ", "pd", ".", "keyn", "ame", ",", " ", "pd", ".", "datatype", ",", " ", "pd", ".", "formula", " ", "FROM", " ", "property", " ", "p", ",", " ", "property", "\\u", "definit", "ion", " ", "pd", " ", "WHE", "RE", " ", "pd", ".", "keyn", "ame", " ", "=", " ", "p", ".", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "AND", " ", "p", ".", "id", " ", "=", " ", "%", "s", " ", "LIMIT", " ", "1", ";'_", ",_", "old", "\\u", "property", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "property", "\\u", "definit", "ion", "\\u", "keyname_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "definition_", "=_", "self_", "._", "db", "\\u", "get_", "(_", "'", "SELECT", " ", "keyn", "ame", ",", " ", "datatype", ",", " ", "formula", " ", "FROM", " ", "property", "\\u", "definit", "ion", " ", "WHE", "RE", " ", "keyn", "ame", " ", "=", " ", "%", "s", " ", "LIMIT", " ", "1", ";'_", ",_", "property", "\\u", "definit", "ion", "\\u", "keyname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "definition_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "old", "\\u", "property", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "db", "\\u", "execute_", "(_", "'", "UPDATE", " ", "property", " ", "SET", " ", "delete", "d", " ", "=", " ", "NOW", "()", ",", " ", "is", "\\u", "delete", "d", " ", "=", " ", "1", ",", " ", "delete", "d\\u", "by", " ", "=", " ", "%", "s", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "s", ";'_", ",_", "user", "\\u", "id_", ",_", "old", "\\u", "property", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db", "\\u", "execute_", "(_", "'", "UPDATE", " ", "entity", " ", "SET", " ", "change", "d", " ", "=", " ", "NOW", "()", ",", " ", "change", "d\\u", "by", " ", "=", " ", "%", "s", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "s", ";'_", ",_", "user", "\\u", "id_", ",_", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "db", "\\u", "get_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", " ", "property", ".", "id", "\\", "10", ";", " ", " ", " ", " ", "FROM", " ", "property", ",", " ", "property", "\\u", "definit", "ion", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "property", "\\u", "definit", "ion", ".", "keyn", "ame", " ", "=", " ", "property", ".", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "property", ".", "entity", "\\u", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "property", "\\u", "definit", "ion", ".", "datapro", "pert", "y", " ", "=", " ", "'", "ent", "u", "-", "change", "d", "-", "at", "'", "\\", "10", ";", " ", " ", " ", " ", "LIMIT", " ", "1", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ",_", "entity", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "db", "\\u", "execute_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "UPDATE", " ", "property", ",", " ", "property", "\\u", "definit", "ion", "\\", "10", ";", " ", " ", " ", " ", "SET", " ", "property", ".", "value", "\\u", "display", " ", "=", " ", "NOW", "()", ",", " ", "property", ".", "value", "\\u", "datetime", " ", "=", " ", "NOW", "()", ",", " ", "property", ".", "created", "\\u", "by", " ", "=", " ", "%", "s", ",", " ", "property", ".", "created", " ", "=", " ", "NOW", "()", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "property", "\\u", "definit", "ion", ".", "keyn", "ame", " ", "=", " ", "property", ".", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "property", ".", "entity", "\\u", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "property", "\\u", "definit", "ion", ".", "datapro", "pert", "y", " ", "=", " ", "'", "ent", "u", "-", "change", "d", "-", "at", "';", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ",_", "user", "\\u", "id_", ",_", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "db", "\\u", "execute_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "INSERT", " ", "INT", "O", " ", "property", " ", "(", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", " ", "entity", "\\u", "id", ",", " ", "value", "\\u", "display", ",", " ", "value", "\\u", "datetime", ",", " ", "created", "\\u", "by", ",", " ", "created", ")", "\\", "10", ";", " ", " ", " ", " ", "SELECT", " ", "keyn", "ame", ",", " ", "%", "s", ",", " ", "NOW", "()", ",", " ", "NOW", "()", ",", " ", "%", "s", ",", " ", "NOW", "()", "\\", "10", ";", " ", " ", " ", " ", "FROM", " ", "property", "\\u", "definit", "ion", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "datapro", "pert", "y", " ", "=", " ", "'", "ent", "u", "-", "change", "d", "-", "at", "'", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "(", "SELECT", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "FROM", " ", "entity", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "s", " ", "LIMIT", " ", "1", ");", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ",_", "entity", "\\u", "id_", ",_", "user", "\\u", "id_", ",_", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "user", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "db", "\\u", "get_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", " ", "property", ".", "id", "\\", "10", ";", " ", " ", " ", " ", "FROM", " ", "property", ",", " ", "property", "\\u", "definit", "ion", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "property", "\\u", "definit", "ion", ".", "keyn", "ame", " ", "=", " ", "property", ".", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "property", ".", "entity", "\\u", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "property", "\\u", "definit", "ion", ".", "datapro", "pert", "y", " ", "=", " ", "'", "ent", "u", "-", "change", "d", "-", "by", "'", "\\", "10", ";", " ", " ", " ", " ", "LIMIT", " ", "1", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ",_", "entity", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "db", "\\u", "execute_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", "UPDATE", " ", "property", ",", " ", "property", "\\u", "definit", "ion", "\\", "10", ";", " ", " ", "SET", " ", "property", ".", "value", "\\u", "display", " ", "=", " ", "NULL", ",", " ", "property", ".", "value", "\\u", "reference", " ", "=", " ", "%", "s", ",", " ", "property", ".", "created", "\\u", "by", " ", "=", " ", "%", "s", ",", " ", "property", ".", "created", " ", "=", " ", "NOW", "()", "\\", "10", ";", " ", " ", "WHE", "RE", " ", "property", "\\u", "definit", "ion", ".", "keyn", "ame", " ", "=", " ", "property", ".", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", "AND", " ", "property", ".", "entity", "\\u", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", "AND", " ", "property", "\\u", "definit", "ion", ".", "datapro", "pert", "y", " ", "=", " ", "'", "ent", "u", "-", "change", "d", "-", "by", "';", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ",_", "user", "\\u", "id_", ",_", "user", "\\u", "id_", ",_", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "db", "\\u", "execute_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", "INSERT", " ", "INT", "O", " ", "property", " ", "(", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", " ", "entity", "\\u", "id", ",", " ", "value", "\\u", "reference", ",", " ", "created", "\\u", "by", ",", " ", "created", ")", "\\", "10", ";", " ", " ", "SELECT", " ", "keyn", "ame", ",", " ", "%", "s", ",", " ", "%", "s", ",", " ", "%", "s", ",", " ", "NOW", "()", "\\", "10", ";", " ", " ", "FROM", " ", "property", "\\u", "definit", "ion", "\\", "10", ";", " ", " ", "WHE", "RE", " ", "datapro", "pert", "y", " ", "=", " ", "'", "ent", "u", "-", "change", "d", "-", "by", "'", "\\", "10", ";", " ", " ", "AND", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "(", "SELECT", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "FROM", " ", "entity", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "s", " ", "LIMIT", " ", "1", ");", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ",_", "entity", "\\u", "id_", ",_", "user", "\\u", "id_", ",_", "user", "\\u", "id_", ",_", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "no", " ", "value", ",", " ", "then", " ", "property", " ", "is", " ", "delete", "d", ",", " ", "return_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "mongodb", "\\u", "entity_", "(_", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "value", "\\u", "display_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "definition_", "._", "get_", "(_", "'", "formula", "'_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field_", "=_", "'", "value", "\\u", "formula", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "definition_", "._", "get_", "(_", "'", "datatype", "'_", ")_", "==_", "'", "text", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field_", "=_", "'", "value", "\\u", "text", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "\\u", "display_", "=_", "'%", "s", "'_", "%_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "\\u", "display_", "=_", "value", "\\u", "display_", "[_", ":_", "500_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "definition_", "._", "get_", "(_", "'", "datatype", "'_", ")_", "==_", "'", "integ", "er", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field_", "=_", "'", "value", "\\u", "integ", "er", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "\\u", "display_", "=_", "'%", "s", "'_", "%_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "definition_", "._", "get_", "(_", "'", "datatype", "'_", ")_", "==_", "'", "decima", "l", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field_", "=_", "'", "value", "\\u", "decima", "l", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "value_", "._", "replace_", "(_", "','_", ",_", "'.'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "float_", "(_", "re_", "._", "sub_", "(_", "r", "'[", "^", "\\\\.", "0", "-", "9", ":]", "'_", ",_", "''_", ",_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "\\u", "display_", "=_", "round_", "(_", "value_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "definition_", "._", "get_", "(_", "'", "datatype", "'_", ")_", "==_", "'", "date", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field_", "=_", "'", "value", "\\u", "datetime", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "\\u", "display_", "=_", "'%", "s", "'_", "%_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "definition_", "._", "get_", "(_", "'", "datatype", "'_", ")_", "==_", "'", "datetime", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field_", "=_", "'", "value", "\\u", "datetime", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "\\u", "display_", "=_", "'%", "s", "'_", "%_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "definition_", "._", "get_", "(_", "'", "datatype", "'_", ")_", "==_", "'", "reference", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field_", "=_", "'", "value", "\\u", "reference", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "properties_", "(_", "entity", "\\u", "id_", "=_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "r_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value", "\\u", "display_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "properties_", "(_", "entity", "\\u", "id_", "=_", "value_", ")_", "[_", "0_", "]_", "[_", "'", "displayname", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "definition_", "._", "get_", "(_", "'", "datatype", "'_", ")_", "==_", "'", "file", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "uploade", "d\\u", "file_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "field_", "=_", "'", "value", "\\u", "file", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "\\u", "display_", "=_", "uploade", "d\\u", "file_", "[_", "'", "filename", "'_", "]_", "[_", ":_", "500_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "uploade", "d\\u", "file_", "._", "get_", "(_", "'", "url", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "self_", "._", "db", "\\u", "execute", "\\u", "lastr", "owi", "d_", "(_", "'", "INSERT", " ", "INT", "O", " ", "file", " ", "SET", " ", "url", " ", "=", " ", "%", "s", ",", " ", "filename", " ", "=", " ", "%", "s", ",", " ", "created", "\\u", "by", " ", "=", " ", "%", "s", ",", " ", "created", " ", "=", " ", "NOW", "();", "'_", ",_", "uploade", "d\\u", "file_", "._", "get_", "(_", "'", "url", "'_", ",_", "''_", ")_", ",_", "uploade", "d\\u", "file_", "._", "get_", "(_", "'", "filename", "'_", ",_", "''_", ")_", ",_", "user", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "uploade", "d\\u", "file_", "._", "get_", "(_", "'", "s3", "key", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "self_", "._", "db", "\\u", "execute", "\\u", "lastr", "owi", "d_", "(_", "'", "INSERT", " ", "INT", "O", " ", "file", " ", "SET", " ", "s3", "\\u", "key", " ", "=", " ", "%", "s", ",", " ", "filename", " ", "=", " ", "%", "s", ",", " ", "files", "ize", " ", "=", " ", "%", "s", ",", " ", "created", "\\u", "by", " ", "=", " ", "%", "s", ",", " ", "created", " ", "=", " ", "NOW", "();", "'_", ",_", "uploade", "d\\u", "file_", "._", "get_", "(_", "'", "s3", "key", "'_", ",_", "''_", ")_", ",_", "uploade", "d\\u", "file_", "._", "get_", "(_", "'", "filename", "'_", ",_", "''_", ")_", ",_", "uploade", "d\\u", "file_", "._", "get_", "(_", "'", "files", "ize", "'_", ",_", "''_", ")_", ",_", "user", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "md5_", "=_", "hashlib_", "._", "md5_", "(_", "uploade", "d\\u", "file_", "._", "get_", "(_", "'", "body", "'_", ")_", ")_", "._", "hexdigest_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "directory_", "=_", "os_", "._", "path_", "._", "join_", "(_", "'/'_", ",_", "'", "ent", "u", "'_", ",_", "'", "files", "'_", ",_", "self_", "._", "app", "\\u", "settings_", "(_", "'", "databa", "se", "-", "name", "'_", ")_", ",_", "md5_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filename_", "=_", "os_", "._", "path_", "._", "join_", "(_", "directory_", ",_", "md5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "directory_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "os_", "._", "makedirs_", "(_", "directory_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "f_", "=_", "open_", "(_", "filename_", ",_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "uploade", "d\\u", "file_", "._", "get_", "(_", "'", "body", "'_", ",_", "''_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "value_", "=_", "self_", "._", "db", "\\u", "execute", "\\u", "lastr", "owi", "d_", "(_", "'", "INSERT", " ", "INT", "O", " ", "file", " ", "SET", " ", "md5", " ", "=", " ", "%", "s", ",", " ", "filename", " ", "=", " ", "%", "s", ",", " ", "files", "ize", " ", "=", " ", "%", "s", ",", " ", "created", "\\u", "by", " ", "=", " ", "%", "s", ",", " ", "created", " ", "=", " ", "NOW", "();", "'_", ",_", "md5_", ",_", "uploade", "d\\u", "file_", "._", "get_", "(_", "'", "filename", "'_", ",_", "''_", ")_", ",_", "len_", "(_", "uploade", "d\\u", "file_", "._", "get_", "(_", "'", "body", "'_", ",_", "''_", ")_", ")_", ",_", "user", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "definition_", "._", "get_", "(_", "'", "datatype", "'_", ")_", "==_", "'", "boolean", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field_", "=_", "'", "value", "\\u", "boolean", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "1_", "if_", "value_", "._", "lower_", "(_", ")_", "==_", "'", "true", "'_", "else_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "\\u", "display_", "=_", "'%", "s", "'_", "%_", "bool_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "definition_", "._", "get_", "(_", "'", "datatype", "'_", ")_", "==_", "'", "counter", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field_", "=_", "'", "value", "\\u", "counter", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "\\u", "display_", "=_", "'%", "s", "'_", "%_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field_", "=_", "'", "value", "\\u", "string", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "value_", "[_", ":_", "500_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "\\u", "display_", "=_", "'%", "s", "'_", "%_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new", "\\u", "property", "\\u", "id_", "=_", "self_", "._", "db", "\\u", "execute", "\\u", "lastr", "owi", "d_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "INSERT", " ", "INT", "O", " ", "property", " ", "SET", "\\", "10", ";", " ", " ", " ", " ", "entity", "\\u", "id", " ", "=", " ", "%%", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "%%", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "%", "s", " ", "=", " ", "%%", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "value", "\\u", "display", " ", "=", " ", "%%", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "created", " ", "=", " ", "NOW", "()", ",", "\\", "10", ";", " ", " ", " ", " ", "created", "\\u", "by", " ", "=", " ", "%%", "s", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "field_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "entity", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "definition_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "value_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "value", "\\u", "display_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "user", "\\u", "id_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "definition_", "._", "get_", "(_", "'", "datatype", "'_", ")_", "==_", "'", "file", "'_", "and_", "uploade", "d\\u", "file_", "._", "get_", "(_", "'", "s3", "key", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "db", "\\u", "execute_", "(_", "'", "UPDATE", " ", "file", " ", "SET", " ", "s3", "\\u", "key", " ", "=", " ", "CONC", "AT", "(", "s3", "\\u", "key", ",", " ", "\\\\'", "/\\\\", "',", " ", "%", "s", ")", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "s", " ", "LIMIT", " ", "1", ";'_", ",_", "new", "\\u", "property", "\\u", "id_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "db", "\\u", "execute_", "(_", "'", "UPDATE", " ", "entity", " ", "SET", " ", "change", "d", " ", "=", " ", "NOW", "()", ",", " ", "change", "d\\u", "by", " ", "=", " ", "%", "s", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "s", ";'_", ",_", "user", "\\u", "id_", ",_", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "set\\u", "mongodb", "\\u", "entity_", "(_", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "new", "\\u", "property", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "mongodb", "\\u", "entity_", "(_", "self_", ",_", "entity", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", "\\", "10", ";", " ", " ", " ", " ", "REPLACE", "(", "REPLACE", "(", "e", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", " ", "'\\u", "',", " ", "'-'", "),", " ", "'.'", ",", " ", "'-'", ")", " ", "AS", " ", "entity", "\\u", "definit", "ion", ",", "\\", "10", ";", " ", " ", " ", " ", "e", ".", "id", " ", " ", " ", " ", " ", "AS", " ", "entity", "\\u", "id", ",", "\\", "10", ";", " ", " ", " ", " ", "e", ".", "shar", "ing", " ", " ", " ", " ", "AS", " ", "entity", "\\u", "shar", "ing", ",", "\\", "10", ";", " ", " ", " ", " ", "e", ".", "created", " ", " ", " ", " ", "AS", " ", "entity", "\\u", "created", ",", "\\", "10", ";", " ", " ", " ", " ", "IF", "(", "CAST", "(", "e", ".", "created", "\\u", "by", " ", "AS", " ", "UNSIGNED", ")", " ", ">", " ", "0", ",", " ", "CAST", "(", "e", ".", "created", "\\u", "by", " ", "AS", " ", "UNSIGNED", "),", " ", "NULL", ")", " ", "AS", " ", "entity", "\\u", "created", "\\u", "by", ",", "\\", "10", ";", " ", " ", " ", " ", "e", ".", "change", "d", " ", " ", " ", " ", "AS", " ", "entity", "\\u", "change", "d", ",", "\\", "10", ";", " ", " ", " ", " ", "IF", "(", "CAST", "(", "e", ".", "change", "d\\u", "by", " ", "AS", " ", "UNSIGNED", ")", " ", ">", " ", "0", ",", " ", "CAST", "(", "e", ".", "change", "d\\u", "by", " ", "AS", " ", "UNSIGNED", "),", " ", "NULL", ")", " ", "AS", " ", "entity", "\\u", "change", "d\\u", "by", ",", "\\", "10", ";", " ", " ", " ", " ", "e", ".", "delete", "d", " ", " ", " ", " ", "AS", " ", "entity", "\\u", "delete", "d", ",", "\\", "10", ";", " ", " ", " ", " ", "IF", "(", "CAST", "(", "e", ".", "delete", "d\\u", "by", " ", "AS", " ", "UNSIGNED", ")", " ", ">", " ", "0", ",", " ", "CAST", "(", "e", ".", "delete", "d\\u", "by", " ", "AS", " ", "UNSIGNED", "),", " ", "NULL", ")", " ", "AS", " ", "entity", "\\u", "delete", "d\\u", "by", ",", "\\", "10", ";", " ", " ", " ", " ", "e", ".", "is", "\\u", "delete", "d", " ", "AS", " ", "entity", "\\u", "is", "\\u", "delete", "d", ",", "\\", "10", ";", " ", " ", " ", " ", "e", ".", "old", "\\u", "id", " ", "AS", " ", "entity", "\\u", "old", "\\u", "id", "\\", "10", ";", " ", " ", " ", " ", "FROM", "\\", "10", ";", " ", " ", " ", " ", "entity", " ", "AS", " ", "e", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "e", ".", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "LIMIT", " ", "1", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "=_", "self_", "._", "db", "\\u", "get_", "(_", "sql_", ",_", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mysql", "\\u", "id_", "=_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "e_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "[_", "'\\u", "mid", "'_", "]_", "=_", "mysql", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "[_", "'\\u", "definit", "ion", "'_", "]_", "=_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "definit", "ion", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "[_", "'\\u", "shar", "ing", "'_", "]_", "=_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "shar", "ing", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "created", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "._", "setdefault_", "(_", "'\\u", "created", "'_", ",_", "{_", "}_", ")_", "[_", "'", "at", "'_", "]_", "=_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "created", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "created", "\\u", "by", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "._", "setdefault_", "(_", "'\\u", "created", "'_", ",_", "{_", "}_", ")_", "[_", "'", "by", "'_", "]_", "=_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "created", "\\u", "by", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "e_", "._", "get_", "(_", "'\\u", "created", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "[_", "'\\u", "created", "'_", "]_", "[_", "'", "type", "'_", "]_", "=_", "'", "action", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "[_", "'\\u", "created", "'_", "]_", "=_", "[_", "e_", "._", "get_", "(_", "'\\u", "created", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "change", "d", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "._", "setdefault_", "(_", "'\\u", "change", "d", "'_", ",_", "{_", "}_", ")_", "[_", "'", "at", "'_", "]_", "=_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "change", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "change", "d\\u", "by", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "._", "setdefault_", "(_", "'\\u", "change", "d", "'_", ",_", "{_", "}_", ")_", "[_", "'", "by", "'_", "]_", "=_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "change", "d\\u", "by", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "e_", "._", "get_", "(_", "'\\u", "change", "d", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "[_", "'\\u", "change", "d", "'_", "]_", "[_", "'", "type", "'_", "]_", "=_", "'", "action", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "[_", "'\\u", "change", "d", "'_", "]_", "=_", "[_", "e_", "._", "get_", "(_", "'\\u", "change", "d", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "is", "\\u", "delete", "d", "'_", ")_", "and_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "delete", "d", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "._", "setdefault_", "(_", "'\\u", "delete", "d", "'_", ",_", "{_", "}_", ")_", "[_", "'", "at", "'_", "]_", "=_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "delete", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "is", "\\u", "delete", "d", "'_", ")_", "and_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "delete", "d\\u", "by", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "._", "setdefault_", "(_", "'\\u", "delete", "d", "'_", ",_", "{_", "}_", ")_", "[_", "'", "by", "'_", "]_", "=_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "delete", "d\\u", "by", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "e_", "._", "get_", "(_", "'\\u", "delete", "d", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "[_", "'\\u", "delete", "d", "'_", "]_", "[_", "'", "type", "'_", "]_", "=_", "'", "action", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "[_", "'\\u", "delete", "d", "'_", "]_", "=_", "[_", "e_", "._", "get_", "(_", "'\\u", "delete", "d", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "viewer", "s_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "mongodb", "\\u", "right_", "(_", "mysql", "\\u", "id_", ",_", "[_", "'", "viewer", "'_", ",_", "'", "expander", "'_", ",_", "'", "editor", "'_", ",_", "'", "owner", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "viewer", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "[_", "'\\u", "viewer", "'_", "]_", "=_", "[_", "{_", "'", "reference", "'_", ":_", "x_", ",_", "'", "type", "'_", ":_", "'", "reference", "'_", "}_", "for_", "x_", "in_", "list_", "(_", "set_", "(_", "viewer", "s_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "expander", "s_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "mongodb", "\\u", "right_", "(_", "mysql", "\\u", "id_", ",_", "[_", "'", "expander", "'_", ",_", "'", "editor", "'_", ",_", "'", "owner", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "expander", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "[_", "'\\u", "expander", "'_", "]_", "=_", "[_", "{_", "'", "reference", "'_", ":_", "x_", ",_", "'", "type", "'_", ":_", "'", "reference", "'_", "}_", "for_", "x_", "in_", "list_", "(_", "set_", "(_", "expander", "s_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "editors", "_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "mongodb", "\\u", "right_", "(_", "mysql", "\\u", "id_", ",_", "[_", "'", "editor", "'_", ",_", "'", "owner", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "editors", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "[_", "'\\u", "editor", "'_", "]_", "=_", "[_", "{_", "'", "reference", "'_", ":_", "x_", ",_", "'", "type", "'_", ":_", "'", "reference", "'_", "}_", "for_", "x_", "in_", "list_", "(_", "set_", "(_", "editors", "_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "owners_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "mongodb", "\\u", "right_", "(_", "mysql", "\\u", "id_", ",_", "[_", "'", "owner", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "owners_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "[_", "'\\u", "owner", "'_", "]_", "=_", "[_", "{_", "'", "reference", "'_", ":_", "x_", ",_", "'", "type", "'_", ":_", "'", "reference", "'_", "}_", "for_", "x_", "in_", "list_", "(_", "set_", "(_", "owners_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "parent_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "mongodb", "\\u", "parent_", "(_", "entity", "\\u", "id_", "=_", "mysql", "\\u", "id_", ",_", "recursive_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "parent_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "[_", "'\\u", "parent", "'_", "]_", "=_", "[_", "{_", "'", "reference", "'_", ":_", "x_", ",_", "'", "type", "'_", ":_", "'", "reference", "'_", "}_", "for_", "x_", "in_", "list_", "(_", "set_", "(_", "parent_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ancestor_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "mongodb", "\\u", "parent_", "(_", "entity", "\\u", "id_", "=_", "mysql", "\\u", "id_", ",_", "recursive_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ancestor_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "[_", "'\\u", "ancestor", "'_", "]_", "=_", "[_", "{_", "'", "reference", "'_", ":_", "x_", ",_", "'", "type", "'_", ":_", "'", "reference", "'_", "}_", "for_", "x_", "in_", "list_", "(_", "set_", "(_", "ancestor_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "id", " ", " ", "AS", " ", "property", "\\u", "id", ",", "\\", "10", ";", " ", " ", " ", " ", "REPLACE", "(", "REPLACE", "(", "pd", ".", "datapro", "pert", "y", ",", " ", "'-'", ",", " ", "'\\u", "')", ",", " ", "'.'", ",", " ", "'\\u", "')", " ", " ", "AS", " ", "property", "\\u", "datapro", "pert", "y", ",", "\\", "10", ";", " ", " ", " ", " ", "pd", ".", "datatype", " ", " ", " ", " ", " ", "AS", " ", "property", "\\u", "datatype", ",", "\\", "10", ";", " ", " ", " ", " ", "pd", ".", "formula", " ", " ", " ", " ", " ", " ", "AS", " ", "property", "\\u", "formula", ",", "\\", "10", ";", " ", " ", " ", " ", "pd", ".", "search", " ", " ", " ", "AS", " ", "property", "\\u", "search", ",", "\\", "10", ";", " ", " ", " ", " ", "IF", "(", "pd", ".", "multil", "ingu", "al", " ", "=", " ", "1", ",", " ", "IF", "(", "p", ".", "language", " ", "=", " ", "'", "english", "',", " ", "'", "en", "',", " ", "'", "et", "')", ",", " ", "NULL", ")", " ", "AS", " ", "property", "\\u", "language", ",", "\\", "10", ";", " ", " ", " ", " ", "TRI", "M", "(", "p", ".", "value", "\\u", "formula", ")", " ", " ", " ", "AS", " ", "value", "\\u", "formula", ",", "\\", "10", ";", " ", " ", " ", " ", "TRI", "M", "(", "p", ".", "value", "\\u", "string", ")", " ", " ", " ", " ", "AS", " ", "value", "\\u", "string", ",", "\\", "10", ";", " ", " ", " ", " ", "TRI", "M", "(", "p", ".", "value", "\\u", "text", ")", " ", " ", "AS", " ", "value", "\\u", "text", ",", "\\", "10", ";", " ", " ", " ", " ", "TRI", "M", "(", "p", ".", "value", "\\u", "display", ")", " ", " ", " ", "AS", " ", "value", "\\u", "display", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "value", "\\u", "integ", "er", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "value", "\\u", "decima", "l", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "value", "\\u", "boolean", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "value", "\\u", "datetime", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "value", "\\u", "reference", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "value", "\\u", "file", ",", "\\", "10", ";", " ", " ", " ", " ", "IF", "(", "pd", ".", "datatype", " ", "=", " ", "'", "file", "',", " ", "(", "SELECT", " ", "s3", "\\u", "key", " ", "FROM", " ", "file", " ", "WHE", "RE", " ", "id", " ", "=", " ", "p", ".", "value", "\\u", "file", " ", "AND", " ", "delete", "d", " ", "IS", " ", "NULL", " ", "LIMIT", " ", "1", "),", " ", "NULL", ")", " ", "AS", " ", "value", "\\u", "file", "\\u", "s3", ",", "\\", "10", ";", " ", " ", " ", " ", "IF", "(", "pd", ".", "datatype", " ", "=", " ", "'", "file", "',", " ", "(", "SELECT", " ", "md5", " ", "FROM", " ", "file", " ", "WHE", "RE", " ", "id", " ", "=", " ", "p", ".", "value", "\\u", "file", " ", "AND", " ", "delete", "d", " ", "IS", " ", "NULL", " ", "LIMIT", " ", "1", "),", " ", "NULL", ")", " ", "AS", " ", "value", "\\u", "file", "\\u", "md5", ",", "\\", "10", ";", " ", " ", " ", " ", "IF", "(", "pd", ".", "datatype", " ", "=", " ", "'", "file", "',", " ", "(", "SELECT", " ", "filename", " ", "FROM", " ", "file", " ", "WHE", "RE", " ", "id", " ", "=", " ", "p", ".", "value", "\\u", "file", " ", "AND", " ", "delete", "d", " ", "IS", " ", "NULL", " ", "LIMIT", " ", "1", "),", " ", "NULL", ")", " ", "AS", " ", "value", "\\u", "file", "\\u", "name", ",", "\\", "10", ";", " ", " ", " ", " ", "IF", "(", "pd", ".", "datatype", " ", "=", " ", "'", "file", "',", " ", "(", "SELECT", " ", "files", "ize", " ", "FROM", " ", "file", " ", "WHE", "RE", " ", "id", " ", "=", " ", "p", ".", "value", "\\u", "file", " ", "AND", " ", "delete", "d", " ", "IS", " ", "NULL", " ", "LIMIT", " ", "1", "),", " ", "NULL", ")", " ", "AS", " ", "value", "\\u", "file", "\\u", "size", ",", "\\", "10", ";", " ", " ", " ", " ", "IF", "(", "pd", ".", "datatype", " ", "=", " ", "'", "file", "',", " ", "(", "SELECT", " ", "url", " ", "FROM", " ", "file", " ", "WHE", "RE", " ", "id", " ", "=", " ", "p", ".", "value", "\\u", "file", " ", "AND", " ", "delete", "d", " ", "IS", " ", "NULL", " ", "LIMIT", " ", "1", "),", " ", "NULL", ")", " ", "AS", " ", "value", "\\u", "file", "\\u", "url", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "value", "\\u", "counter", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "created", ",", "\\", "10", ";", " ", " ", " ", " ", "IF", "(", "CAST", "(", "p", ".", "created", "\\u", "by", " ", "AS", " ", "UNSIGNED", ")", " ", ">", " ", "0", ",", " ", "CAST", "(", "p", ".", "created", "\\u", "by", " ", "AS", " ", "UNSIGNED", "),", " ", "NULL", ")", " ", "AS", " ", "created", "\\u", "by", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "is", "\\u", "delete", "d", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "delete", "d", ",", "\\", "10", ";", " ", " ", " ", " ", "IF", "(", "CAST", "(", "p", ".", "delete", "d\\u", "by", " ", "AS", " ", "UNSIGNED", ")", " ", ">", " ", "0", ",", " ", "CAST", "(", "p", ".", "delete", "d\\u", "by", " ", "AS", " ", "UNSIGNED", "),", " ", "NULL", ")", " ", "AS", " ", "delete", "d\\u", "by", "\\", "10", ";", " ", " ", " ", " ", "FROM", "\\", "10", ";", " ", " ", " ", " ", "property", " ", "AS", " ", "p", ",", "\\", "10", ";", " ", " ", " ", " ", "property", "\\u", "definit", "ion", " ", "AS", " ", "pd", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "pd", ".", "keyn", "ame", " ", "=", " ", "p", ".", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "p", ".", "entity", "\\u", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "p", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "pd", ".", "datapro", "pert", "y", " ", "NOT", " ", "IN", " ", "('", "ent", "u", "-", "change", "d", "-", "by", "',", " ", "'", "ent", "u", "-", "change", "d", "-", "at", "',", " ", "'", "ent", "u", "-", "created", "-", "by", "',", " ", "'", "ent", "u", "-", "created", "-", "at", "')", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "pd", ".", "datapro", "pert", "y", " ", "NOT", " ", "LI", "KE", " ", "'", "auth", "\\u", "%%'", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "pd", ".", "datatype", " ", "NOT", " ", "IN", " ", "('", "counter", "')", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "pd", ".", "formula", " ", "=", " ", "0", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "properties_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "r2_", "in_", "self_", "._", "db", "\\u", "query_", "(_", "sql_", ",_", "mysql", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "string", "'_", "and_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "string", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "[_", "'", "value", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "string", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "text", "'_", "and_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "text", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "[_", "'", "value", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "text", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "integ", "er", "'_", "and_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "integ", "er", "'_", ")_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "[_", "'", "value", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "integ", "er", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "decima", "l", "'_", "and_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "decima", "l", "'_", ")_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "[_", "'", "value", "'_", "]_", "=_", "float_", "(_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "decima", "l", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "boolean", "'_", "and_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "boolean", "'_", ")_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "[_", "'", "value", "'_", "]_", "=_", "bool_", "(_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "boolean", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "in_", "[_", "'", "date", "'_", ",_", "'", "datetime", "'_", "]_", "and_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "datetime", "'_", ")_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "[_", "'", "value", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "datetime", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "reference", "'_", "and_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "reference", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "[_", "'", "reference", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "reference", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "counter", "-", "value", "'_", "and_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "string", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "[_", "'", "value", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "string", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "file", "'_", "and_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "file", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "[_", "'", "value", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "file", "\\u", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "file", "\\u", "url", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "value_", "[_", "'", "url", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "file", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "value_", "[_", "'", "size", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "file", "\\u", "size", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "file", "\\u", "md5", "'_", ",_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "value_", "[_", "'", "md5", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "file", "\\u", "md5", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "file", "\\u", "s3", "'_", ",_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "value_", "[_", "'", "s3", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "file", "\\u", "s3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "value_", "[_", "'\\u", "mid", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "[_", "'", "type", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "language", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "[_", "'", "language", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "language", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "r2", ".", "get", "('", "created", "')", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "value", ".", "setdefault", "('", "created", "',", " ", "{})", "['", "at", "']", " ", "=", " ", "r2", ".", "get", "('", "created", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "r2", ".", "get", "('", "created", "\\u", "by", "')", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "value", ".", "setdefault", "('", "created", "',", " ", "{})", "['", "by", "']", " ", "=", " ", "r2", ".", "get", "('", "created", "\\u", "by", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "r2", ".", "get", "('", "is", "\\u", "delete", "d", "')", " ", "and", " ", "r2", ".", "get", "('", "delete", "d", "')", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "value", ".", "setdefault", "('", "delete", "d", "',", " ", "{})", "['", "at", "']", " ", "=", " ", "r2", ".", "get", "('", "delete", "d", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "r2", ".", "get", "('", "is", "\\u", "delete", "d", "')", " ", "and", " ", "r2", ".", "get", "('", "delete", "d\\u", "by", "')", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "value", ".", "setdefault", "('", "delete", "d", "',", " ", "{})", "['", "by", "']", " ", "=", " ", "r2", ".", "get", "('", "delete", "d\\u", "by", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "e_", "._", "setdefault_", "(_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", ",_", "[_", "]_", ")_", "._", "append_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "r2", ".", "get", "('", "value", "\\u", "display", "')", " ", "and", " ", "r2", ".", "get", "('", "property", "\\u", "search", "')", " ", "==", " ", "1", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "r2", ".", "get", "('", "property", "\\u", "language", "')", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "e", ".", "setdefault", "('\\", "use", "arch", "',", " ", "{})", ".", "setdefault", "(", "r2", ".", "get", "('", "property", "\\u", "language", "')", ",", " ", "[]", ").", "append", "(", "r2", ".", "get", "('", "value", "\\u", "display", "')", ".", "lower", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "e", ".", "setdefault", "('\\", "use", "arch", "',", " ", "{})", ".", "setdefault", "('", "et", "',", " ", "[]", ").", "append", "(", "r2", ".", "get", "('", "value", "\\u", "display", "')", ".", "lower", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "e", ".", "setdefault", "('\\", "use", "arch", "',", " ", "{})", ".", "setdefault", "('", "en", "',", " ", "[]", ").", "append", "(", "r2", ".", "get", "('", "value", "\\u", "display", "')", ".", "lower", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "l", " ", "in", " ", "['", "et", "',", " ", "'", "en", "']", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "l", " ", "in", " ", "e", ".", "get", "('\\", "use", "arch", "',", " ", "{})", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "e", "['", "\\u", "search", "']", "[", "l", "]", " ", "=", " ", "list", "(", "set", "(", "e", "['", "\\u", "search", "']", "[", "l", "]))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Creat", "e", " ", "or", " ", "replace", " ", "Mon", "go", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mongo", "\\u", "entity", "\\u", "version_", "=_", "self_", "._", "mongodb", "_", "(_", ")_", "._", "entity", "Version_", "._", "find", "\\u", "one_", "(_", "{_", "'\\u", "mid", "'_", ":_", "mysql", "\\u", "id_", "}_", ",_", "{_", "'\\u", "id", "'_", ":_", "False_", ",_", "'\\u", "entity", "'_", ":_", "True_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mongo", "\\u", "entity", "\\u", "version_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "[_", "'\\u", "entity", "'_", "]_", "=_", "mongo", "\\u", "entity", "\\u", "version_", "._", "get_", "(_", "'\\u", "entity", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "[_", "'\\u", "entity", "'_", "]_", "=_", "self_", "._", "mongodb", "_", "(_", ")_", "._", "entity_", "._", "insert", "\\u", "one_", "(_", "{_", "}_", ")_", "._", "inserted", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "mongodb", "_", "(_", ")_", "._", "entity", "Version_", "._", "insert", "\\u", "one_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "captur", "e", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "error_", "(_", "'", "Mon", "go", "Db", " ", "error", ":", " ", "%", "s", " ", "-", " ", "%", "s", "'_", "%_", "(_", "err_", ",_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "get", "\\u", "mongodb", "\\u", "parent_", "(_", "self_", ",_", "entity", "\\u", "id_", ",_", "recursive_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", " ", "entity", "\\u", "id", "\\", "10", ";", " ", " ", " ", " ", "FROM", " ", "relation", "ship", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "'", "child", "'", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "entity", "\\u", "id", " ", "IS", " ", "NOT", " ", "NULL", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "entity", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "entities_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "r_", "in_", "self_", "._", "db", "\\u", "query_", "(_", "sql_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entities_", "._", "append_", "(_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "recursive_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entities_", "=_", "entities_", "+_", "self_", "._", "\\u\\u", "get", "\\u", "mongodb", "\\u", "parent_", "(_", "entity", "\\u", "id_", "=_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "recursive_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "entities_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "get", "\\u", "mongodb", "\\u", "right_", "(_", "self_", ",_", "entity", "\\u", "id_", ",_", "rights_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", " ", "relate", "d\\u", "entity", "\\u", "id", "\\", "10", ";", " ", " ", " ", " ", "FROM", " ", "relation", "ship", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "IN", " ", "(%", "s", ")", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "relate", "d\\u", "entity", "\\u", "id", " ", "IS", " ", "NOT", " ", "NULL", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "entity", "\\u", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "(_", "',", " ", "'_", "._", "join_", "(_", "[_", "'\\\\'", "%", "s", "\\\\''_", "%_", "x_", "for_", "x_", "in_", "rights_", "]_", ")_", ",_", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "entities_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "r_", "in_", "self_", "._", "db", "\\u", "query_", "(_", "sql_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entities_", "._", "append_", "(_", "r_", "._", "get_", "(_", "'", "relate", "d\\u", "entity", "\\u", "id", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "entities_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "counter_", "(_", "self_", ",_", "entity", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", "s", " ", "counter", " ", "property", ".", "\\", "10", ";", " ", " ", " ", " ", "Counter", " ", "mechani", "cs", " ", "is", " ", "real", " ", "hack", ".", " ", "It", " ", "will", " ", "soo", "n", " ", "be", " ", "obsolete", "d", " ", "by", " ", "formula", " ", "field", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "entity", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Va", "stu", "ski", "rj", "a", " ", "hack", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "db", "\\u", "get_", "(_", "'", "SELECT", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "FROM", " ", "entity", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "s", "'_", ",_", "entity", "\\u", "id_", ")_", "._", "get_", "(_", "'", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "'_", ")_", "==_", "'", "repl", "y", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parent_", "=_", "self_", "._", "get", "\\u", "relative", "s_", "(_", "relate", "d\\u", "entity", "\\u", "id_", "=_", "entity", "\\u", "id_", ",_", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "'", "child", "'_", ",_", "reverse", "\\u", "relation_", "=_", "True_", ",_", "limit_", "=_", "1_", ")_", "._", "values_", "(_", ")_", "[_", "0_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "childs_", "=_", "self_", "._", "get", "\\u", "relative", "s_", "(_", "entity", "\\u", "id_", "=_", "parent_", "._", "get_", "(_", "'", "id", "'_", ",_", "None_", ")_", ",_", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "'", "child", "'_", ")_", "._", "values_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "childs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "child", "s", "\\u", "count_", "=_", "len_", "(_", "[_", "y_", "._", "get_", "(_", "'", "id", "'_", ",_", "0_", ")_", "for_", "y_", "in_", "childs_", "[_", "0_", "]_", "if_", "y_", "._", "get_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "get_", "(_", "'", "registr", "y", "-", "number", "'_", ",_", "{_", "}_", ")_", "._", "get_", "(_", "'", "values", "'_", ",_", "None_", ")_", "]_", ")_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "child", "s", "\\u", "count_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "parent", "\\u", "number_", "=_", "''_", "._", "join_", "(_", "[_", "'%", "s", "'_", "%_", "x_", "[_", "'", "value", "'_", "]_", "for_", "x_", "in_", "parent_", "._", "get_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "get_", "(_", "'", "registr", "y", "-", "number", "'_", ",_", "{_", "}_", ")_", "._", "get_", "(_", "'", "values", "'_", ",_", "[_", "]_", ")_", "if_", "x_", "[_", "'", "value", "'_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "counter", "\\u", "value_", "=_", "'%", "s", "-%", "s", "'_", "%_", "(_", "parent", "\\u", "number_", ",_", "child", "s", "\\u", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set\\u", "property_", "(_", "entity", "\\u", "id_", "=_", "entity", "\\u", "id_", ",_", "property", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "'", "repl", "y", "-", "registr", "y", "-", "number", "'_", ",_", "value_", "=_", "counter", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "counter", "\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "property", "\\u", "id_", "=_", "self_", "._", "db", "\\u", "execute", "\\u", "lastr", "owi", "d_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "INSERT", " ", "INT", "O", " ", "property", " ", "(", "\\", "10", ";", " ", " ", " ", " ", "entity", "\\u", "id", ",", "\\", "10", ";", " ", " ", " ", " ", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", "\\", "10", ";", " ", " ", " ", " ", "value", "\\u", "string", ",", "\\", "10", ";", " ", " ", " ", " ", "created", "\\u", "by", ",", "\\", "10", ";", " ", " ", " ", " ", "created", "\\", "10", ";", " ", " ", " ", " ", ")", " ", "SELECT", " ", "/*", " ", "SQL", "\\u", "NO", "\\u", "CACHE", " ", "*/", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "entity", "\\u", "id", ")", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "property", "\\u", "definit", "ion", "2", ".", "keyn", "ame", ",", "\\", "10", ";", " ", " ", " ", " ", "CONC", "AT", "(", "\\", "10", ";", " ", " ", " ", " ", "IF", "NULL", "((", "\\", "10", ";", " ", " ", "SELECT", "\\", "10", ";", " ", " ", "value", "\\u", "string", "\\", "10", ";", " ", " ", "FROM", "\\", "10", ";", " ", " ", "property", ",", "\\", "10", ";", " ", " ", "property", "\\u", "definit", "ion", ",", "\\", "10", ";", " ", " ", "entity", "\\", "10", ";", " ", " ", "WHE", "RE", " ", "property", "\\u", "definit", "ion", ".", "keyn", "ame", " ", "=", " ", "property", ".", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", "AND", " ", "entity", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "property", "\\u", "definit", "ion", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", "AND", " ", "entity", ".", "id", " ", "=", " ", "property", ".", "entity", "\\u", "id", "\\", "10", ";", " ", " ", "AND", " ", "property", "\\u", "definit", "ion", ".", "datapro", "pert", "y", " ", "=", " ", "'", "series", "'", "\\", "10", ";", " ", " ", "AND", " ", "entity", ".", "id", " ", "IN", " ", "(", "SELECT", " ", "entity", "\\u", "id", " ", "FROM", " ", "relation", "ship", " ", "WHE", "RE", " ", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "(", "entity", "\\u", "id", ")", "s", " ", "AND", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "'", "child", "')", "\\", "10", ";", " ", " ", "AND", " ", "entity", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", "AND", " ", "property", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", "LIMIT", " ", "1", "\\", "10", ";", " ", " ", " ", " ", "),", " ", "''", "),", "\\", "10", ";", " ", " ", " ", " ", "IF", "NULL", "((", "\\", "10", ";", " ", " ", "SELECT", "\\", "10", ";", " ", " ", "value", "\\u", "string", "\\", "10", ";", " ", " ", "FROM", "\\", "10", ";", " ", " ", "property", ",", "\\", "10", ";", " ", " ", "property", "\\u", "definit", "ion", ",", "\\", "10", ";", " ", " ", "entity", "\\", "10", ";", " ", " ", "WHE", "RE", " ", "property", "\\u", "definit", "ion", ".", "keyn", "ame", " ", "=", " ", "property", ".", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", "AND", " ", "entity", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "property", "\\u", "definit", "ion", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", "AND", " ", "entity", ".", "id", " ", "=", " ", "property", ".", "entity", "\\u", "id", "\\", "10", ";", " ", " ", "AND", " ", "property", "\\u", "definit", "ion", ".", "datapro", "pert", "y", "='", "prefix", "'", "\\", "10", ";", " ", " ", "AND", " ", "entity", ".", "id", " ", "IN", " ", "(", "SELECT", " ", "entity", "\\u", "id", " ", "FROM", " ", "relation", "ship", " ", "WHE", "RE", " ", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "(", "entity", "\\u", "id", ")", "s", " ", "AND", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "'", "child", "')", "\\", "10", ";", " ", " ", "AND", " ", "entity", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", "AND", " ", "property", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", "LIMIT", " ", "1", "\\", "10", ";", " ", " ", " ", " ", "),", " ", "''", "),", "\\", "10", ";", " ", " ", " ", " ", "counter", ".", "value", "+", "counter", ".", "increment", ")", " ", "AS", " ", "value", ",", "\\", "10", ";", " ", " ", " ", " ", "'%", "(", "user", "\\u", "id", ")", "s", "',", "\\", "10", ";", " ", " ", " ", " ", "NOW", "()", "\\", "10", ";", " ", " ", " ", " ", "FROM", "\\", "10", ";", " ", " ", " ", " ", "property", ",", "\\", "10", ";", " ", " ", " ", " ", "property", "\\u", "definit", "ion", ",", "\\", "10", ";", " ", " ", " ", " ", "relation", "ship", ",", "\\", "10", ";", " ", " ", " ", " ", "property", "\\u", "definit", "ion", " ", "AS", " ", "property", "\\u", "definit", "ion", "2", ",", "\\", "10", ";", " ", " ", " ", " ", "counter", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "property", "\\u", "definit", "ion", ".", "keyn", "ame", " ", "=", " ", "property", ".", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "relation", "ship", ".", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "property", "\\u", "definit", "ion", ".", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "property", "\\u", "definit", "ion", "2", ".", "keyn", "ame", " ", "=", " ", "relation", "ship", ".", "relate", "d\\u", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "counter", ".", "id", " ", "=", " ", "property", ".", "value", "\\u", "counter", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "property", ".", "entity", "\\u", "id", " ", "IN", " ", "(", "SELECT", " ", "entity", "\\u", "id", " ", "FROM", " ", "relation", "ship", " ", "WHE", "RE", " ", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "(", "entity", "\\u", "id", ")", "s", " ", "AND", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "'", "child", "')", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "property", "\\u", "definit", "ion", ".", "datatype", "=", " ", "'", "counter", "'", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "property", "\\u", "definit", "ion", "2", ".", "datatype", " ", "=", " ", "'", "counter", "-", "value", "'", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "relation", "ship", ".", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "'", "target", "-", "property", "'", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "property", "\\u", "definit", "ion", "2", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "(", "SELECT", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "FROM", " ", "entity", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "(", "entity", "\\u", "id", ")", "s", " ", "LIMIT", " ", "1", ")", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "relation", "ship", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "property", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "counter", ".", "type", " ", "=", " ", "'", "increment", "';", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "{_", "'", "entity", "\\u", "id", "'_", ":_", "entity", "\\u", "id_", ",_", "'", "user", "\\u", "id", "'_", ":_", "self_", "._", "\\u\\u", "user", "\\u", "id_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "db", "\\u", "execute_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "UPDATE", "\\", "10", ";", " ", " ", " ", " ", "counter", ",", "\\", "10", ";", " ", " ", " ", " ", "(", "\\", "10", ";", " ", " ", " ", " ", "SELECT", "\\", "10", ";", " ", " ", "counter", ".", "id", "\\", "10", ";", " ", " ", " ", " ", "FROM", "\\", "10", ";", " ", " ", "property", ",", "\\", "10", ";", " ", " ", "property", "\\u", "definit", "ion", ",", "\\", "10", ";", " ", " ", "relation", "ship", ",", "\\", "10", ";", " ", " ", "property", "\\u", "definit", "ion", " ", "AS", " ", "property", "\\u", "definit", "ion", "2", ",", "\\", "10", ";", " ", " ", "counter", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "property", "\\u", "definit", "ion", ".", "keyn", "ame", " ", "=", " ", "property", ".", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "relation", "ship", ".", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "property", "\\u", "definit", "ion", ".", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "property", "\\u", "definit", "ion", "2", ".", "keyn", "ame", " ", "=", " ", "relation", "ship", ".", "relate", "d\\u", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "counter", ".", "id", " ", "=", " ", "property", ".", "value", "\\u", "counter", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "property", ".", "entity", "\\u", "id", " ", "IN", " ", "(", "SELECT", " ", "entity", "\\u", "id", " ", "FROM", " ", "relation", "ship", " ", "WHE", "RE", " ", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "(", "entity", "\\u", "id", ")", "s", " ", "AND", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "'", "child", "')", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "property", "\\u", "definit", "ion", ".", "datatype", "=", " ", "'", "counter", "'", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "property", "\\u", "definit", "ion", "2", ".", "datatype", " ", "=", " ", "'", "counter", "-", "value", "'", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "relation", "ship", ".", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "'", "target", "-", "property", "'", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "property", "\\u", "definit", "ion", "2", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "(", "SELECT", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "FROM", " ", "entity", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "(", "entity", "\\u", "id", ")", "s", " ", "LIMIT", " ", "1", ")", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "counter", ".", "type", " ", "=", " ", "'", "increment", "'", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "relation", "ship", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "property", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", ")", " ", "X", "\\", "10", ";", " ", " ", " ", " ", "SET", "\\", "10", ";", " ", " ", " ", " ", "counter", ".", "value", " ", "=", " ", "counter", ".", "value", " ", "+", " ", "counter", ".", "increment", ",", "\\", "10", ";", " ", " ", " ", " ", "counter", ".", "change", "d\\u", "by", " ", "=", " ", "'%", "(", "user", "\\u", "id", ")", "s", "',", "\\", "10", ";", " ", " ", " ", " ", "counter", ".", "change", "d", " ", "=", " ", "NOW", "()", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "counter", ".", "id", " ", "=", " ", "X", ".", "id", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "{_", "'", "entity", "\\u", "id", "'_", ":_", "entity", "\\u", "id_", ",_", "'", "user", "\\u", "id", "'_", ":_", "self_", "._", "\\u\\u", "user", "\\u", "id_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "db", "\\u", "execute_", "(_", "'", "UPDATE", " ", "property", " ", "SET", " ", "value", "\\u", "display", " ", "=", " ", "value", "\\u", "string", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "s", "'_", ",_", "property", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "db", "\\u", "get_", "(_", "'", "SELECT", " ", "value", "\\u", "string", " ", "FROM", " ", "property", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "s", "'_", ",_", "property", "\\u", "id_", ")_", "._", "get_", "(_", "'", "value", "\\u", "string", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "relations_", "(_", "self_", ",_", "entity", "\\u", "id_", ",_", "relate", "d\\u", "entity", "\\u", "id_", ",_", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyname_", ",_", "delete_", "=_", "False_", ",_", "update_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Add", "s", " ", "or", " ", "remove", "s", " ", "Entit", "y", " ", "relation", "s", ".", " ", "entity", "\\u", "id", ",", " ", "relate", "d\\u", "entity", "\\u", "id", ",", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "can", " ", "be", " ", "single", " ", "value", " ", "or", " ", "list", " ", "of", " ", "values", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "type_", "(_", "entity", "\\u", "id_", ")_", "is_", "not_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entity", "\\u", "id_", "=_", "[_", "entity", "\\u", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type_", "(_", "relate", "d\\u", "entity", "\\u", "id_", ")_", "is_", "not_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "relate", "d\\u", "entity", "\\u", "id_", "=_", "[_", "relate", "d\\u", "entity", "\\u", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type_", "(_", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyname_", ")_", "is_", "not_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "[_", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyname_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "e_", "in_", "entity", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "r_", "in_", "relate", "d\\u", "entity", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "t_", "in_", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyname_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "db", "\\u", "execute_", "(_", "'", "UPDATE", " ", "entity", " ", "SET", " ", "change", "d", " ", "=", " ", "NOW", "()", " ", "WHE", "RE", " ", "entity", ".", "id", " ", "=", " ", "%", "s", ";'_", ",_", "r_", "if_", "t_", "==_", "'", "child", "'_", "else_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "delete_", "==_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "UPDATE", " ", "relation", "ship", " ", "SET", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "delete", "d\\u", "by", " ", "=", " ", "%", "s", ",", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "delete", "d", " ", "=", " ", "NOW", "()", ",", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "is", "\\u", "delete", "d", " ", "=", " ", "1", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "WHE", "RE", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "'%", "s", "'", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "AND", " ", "entity", "\\u", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "AND", " ", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "s", ";", "\\", "10", ";", " ", " ", "\"\"\"_", "%_", "(_", "self_", "._", "\\u\\u", "user", "\\u", "id_", ",_", "t_", ",_", "e_", ",_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logg", "ing", ".", "debug", "(", "sql", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "db", "\\u", "execute_", "(_", "sql_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "update_", "==_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "UPDATE", " ", "relation", "ship", " ", "SET", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "delete", "d\\u", "by", " ", "=", " ", "NULL", ",", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "delete", "d", " ", "=", " ", "NULL", ",", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "change", "d\\u", "by", " ", "=", " ", "%", "s", ",", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "change", "d", " ", "=", " ", "NOW", "()", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "WHE", "RE", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "'%", "s", "'", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "AND", " ", "entity", "\\u", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "AND", " ", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "s", ";", "\\", "10", ";", " ", " ", "\"\"\"_", "%_", "(_", "self_", "._", "\\u\\u", "user", "\\u", "id_", ",_", "t_", ",_", "e_", ",_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logg", "ing", ".", "debug", "(", "sql", ")_", "\\u\\u\\uNL\\u\\u\\u_", "old_", "=_", "self_", "._", "db", "\\u", "execute", "\\u", "rowcount_", "(_", "sql_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "old_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "INSERT", " ", "INT", "O", " ", "relation", "ship", " ", "SET", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "'%", "s", "',", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "entity", "\\u", "id", " ", "=", " ", "%", "s", ",", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "s", ",", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "created", "\\u", "by", " ", "=", " ", "%", "s", ",", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "created", " ", "=", " ", "NOW", "();", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "\"\"\"_", "%_", "(_", "t_", ",_", "e_", ",_", "r_", ",_", "self_", "._", "\\u\\u", "user", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logg", "ing", ".", "debug", "(", "sql", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "db", "\\u", "execute_", "(_", "sql_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "SELECT", " ", "id", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "FROM", " ", "relation", "ship", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "WHE", "RE", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "'%", "s", "'", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "AND", " ", "entity", "\\u", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "AND", " ", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "AND", " ", "is", "\\u", "delete", "d", " ", "=", " ", "0", ";", "\\", "10", ";", " ", " ", "\"\"\"_", "%_", "(_", "t_", ",_", "e_", ",_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old_", "=_", "self_", "._", "db", "\\u", "get_", "(_", "sql_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logg", "ing", ".", "debug", "(", "sql", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "old_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "INSERT", " ", "INT", "O", " ", "relation", "ship", " ", "SET", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "'%", "s", "',", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "entity", "\\u", "id", " ", "=", " ", "%", "s", ",", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "s", ",", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "created", "\\u", "by", " ", "=", " ", "%", "s", ",", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "created", " ", "=", " ", "NOW", "();", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "\"\"\"_", "%_", "(_", "t_", ",_", "e_", ",_", "r_", ",_", "self_", "._", "\\u\\u", "user", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logg", "ing", ".", "debug", "(", "sql", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "db", "\\u", "execute_", "(_", "sql_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "rights_", "(_", "self_", ",_", "entity", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "entity", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rights_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "right_", "in_", "[_", "'", "viewer", "'_", ",_", "'", "expander", "'_", ",_", "'", "editor", "'_", ",_", "'", "owner", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", " ", "relate", "d\\u", "entity", "\\u", "id", "\\", "10", ";", " ", " ", " ", " ", "FROM", " ", "relation", "ship", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "entity", "\\u", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "relationship_", "=_", "self_", "._", "db", "\\u", "query_", "(_", "sql_", ",_", "right_", ",_", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "relationship_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ids_", "=_", "[_", "x_", "._", "get_", "(_", "'", "relate", "d\\u", "entity", "\\u", "id", "'_", ")_", "for_", "x_", "in_", "relationship_", "if_", "x_", "._", "get_", "(_", "'", "relate", "d\\u", "entity", "\\u", "id", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ids_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entities_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "properties_", "(_", "entity", "\\u", "id_", "=_", "ids_", ",_", "full", "\\u", "definition_", "=_", "False_", ",_", "only", "\\u", "public_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "entities_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "rights_", "[_", "right_", "]_", "=_", "entities_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "rights_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "rights_", "(_", "self_", ",_", "entity", "\\u", "id_", ",_", "relate", "d\\u", "entity", "\\u", "id_", ",_", "right_", "=_", "None_", ",_", "ignore", "\\u", "user_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "entity", "\\u", "id_", "or_", "not_", "relate", "d\\u", "entity", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ignore", "\\u", "user_", "==_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "id_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "\\u\\u", "user", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "user", "\\u", "id_", "=_", "self_", "._", "\\u\\u", "user", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type_", "(_", "entity", "\\u", "id_", ")_", "is_", "not_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entity", "\\u", "id_", "=_", "[_", "entity", "\\u", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type_", "(_", "relate", "d\\u", "entity", "\\u", "id_", ")_", "is_", "not_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "relate", "d\\u", "entity", "\\u", "id_", "=_", "[_", "relate", "d\\u", "entity", "\\u", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "UPDATE", " ", "relation", "ship", " ", "SET", "\\", "10", ";", " ", " ", " ", " ", "delete", "d", " ", "=", " ", "NOW", "()", ",", "\\", "10", ";", " ", " ", " ", " ", "is", "\\u", "delete", "d", " ", "=", " ", "1", ",", "\\", "10", ";", " ", " ", " ", " ", "delete", "d\\u", "by", " ", "=", " ", "%%", "s", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "IN", " ", "('", "viewer", "',", " ", "'", "expander", "',", " ", "'", "editor", "',", " ", "'", "owner", "')", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "entity", "\\u", "id", " ", "IN", " ", "(%", "s", ")", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "relate", "d\\u", "entity", "\\u", "id", " ", "IN", " ", "(%", "s", ");", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "(_", "','_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "entity", "\\u", "id_", ")_", ")_", ",_", "','_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "relate", "d\\u", "entity", "\\u", "id_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db", "\\u", "execute_", "(_", "sql_", ",_", "user", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "right_", "in_", "[_", "'", "viewer", "'_", ",_", "'", "expander", "'_", ",_", "'", "editor", "'_", ",_", "'", "owner", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "e_", "in_", "entity", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "re_", "in_", "relate", "d\\u", "entity", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "db", "\\u", "execute_", "(_", "'", "INSERT", " ", "INT", "O", " ", "relation", "ship", " ", "SET", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "%", "s", ",", " ", "entity", "\\u", "id", " ", "=", " ", "%", "s", ",", " ", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "s", ",", " ", "created", " ", "=", " ", "NOW", "()", ",", " ", "created", "\\u", "by", " ", "=", " ", "%", "s", ";'_", ",_", "right_", ",_", "int_", "(_", "e_", ")_", ",_", "int_", "(_", "re_", ")_", ",_", "user", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "db", "\\u", "execute_", "(_", "'", "UPDATE", " ", "entity", " ", "SET", " ", "change", "d", " ", "=", " ", "NOW", "()", " ", "WHE", "RE", " ", "entity", ".", "id", " ", "IN", " ", "(%", "s", ");'_", "%_", "','_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "entity", "\\u", "id_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "shar", "ing_", "(_", "self_", ",_", "entity", "\\u", "id_", ",_", "shar", "ing_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "entity", "\\u", "id_", "or_", "not_", "shar", "ing_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type_", "(_", "entity", "\\u", "id_", ")_", "is_", "not_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entity", "\\u", "id_", "=_", "[_", "entity", "\\u", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "UPDATE", " ", "entity", " ", "SET", "\\", "10", ";", " ", " ", " ", " ", "shar", "ing", " ", "=", " ", "%%", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "change", "d", " ", "=", " ", "NOW", "()", ",", "\\", "10", ";", " ", " ", " ", " ", "change", "d\\u", "by", " ", "=", " ", "%%", "s", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "id", " ", "IN", " ", "(%", "s", ");", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "','_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "entity", "\\u", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "db", "\\u", "execute_", "(_", "sql_", ",_", "shar", "ing_", ",_", "self_", "._", "\\u\\u", "user", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "shar", "ing", "\\u", "key_", "(_", "self_", ",_", "entity", "\\u", "id_", ",_", "generate_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "entity", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "generate_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "shar", "ing", "\\u", "key_", "=_", "''_", "._", "join_", "(_", "random_", "._", "choice_", "(_", "string_", "._", "ascii", "\\u", "letters_", "+_", "string_", "._", "digits_", ")_", "for_", "x_", "in_", "range_", "(_", "64_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "shar", "ing", "\\u", "key_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type_", "(_", "entity", "\\u", "id_", ")_", "is_", "not_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entity", "\\u", "id_", "=_", "[_", "entity", "\\u", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "UPDATE", " ", "entity", " ", "SET", "\\", "10", ";", " ", " ", " ", " ", "shar", "ing", "\\u", "key", " ", "=", " ", "%%", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "change", "d", " ", "=", " ", "NOW", "()", ",", "\\", "10", ";", " ", " ", " ", " ", "change", "d\\u", "by", " ", "=", " ", "%%", "s", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "id", " ", "IN", " ", "(%", "s", ");", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "','_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "entity", "\\u", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "db", "\\u", "execute_", "(_", "sql_", ",_", "shar", "ing", "\\u", "key_", ",_", "self_", "._", "\\u\\u", "user", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "shar", "ing", "\\u", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "users_", "(_", "self_", ",_", "search_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "To", " ", "return", " ", "list", " ", "of", " ", "entit", "ies", " ", "tha", "t", " ", "have", "\\", "10", ";", " ", " ", " ", " ", "'", "ent", "u", "-", "user", "'", " ", "or", " ", "'", "ent", "u", "-", "api", "-", "key", "'", " ", "property", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "query", "\\u", "re_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "search_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "join", "\\u", "parts_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "s_", "in_", "search_", "._", "split_", "(_", "'", " ", "'_", ")_", "[_", ":_", "5_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "join", "\\u", "parts_", "._", "append_", "(_", "'", "AND", " ", "sp", ".", "value", "\\u", "display", " ", "REGEX", "P", "(\\\\'", "%", "(", "qs", ")", "s", "\\\\')", "'_", "%_", "{_", "'", "qs", "'_", ":_", "s_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "query", "\\u", "re_", "=_", "'", " ", "'_", "._", "join_", "(_", "join", "\\u", "parts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", " ", "DIST", "INC", "T", " ", "e", ".", "id", " ", "AS", " ", "id", ",", " ", "sp", ".", "value", "\\u", "display", ",", " ", "spd", ".*", "\\", "10", ";", " ", " ", " ", " ", "FROM", " ", "entity", " ", "AS", " ", "e", "\\", "10", ";", " ", " ", " ", " ", "LEF", "T", " ", "JOIN", " ", "relation", "ship", " ", "AS", " ", "r", " ", " ", " ", "ON", " ", "r", ".", "entity", "\\u", "id", " ", " ", "=", " ", "e", ".", "id", "\\", "10", ";", " ", " ", " ", " ", "LEF", "T", " ", "JOIN", " ", "property", " ", "AS", " ", "p", " ", " ", " ", "ON", " ", "p", ".", "entity", "\\u", "id", " ", "=", " ", "e", ".", "id", "\\", "10", ";", " ", " ", " ", " ", "RIG", "HT", " ", "JOIN", " ", "property", "\\u", "definit", "ion", " ", "AS", " ", "pd", " ", " ", "ON", " ", "p", ".", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "pd", ".", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", " ", "AND", " ", "pd", ".", "datapro", "pert", "y", " ", "IN", " ", "('", "ent", "u", "-", "user", "','", "ent", "u", "-", "api", "-", "key", "')", "\\", "10", ";", " ", " ", " ", " ", "LEF", "T", " ", "JOIN", " ", "property", " ", "AS", " ", "sp", " ", " ", " ", " ", " ", " ", "ON", " ", "sp", ".", "entity", "\\u", "id", " ", "=", " ", "e", ".", "id", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "query", "\\u", "re", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "LEF", "T", " ", "JOIN", " ", "property", "\\u", "definit", "ion", " ", "AS", " ", "spd", " ", "ON", " ", "spd", ".", "keyn", "ame", " ", "=", " ", "sp", ".", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", " ", "AND", " ", "spd", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", " ", "AND", " ", "spd", ".", "search", " ", "=", " ", "1", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "e", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "r", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "p", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "sp", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "(", " ", "r", ".", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "(", "user", "\\u", "id", ")", "i", " ", "AND", " ", "r", ".", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "IN", " ", "('", "viewer", "',", " ", "'", "expander", "',", " ", "'", "editor", "',", " ", "'", "owner", "')", "\\", "10", ";", " ", " ", " ", "OR", " ", "e", ".", "shar", "ing", " ", "IN", " ", "('", "domain", "',", " ", "'", "public", "')", "\\", "10", ";", " ", " ", " ", " ", ")", " ", "ORDE", "R", " ", "BY", " ", "e", ".", "sort", ",", " ", "e", ".", "created", " ", "DESC", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "{_", "'", "user", "\\u", "id", "'_", ":_", "self_", "._", "\\u\\u", "user", "\\u", "id_", ",_", "'", "query", "\\u", "re", "'_", ":_", "query", "\\u", "re_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logg", "ing", ".", "debug", "(", "sql", ")_", "\\u\\u\\uNL\\u\\u\\u_", "ids_", "=_", "self_", "._", "db", "\\u", "query_", "(_", "sql_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logg", "ing", ".", "debug", "(", "ids", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "entities_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "properties_", "(_", "entity", "\\u", "id_", "=_", "[_", "x_", "._", "get_", "(_", "'", "id", "'_", ")_", "for_", "x_", "in_", "ids_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "entities_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "entities_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "entities_", "(_", "self_", ",_", "ids", "\\u", "only_", "=_", "False_", ",_", "entity", "\\u", "id_", "=_", "None_", ",_", "search_", "=_", "None_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "None_", ",_", "datapro", "pert", "y_", "=_", "None_", ",_", "limit_", "=_", "None_", ",_", "full", "\\u", "definition_", "=_", "False_", ",_", "only", "\\u", "public_", "=_", "False_", ",_", "shar", "ing", "\\u", "key_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "ids", "\\u", "only", " ", "=", " ", "Tru", "e", ",", " ", "then", " ", "return", "s", " ", "list", " ", "of", " ", "Entit", "y", " ", "ID", "s", ".", " ", "Else", " ", "return", "s", " ", "list", " ", "of", " ", "Entit", "ies", " ", "(", "with", " ", "proper", "ties", ")", " ", "as", " ", "dictionar", "y", ".", " ", "entity", "\\u", "id", ",", " ", "entity", "\\u", "definit", "ion", " ", "and", " ", "datapro", "pert", "y", " ", "can", " ", "be", " ", "single", " ", "value", " ", "or", " ", "list", " ", "of", " ", "values", ".", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "limit", " ", "=", " ", "1", ",", " ", "then", " ", "return", "s", " ", "Entit", "y", " ", "(", "not", " ", "list", ").", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "full", "\\u", "definit", "ion", " ", "=", " ", "Tru", "e", " ", ",", "then", " ", "return", "s", " ", "als", "o", " ", "empty", " ", "proper", "ties", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ids_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "id", "\\u", "list_", "(_", "entity", "\\u", "id_", "=_", "entity", "\\u", "id_", ",_", "search_", "=_", "search_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ",_", "limit_", "=_", "limit_", ",_", "only", "\\u", "public_", "=_", "only", "\\u", "public_", ",_", "shar", "ing", "\\u", "key_", "=_", "shar", "ing", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ids", "\\u", "only_", "==_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ids_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "entities_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "properties_", "(_", "entity", "\\u", "id_", "=_", "ids_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ",_", "datapro", "pert", "y_", "=_", "datapro", "pert", "y_", ",_", "full", "\\u", "definition_", "=_", "full", "\\u", "definition_", ",_", "only", "\\u", "public_", "=_", "only", "\\u", "public_", ",_", "shar", "ing", "\\u", "key_", "=_", "shar", "ing", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "entities_", "and_", "full", "\\u", "definition_", "==_", "False_", "and_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "limit_", "==_", "1_", "and_", "len_", "(_", "entities_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "entities_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "entities_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "get", "\\u", "id", "\\u", "list_", "(_", "self_", ",_", "entity", "\\u", "id_", "=_", "None_", ",_", "search_", "=_", "None_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "None_", ",_", "limit_", "=_", "None_", ",_", "only", "\\u", "public_", "=_", "False_", ",_", "shar", "ing", "\\u", "key_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "list", " ", "of", " ", "Entit", "y", " ", "ID", "s", ".", " ", "entity", "\\u", "id", ",", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "and", " ", "user", "\\u", "id", " ", "can", " ", "be", " ", "single", " ", "ID", " ", "or", " ", "list", " ", "of", " ", "ID", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "select", "\\u", "parts_", "=_", "[_", "'", "e", ".", "id", " ", "AS", " ", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "join", "\\u", "parts_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "where", "\\u", "parts_", "=_", "[_", "'", "e", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sql", "\\u", "parts_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "search_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "s_", "in_", "search_", "._", "split_", "(_", "'", " ", "'_", ")_", "[_", ":_", "5_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "join", "\\u", "parts_", "._", "append_", "(_", "'", "RIG", "HT", " ", "JOIN", " ", "property", " ", "AS", " ", "p", "%", "(", "idx", ")", "i", " ", "ON", " ", "p", "%", "(", "idx", ")", "i", ".", "entity", "\\u", "id", " ", "=", " ", "e", ".", "id", " ", "RIG", "HT", " ", "JOIN", " ", "property", "\\u", "definit", "ion", " ", "AS", " ", "pp", "d", "%", "(", "idx", ")", "i", " ", "ON", " ", "pp", "d", "%", "(", "idx", ")", "i", ".", "keyn", "ame", " ", "=", " ", "p", "%", "(", "idx", ")", "i", ".", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "AND", " ", "pp", "d", "%", "(", "idx", ")", "i", ".", "search", " ", "=", " ", "1", "'_", "%_", "{_", "'", "idx", "'_", ":_", "i_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "self_", "._", "\\u\\u", "user", "\\u", "id_", "or_", "only", "\\u", "public_", "==_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "join", "\\u", "parts_", "._", "append_", "(_", "'", "LEF", "T", " ", "JOIN", " ", "property", "\\u", "definit", "ion", " ", "AS", " ", "pd", "%", "i", " ", "ON", " ", "pd", "%", "i", ".", "keyn", "ame", " ", "=", " ", "p", "%", "i", ".", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", "'_", "%_", "(_", "i_", ",_", "i_", ",_", "i_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "where", "\\u", "parts_", "._", "append_", "(_", "'", "p", "%", "i", ".", "value", "\\u", "display", " ", "LI", "KE", " ", "\\\\'", "%%%", "%%", "s", "%%%", "%\\", "\\", "''_", "%_", "(_", "i_", ",_", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "where", "\\u", "parts_", "._", "append_", "(_", "'", "p", "%", "i", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "'_", "%_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ")_", "is_", "not_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "[_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "where", "\\u", "parts_", "._", "append_", "(_", "'", "e", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "IN", " ", "(%", "s", ")'_", "%_", "','_", "._", "join_", "(_", "[_", "'\\\\'", "%", "s", "\\\\''_", "%_", "x_", "for_", "x_", "in_", "map_", "(_", "str_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ")_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "entity", "\\u", "id_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "entity", "\\u", "id_", ")_", "is_", "not_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entity", "\\u", "id_", "=_", "[_", "entity", "\\u", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "where", "\\u", "parts_", "._", "append_", "(_", "'", "e", ".", "id", " ", "IN", " ", "(%", "s", ")'_", "%_", "','_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "entity", "\\u", "id_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u\\u", "user", "\\u", "id_", "and_", "only", "\\u", "public_", "==_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "where", "\\u", "parts_", "._", "append_", "(_", "'", "r", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "join", "\\u", "parts_", "._", "append_", "(_", "'", "RIG", "HT", " ", "JOIN", " ", "relation", "ship", " ", "AS", " ", "r", " ", " ", "ON", " ", "r", ".", "entity", "\\u", "id", " ", " ", "=", " ", "e", ".", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "where", "\\u", "parts_", "._", "append_", "(_", "'(", "r", ".", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "s", " ", "AND", " ", "r", ".", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "IN", " ", "(\\\\'", "viewer", "\\\\'", ",", " ", "\\\\'", "expander", "\\\\'", ",", " ", "\\\\'", "editor", "\\\\'", ",", " ", "\\\\'", "owner", "\\\\')", " ", "OR", " ", "e", ".", "shar", "ing", " ", "IN", " ", "(\\\\'", "domain", "\\\\'", ",", " ", "\\\\'", "public", "\\\\')", ")'_", "%_", "self_", "._", "\\u\\u", "user", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "shar", "ing", "\\u", "key_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "where", "\\u", "parts_", "._", "append_", "(_", "'", "e", ".", "shar", "ing", "\\u", "key", " ", "=", " ", "\\\\'", "%", "s", "\\\\''_", "%_", "shar", "ing", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "where", "\\u", "parts_", "._", "append_", "(_", "'", "e", ".", "shar", "ing", " ", "=", " ", "\\\\'", "public", "\\\\''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "search_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "s_", "in_", "search_", "._", "split_", "(_", "'", " ", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "where", "\\u", "parts_", "._", "append_", "(_", "'", "pd", "%", "i", ".", "public", " ", "=", " ", "1", "'_", "%_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "select", "\\u", "parts_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql", "\\u", "parts_", "._", "append_", "(_", "'", "SELECT", " ", "DIST", "INC", "T", " ", "%", "s", "'_", "%_", "',", " ", "'_", "._", "join_", "(_", "select", "\\u", "parts_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sql", "\\u", "parts_", "._", "append_", "(_", "'", " ", "FROM", " ", "entity", " ", "AS", " ", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "join", "\\u", "parts_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql", "\\u", "parts_", "._", "append_", "(_", "'", " ", "%", "s", "'_", "%_", "'", " ", "'_", "._", "join_", "(_", "join", "\\u", "parts_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "where", "\\u", "parts_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql", "\\u", "parts_", "._", "append_", "(_", "'", " ", "WHE", "RE", " ", "%", "s", "'_", "%_", "'", " ", "AND", " ", "'_", "._", "join_", "(_", "where", "\\u", "parts_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "limit_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "limit_", "=_", "'", " ", "LIMIT", " ", "%", "s", "'_", "%_", "limit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "limit_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sql", "\\u", "parts_", "._", "append_", "(_", "'", " ", "ORDE", "R", " ", "BY", " ", "e", ".", "sort", ",", " ", "e", ".", "created", " ", "DESC", "%", "s", ";'_", "%_", "limit_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sql_", "=_", "''_", "._", "join_", "(_", "sql", "\\u", "parts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logg", "ing", ".", "debug", "(", "sql", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "items_", "=_", "self_", "._", "db", "\\u", "query_", "(_", "sql_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "items_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "[_", "x_", "._", "get_", "(_", "'", "id", "'_", ")_", "for_", "x_", "in_", "items_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "get", "\\u", "properties_", "(_", "self_", ",_", "entity", "\\u", "id_", "=_", "None_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "None_", ",_", "datapro", "pert", "y_", "=_", "None_", ",_", "full", "\\u", "definition_", "=_", "False_", ",_", "only", "\\u", "public_", "=_", "False_", ",_", "shar", "ing", "\\u", "key_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "Entit", "y", " ", "proper", "ties", ".", " ", "entity", "\\u", "id", " ", "can", " ", "be", " ", "single", " ", "ID", " ", "or", " ", "list", " ", "of", " ", "ID", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "full", "\\u", "definit", "ion", " ", "-", " ", "All", " ", "metadata", " ", "for", " ", "entity", " ", "and", " ", "proper", "ties", " ", "is", " ", "fetched", ",", " ", "if", " ", "Tru", "e", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "entity", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "entity", "\\u", "id_", ")_", "is_", "not_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entity", "\\u", "id_", "=_", "[_", "entity", "\\u", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u\\u", "user", "\\u", "id_", "and_", "only", "\\u", "public_", "==_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rights_", "=_", "'(", "SELECT", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "FROM", " ", "relation", "ship", " ", "WHE", "RE", " ", "entity", "\\u", "id", " ", "=", " ", "entity", ".", "id", " ", "AND", " ", "is", "\\u", "delete", "d", " ", "=", " ", "0", " ", "AND", " ", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "s", " ", "AND", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "IN", " ", "(\\\\'", "viewer", "\\\\'", ",", " ", "\\\\'", "expander", "\\\\'", ",", " ", "\\\\'", "editor", "\\\\'", ",", " ", "\\\\'", "owner", "\\\\')", " ", "LIMIT", " ", "1", ")'_", "%_", "self_", "._", "\\u\\u", "user", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "public_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "shar", "ing", "\\u", "key_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rights_", "=_", "'", "FAL", "SE", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "public_", "=_", "'", "AND", " ", "entity", ".", "shar", "ing", "\\u", "key", " ", "=", " ", "\\\\'", "%", "s", "\\\\''_", "%_", "shar", "ing", "\\u", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rights_", "=_", "'", "FAL", "SE", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "public_", "=_", "'", "AND", " ", "entity", ".", "shar", "ing", " ", "=", " ", "\\\\'", "public", "\\\\'", " ", "AND", " ", "property", "\\u", "definit", "ion", ".", "public", " ", "=", " ", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "datapro", "pert", "ys", "ql_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "datapro", "pert", "y_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "datapro", "pert", "y_", ")_", "is_", "not_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "datapro", "pert", "y_", "=_", "[_", "datapro", "pert", "y_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "datapro", "pert", "ys", "ql_", "=_", "'", "AND", " ", "property", "\\u", "definit", "ion", ".", "datapro", "pert", "y", " ", "IN", " ", "(%", "s", ")'_", "%_", "','_", "._", "join_", "(_", "[_", "'\\\\'", "%", "s", "\\\\''_", "%_", "x_", "for_", "x_", "in_", "datapro", "pert", "y_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", "\\", "10", ";", " ", " ", "entity", "\\u", "definit", "ion", ".", "keyn", "ame", " ", " ", " ", " ", " ", "AS", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", "\\", "10", ";", " ", " ", "entity", ".", "id", " ", " ", " ", "AS", " ", "entity", "\\u", "id", ",", "\\", "10", ";", " ", " ", "entity", ".", "created", " ", " ", " ", " ", "AS", " ", "entity", "\\u", "created", ",", "\\", "10", ";", " ", " ", "entity", ".", "change", "d", " ", " ", " ", " ", "AS", " ", "entity", "\\u", "change", "d", ",", "\\", "10", ";", " ", " ", "entity", ".", "shar", "ing", " ", " ", " ", " ", "AS", " ", "entity", "\\u", "shar", "ing", ",", "\\", "10", ";", " ", " ", "entity", ".", "shar", "ing", "\\u", "key", " ", " ", " ", " ", "AS", " ", "entity", "\\u", "shar", "ing", "\\u", "key", ",", "\\", "10", ";", " ", " ", "%", "(", "rights", ")", "s", " ", " ", "AS", " ", "entity", "\\u", "right", ",", "\\", "10", ";", " ", " ", "entity", ".", "sort", " ", " ", " ", " ", " ", " ", " ", "AS", " ", "entity", "\\u", "sort", "\\u", "value", ",", "\\", "10", ";", " ", " ", "property", "\\u", "definit", "ion", ".", "keyn", "ame", " ", " ", " ", "AS", " ", "property", "\\u", "keyn", "ame", ",", "\\", "10", ";", " ", " ", "property", "\\u", "definit", "ion", ".", "ordinal", " ", " ", " ", "AS", " ", "property", "\\u", "ordinal", ",", "\\", "10", ";", " ", " ", "property", "\\u", "definit", "ion", ".", "formula", " ", " ", " ", "AS", " ", "property", "\\u", "formula", ",", "\\", "10", ";", " ", " ", "property", "\\u", "definit", "ion", ".", "executable", " ", " ", " ", " ", " ", " ", "AS", " ", "property", "\\u", "executable", ",", "\\", "10", ";", " ", " ", "property", "\\u", "definit", "ion", ".", "datatype", " ", " ", "AS", " ", "property", "\\u", "datatype", ",", "\\", "10", ";", " ", " ", "property", "\\u", "definit", "ion", ".", "datapro", "pert", "y", " ", " ", " ", " ", "AS", " ", "property", "\\u", "datapro", "pert", "y", ",", "\\", "10", ";", " ", " ", "property", "\\u", "definit", "ion", ".", "mandat", "ory", " ", "AS", " ", "property", "\\u", "mandat", "ory", ",", "\\", "10", ";", " ", " ", "property", "\\u", "definit", "ion", ".", "multil", "ingu", "al", " ", " ", " ", " ", "AS", " ", "property", "\\u", "multil", "ingu", "al", ",", "\\", "10", ";", " ", " ", "property", "\\u", "definit", "ion", ".", "multiplicit", "y", " ", " ", " ", " ", "AS", " ", "property", "\\u", "multiplicit", "y", ",", "\\", "10", ";", " ", " ", "property", "\\u", "definit", "ion", ".", "public", " ", " ", " ", " ", "AS", " ", "property", "\\u", "public", ",", "\\", "10", ";", " ", " ", "property", "\\u", "definit", "ion", ".", "read", "only", " ", " ", "AS", " ", "property", "\\u", "read", "only", ",", "\\", "10", ";", " ", " ", "property", "\\u", "definit", "ion", ".", "visi", "ble", " ", " ", " ", "AS", " ", "property", "\\u", "visi", "ble", ",", "\\", "10", ";", " ", " ", "property", ".", "id", " ", " ", " ", " ", " ", " ", " ", "AS", " ", "value", "\\u", "id", ",", "\\", "10", ";", " ", " ", "property", ".", "id", " ", " ", " ", " ", " ", " ", " ", "AS", " ", "value", "\\u", "ordinal", ",", "\\", "10", ";", " ", " ", "property", ".", "created", " ", " ", " ", " ", " ", " ", "AS", " ", "value", "\\u", "created", ",", "\\", "10", ";", " ", " ", "property", ".", "created", "\\u", "by", " ", " ", " ", "AS", " ", "value", "\\u", "created", "\\u", "by", ",", "\\", "10", ";", " ", " ", "property", ".", "value", "\\u", "display", " ", " ", " ", " ", "AS", " ", "value", "\\u", "display", ",", "\\", "10", ";", " ", " ", "property", ".", "value", "\\u", "formula", " ", " ", " ", " ", "AS", " ", "value", "\\u", "formula", ",", "\\", "10", ";", " ", " ", "property", ".", "value", "\\u", "string", " ", " ", " ", " ", " ", "AS", " ", "value", "\\u", "string", ",", "\\", "10", ";", " ", " ", "property", ".", "value", "\\u", "text", " ", " ", " ", "AS", " ", "value", "\\u", "text", ",", "\\", "10", ";", " ", " ", "property", ".", "value", "\\u", "integ", "er", " ", " ", " ", " ", "AS", " ", "value", "\\u", "integ", "er", ",", "\\", "10", ";", " ", " ", "property", ".", "value", "\\u", "decima", "l", " ", " ", " ", " ", "AS", " ", "value", "\\u", "decima", "l", ",", "\\", "10", ";", " ", " ", "property", ".", "value", "\\u", "boolean", " ", " ", " ", " ", "AS", " ", "value", "\\u", "boolean", ",", "\\", "10", ";", " ", " ", "property", ".", "value", "\\u", "datetime", " ", " ", " ", "AS", " ", "value", "\\u", "datetime", ",", "\\", "10", ";", " ", " ", "property", ".", "value", "\\u", "entity", " ", " ", " ", " ", " ", "AS", " ", "value", "\\u", "entity", ",", "\\", "10", ";", " ", " ", "property", ".", "value", "\\u", "counter", " ", " ", " ", " ", "AS", " ", "value", "\\u", "counter", ",", "\\", "10", ";", " ", " ", "property", ".", "value", "\\u", "reference", " ", " ", "AS", " ", "value", "\\u", "reference", ",", "\\", "10", ";", " ", " ", "property", ".", "value", "\\u", "file", " ", " ", " ", "AS", " ", "value", "\\u", "file", "\\", "10", ";", " ", " ", " ", " ", "FROM", "\\", "10", ";", " ", " ", "entity", ",", "\\", "10", ";", " ", " ", "entity", "\\u", "definit", "ion", ",", "\\", "10", ";", " ", " ", "property", ",", "\\", "10", ";", " ", " ", "property", "\\u", "definit", "ion", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "property", ".", "entity", "\\u", "id", " ", "=", " ", "entity", ".", "id", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "entity", "\\u", "definit", "ion", ".", "keyn", "ame", " ", "=", " ", "entity", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "property", "\\u", "definit", "ion", ".", "keyn", "ame", " ", "=", " ", "property", ".", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "entity", "\\u", "definit", "ion", ".", "keyn", "ame", " ", "=", " ", "property", "\\u", "definit", "ion", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "(", "property", ".", "language", " ", "=", " ", "'%", "(", "language", ")", "s", "'", " ", "OR", " ", "property", ".", "language", " ", "IS", " ", "NULL", ")", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "entity", ".", "id", " ", "IN", " ", "(%", "(", "idl", "ist", ")", "s", ")", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "entity", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "property", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "public", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "datapro", "pert", "ys", "ql", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "ORDE", "R", " ", "BY", "\\", "10", ";", " ", " ", "entity", "\\u", "definit", "ion", ".", "keyn", "ame", ",", "\\", "10", ";", " ", " ", "entity", ".", "created", " ", "DESC", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "{_", "'", "language", "'_", ":_", "self_", "._", "get", "\\u", "user", "\\u", "locale_", "(_", ")_", "._", "code_", ",_", "'", "public", "'_", ":_", "public_", ",_", "'", "idl", "ist", "'_", ":_", "','_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "entity", "\\u", "id_", ")_", ")_", ",_", "'", "datapro", "pert", "ys", "ql", "'_", ":_", "datapro", "pert", "ys", "ql_", ",_", "'", "rights", "'_", ":_", "rights_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logg", "ing", ".", "debug", "(", "sql", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "items_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "self_", "._", "db", "\\u", "query_", "(_", "sql_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "shar", "ing", "'_", ")_", "==_", "'", "private", "'_", "and_", "not_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "right", "'_", ")_", "and_", "not_", "shar", "ing", "\\u", "key_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "shar", "ing", "'_", ")_", "in_", "[_", "'", "domain", "'_", ",_", "'", "public", "'_", "]_", "and_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "right", "'_", ")_", "not_", "in_", "[_", "'", "viewer", "'_", ",_", "'", "expander", "'_", ",_", "'", "editor", "'_", ",_", "'", "owner", "'_", "]_", "and_", "row_", "._", "get_", "(_", "'", "property", "\\u", "public", "'_", ")_", "!=_", "1_", "and_", "not_", "shar", "ing", "\\u", "key_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Entity_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "definit", "ion", "\\u", "keyn", "ame", "'_", "]_", "=_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "id", "'_", "]_", "=_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "label", "'_", "]_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "label", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "label", "\\u", "plural", "'_", "]_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "label", "\\u", "plural", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "description", "'_", "]_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "description", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "sort", "'_", "]_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "sort", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "sort", "\\u", "value", "'_", "]_", "=_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "sort", "\\u", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "created", "'_", "]_", "=_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "created", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "change", "d", "'_", "]_", "=_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "change", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "displayname", "'_", "]_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "displayname", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "display", "info", "'_", "]_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "display", "info", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "display", "table", "'_", "]_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "display", "table", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "shar", "ing", "'_", "]_", "=_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "shar", "ing", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "shar", "ing", "\\u", "key", "'_", "]_", "=_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "shar", "ing", "\\u", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "right", "'_", "]_", "=_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "right", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "ordinal", "'_", "]_", "=_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "created", "'_", ")_", "if_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "created", "'_", ")_", "else_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Property_", "\\u\\u\\uNL\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "keyn", "ame", "'_", "]_", "=_", "row_", "._", "get_", "(_", "'", "property", "\\u", "keyn", "ame", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "fieldset", "'_", "]_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "fieldset", "'_", ",_", "property", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "row_", "._", "get_", "(_", "'", "property", "\\u", "keyn", "ame", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "label", "'_", "]_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "label", "'_", ",_", "property", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "row_", "._", "get_", "(_", "'", "property", "\\u", "keyn", "ame", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "label", "\\u", "plural", "'_", "]_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "label", "\\u", "plural", "'_", ",_", "property", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "row_", "._", "get_", "(_", "'", "property", "\\u", "keyn", "ame", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "description", "'_", "]_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "description", "'_", ",_", "property", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "row_", "._", "get_", "(_", "'", "property", "\\u", "keyn", "ame", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "datatype", "'_", "]_", "=_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "datapro", "pert", "y", "'_", "]_", "=_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "mandat", "ory", "'_", "]_", "=_", "bool_", "(_", "row_", "._", "get_", "(_", "'", "property", "\\u", "mandat", "ory", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "multil", "ingu", "al", "'_", "]_", "=_", "bool_", "(_", "row_", "._", "get_", "(_", "'", "property", "\\u", "multil", "ingu", "al", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "multiplicit", "y", "'_", "]_", "=_", "row_", "._", "get_", "(_", "'", "property", "\\u", "multiplicit", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "ordinal", "'_", "]_", "=_", "row_", "._", "get_", "(_", "'", "property", "\\u", "ordinal", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "formula", "'_", "]_", "=_", "bool_", "(_", "row_", "._", "get_", "(_", "'", "property", "\\u", "formula", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "executable", "'_", "]_", "=_", "bool_", "(_", "row_", "._", "get_", "(_", "'", "property", "\\u", "executable", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "public", "'_", "]_", "=_", "bool_", "(_", "row_", "._", "get_", "(_", "'", "property", "\\u", "public", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "read", "only", "'_", "]_", "=_", "bool_", "(_", "row_", "._", "get_", "(_", "'", "property", "\\u", "read", "only", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "visi", "ble", "'_", "]_", "=_", "bool_", "(_", "row_", "._", "get_", "(_", "'", "property", "\\u", "visi", "ble", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Value_", "\\u\\u\\uNL\\u\\u\\u_", "value_", "=_", "row_", "._", "get_", "(_", "'", "value", "\\u", "display", "'_", ")_", "if_", "row_", "._", "get_", "(_", "'", "value", "\\u", "display", "'_", ")_", "else_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "row_", "._", "get_", "(_", "'", "property", "\\u", "formula", "'_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "db", "\\u", "value_", "=_", "row_", "._", "get_", "(_", "'", "value", "\\u", "formula", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "string", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "db", "\\u", "value_", "=_", "row_", "._", "get_", "(_", "'", "value", "\\u", "string", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "text", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "db", "\\u", "value_", "=_", "row_", "._", "get_", "(_", "'", "value", "\\u", "text", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "row_", "._", "get_", "(_", "'", "value", "\\u", "text", "'_", ")_", "if_", "row_", "._", "get_", "(_", "'", "value", "\\u", "text", "'_", ")_", "else_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "integ", "er", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "db", "\\u", "value_", "=_", "row_", "._", "get_", "(_", "'", "value", "\\u", "integ", "er", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "decima", "l", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "db", "\\u", "value_", "=_", "row_", "._", "get_", "(_", "'", "value", "\\u", "decima", "l", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "date", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "db", "\\u", "value_", "=_", "row_", "._", "get_", "(_", "'", "value", "\\u", "datetime", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "datetime", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "db", "\\u", "value_", "=_", "row_", "._", "get_", "(_", "'", "value", "\\u", "datetime", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "reference", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "db", "\\u", "value_", "=_", "row_", "._", "get_", "(_", "'", "value", "\\u", "reference", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "file", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "db", "\\u", "value_", "=_", "row_", "._", "get_", "(_", "'", "value", "\\u", "file", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "boolean", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "db", "\\u", "value_", "=_", "row_", "._", "get_", "(_", "'", "value", "\\u", "boolean", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "counter", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "db", "\\u", "value_", "=_", "row_", "._", "get_", "(_", "'", "value", "\\u", "counter", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "counter", "-", "value", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "db", "\\u", "value_", "=_", "row_", "._", "get_", "(_", "'", "value", "\\u", "string", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "db", "\\u", "value_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "'", "X", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "values", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "value", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "value", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "id", "'_", "]_", "=_", "row_", "._", "get_", "(_", "'", "value", "\\u", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "values", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "value", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "value", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "ordinal", "'_", "]_", "=_", "row_", "._", "get_", "(_", "'", "value", "\\u", "ordinal", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "values", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "value", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "value", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "value", "'_", "]_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "values", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "value", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "value", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "db", "\\u", "value", "'_", "]_", "=_", "db", "\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "values", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "value", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "value", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "created", "'_", "]_", "=_", "row_", "._", "get_", "(_", "'", "value", "\\u", "created", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "values", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "value", "\\u", "%", "s", "'_", "%_", "row_", "._", "get_", "(_", "'", "value", "\\u", "id", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "created", "\\u", "by", "'_", "]_", "=_", "row_", "._", "get_", "(_", "'", "value", "\\u", "created", "\\u", "by", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "items_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "full", "\\u", "definition_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ")_", "is_", "not_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "[_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "items_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "e_", "in_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "e_", ",_", "{_", "}_", ")_", "[_", "'", "definit", "ion", "\\u", "keyn", "ame", "'_", "]_", "=_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'", "item", "\\u", "%", "s", "'_", "%_", "e_", ",_", "{_", "}_", ")_", "[_", "'", "ordinal", "'_", "]_", "=_", "'", "X", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "items_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "._", "get_", "(_", "'", "id", "'_", ",_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "items_", "[_", "key_", "]_", "=_", "dict_", "(_", "items_", "[_", "key_", "]_", "._", "items_", "(_", ")_", "+_", "self_", "._", "\\u\\u", "get", "\\u", "display", "fields_", "(_", "value_", ")_", "._", "items_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "[_", "key_", "]_", "[_", "'", "display", "pic", "ture", "'_", "]_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "pic", "ture", "\\u", "url_", "(_", "value_", "[_", "'", "id", "'_", "]_", ",_", "value_", "[_", "'", "definit", "ion", "\\u", "keyn", "ame", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "items_", "[_", "key_", "]_", "[_", "'", "complete", "d", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "d_", "in_", "self_", "._", "get", "\\u", "definition_", "(_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "value_", "[_", "'", "definit", "ion", "\\u", "keyn", "ame", "'_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "value_", "._", "get_", "(_", "'", "id", "'_", ",_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "items_", "[_", "key_", "]_", "[_", "'", "displayname", "'_", "]_", "=_", "d_", "[_", "'", "entity", "\\u", "label", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "items_", "[_", "key_", "]_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "d_", "[_", "'", "property", "\\u", "datapro", "pert", "y", "'_", "]_", ",_", "{_", "}_", ")_", "[_", "'", "keyn", "ame", "'_", "]_", "=_", "d_", "[_", "'", "property", "\\u", "keyn", "ame", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "[_", "key_", "]_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "d_", "[_", "'", "property", "\\u", "datapro", "pert", "y", "'_", "]_", ",_", "{_", "}_", ")_", "[_", "'", "fieldset", "'_", "]_", "=_", "d_", "[_", "'", "property", "\\u", "fieldset", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "[_", "key_", "]_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "d_", "[_", "'", "property", "\\u", "datapro", "pert", "y", "'_", "]_", ",_", "{_", "}_", ")_", "[_", "'", "label", "'_", "]_", "=_", "d_", "[_", "'", "property", "\\u", "label", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "[_", "key_", "]_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "d_", "[_", "'", "property", "\\u", "datapro", "pert", "y", "'_", "]_", ",_", "{_", "}_", ")_", "[_", "'", "label", "\\u", "plural", "'_", "]_", "=_", "d_", "[_", "'", "property", "\\u", "label", "\\u", "plural", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "[_", "key_", "]_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "d_", "[_", "'", "property", "\\u", "datapro", "pert", "y", "'_", "]_", ",_", "{_", "}_", ")_", "[_", "'", "description", "'_", "]_", "=_", "d_", "[_", "'", "property", "\\u", "description", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "[_", "key_", "]_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "d_", "[_", "'", "property", "\\u", "datapro", "pert", "y", "'_", "]_", ",_", "{_", "}_", ")_", "[_", "'", "datatype", "'_", "]_", "=_", "d_", "[_", "'", "property", "\\u", "datatype", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "[_", "key_", "]_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "d_", "[_", "'", "property", "\\u", "datapro", "pert", "y", "'_", "]_", ",_", "{_", "}_", ")_", "[_", "'", "datapro", "pert", "y", "'_", "]_", "=_", "d_", "[_", "'", "property", "\\u", "datapro", "pert", "y", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "[_", "key_", "]_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "d_", "[_", "'", "property", "\\u", "datapro", "pert", "y", "'_", "]_", ",_", "{_", "}_", ")_", "[_", "'", "mandat", "ory", "'_", "]_", "=_", "d_", "[_", "'", "property", "\\u", "mandat", "ory", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "[_", "key_", "]_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "d_", "[_", "'", "property", "\\u", "datapro", "pert", "y", "'_", "]_", ",_", "{_", "}_", ")_", "[_", "'", "multil", "ingu", "al", "'_", "]_", "=_", "d_", "[_", "'", "property", "\\u", "multil", "ingu", "al", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "[_", "key_", "]_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "d_", "[_", "'", "property", "\\u", "datapro", "pert", "y", "'_", "]_", ",_", "{_", "}_", ")_", "[_", "'", "multiplicit", "y", "'_", "]_", "=_", "d_", "[_", "'", "property", "\\u", "multiplicit", "y", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "[_", "key_", "]_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "d_", "[_", "'", "property", "\\u", "datapro", "pert", "y", "'_", "]_", ",_", "{_", "}_", ")_", "[_", "'", "ordinal", "'_", "]_", "=_", "d_", "[_", "'", "property", "\\u", "ordinal", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "[_", "key_", "]_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "d_", "[_", "'", "property", "\\u", "datapro", "pert", "y", "'_", "]_", ",_", "{_", "}_", ")_", "[_", "'", "public", "'_", "]_", "=_", "d_", "[_", "'", "property", "\\u", "public", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "[_", "key_", "]_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "d_", "[_", "'", "property", "\\u", "datapro", "pert", "y", "'_", "]_", ",_", "{_", "}_", ")_", "[_", "'", "read", "only", "'_", "]_", "=_", "d_", "[_", "'", "property", "\\u", "read", "only", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "[_", "key_", "]_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "d_", "[_", "'", "property", "\\u", "datapro", "pert", "y", "'_", "]_", ",_", "{_", "}_", ")_", "[_", "'", "visi", "ble", "'_", "]_", "=_", "d_", "[_", "'", "property", "\\u", "visi", "ble", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "d_", "[_", "'", "property", "\\u", "mandat", "ory", "'_", "]_", "and_", "len_", "(_", "value_", "._", "get_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "get_", "(_", "'%", "s", "'_", "%_", "d_", "[_", "'", "property", "\\u", "datapro", "pert", "y", "'_", "]_", ",_", "{_", "}_", ")_", "._", "get_", "(_", "'", "values", "'_", ",_", "{_", "}_", ")_", "._", "values_", "(_", ")_", ")_", "<_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "items_", "[_", "key_", "]_", "[_", "'", "complete", "d", "'_", "]_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "full", "\\u", "definition_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "not_", "d_", "[_", "'", "property", "\\u", "multiplicit", "y", "'_", "]_", "or_", "d_", "[_", "'", "property", "\\u", "multiplicit", "y", "'_", "]_", ">_", "len_", "(_", "value_", "._", "get_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "get_", "(_", "'%", "s", "'_", "%_", "d_", "[_", "'", "property", "\\u", "datapro", "pert", "y", "'_", "]_", ",_", "{_", "}_", ")_", "._", "get_", "(_", "'", "values", "'_", ",_", "{_", "}_", ")_", "._", "values_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "items_", "[_", "key_", "]_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "d_", "[_", "'", "property", "\\u", "datapro", "pert", "y", "'_", "]_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "values", "'_", ",_", "{_", "}_", ")_", "[_", "'", "value", "\\u", "new", "'_", "]_", "=_", "{_", "'", "id", "'_", ":_", "''_", ",_", "'", "ordinal", "'_", ":_", "'", "X", "'_", ",_", "'", "value", "'_", ":_", "''_", ",_", "'", "db", "\\u", "value", "'_", ":_", "''_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "d_", "[_", "'", "property", "\\u", "multiplicit", "y", "'_", "]_", "or_", "d_", "[_", "'", "property", "\\u", "multiplicit", "y", "'_", "]_", ">_", "len_", "(_", "value_", "._", "get_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "get_", "(_", "'%", "s", "'_", "%_", "d_", "[_", "'", "property", "\\u", "datapro", "pert", "y", "'_", "]_", ",_", "{_", "}_", ")_", "._", "get_", "(_", "'", "values", "'_", ",_", "{_", "}_", ")_", "._", "values_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "items_", "[_", "key_", "]_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "d_", "[_", "'", "property", "\\u", "datapro", "pert", "y", "'_", "]_", ",_", "{_", "}_", ")_", "[_", "'", "can", "\\u", "add", "\\u", "new", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "items_", "[_", "key_", "]_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "d_", "[_", "'", "property", "\\u", "datapro", "pert", "y", "'_", "]_", ",_", "{_", "}_", ")_", "[_", "'", "can", "\\u", "add", "\\u", "new", "'_", "]_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "d_", "[_", "'", "property", "\\u", "classif", "ier", "\\u", "id", "'_", "]_", "and_", "d_", "[_", "'", "property", "\\u", "datatype", "'_", "]_", "!=_", "'", "reference", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "for_", "c_", "in_", "self_", "._", "get", "\\u", "entities_", "(_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "d_", "[_", "'", "property", "\\u", "classif", "ier", "\\u", "id", "'_", "]_", ",_", "only", "\\u", "public_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "c_", "._", "get_", "(_", "'", "id", "'_", ",_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "items_", "[_", "key_", "]_", "._", "setdefault_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "d_", "[_", "'", "property", "\\u", "datapro", "pert", "y", "'_", "]_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "select", "'_", ",_", "[_", "]_", ")_", "._", "append_", "(_", "{_", "'", "id", "'_", ":_", "c_", "._", "get_", "(_", "'", "id", "'_", ",_", "''_", ")_", ",_", "'", "label", "'_", ":_", "c_", "._", "get_", "(_", "'", "displayname", "'_", ",_", "''_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "p", "\\u", "key_", ",_", "p", "\\u", "value_", "in_", "value_", "._", "get_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "p", "\\u", "value_", "._", "get_", "(_", "'", "values", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "items_", "[_", "key_", "]_", "[_", "'", "proper", "ties", "'_", "]_", "[_", "p", "\\u", "key_", "]_", "[_", "'", "values", "'_", "]_", "=_", "sorted_", "(_", "p", "\\u", "value_", "._", "get_", "(_", "'", "values", "'_", ",_", "{_", "}_", ")_", "._", "values_", "(_", ")_", ",_", "key_", "=_", "itemgetter_", "(_", "'", "ordinal", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "p", "\\u", "value_", "[_", "'", "datatype", "'_", "]_", "==_", "'", "reference", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "reference", "\\u", "definition_", "=_", "self_", "._", "db", "\\u", "get_", "(_", "'", "SELECT", " ", "classify", "ing", "\\u", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "FROM", " ", "property", "\\u", "definit", "ion", " ", "WHE", "RE", " ", "keyn", "ame", " ", "=", " ", "%", "s", " ", "LIMIT", " ", "1", ";'_", ",_", "p", "\\u", "value_", "[_", "'", "keyn", "ame", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "reference", "\\u", "definition_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "reference", "\\u", "definition_", "._", "get_", "(_", "'", "classify", "ing", "\\u", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "items_", "[_", "key_", "]_", "[_", "'", "proper", "ties", "'_", "]_", "[_", "p", "\\u", "key_", "]_", "[_", "'", "reference", "\\u", "definit", "ion", "'_", "]_", "=_", "reference", "\\u", "definition_", "._", "get_", "(_", "'", "classify", "ing", "\\u", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "p", "\\u", "value_", "[_", "'", "datatype", "'_", "]_", "==_", "'", "file", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "f", "\\u", "key_", ",_", "f", "\\u", "value_", "in_", "enumerate_", "(_", "p", "\\u", "value_", "._", "get_", "(_", "'", "values", "'_", ",_", "{_", "}_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "not_", "f", "\\u", "value_", "._", "get_", "(_", "'", "db", "\\u", "value", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "file", "\\u", "result_", "=_", "self_", "._", "db", "\\u", "get_", "(_", "'", "SELECT", " ", "md5", ",", " ", "files", "ize", ",", " ", "created", " ", "FROM", " ", "file", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "s", ";'_", ",_", "f", "\\u", "value_", "._", "get_", "(_", "'", "db", "\\u", "value", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "file", "\\u", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "items_", "[_", "key_", "]_", "[_", "'", "proper", "ties", "'_", "]_", "[_", "p", "\\u", "key_", "]_", "[_", "'", "values", "'_", "]_", "[_", "f", "\\u", "key_", "]_", "[_", "'", "md5", "'_", "]_", "=_", "file", "\\u", "result_", "._", "get_", "(_", "'", "md5", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "[_", "key_", "]_", "[_", "'", "proper", "ties", "'_", "]_", "[_", "p", "\\u", "key_", "]_", "[_", "'", "values", "'_", "]_", "[_", "f", "\\u", "key_", "]_", "[_", "'", "files", "ize", "'_", "]_", "=_", "file", "\\u", "result_", "._", "get_", "(_", "'", "files", "ize", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "[_", "key_", "]_", "[_", "'", "proper", "ties", "'_", "]_", "[_", "p", "\\u", "key_", "]_", "[_", "'", "values", "'_", "]_", "[_", "f", "\\u", "key_", "]_", "[_", "'", "created", "'_", "]_", "=_", "file", "\\u", "result_", "._", "get_", "(_", "'", "created", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "items_", "._", "values_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "get", "\\u", "display", "fields_", "(_", "self_", ",_", "entity", "\\u", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "Entit", "y", " ", "displayname", ",", " ", "display", "info", ",", " ", "display", "table", " ", "fields", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "display", "field_", "in_", "[_", "'", "displayname", "'_", ",_", "'", "display", "info", "'_", ",_", "'", "display", "table", "'_", ",_", "'", "sort", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "[_", "display", "field_", "]_", "=_", "entity", "\\u", "dict_", "._", "get_", "(_", "display", "field_", ",_", "''_", ")_", "if_", "entity", "\\u", "dict_", "._", "get_", "(_", "display", "field_", ",_", "''_", ")_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "data\\u", "property_", "in_", "find", "Tags_", "(_", "entity", "\\u", "dict_", "._", "get_", "(_", "display", "field_", ",_", "''_", ")_", ",_", "'@'_", ",_", "'@'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "datapro", "pert", "y", "\\u", "dict_", "=_", "entity", "\\u", "dict_", "._", "get_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "get_", "(_", "data\\u", "property_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "[_", "display", "field_", "]_", "=_", "result_", "[_", "display", "field_", "]_", "._", "replace_", "(_", "'@", "%", "s", "@'_", "%_", "data\\u", "property_", ",_", "',", " ", "'_", "._", "join_", "(_", "[_", "'%", "s", "'_", "%_", "x_", "[_", "'", "value", "'_", "]_", "for_", "x_", "in_", "datapro", "pert", "y", "\\u", "dict_", "._", "get_", "(_", "'", "values", "'_", ",_", "{_", "}_", ")_", "._", "values_", "(_", ")_", "]_", ")_", ")_", "._", "replace_", "(_", "'\\\\", "n", "'_", ",_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "[_", "'", "display", "table", "\\u", "labels", "'_", "]_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "display", "table", "header", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "entity", "\\u", "dict_", "._", "get_", "(_", "'", "definit", "ion", "\\u", "keyn", "ame", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "result_", "[_", "'", "display", "table", "\\u", "labels", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "[_", "'", "display", "table", "\\u", "labels", "'_", "]_", "=_", "entity", "\\u", "dict_", "._", "get_", "(_", "'", "display", "table", "'_", ",_", "''_", ")_", "if_", "entity", "\\u", "dict_", "._", "get_", "(_", "'", "display", "table", "'_", ",_", "''_", ")_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "data\\u", "property_", "in_", "find", "Tags_", "(_", "entity", "\\u", "dict_", "._", "get_", "(_", "'", "display", "table", "'_", ",_", "''_", ")_", ",_", "'@'_", ",_", "'@'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "[_", "'", "display", "table", "\\u", "labels", "'_", "]_", "=_", "result_", "[_", "'", "display", "table", "\\u", "labels", "'_", "]_", "._", "replace_", "(_", "'@", "%", "s", "@'_", "%_", "data\\u", "property_", ",_", "entity", "\\u", "dict_", "._", "get_", "(_", "'", "proper", "ties", "'_", ",_", "{_", "}_", ")_", "._", "get_", "(_", "data\\u", "property_", ",_", "{_", "}_", ")_", "._", "get_", "(_", "'", "label", "'_", ",_", "''_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "[_", "'", "display", "table", "'_", "]_", "=_", "result_", "[_", "'", "display", "table", "'_", "]_", "._", "split_", "(_", "'|'_", ")_", "if_", "result_", "[_", "'", "display", "table", "'_", "]_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "[_", "'", "display", "table", "\\u", "labels", "'_", "]_", "=_", "result_", "[_", "'", "display", "table", "\\u", "labels", "'_", "]_", "._", "split_", "(_", "'|'_", ")_", "if_", "result_", "[_", "'", "display", "table", "\\u", "labels", "'_", "]_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "entity", "\\u", "dict_", "._", "get_", "(_", "'", "id", "'_", ",_", "None_", ")_", "and_", "entity", "\\u", "dict_", "._", "get_", "(_", "'", "sort", "\\u", "value", "'_", ",_", "None_", ")_", "!=_", "result_", "[_", "'", "sort", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "db", "\\u", "execute_", "(_", "'", "UPDATE", " ", "entity", " ", "SET", " ", "sort", " ", "=", " ", "LEF", "T", "(%", "s", ",", " ", "100", ")", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "s", "'_", ",_", "result_", "[_", "'", "sort", "'_", "]_", ",_", "entity", "\\u", "dict_", "._", "get_", "(_", "'", "id", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "get", "\\u", "pic", "ture", "\\u", "url_", "(_", "self_", ",_", "entity", "\\u", "id_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "Entit", "y", " ", "pic", "ture", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", "\\", "10", ";", " ", " ", " ", " ", "f", ".", "id", "\\", "10", ";", " ", " ", " ", " ", "FROM", "\\", "10", ";", " ", " ", " ", " ", "property", ",", "\\", "10", ";", " ", " ", " ", " ", "property", "\\u", "definit", "ion", ",", "\\", "10", ";", " ", " ", " ", " ", "file", " ", "f", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "property", "\\u", "definit", "ion", ".", "keyn", "ame", "=", "property", ".", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "f", ".", "id", " ", "=", " ", "property", ".", "value", "\\u", "file", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "property", "\\u", "definit", "ion", ".", "datapro", "pert", "y", "='", "photo", "'", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "property", ".", "entity", "\\u", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "property", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "LIMIT", " ", "1", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "self_", "._", "db", "\\u", "get_", "(_", "sql_", ",_", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'/", "api", "2", "/", "entity", "-%", "s", "/", "pic", "ture", "'_", "%_", "entity", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "in_", "[_", "'", "audio", "video", "'_", ",_", "'", "book", "'_", ",_", "'", "method", "ical", "'_", ",_", "'", "periodic", "al", "'_", ",_", "'", "textb", "ook", "'_", ",_", "'", "workbook", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'/", "photo", "-", "by", "-", "isbn", "?", "entity", "=", "%", "s", "'_", "%_", "entity", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "==_", "'", "person", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "https", "://", "secure", ".", "gravatar", ".", "com", "/", "avat", "ar", "/", "%", "s", "?", "d", "=", "wav", "ata", "r", "&", "s", "=", "150", "'_", "%_", "(_", "hashlib_", "._", "md5_", "(_", "str_", "(_", "entity", "\\u", "id_", ")_", ")_", "._", "hexdigest_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "https", "://", "secure", ".", "gravatar", ".", "com", "/", "avat", "ar", "/", "%", "s", "?", "d", "=", "identi", "con", "&", "s", "=", "150", "'_", "%_", "(_", "hashlib_", "._", "md5_", "(_", "str_", "(_", "entity", "\\u", "id_", ")_", ")_", "._", "hexdigest_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "definition_", "(_", "self_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "Entit", "y", " ", "definit", "ion", " ", "(", "with", " ", "property", " ", "definit", "ion", "s", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type_", "(_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ")_", "is_", "not_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "[_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", "\\", "10", ";", " ", " ", " ", " ", "entity", "\\u", "definit", "ion", ".", "keyn", "ame", " ", "AS", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", "\\", "10", ";", " ", " ", " ", " ", "property", "\\u", "definit", "ion", ".", "keyn", "ame", " ", "AS", " ", "property", "\\u", "keyn", "ame", ",", "\\", "10", ";", " ", " ", " ", " ", "property", "\\u", "definit", "ion", ".", "formula", " ", "AS", " ", "property", "\\u", "formula", ",", "\\", "10", ";", " ", " ", " ", " ", "property", "\\u", "definit", "ion", ".", "datatype", " ", "AS", " ", "property", "\\u", "datatype", ",", "\\", "10", ";", " ", " ", " ", " ", "property", "\\u", "definit", "ion", ".", "datapro", "pert", "y", " ", "AS", " ", "property", "\\u", "datapro", "pert", "y", ",", "\\", "10", ";", " ", " ", " ", " ", "property", "\\u", "definit", "ion", ".", "mandat", "ory", " ", "AS", " ", "property", "\\u", "mandat", "ory", ",", "\\", "10", ";", " ", " ", " ", " ", "property", "\\u", "definit", "ion", ".", "multil", "ingu", "al", " ", "AS", " ", "property", "\\u", "multil", "ingu", "al", ",", "\\", "10", ";", " ", " ", " ", " ", "property", "\\u", "definit", "ion", ".", "multiplicit", "y", " ", "AS", " ", "property", "\\u", "multiplicit", "y", ",", "\\", "10", ";", " ", " ", " ", " ", "property", "\\u", "definit", "ion", ".", "ordinal", " ", "AS", " ", "property", "\\u", "ordinal", ",", "\\", "10", ";", " ", " ", " ", " ", "property", "\\u", "definit", "ion", ".", "public", " ", "AS", " ", "property", "\\u", "public", ",", "\\", "10", ";", " ", " ", " ", " ", "property", "\\u", "definit", "ion", ".", "read", "only", " ", "AS", " ", "property", "\\u", "read", "only", ",", "\\", "10", ";", " ", " ", " ", " ", "property", "\\u", "definit", "ion", ".", "visi", "ble", " ", "AS", " ", "property", "\\u", "visi", "ble", ",", "\\", "10", ";", " ", " ", " ", " ", "property", "\\u", "definit", "ion", ".", "classify", "ing", "\\u", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "AS", " ", "property", "\\u", "classif", "ier", "\\u", "id", "\\", "10", ";", " ", " ", " ", " ", "FROM", "\\", "10", ";", " ", " ", " ", " ", "entity", "\\u", "definit", "ion", ",", "\\", "10", ";", " ", " ", " ", " ", "property", "\\u", "definit", "ion", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "entity", "\\u", "definit", "ion", ".", "keyn", "ame", " ", "=", " ", "property", "\\u", "definit", "ion", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "entity", "\\u", "definit", "ion", ".", "keyn", "ame", " ", "IN", " ", "(%", "s", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "','_", "._", "join_", "(_", "[_", "'\\\\'", "%", "s", "\\\\''_", "%_", "x_", "for_", "x_", "in_", "map_", "(_", "str_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logg", "ing", ".", "debug", "(", "sql", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "defs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "r_", "in_", "self_", "._", "db", "\\u", "query_", "(_", "sql_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defs_", "._", "append_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "'_", ":_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "entity", "\\u", "label", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "label", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "entity", "\\u", "label", "\\u", "plural", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "label", "\\u", "plural", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "entity", "\\u", "description", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "description", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "entity", "\\u", "displayname", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "displayname", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "entity", "\\u", "display", "info", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "display", "info", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "entity", "\\u", "display", "table", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "display", "table", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "property", "\\u", "keyn", "ame", "'_", ":_", "r_", "._", "get_", "(_", "'", "property", "\\u", "keyn", "ame", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "property", "\\u", "fieldset", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "fieldset", "'_", ",_", "property", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "r_", "._", "get_", "(_", "'", "property", "\\u", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "property", "\\u", "label", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "label", "'_", ",_", "property", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "r_", "._", "get_", "(_", "'", "property", "\\u", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "property", "\\u", "label", "\\u", "plural", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "label", "\\u", "plural", "'_", ",_", "property", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "r_", "._", "get_", "(_", "'", "property", "\\u", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "property", "\\u", "description", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "description", "'_", ",_", "property", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "r_", "._", "get_", "(_", "'", "property", "\\u", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "property", "\\u", "datatype", "'_", ":_", "r_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ":_", "r_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "property", "\\u", "mandat", "ory", "'_", ":_", "bool_", "(_", "r_", "._", "get_", "(_", "'", "property", "\\u", "mandat", "ory", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "property", "\\u", "multil", "ingu", "al", "'_", ":_", "bool_", "(_", "r_", "._", "get_", "(_", "'", "property", "\\u", "multil", "ingu", "al", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "property", "\\u", "multiplicit", "y", "'_", ":_", "r_", "._", "get_", "(_", "'", "property", "\\u", "multiplicit", "y", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "property", "\\u", "ordinal", "'_", ":_", "r_", "._", "get_", "(_", "'", "property", "\\u", "ordinal", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "property", "\\u", "public", "'_", ":_", "bool_", "(_", "r_", "._", "get_", "(_", "'", "property", "\\u", "public", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "property", "\\u", "read", "only", "'_", ":_", "bool_", "(_", "r_", "._", "get_", "(_", "'", "property", "\\u", "read", "only", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "property", "\\u", "visi", "ble", "'_", ":_", "bool_", "(_", "r_", "._", "get_", "(_", "'", "property", "\\u", "visi", "ble", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "property", "\\u", "classif", "ier", "\\u", "id", "'_", ":_", "r_", "._", "get_", "(_", "'", "property", "\\u", "classif", "ier", "\\u", "id", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "defs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "entity", "\\u", "definition_", "(_", "self_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "entity", "\\u", "definit", "ion", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ")_", "is_", "not_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "[_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", "\\", "10", ";", " ", " ", " ", " ", "keyn", "ame", ",", "\\", "10", ";", " ", " ", " ", " ", "open", "\\u", "after", "\\u", "add", ",", "\\", "10", ";", " ", " ", " ", " ", "ordinal", ",", "\\", "10", ";", " ", " ", " ", " ", "action", "s", "\\u", "add", "\\", "10", ";", " ", " ", " ", " ", "FROM", "\\", "10", ";", " ", " ", " ", " ", "entity", "\\u", "definit", "ion", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "keyn", "ame", " ", "IN", " ", "(%", "s", ");", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "','_", "._", "join_", "(_", "[_", "'\\\\'", "%", "s", "\\\\''_", "%_", "x_", "for_", "x_", "in_", "map_", "(_", "str_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logg", "ing", ".", "debug", "(", "sql", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "defs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "d_", "in_", "self_", "._", "db", "\\u", "query_", "(_", "sql_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defs_", "._", "append_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "keyn", "ame", "'_", ":_", "d_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "label", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "label", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "d_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "label", "\\u", "plural", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "label", "\\u", "plural", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "d_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "description", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "d_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "menu", "group", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "menu", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "d_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "open", "\\u", "after", "\\u", "add", "'_", ":_", "d_", "._", "get_", "(_", "'", "open", "\\u", "after", "\\u", "add", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ordinal", "'_", ":_", "d_", "._", "get_", "(_", "'", "ordinal", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "action", "s", "\\u", "add", "'_", ":_", "d_", "._", "get_", "(_", "'", "action", "s", "\\u", "add", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "defs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "relative", "s_", "(_", "self_", ",_", "ids", "\\u", "only_", "=_", "False_", ",_", "relation", "ship", "\\u", "ids", "\\u", "only_", "=_", "False_", ",_", "entity", "\\u", "id_", "=_", "None_", ",_", "relate", "d\\u", "entity", "\\u", "id_", "=_", "None_", ",_", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "None_", ",_", "reverse", "\\u", "relation_", "=_", "False_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "None_", ",_", "full", "\\u", "definition_", "=_", "False_", ",_", "limit_", "=_", "None_", ",_", "only", "\\u", "public_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "Entit", "y", " ", "relative", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "ids", "\\u", "only", ",", " ", "relation", "ship", "\\u", "ids", "\\u", "only", " ", "-", " ", "return", " ", "only", " ", "respec", "tiv", "e", " ", "id", "'", "s", " ", "if", " ", "Tru", "e", ";", " ", "return", " ", "full", " ", "info", " ", "by", " ", "default", " ", "(", "Fal", "se", ",", " ", "Fal", "se", ").", "\\", "10", ";", " ", " ", "(", "Tru", "e", ",", " ", "Tru", "e", ")", " ", "is", " ", "interprete", "d", " ", "as", " ", "(", "Tru", "e", ",", " ", "Fal", "se", ")", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "entity", "\\u", "id", " ", "-", " ", "find", " ", "only", " ", "relation", "s", " ", "for", " ", "these", " ", "entit", "ies", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "relate", "d\\u", "entity", "\\u", "id", " ", "-", " ", "find", " ", "only", " ", "relation", "s", " ", "for", " ", "these", " ", "relate", "d", " ", "entit", "ies", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "-", " ", "find", " ", "only", " ", "relation", "s", " ", "with", " ", "these", " ", "relation", "ship", " ", "types", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "reverse", "\\u", "relation", " ", "-", " ", "obsolete", ".", " ", "Ju", "st", " ", "give", " ", "relate", "d\\u", "entity", "\\u", "id", " ", "inst", "ead", " ", "of", " ", "entity", "\\u", "id", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "-", " ", "find", " ", "only", " ", "relation", "s", " ", "with", " ", "entit", "ies", " ", "of", " ", "these", " ", "entity", " ", "types", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "full", "\\u", "definit", "ion", " ", "-", " ", "parameter", " ", "gets", " ", "forwarded", " ", "to", " ", "Entit", "y", ".\\u", "\\u", "get", "\\u", "proper", "ties", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "limit", " ", "-", " ", "My", "SQL", "-", "specific", " ", "limit", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "only", "\\u", "public", " ", "-", " ", "if", " ", "Tru", "e", " ", "then", " ", "only", " ", "public", " ", "entit", "ies", " ", "are", " ", "fetched", ",", " ", "other", "vis", "e", " ", "user", " ", "rights", " ", "are", " ", "checke", "d", ".", " ", "Al", "so", " ", "gets", " ", "forwarded", " ", "to", " ", "Entit", "y", ".\\u", "\\u", "get", "\\u", "proper", "ties", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "entity", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "entity", "\\u", "id_", ")_", "is_", "not_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entity", "\\u", "id_", "=_", "[_", "entity", "\\u", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "relate", "d\\u", "entity", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "relate", "d\\u", "entity", "\\u", "id_", ")_", "is_", "not_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "relate", "d\\u", "entity", "\\u", "id_", "=_", "[_", "relate", "d\\u", "entity", "\\u", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyname_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyname_", ")_", "is_", "not_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "[_", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyname_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ")_", "is_", "not_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "[_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "uni", "ons", "ql_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "reverse", "\\u", "relation_", "==_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", " ", "DIST", "INC", "T", "\\", "10", ";", " ", " ", "r", ".", "id", " ", "AS", " ", "relation", "ship", "\\u", "id", ",", "\\", "10", ";", " ", " ", "r", ".", "entity", "\\u", "id", " ", "AS", " ", "id", ",", "\\", "10", ";", " ", " ", "e", ".", "sort", ",", "\\", "10", ";", " ", " ", "e", ".", "created", "\\", "10", ";", " ", " ", " ", " ", "FROM", "\\", "10", ";", " ", " ", "entity", " ", "AS", " ", "e", ",", "\\", "10", ";", " ", " ", "relation", "ship", " ", "AS", " ", "r", ",", "\\", "10", ";", " ", " ", "relation", "ship", " ", "AS", " ", "rights", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "r", ".", "entity", "\\u", "id", " ", "=", " ", "e", ".", "id", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "rights", ".", "entity", "\\u", "id", " ", "=", " ", "e", ".", "id", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "r", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "rights", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "e", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", " ", "DIST", "INC", "T", "\\", "10", ";", " ", " ", "r", ".", "id", " ", "AS", " ", "relation", "ship", "\\u", "id", ",", "\\", "10", ";", " ", " ", "r", ".", "relate", "d\\u", "entity", "\\u", "id", " ", "AS", " ", "id", ",", "\\", "10", ";", " ", " ", "e", ".", "sort", ",", "\\", "10", ";", " ", " ", "e", ".", "created", "\\", "10", ";", " ", " ", " ", " ", "FROM", "\\", "10", ";", " ", " ", "entity", " ", "AS", " ", "e", ",", "\\", "10", ";", " ", " ", "relation", "ship", " ", "AS", " ", "r", ",", "\\", "10", ";", " ", " ", "relation", "ship", " ", "AS", " ", "rights", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "r", ".", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "e", ".", "id", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "rights", ".", "entity", "\\u", "id", " ", "=", " ", "e", ".", "id", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "r", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "rights", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "e", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "ids", "\\u", "only_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "uni", "ons", "ql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", "UNION", " ", "SELECT", " ", "DIST", "INC", "T", "\\", "10", ";", " ", " ", "NULL", " ", "AS", " ", "relation", "ship", "\\u", "id", ",", "\\", "10", ";", " ", " ", "up", ".", "entity", "\\u", "id", " ", "AS", " ", "id", ",", "\\", "10", ";", " ", " ", "ue", ".", "sort", ",", "\\", "10", ";", " ", " ", "ue", ".", "created", "\\", "10", ";", " ", " ", "FROM", "\\", "10", ";", " ", " ", "property", " ", "up", ",", "\\", "10", ";", " ", " ", "entity", " ", "ue", ",", "\\", "10", ";", " ", " ", "relation", "ship", " ", "AS", " ", "uri", "ghts", "\\", "10", ";", " ", " ", "WHE", "RE", " ", "ue", ".", "id", " ", "=", " ", "up", ".", "entity", "\\u", "id", "\\", "10", ";", " ", " ", "AND", " ", "uri", "ghts", ".", "entity", "\\u", "id", " ", "=", " ", "ue", ".", "id", "\\", "10", ";", " ", " ", "AND", " ", "up", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", "AND", " ", "ue", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", "AND", " ", "uri", "ghts", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "entity", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", "+=_", "'", " ", "AND", " ", "r", ".", "entity", "\\u", "id", " ", "IN", " ", "(%", "s", ")'_", "%_", "','_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "entity", "\\u", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "relate", "d\\u", "entity", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", "+=_", "'", " ", "AND", " ", "r", ".", "relate", "d\\u", "entity", "\\u", "id", " ", "IN", " ", "(%", "s", ")'_", "%_", "','_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "relate", "d\\u", "entity", "\\u", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u\\u", "user", "\\u", "id_", "and_", "only", "\\u", "public_", "==_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", "+=_", "'", " ", "AND", " ", "(", "rights", ".", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "s", " ", "AND", " ", "rights", ".", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "IN", " ", "(\\\\'", "viewer", "\\\\'", ",", " ", "\\\\'", "expander", "\\\\'", ",", " ", "\\\\'", "editor", "\\\\'", ",", " ", "\\\\'", "owner", "\\\\')", " ", "OR", " ", "e", ".", "shar", "ing", " ", " ", "IN", " ", "(\\\\'", "domain", "\\\\'", ",", " ", "\\\\'", "public", "\\\\')", ")'_", "%_", "self_", "._", "\\u\\u", "user", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", "+=_", "'", " ", "AND", " ", "e", ".", "shar", "ing", " ", "=", " ", "\\\\'", "public", "\\\\''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyname_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", "+=_", "'", " ", "AND", " ", "r", ".", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "IN", " ", "(%", "s", ")'_", "%_", "','_", "._", "join_", "(_", "[_", "'\\\\'", "%", "s", "\\\\''_", "%_", "x_", "for_", "x_", "in_", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyname_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", "+=_", "'", " ", "AND", " ", "e", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "IN", " ", "(%", "s", ")'_", "%_", "','_", "._", "join_", "(_", "[_", "'\\\\'", "%", "s", "\\\\''_", "%_", "x_", "for_", "x_", "in_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "uni", "ons", "ql_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", "+=_", "uni", "ons", "ql_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "entity", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", "+=_", "'", " ", "AND", " ", "up", ".", "value", "\\u", "reference", " ", "IN", " ", "(%", "s", ")'_", "%_", "','_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "entity", "\\u", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u\\u", "user", "\\u", "id_", "and_", "only", "\\u", "public_", "==_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", "+=_", "'", " ", "AND", " ", "(", "uri", "ghts", ".", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "s", " ", "AND", " ", "uri", "ghts", ".", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "IN", " ", "(\\\\'", "viewer", "\\\\'", ",", " ", "\\\\'", "expander", "\\\\'", ",", " ", "\\\\'", "editor", "\\\\'", ",", " ", "\\\\'", "owner", "\\\\')", " ", "OR", " ", "ue", ".", "shar", "ing", " ", " ", "IN", " ", "(\\\\'", "domain", "\\\\'", ",", " ", "\\\\'", "public", "\\\\')", ")'_", "%_", "self_", "._", "\\u\\u", "user", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", "+=_", "'", " ", "AND", " ", "ue", ".", "shar", "ing", " ", "=", " ", "\\\\'", "public", "\\\\''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", "+=_", "'", " ", "AND", " ", "ue", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "IN", " ", "(%", "s", ")'_", "%_", "','_", "._", "join_", "(_", "[_", "'\\\\'", "%", "s", "\\\\''_", "%_", "x_", "for_", "x_", "in_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sql_", "+=_", "'", " ", "ORDE", "R", " ", "BY", " ", "sort", ",", " ", "created", " ", "DESC", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "limit_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", "+=_", "'", " ", "LIMIT", " ", "%", "d", "'_", "%_", "limit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sql_", "+=_", "';'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logg", "ing", ".", "debug", "(", "sql", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "ids", "\\u", "only_", "==_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "items_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "item_", "in_", "self_", "._", "db", "\\u", "query_", "(_", "sql_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "items_", "._", "append_", "(_", "item_", "._", "get_", "(_", "'", "id", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "relation", "ship", "\\u", "ids", "\\u", "only_", "==_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "items_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "item_", "in_", "self_", "._", "db", "\\u", "query_", "(_", "sql_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "items_", "._", "append_", "(_", "item_", "._", "get_", "(_", "'", "relation", "ship", "\\u", "id", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "items_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "item_", "in_", "self_", "._", "db", "\\u", "query_", "(_", "sql_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ent_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "properties_", "(_", "entity", "\\u", "id_", "=_", "item_", "._", "get_", "(_", "'", "id", "'_", ")_", ",_", "full", "\\u", "definition_", "=_", "full", "\\u", "definition_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ",_", "only", "\\u", "public_", "=_", "only", "\\u", "public_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "ent_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ent_", "=_", "ent_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "setdefault_", "(_", "'%", "s", "'_", "%_", "ent_", "._", "get_", "(_", "'", "label", "\\u", "plural", "'_", ",_", "''_", ")_", ",_", "[_", "]_", ")_", "._", "append_", "(_", "ent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "items_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "file_", "(_", "self_", ",_", "file", "\\u", "id_", ",_", "shar", "ing", "\\u", "key_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "file", " ", "object", ".", " ", "File", " ", "proper", "ties", " ", "are", " ", "id", ",", " ", "file", ",", " ", "filename", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "type_", "(_", "file", "\\u", "id_", ")_", "is_", "not_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "file", "\\u", "id_", "=_", "[_", "file", "\\u", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u\\u", "user", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "where_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "p", ".", "entity", "\\u", "id", " ", "IN", " ", "(", "\\", "10", ";", " ", " ", "SELECT", " ", "entity", "\\u", "id", "\\", "10", ";", " ", " ", "FROM", " ", "relation", "ship", "\\", "10", ";", " ", " ", "WHE", "RE", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "IN", " ", "('", "viewer", "',", " ", "'", "expander", "',", " ", "'", "editor", "',", " ", "'", "owner", "')", "\\", "10", ";", " ", " ", "AND", " ", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", "AND", " ", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", "UNION", " ", "SELECT", " ", "id", "\\", "10", ";", " ", " ", "FROM", " ", "entity", "\\", "10", ";", " ", " ", "WHE", "RE", " ", "shar", "ing", " ", "IN", " ", "('", "domain", "',", " ", "'", "public", "')", "\\", "10", ";", " ", " ", "AND", " ", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "self_", "._", "\\u\\u", "user", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "shar", "ing", "\\u", "key_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "where_", "=_", "'", "AND", " ", "p", ".", "entity", "\\u", "id", " ", "IN", " ", "(", "SELECT", " ", "id", " ", "FROM", " ", "entity", " ", "WHE", "RE", " ", "shar", "ing", "\\u", "key", " ", "=", " ", "\\\\'", "%", "s", "\\\\')", "'_", "%_", "shar", "ing", "\\u", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "where_", "=_", "'", "AND", " ", "pd", ".", "public", " ", "=", " ", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", " ", "DIST", "INC", "T", "\\", "10", ";", " ", " ", " ", " ", "f", ".", "id", ",", "\\", "10", ";", " ", " ", " ", " ", "f", ".", "md5", ",", "\\", "10", ";", " ", " ", " ", " ", "f", ".", "filename", ",", "\\", "10", ";", " ", " ", " ", " ", "f", ".", "s3", "\\u", "key", ",", "\\", "10", ";", " ", " ", " ", " ", "f", ".", "url", ",", "\\", "10", ";", " ", " ", " ", " ", "f", ".", "created", "\\", "10", ";", " ", " ", " ", " ", "FROM", "\\", "10", ";", " ", " ", " ", " ", "file", " ", "AS", " ", "f", ",", "\\", "10", ";", " ", " ", " ", " ", "property", " ", "AS", " ", "p", ",", "\\", "10", ";", " ", " ", " ", " ", "property", "\\u", "definit", "ion", " ", "AS", " ", "pd", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "p", ".", "value", "\\u", "file", " ", "=", " ", "f", ".", "id", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "pd", ".", "keyn", "ame", " ", "=", " ", "p", ".", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "f", ".", "id", " ", "IN", " ", "(%", "(", "file", "\\u", "id", ")", "s", ")", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "user", "\\u", "where", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "p", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "{_", "'", "file", "\\u", "id", "'_", ":_", "','_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "file", "\\u", "id_", ")_", ")_", ",_", "'", "user", "\\u", "where", "'_", ":_", "user", "\\u", "where_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logg", "ing", ".", "debug", "(", "sql", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "f_", "in_", "self_", "._", "db", "\\u", "query_", "(_", "sql_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "f_", "._", "get_", "(_", "'", "md5", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "os_", "._", "path_", "._", "join_", "(_", "'/'_", ",_", "'", "ent", "u", "'_", ",_", "'", "files", "'_", ",_", "self_", "._", "app", "\\u", "settings_", "(_", "'", "databa", "se", "-", "name", "'_", ")_", ",_", "f_", "._", "get_", "(_", "'", "md5", "'_", ")_", "[_", "0_", "]_", ",_", "f_", "._", "get_", "(_", "'", "md5", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "with_", "open_", "(_", "filename_", ",_", "'", "r", "'_", ")_", "as_", "myfile_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "fileco", "ntent", "_", "=_", "myfile_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "fileco", "ntent", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fileco", "ntent", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "._", "append_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "f_", "._", "get_", "(_", "'", "id", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "created", "'_", ":_", "f_", "._", "get_", "(_", "'", "created", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "file", "'_", ":_", "fileco", "ntent", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "filename", "'_", ":_", "f_", "._", "get_", "(_", "'", "filename", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "s3", "key", "'_", ":_", "f_", "._", "get_", "(_", "'", "s3", "\\u", "key", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "url", "'_", ":_", "f_", "._", "get_", "(_", "'", "url", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "allow", "ed", "\\u", "childs_", "(_", "self_", ",_", "entity", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "allow", "ed", " ", "child", " ", "definit", "ion", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "self_", "._", "db", "\\u", "get_", "(_", "'", "SELECT", " ", "id", " ", "FROM", " ", "relation", "ship", " ", "WHE", "RE", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "i", "N", " ", "(\\\\'", "expander", "\\\\'", ",", " ", "\\\\'", "editor", "\\\\'", ",", " ", "\\\\'", "owner", "\\\\')", " ", "AND", " ", "entity", "\\u", "id", " ", "=", " ", "%", "s", " ", "AND", " ", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "s", " ", "AND", " ", "is", "\\u", "delete", "d", " ", "=", " ", "0", " ", "LIMIT", " ", "1", ";'_", ",_", "entity", "\\u", "id_", ",_", "self_", "._", "\\u\\u", "user", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", " ", "DIST", "INC", "T", "\\", "10", ";", " ", " ", " ", " ", "entity", "\\u", "definit", "ion", ".", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "FROM", "\\", "10", ";", " ", " ", " ", " ", "relation", "ship", "\\", "10", ";", " ", " ", " ", " ", "LEF", "T", " ", "JOIN", " ", "entity", "\\u", "definit", "ion", " ", "ON", " ", "relation", "ship", ".", "relate", "d\\u", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "entity", "\\u", "definit", "ion", ".", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "relation", "ship", ".", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "'", "allow", "ed", "-", "child", "'", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "relation", "ship", ".", "entity", "\\u", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "relation", "ship", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "ORDE", "R", " ", "BY", " ", "entity", "\\u", "definit", "ion", ".", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "entity", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logg", "ing", ".", "debug", "(", "sql", ")_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "self_", "._", "db", "\\u", "query_", "(_", "sql_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", " ", "DIST", "INC", "T", "\\", "10", ";", " ", " ", "entity", "\\u", "definit", "ion", ".", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "FROM", "\\", "10", ";", " ", " ", "entity", "\\u", "definit", "ion", ",", "\\", "10", ";", " ", " ", "relation", "ship", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "relation", "ship", ".", "relate", "d\\u", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "entity", "\\u", "definit", "ion", ".", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "relation", "ship", ".", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "'", "allow", "ed", "-", "child", "'", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "relation", "ship", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "(", "SELECT", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "FROM", " ", "entity", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "s", " ", "LIMIT", " ", "1", ")", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "relation", "ship", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "entity", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logg", "ing", ".", "debug", "(", "sql", ")_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "self_", "._", "db", "\\u", "query_", "(_", "sql_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "defs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "d_", "in_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defs_", "._", "append_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "keyn", "ame", "'_", ":_", "d_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "label", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "label", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "d_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "label", "\\u", "plural", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "label", "\\u", "plural", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "d_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "description", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "d_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "menu", "group", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "menu", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "d_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "defs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "allow", "ed", "\\u", "parents_", "(_", "self_", ",_", "entity", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "allow", "ed", " ", "parent", " ", "definit", "ion", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", " ", "DIST", "INC", "T", " ", "IF", "(", "entity", "\\u", "id", ",", " ", "(", "SELECT", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "FROM", " ", "entity", " ", "WHE", "RE", " ", "id", " ", "=", " ", "relation", "ship", ".", "entity", "\\u", "id", " ", "LIMIT", " ", "1", "),", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", ")", " ", "AS", " ", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "FROM", " ", "relation", "ship", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "'", "allow", "ed", "-", "child", "'", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "relate", "d\\u", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "(", "SELECT", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "FROM", " ", "entity", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "s", " ", "LIMIT", " ", "1", ")", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "is", "\\u", "delete", "d", " ", "=", " ", "0", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "entity", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logg", "ing", ".", "debug", "(", "sql", ")_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "self_", "._", "db", "\\u", "query_", "(_", "sql_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "defs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "d_", "in_", "self_", "._", "db", "\\u", "query_", "(_", "sql_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defs_", "._", "append_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "keyn", "ame", "'_", ":_", "d_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "label", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "label", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "d_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "label", "\\u", "plural", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "label", "\\u", "plural", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "d_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "description", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "d_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "menu", "group", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "menu", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "d_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "defs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "definit", "ion", "s", "\\u", "with", "\\u", "option", "al", "\\u", "parent_", "(_", "self_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "allow", "ed", " ", "entity", " ", "definit", "ion", "s", " ", "what", " ", "have", " ", "default", " ", "parent", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ")_", "is_", "not_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "[_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", " ", "DIST", "INC", "T", "\\", "10", ";", " ", " ", " ", " ", "entity", "\\u", "definit", "ion", ".", "keyn", "ame", ",", "\\", "10", ";", " ", " ", " ", " ", "relation", "ship", ".", "relate", "d\\u", "entity", "\\u", "id", "\\", "10", ";", " ", " ", " ", " ", "FROM", "\\", "10", ";", " ", " ", " ", " ", "entity", "\\u", "definit", "ion", ",", "\\", "10", ";", " ", " ", " ", " ", "relation", "ship", ",", "\\", "10", ";", " ", " ", " ", " ", "relation", "ship", " ", "AS", " ", "rights", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "relation", "ship", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "entity", "\\u", "definit", "ion", ".", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "rights", ".", "entity", "\\u", "id", " ", "=", " ", "relation", "ship", ".", "relate", "d\\u", "entity", "\\u", "id", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "relation", "ship", ".", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "'", "option", "al", "-", "parent", "'", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "rights", ".", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "i", "N", " ", "('", "expander", "',", " ", "'", "editor", "',", " ", "'", "owner", "')", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "rights", ".", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "rights", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "entity", "\\u", "definit", "ion", ".", "keyn", "ame", " ", "IN", " ", "(%", "s", ")", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "relation", "ship", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "(_", "self_", "._", "\\u\\u", "user", "\\u", "id_", ",_", "','_", "._", "join_", "(_", "[_", "'\\\\'", "%", "s", "\\\\''_", "%_", "x_", "for_", "x_", "in_", "map_", "(_", "str_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", ")_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logg", "ing", ".", "debug", "(", "sql", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "defs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "d_", "in_", "self_", "._", "db", "\\u", "query_", "(_", "sql_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "relate", "d\\u", "entity_", "=_", "self_", "._", "get", "\\u", "entities_", "(_", "entity", "\\u", "id_", "=_", "d_", "._", "get_", "(_", "'", "relate", "d\\u", "entity", "\\u", "id", "'_", ")_", ",_", "limit_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defs_", "._", "append_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "keyn", "ame", "'_", ":_", "d_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "label", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "label", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "d_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "label", "\\u", "plural", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "label", "\\u", "plural", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "d_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "description", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "d_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "menu", "group", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "menu", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "d_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "relate", "d\\u", "entity", "\\u", "id", "'_", ":_", "d_", "._", "get_", "(_", "'", "relate", "d\\u", "entity", "\\u", "id", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "relate", "d\\u", "entity", "\\u", "label", "'_", ":_", "relate", "d\\u", "entity_", "._", "get_", "(_", "'", "displayname", "'_", ")_", "if_", "relate", "d\\u", "entity_", "else_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "defs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "public", "\\u", "paths_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "public", " ", "path", "s", " ", "with", " ", "labels", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "paths_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "self_", "._", "db", "\\u", "query_", "(_", "'", "SELECT", " ", "DIST", "INC", "T", " ", "keyn", "ame", ",", " ", "public", "\\u", "path", " ", "FROM", " ", "entity", "\\u", "definit", "ion", " ", "WHE", "RE", " ", "public", "\\u", "path", " ", "IS", " ", "NOT", " ", "NULL", " ", "ORDE", "R", " ", "BY", " ", "public", "\\u", "path", ";'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "paths_", "[_", "i_", "._", "get_", "(_", "'", "public", "\\u", "path", "'_", ")_", "]_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "public", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "i_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "paths_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "public", "\\u", "path_", "(_", "self_", ",_", "entity", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "public", " ", "path", " ", "for", " ", "entity", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "Fal", "se", ",", " ", "if", " ", "public", " ", "path", " ", "doe", "s", " ", "not", " ", "exist", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "path_", "=_", "self_", "._", "db", "\\u", "query_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", " ", "ed", ".", "public", "\\u", "path", "\\", "10", ";", " ", " ", " ", " ", "FROM", " ", "entity", " ", "e", "\\", "10", ";", " ", " ", " ", " ", "LEF", "T", " ", "JOIN", " ", "entity", "\\u", "definit", "ion", " ", "ed", " ", "ON", " ", "ed", ".", "keyn", "ame", " ", "=", " ", "e", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "e", ".", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "e", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "ed", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "e", ".", "shar", "ing", " ", "=", " ", "'", "public", "'", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "ed", ".", "public", "\\u", "path", " ", "IS", " ", "NOT", " ", "NULL", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "menu_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "user", " ", "menu", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "\\u\\u", "user", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "select_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", "\\", "10", ";", " ", " ", "t", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", "\\", "10", ";", " ", " ", "t", ".", "field", ",", "\\", "10", ";", " ", " ", "t", ".", "value", ",", "\\", "10", ";", " ", " ", "(", "\\", "10", ";", " ", " ", "SELECT", " ", "entity", ".", "id", "\\", "10", ";", " ", " ", "FROM", " ", "entity", "\\", "10", ";", " ", " ", "WHE", "RE", " ", "entity", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "t", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", "AND", " ", "entity", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", "AND", " ", "entity", ".", "shar", "ing", " ", "IN", " ", "('", "domain", "',", " ", "'", "public", "')", "\\", "10", ";", " ", " ", "LIMIT", " ", "1", "\\", "10", ";", " ", " ", ")", " ", "AS", " ", "x", "\\", "10", ";", " ", " ", " ", " ", "FROM", "\\", "10", ";", " ", " ", "translatio", "n", " ", "AS", " ", "t", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "t", ".", "field", " ", "IN", " ", "('", "menu", "',", " ", "'", "label", "',", " ", "'", "label", "\\u", "plural", "')", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "IF", "NULL", "(", "t", ".", "language", ",", " ", "'%", "(", "language", ")", "s", "')", " ", "=", " ", "'%", "(", "language", ")", "s", "'", "\\", "10", ";", " ", " ", " ", " ", "HA", "VING", " ", "x", " ", "IS", " ", "NOT", " ", "NULL", "\\", "10", ";", " ", " ", " ", " ", "UNION", " ", "SELECT", "\\", "10", ";", " ", " ", "t", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", "\\", "10", ";", " ", " ", "t", ".", "field", ",", "\\", "10", ";", " ", " ", "t", ".", "value", ",", "\\", "10", ";", " ", " ", "(", "\\", "10", ";", " ", " ", "SELECT", " ", "entity", ".", "id", "\\", "10", ";", " ", " ", "FROM", " ", "entity", ",", " ", "relation", "ship", "\\", "10", ";", " ", " ", "WHE", "RE", " ", "relation", "ship", ".", "entity", "\\u", "id", " ", "=", " ", "entity", ".", "id", "\\", "10", ";", " ", " ", "AND", " ", "entity", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "t", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", "AND", " ", "entity", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", "AND", " ", "relation", "ship", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", "AND", " ", "relation", "ship", ".", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "IN", " ", "('", "viewer", "',", " ", "'", "expander", "',", " ", "'", "editor", "',", " ", "'", "owner", "')", "\\", "10", ";", " ", " ", "AND", " ", "relation", "ship", ".", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "%", "(", "user", "\\u", "id", ")", "s", "\\", "10", ";", " ", " ", "LIMIT", " ", "1", "\\", "10", ";", " ", " ", ")", " ", "AS", " ", "x", "\\", "10", ";", " ", " ", " ", " ", "FROM", "\\", "10", ";", " ", " ", "translatio", "n", " ", "AS", " ", "t", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "t", ".", "field", " ", "IN", " ", "('", "menu", "',", " ", "'", "label", "',", " ", "'", "label", "\\u", "plural", "')", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "IF", "NULL", "(", "t", ".", "language", ",", " ", "'%", "(", "language", ")", "s", "')", " ", "=", " ", "'%", "(", "language", ")", "s", "'", "\\", "10", ";", " ", " ", " ", " ", "HA", "VING", " ", "x", " ", "IS", " ", "NOT", " ", "NULL", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "{_", "'", "user", "\\u", "id", "'_", ":_", "self_", "._", "\\u\\u", "user", "\\u", "id_", ",_", "'", "language", "'_", ":_", "self_", "._", "\\u\\u", "language_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "select_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", "\\", "10", ";", " ", " ", "t", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", "\\", "10", ";", " ", " ", "t", ".", "field", ",", "\\", "10", ";", " ", " ", "t", ".", "value", ",", "\\", "10", ";", " ", " ", "(", "\\", "10", ";", " ", " ", "SELECT", " ", "entity", ".", "id", "\\", "10", ";", " ", " ", "FROM", " ", "entity", "\\", "10", ";", " ", " ", "WHE", "RE", " ", "entity", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "t", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", "AND", " ", "entity", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", "AND", " ", "entity", ".", "shar", "ing", " ", "=", " ", "'", "public", "'", "\\", "10", ";", " ", " ", "LIMIT", " ", "1", "\\", "10", ";", " ", " ", ")", " ", "AS", " ", "x", "\\", "10", ";", " ", " ", " ", " ", "FROM", "\\", "10", ";", " ", " ", "translatio", "n", " ", "AS", " ", "t", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "t", ".", "field", " ", "IN", " ", "('", "menu", "',", " ", "'", "label", "',", " ", "'", "label", "\\u", "plural", "')", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "IF", "NULL", "(", "t", ".", "language", ",", " ", "'%", "(", "language", ")", "s", "')", " ", "=", " ", "'%", "(", "language", ")", "s", "'", "\\", "10", ";", " ", " ", " ", " ", "HA", "VING", " ", "x", " ", "IS", " ", "NOT", " ", "NULL", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "{_", "'", "language", "'_", ":_", "self_", "._", "\\u\\u", "language_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", "\\", "10", ";", " ", " ", " ", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "AS", " ", "definit", "ion", ",", "\\", "10", ";", " ", " ", " ", " ", "MAX", "(", "IF", "(", "field", "='", "menu", "',", " ", "value", ",", " ", "NULL", "))", " ", "AS", " ", "menu", ",", "\\", "10", ";", " ", " ", " ", " ", "MAX", "(", "IF", "(", "field", "='", "label", "',", " ", "value", ",", " ", "NULL", "))", " ", "AS", " ", "label", ",", "\\", "10", ";", " ", " ", " ", " ", "MAX", "(", "IF", "(", "field", "='", "label", "\\u", "plural", "',", " ", "value", ",", " ", "NULL", "))", " ", "AS", " ", "label", "\\u", "plural", "\\", "10", ";", " ", " ", " ", " ", "FROM", " ", "(", "\\", "10", ";", " ", " ", " ", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", ")", " ", "AS", " ", "x", "\\", "10", ";", " ", " ", " ", " ", "GROU", "P", " ", "BY", " ", "definit", "ion", "\\", "10", ";", " ", " ", " ", " ", "HA", "VING", " ", "menu", " ", "IS", " ", "NOT", " ", "NULL", "\\", "10", ";", " ", " ", " ", " ", "ORDE", "R", " ", "BY", "\\", "10", ";", " ", " ", " ", " ", "menu", ",", "\\", "10", ";", " ", " ", " ", " ", "label", "\\u", "plural", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "user", "\\u", "select_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logg", "ing", ".", "debug", "(", "sql", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "menu_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "m_", "in_", "self_", "._", "db", "\\u", "query_", "(_", "sql_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "menu_", "._", "setdefault_", "(_", "m_", "._", "get_", "(_", "'", "menu", "'_", ")_", ",_", "{_", "}_", ")_", "[_", "'", "label", "'_", "]_", "=_", "m_", "._", "get_", "(_", "'", "menu", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "menu_", "._", "setdefault_", "(_", "m_", "._", "get_", "(_", "'", "menu", "'_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "'", "items", "'_", ",_", "[_", "]_", ")_", "._", "append_", "(_", "{_", "'", "keyn", "ame", "'_", ":_", "m_", "._", "get_", "(_", "'", "definit", "ion", "'_", ")_", ",_", "'", "title", "'_", ":_", "m_", "._", "get_", "(_", "'", "label", "\\u", "plural", "'_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "sorted_", "(_", "menu_", "._", "values_", "(_", ")_", ",_", "key_", "=_", "itemgetter_", "(_", "'", "label", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "find", "Tags_", "(_", "s_", ",_", "beginn", "ing_", ",_", "end_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Fin", "ds", " ", "and", " ", "return", "s", " ", "list", " ", "of", " ", "tags", " ", "from", " ", "string", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "re_", "._", "compile_", "(_", "'%", "s", "(.*?)", "%", "s", "'_", "%_", "(_", "beginn", "ing_", ",_", "end_", ")_", ",_", "re_", "._", "DOTALL_", ")_", "._", "findall_", "(_", "s_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Testing equality to None
acabin/docphp/docphp.py
[ { "content": "def getLanguageList(languageName=None, format='all', getAll=True):\n if not getAll:\n languageName = getSetting('languages')\n\n if languageName == None:\n dic = []\n elif isinstance(languageName, str):\n dic = [languageName]\n else:\n dic = languageName\n\n languages = getAllLanguages()\n languages = [(k, languages[k]) for k in sorted(languages.keys())]\n languageList = []\n index = None\n for k, v in languages:\n if languageName == None or k in dic:\n index = len(languageList)\n if format == 'all':\n languageList.append(k + ' ' + v['name'] + ' (' + v['nativeName'] + ')')\n elif format == 'name':\n languageList.append(v['name'])\n elif format == 'nativeName':\n languageList.append(v['nativeName'])\n elif format == 'raw':\n v['shortName'] = k\n languageList.append(v)\n\n return languageList, index", "metadata": "root.getLanguageList", "header": "['module', '___EOS___']", "index": 77 }, { "content": " def run(self, edit, event=None, symbol=None, force=False):\n global language, currentView\n view = self.view\n currentView = view\n pt = False\n\n language = getSetting('language')\n\n if not language:\n view.window().run_command('docphp_checkout_language')\n return\n\n if symbol == None:\n if event:\n pt = view.window_to_text((event[\"x\"], event[\"y\"]))\n else:\n pt = view.sel()[0]\n self.pt = pt\n symbol, locations = sublime_symbol.symbol_at_point(view, pt)\n\n translatedSymbol = symbol.replace('_', '-')\n\n # symbol = 'basename'\n\n translatedSymbol, symbolDescription = getSymbolDescription(translatedSymbol)\n\n if symbolDescription == None:\n if self.search_in_scope(symbol):\n return\n if getSetting('search_user_symbols') and len(locations):\n sublime_symbol.navigate_to_symbol(view, symbol, locations)\n return\n if getSetting('prompt_when_not_found'):\n view.show_popup('not found', sublime.COOPERATE_WITH_AUTO_COMPLETE)\n return\n if symbolDescription == False:\n return\n\n if getSetting('use_panel') == False:\n self.show_popup(translatedSymbol, symbolDescription)\n else:\n self.show_panel(translatedSymbol, symbolDescription, edit)", "metadata": "root.DocphpShowDefinitionCommand.run", "header": "['class', 'DocphpShowDefinitionCommand', '(', 'sublime_plugin', '.', 'TextCommand', ')', ':', '___EOS___']", "index": 297 }, { "content": " def updateLanguage(self, index=None):\n if index == -1 or index == None:\n return\n languageName = re.search('^\\w+', self.languageList[index]).group(0)\n\n self.languageName = languageName\n sublime.set_timeout_async(self.checkoutLanguage, 0)", "metadata": "root.DocphpCheckoutLanguageCommand.updateLanguage", "header": "['class', 'DocphpCheckoutLanguageCommand', '(', 'sublime_plugin', '.', 'TextCommand', ')', ':', '___EOS___']", "index": 597 } ]
[ { "span": "languageName == None:", "start_line": 81, "start_column": 7, "end_line": 81, "end_column": 27 }, { "span": "languageName == None ", "start_line": 93, "start_column": 11, "end_line": 93, "end_column": 31 }, { "span": "symbol == None:", "start_line": 309, "start_column": 11, "end_line": 309, "end_column": 25 }, { "span": "symbolDescription == None:", "start_line": 323, "start_column": 11, "end_line": 323, "end_column": 36 }, { "span": "index == None:", "start_line": 598, "start_column": 26, "end_line": 598, "end_column": 39 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Lang", "ua", "ge", "List_", "(_", "language", "Name_", "=_", "None_", ",_", "format_", "=_", "'", "all", "'_", ",_", "get", "All_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "get", "All_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "language", "Name_", "=_", "get", "Setting_", "(_", "'", "language", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "language", "Name_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dic_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "language", "Name_", ",_", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dic_", "=_", "[_", "language", "Name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dic_", "=_", "language", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "languages_", "=_", "get", "All", "Languages", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "languages_", "=_", "[_", "(_", "k_", ",_", "languages_", "[_", "k_", "]_", ")_", "for_", "k_", "in_", "sorted_", "(_", "languages_", "._", "keys_", "(_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "language", "List_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "languages_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "language", "Name_", "==_", "None_", "or_", "k_", "in_", "dic_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "index_", "=_", "len_", "(_", "language", "List_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "format_", "==_", "'", "all", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "language", "List_", "._", "append_", "(_", "k_", "+_", "'", " ", "'_", "+_", "v_", "[_", "'", "name", "'_", "]_", "+_", "'", " ", "('_", "+_", "v_", "[_", "'", "nativ", "e", "Name", "'_", "]_", "+_", "')'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "format_", "==_", "'", "name", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "language", "List_", "._", "append_", "(_", "v_", "[_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "format_", "==_", "'", "nativ", "e", "Name", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "language", "List_", "._", "append_", "(_", "v_", "[_", "'", "nativ", "e", "Name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "format_", "==_", "'", "raw", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "[_", "'", "short", "Name", "'_", "]_", "=_", "k_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "language", "List_", "._", "append_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "language", "List_", ",_", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Doc", "php", "Show", "Definit", "ion", "Command_", "(_", "sublim", "e\\u", "plugin_", "._", "Text", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "self_", ",_", "edit_", ",_", "event_", "=_", "None_", ",_", "symbol_", "=_", "None_", ",_", "force_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "language_", ",_", "current", "View_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view_", "=_", "self_", "._", "view_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "View_", "=_", "view_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pt_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "language_", "=_", "get", "Setting_", "(_", "'", "language", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "language_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "view_", "._", "window_", "(_", ")_", "._", "run", "\\u", "command_", "(_", "'", "doc", "php", "\\u", "check", "out", "\\u", "language", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "symbol_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "event_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pt_", "=_", "view_", "._", "window", "\\u", "to", "\\u", "text_", "(_", "(_", "event_", "[_", "\"", "x", "\"_", "]_", ",_", "event_", "[_", "\"", "y", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pt_", "=_", "view_", "._", "sel_", "(_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "pt_", "=_", "pt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "symbol_", ",_", "locations_", "=_", "sublim", "e\\u", "symbol_", "._", "symbol", "\\u", "at", "\\u", "point_", "(_", "view_", ",_", "pt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "translat", "ed", "Symbol_", "=_", "symbol_", "._", "replace_", "(_", "'\\u'_", ",_", "'-'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "symbol", " ", "=", " ", "'", "basen", "ame", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "translat", "ed", "Symbol_", ",_", "symbol", "Description_", "=_", "get", "Sym", "bol", "Description_", "(_", "translat", "ed", "Symbol_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "symbol", "Description_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "search", "\\u", "in", "\\u", "scope_", "(_", "symbol_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "get", "Setting_", "(_", "'", "search", "\\u", "user", "\\u", "symbols", "'_", ")_", "and_", "len_", "(_", "locations_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sublim", "e\\u", "symbol_", "._", "navigate", "\\u", "to", "\\u", "symbol_", "(_", "view_", ",_", "symbol_", ",_", "locations_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "get", "Setting_", "(_", "'", "prompt", "\\u", "whe", "n", "\\u", "not", "\\u", "found", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "view_", "._", "show", "\\u", "popup_", "(_", "'", "not", " ", "found", "'_", ",_", "sublime_", "._", "COO", "PER", "ATE", "\\u", "WITH", "\\u", "AUTO", "\\u", "COMPLETE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "symbol", "Description_", "==_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "get", "Setting_", "(_", "'", "use", "\\u", "panel", "'_", ")_", "==_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "show", "\\u", "popup_", "(_", "translat", "ed", "Symbol_", ",_", "symbol", "Description_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "show", "\\u", "panel_", "(_", "translat", "ed", "Symbol_", ",_", "symbol", "Description_", ",_", "edit_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Doc", "php", "Check", "out", "Lang", "ua", "ge", "Command_", "(_", "sublim", "e\\u", "plugin_", "._", "Text", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update", "Language_", "(_", "self_", ",_", "index_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "index_", "==_", "-_", "1_", "or_", "index_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "language", "Name_", "=_", "re_", "._", "search_", "(_", "'", "^", "\\\\", "w", "+'_", ",_", "self_", "._", "language", "List_", "[_", "index_", "]_", ")_", "._", "group_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "language", "Name_", "=_", "language", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sublime_", "._", "set\\u", "timeo", "ut", "\\u", "async_", "(_", "self_", "._", "check", "out", "Language_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
dimagi/commcare-hq/corehq/apps/sms/api.py
[ { "content": "def enqueue_directly(msg):\n try:\n from corehq.apps.sms.management.commands.run_sms_queue import SMSEnqueuingOperation\n SMSEnqueuingOperation().enqueue_directly(msg)\n except:\n # If this direct enqueue fails, no problem, it will get picked up\n # shortly.\n pass", "metadata": "root.enqueue_directly", "header": "['module', '___EOS___']", "index": 194 }, { "content": "def queue_outgoing_sms(msg):\n if settings.SMS_QUEUE_ENABLED:\n try:\n msg.processed = False\n msg.datetime_to_process = msg.date\n msg.queued_timestamp = get_utcnow()\n msg.save()\n except:\n log_sms_exception(msg)\n return False\n\n enqueue_directly(msg)\n return True\n else:\n msg.processed = True\n msg_sent = send_message_via_backend(msg)\n msg.publish_change()\n if msg_sent:\n create_billable_for_sms(msg)\n return msg_sent", "metadata": "root.queue_outgoing_sms", "header": "['module', '___EOS___']", "index": 204 }, { "content": "def process_incoming(msg):\n v = VerifiedNumber.by_phone(msg.phone_number, include_pending=True)\n\n if v is not None and v.verified:\n msg.couch_recipient_doc_type = v.owner_doc_type\n msg.couch_recipient = v.owner_id\n msg.domain = v.domain\n msg.location_id = get_location_id_by_verified_number(v)\n msg.save()\n\n if msg.domain_scope:\n # only process messages for phones known to be associated with this domain\n if v is None or v.domain != msg.domain_scope:\n raise DomainScopeValidationError(\n 'Attempted to simulate incoming sms from phone number not ' \\\n 'verified with this domain'\n )\n\n can_receive_sms = PhoneBlacklist.can_receive_sms(msg.phone_number)\n opt_in_keywords, opt_out_keywords = get_opt_keywords(msg)\n if is_opt_message(msg.text, opt_out_keywords) and can_receive_sms:\n if PhoneBlacklist.opt_out_sms(msg.phone_number):\n metadata = MessageMetadata(ignore_opt_out=True)\n text = get_message(MSG_OPTED_OUT, v, context=(opt_in_keywords[0],))\n if v:\n send_sms_to_verified_number(v, text, metadata=metadata)\n else:\n send_sms(msg.domain, None, msg.phone_number, text, metadata=metadata)\n elif is_opt_message(msg.text, opt_in_keywords) and not can_receive_sms:\n if PhoneBlacklist.opt_in_sms(msg.phone_number):\n text = get_message(MSG_OPTED_IN, v, context=(opt_out_keywords[0],))\n if v:\n send_sms_to_verified_number(v, text)\n else:\n send_sms(msg.domain, None, msg.phone_number, text)\n elif v is not None and v.verified:\n if domain_has_privilege(msg.domain, privileges.INBOUND_SMS):\n for h in settings.SMS_HANDLERS:\n try:\n handler = to_function(h)\n except:\n notify_exception(None, message=('error loading sms handler: %s' % h))\n continue\n\n try:\n was_handled = handler(v, msg.text, msg=msg)\n except Exception, e:\n log_sms_exception(msg)\n was_handled = False\n\n if was_handled:\n break\n else:\n handled = process_pre_registration(msg)\n\n if not handled:\n handled = process_sms_registration(msg)\n\n if not handled:\n import verify\n verify.process_verification(v, msg)\n\n # If the sms queue is enabled, then the billable gets created in remove_from_queue()\n if (\n not settings.SMS_QUEUE_ENABLED and\n msg.domain and\n domain_has_privilege(msg.domain, privileges.INBOUND_SMS)\n ):\n create_billable_for_sms(msg)", "metadata": "root.process_incoming", "header": "['module', '___EOS___']", "index": 491 } ]
[ { "span": "except:", "start_line": 198, "start_column": 4, "end_line": 198, "end_column": 11 }, { "span": "except:", "start_line": 211, "start_column": 8, "end_line": 211, "end_column": 15 }, { "span": "except:", "start_line": 531, "start_column": 16, "end_line": 531, "end_column": 23 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "enqueue", "\\u", "direct", "ly_", "(_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "core", "hq", "_", "._", "apps_", "._", "sms_", "._", "management_", "._", "commands_", "._", "run", "\\u", "sms", "\\u", "queue_", "import_", "SMS", "Enque", "uin", "g", "Operation_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SMS", "Enque", "uin", "g", "Operation_", "(_", ")_", "._", "enqueue", "\\u", "direct", "ly_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "this", " ", "direct", " ", "enqueue", " ", "fail", "s", ",", " ", "no", " ", "problem", ",", " ", "it", " ", "will", " ", "get", " ", "picked", " ", "up_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "short", "ly", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "queue", "\\u", "outgoing", "\\u", "sms_", "(_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "settings_", "._", "SMS", "\\u", "QUEUE", "\\u", "ENABLED_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "._", "processed_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "datetime", "\\u", "to", "\\u", "process_", "=_", "msg_", "._", "date_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "queue", "d\\u", "timestamp_", "=_", "get", "\\u", "utcnow_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log", "\\u", "sms", "\\u", "exception_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "enqueue", "\\u", "direct", "ly_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "._", "processed_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg", "\\u", "sent_", "=_", "send", "\\u", "message", "\\u", "via", "\\u", "backend_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "publi", "sh", "\\u", "change_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "msg", "\\u", "sent_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "create", "\\u", "bill", "able", "\\u", "for", "\\u", "sms_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "msg", "\\u", "sent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "incoming_", "(_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "Verifie", "d", "Number_", "._", "by", "\\u", "phone_", "(_", "msg_", "._", "phone", "\\u", "number_", ",_", "include", "\\u", "pending_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "v_", "is_", "not_", "None_", "and_", "v_", "._", "verified_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "._", "couch", "\\u", "recip", "ient", "\\u", "doc", "\\u", "type_", "=_", "v_", "._", "owner", "\\u", "doc", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "couch", "\\u", "recipient_", "=_", "v_", "._", "owner", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "domain_", "=_", "v_", "._", "domain_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "location", "\\u", "id_", "=_", "get", "\\u", "location", "\\u", "id", "\\u", "by", "\\u", "verifie", "d\\u", "number_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "msg_", "._", "domain", "\\u", "scope_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "only", " ", "process", " ", "message", "s", " ", "for", " ", "phone", "s", " ", "know", "n", " ", "to", " ", "be", " ", "associate", "d", " ", "with", " ", "this", " ", "domain_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "v_", "is_", "None_", "or_", "v_", "._", "domain_", "!=_", "msg_", "._", "domain", "\\u", "scope_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Doma", "in", "Sco", "pe", "Validat", "ion", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Atte", "mpte", "d", " ", "to", " ", "simulat", "e", " ", "inco", "ming", " ", "sms", " ", "from", " ", "phone", " ", "number", " ", "not", " ", "'_", "'", "verifie", "d", " ", "with", " ", "this", " ", "domain", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "can", "\\u", "receive", "\\u", "sms_", "=_", "Phone", "Black", "list_", "._", "can", "\\u", "receive", "\\u", "sms_", "(_", "msg_", "._", "phone", "\\u", "number_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opt", "\\u", "in", "\\u", "keywords_", ",_", "opt", "\\u", "out", "\\u", "keywords_", "=_", "get", "\\u", "opt", "\\u", "keywords_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "is", "\\u", "opt", "\\u", "message_", "(_", "msg_", "._", "text_", ",_", "opt", "\\u", "out", "\\u", "keywords_", ")_", "and_", "can", "\\u", "receive", "\\u", "sms_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "Phone", "Black", "list_", "._", "opt", "\\u", "out", "\\u", "sms_", "(_", "msg_", "._", "phone", "\\u", "number_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "metadata_", "=_", "Messag", "e", "Metadata_", "(_", "ignore", "\\u", "opt", "\\u", "out_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "get", "\\u", "message_", "(_", "MS", "G", "\\u", "OPT", "ED", "\\u", "OUT_", ",_", "v_", ",_", "context_", "=_", "(_", "opt", "\\u", "in", "\\u", "keywords_", "[_", "0_", "]_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "v_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "send", "\\u", "sms", "\\u", "to", "\\u", "verifie", "d\\u", "number_", "(_", "v_", ",_", "text_", ",_", "metadata_", "=_", "metadata_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "send", "\\u", "sms_", "(_", "msg_", "._", "domain_", ",_", "None_", ",_", "msg_", "._", "phone", "\\u", "number_", ",_", "text_", ",_", "metadata_", "=_", "metadata_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "is", "\\u", "opt", "\\u", "message_", "(_", "msg_", "._", "text_", ",_", "opt", "\\u", "in", "\\u", "keywords_", ")_", "and_", "not_", "can", "\\u", "receive", "\\u", "sms_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "Phone", "Black", "list_", "._", "opt", "\\u", "in", "\\u", "sms_", "(_", "msg_", "._", "phone", "\\u", "number_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "get", "\\u", "message_", "(_", "MS", "G", "\\u", "OPT", "ED", "\\u", "IN_", ",_", "v_", ",_", "context_", "=_", "(_", "opt", "\\u", "out", "\\u", "keywords_", "[_", "0_", "]_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "v_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "send", "\\u", "sms", "\\u", "to", "\\u", "verifie", "d\\u", "number_", "(_", "v_", ",_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "send", "\\u", "sms_", "(_", "msg_", "._", "domain_", ",_", "None_", ",_", "msg_", "._", "phone", "\\u", "number_", ",_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "v_", "is_", "not_", "None_", "and_", "v_", "._", "verified_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "domain", "\\u", "has", "\\u", "privilege", "_", "(_", "msg_", "._", "domain_", ",_", "privilege", "s_", "._", "IN", "BOUND", "\\u", "SMS", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "h_", "in_", "settings_", "._", "SMS", "\\u", "HANDLER", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "handler_", "=_", "to", "\\u", "function_", "(_", "h_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "notif", "y", "\\u", "exception_", "(_", "None_", ",_", "message_", "=_", "(_", "'", "error", " ", "load", "ing", " ", "sms", " ", "handler", ":", " ", "%", "s", "'_", "%_", "h_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "was", "\\u", "handled_", "=_", "handler_", "(_", "v_", ",_", "msg_", "._", "text_", ",_", "msg_", "=_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "log", "\\u", "sms", "\\u", "exception_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "was", "\\u", "handled_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "was", "\\u", "handled_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "handled_", "=_", "process", "\\u", "pre", "\\u", "registration_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "handled_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "handled_", "=_", "process", "\\u", "sms", "\\u", "registration_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "handled_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "verify_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "verify_", "._", "process", "\\u", "verification", "_", "(_", "v_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "sms", " ", "queue", " ", "is", " ", "enable", "d", ",", " ", "then", " ", "the", " ", "bill", "able", " ", "gets", " ", "created", " ", "in", " ", "remove", "\\u", "from", "\\u", "queue", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "settings_", "._", "SMS", "\\u", "QUEUE", "\\u", "ENABLED_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "msg_", "._", "domain_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "domain", "\\u", "has", "\\u", "privilege", "_", "(_", "msg_", "._", "domain_", ",_", "privilege", "s_", "._", "IN", "BOUND", "\\u", "SMS", "_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "create", "\\u", "bill", "able", "\\u", "for", "\\u", "sms_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
missionpinball/mpf/tests/test_BallDeviceEventConfirmation.py
[ { "content": "import unittest\n\nfrom mpf.system.machine import MachineController\nfrom MpfTestCase import MpfTestCase\nfrom mock import MagicMock\nimport time\nimport tests.test_BallDeviceSwitchConfirmation\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestBallDeviceEventConfirmation(tests.test_BallDeviceSwitchConfirmation.TestBallDeviceSwitchConfirmation):\n\n\n", "metadata": "root.TestBallDeviceEventConfirmation", "header": "['module', '___EOS___']", "index": 8 }, { "content": " def getConfigFile(self):\n return 'test_ball_device_event_confirmation.yaml'", "metadata": "root.TestBallDeviceEventConfirmation.getConfigFile", "header": "['class', 'TestBallDeviceEventConfirmation', '(', 'tests', '.', 'test_BallDeviceSwitchConfirmation', '.', 'TestBallDeviceSwitchConfirmation', ')', ':', '___EOS___']", "index": 10 }, { "content": " def getMachinePath(self):\n return '../tests/machine_files/ball_device/'", "metadata": "root.TestBallDeviceEventConfirmation.getMachinePath", "header": "['class', 'TestBallDeviceEventConfirmation', '(', 'tests', '.', 'test_BallDeviceSwitchConfirmation', '.', 'TestBallDeviceSwitchConfirmation', ')', ':', '___EOS___']", "index": 13 }, { "content": " def _hit_confirm(self):\n self.machine.events.post(\"launcher_confirm\")", "metadata": "root.TestBallDeviceEventConfirmation._hit_confirm", "header": "['class', 'TestBallDeviceEventConfirmation', '(', 'tests', '.', 'test_BallDeviceSwitchConfirmation', '.', 'TestBallDeviceSwitchConfirmation', ')', ':', '___EOS___']", "index": 16 } ]
[ { "span": "import unittest", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 15 }, { "span": "from mpf.system.machine import MachineController", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 48 }, { "span": "from MpfTestCase import MpfTestCase", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 35 }, { "span": "from mock import MagicMock", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 26 }, { "span": "import time", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 11 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "mpf", "_", "._", "system_", "._", "machine_", "import_", "Machine", "Controller_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Mp", "f", "Test", "Case_", "import_", "Mp", "f", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mock_", "import_", "Mag", "ic", "Mock_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tests_", "._", "test\\u", "Ball", "Dev", "ice", "Switch", "Confirmation", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Test", "Ball", "Dev", "ice", "Event", "Confirmation", "_", "(_", "tests_", "._", "test\\u", "Ball", "Dev", "ice", "Switch", "Confirmation", "_", "._", "Test", "Ball", "Dev", "ice", "Switch", "Confirmation", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Ball", "Dev", "ice", "Event", "Confirmation", "_", "(_", "tests_", "._", "test\\u", "Ball", "Dev", "ice", "Switch", "Confirmation", "_", "._", "Test", "Ball", "Dev", "ice", "Switch", "Confirmation", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get", "Config", "File_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "test\\u", "bal", "l\\u", "device", "\\u", "event", "\\u", "confirmation", ".", "yaml", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Ball", "Dev", "ice", "Event", "Confirmation", "_", "(_", "tests_", "._", "test\\u", "Ball", "Dev", "ice", "Switch", "Confirmation", "_", "._", "Test", "Ball", "Dev", "ice", "Switch", "Confirmation", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Machine", "Path_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'../", "tests", "/", "machine", "\\u", "files", "/", "bal", "l\\u", "device", "/'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Ball", "Dev", "ice", "Event", "Confirmation", "_", "(_", "tests_", "._", "test\\u", "Ball", "Dev", "ice", "Switch", "Confirmation", "_", "._", "Test", "Ball", "Dev", "ice", "Switch", "Confirmation", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "hit", "\\u", "confirm_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "machine_", "._", "events_", "._", "post_", "(_", "\"", "launcher", "\\u", "confirm", "\"_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unnecessary pass
cTn-dev/PyComms/PyComms/pycomms.py
[ { "content": "#!/usr/bin/python\n\n# Python Standard Library Imports\nimport smbus\n\n# External Imports\npass\n\n# Custom Imports\npass\n\n# ===========================================================================\n# PyComms I2C Base Class (an rewriten Adafruit_I2C pythone class clone)\n# ===========================================================================\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "pass", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 4 }, { "span": "pass", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 4 } ]
[]
1
true
[ "[CLS]_", "Un", "necessar", "y_", "pass_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "python_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "Standard", " ", "Libr", "ary", " ", "Imports", "_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "smb", "us_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Exter", "nal", " ", "Imports", "_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Custom", " ", "Imports", "_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "==============", "==============", "==============", "==============", "==============", "=====", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Py", "Comm", "s", " ", "I2", "C", " ", "Base", " ", "Class", " ", "(", "an", " ", "rewrite", "n", " ", "Adafruit", "\\u", "I2", "C", " ", "python", "e", " ", "class", " ", "clone", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "==============", "==============", "==============", "==============", "==============", "=====", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unnecessary pass
bmcfee/librosa/tests/test_filters.py
[ { "content": "def test_hz_to_mel():\n def __test_to_mel(infile):\n DATA = load(infile)\n z = librosa.hz_to_mel(DATA['f'], DATA['htk'])\n\n assert np.allclose(z, DATA['result'])\n\n for infile in files('data/feature-hz_to_mel-*.mat'):\n yield (__test_to_mel, infile)\n\n pass", "metadata": "root.test_hz_to_mel", "header": "['module', '___EOS___']", "index": 55 }, { "content": "def test_mel_to_hz():\n\n def __test_to_hz(infile):\n DATA = load(infile)\n z = librosa.mel_to_hz(DATA['f'], DATA['htk'])\n\n assert np.allclose(z, DATA['result'])\n\n for infile in files('data/feature-mel_to_hz-*.mat'):\n yield (__test_to_hz, infile)\n\n pass", "metadata": "root.test_mel_to_hz", "header": "['module', '___EOS___']", "index": 68 }, { "content": "def test_hz_to_octs():\n def __test_to_octs(infile):\n DATA = load(infile)\n z = librosa.hz_to_octs(DATA['f'])\n\n assert np.allclose(z, DATA['result'])\n\n for infile in files('data/feature-hz_to_octs-*.mat'):\n yield (__test_to_octs, infile)\n\n pass", "metadata": "root.test_hz_to_octs", "header": "['module', '___EOS___']", "index": 82 } ]
[ { "span": "pass", "start_line": 65, "start_column": 4, "end_line": 65, "end_column": 8 }, { "span": "pass", "start_line": 79, "start_column": 4, "end_line": 79, "end_column": 8 }, { "span": "pass", "start_line": 92, "start_column": 4, "end_line": 92, "end_column": 8 } ]
[]
1
true
[ "[CLS]_", "Un", "necessar", "y_", "pass_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "hz", "\\u", "to", "\\u", "mel", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "test\\u", "to", "\\u", "mel", "_", "(_", "infile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "DATA_", "=_", "load_", "(_", "infile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z_", "=_", "libro", "sa_", "._", "hz", "\\u", "to", "\\u", "mel", "_", "(_", "DATA_", "[_", "'", "f", "'_", "]_", ",_", "DATA_", "[_", "'", "ht", "k", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "np_", "._", "allclose_", "(_", "z_", ",_", "DATA_", "[_", "'", "result", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "infile_", "in_", "files_", "(_", "'", "data", "/", "feature", "-", "hz", "\\u", "to", "\\u", "mel", "-*", ".", "mat", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "(_", "\\u\\u", "test\\u", "to", "\\u", "mel", "_", ",_", "infile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "mel", "\\u", "to", "\\u", "hz_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "test\\u", "to", "\\u", "hz_", "(_", "infile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "DATA_", "=_", "load_", "(_", "infile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z_", "=_", "libro", "sa_", "._", "mel", "\\u", "to", "\\u", "hz_", "(_", "DATA_", "[_", "'", "f", "'_", "]_", ",_", "DATA_", "[_", "'", "ht", "k", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "np_", "._", "allclose_", "(_", "z_", ",_", "DATA_", "[_", "'", "result", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "infile_", "in_", "files_", "(_", "'", "data", "/", "feature", "-", "mel", "\\u", "to", "\\u", "hz", "-*", ".", "mat", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "(_", "\\u\\u", "test\\u", "to", "\\u", "hz_", ",_", "infile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "hz", "\\u", "to", "\\u", "oct", "s_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "test\\u", "to", "\\u", "oct", "s_", "(_", "infile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "DATA_", "=_", "load_", "(_", "infile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z_", "=_", "libro", "sa_", "._", "hz", "\\u", "to", "\\u", "oct", "s_", "(_", "DATA_", "[_", "'", "f", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "np_", "._", "allclose_", "(_", "z_", ",_", "DATA_", "[_", "'", "result", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "infile_", "in_", "files_", "(_", "'", "data", "/", "feature", "-", "hz", "\\u", "to", "\\u", "oct", "s", "-*", ".", "mat", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "(_", "\\u\\u", "test\\u", "to", "\\u", "oct", "s_", ",_", "infile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2 ]
Unused import
udibr/sketch/sketch.py
[ { "content": "#!/usr/bin/env python\n\nfrom __future__ import division, print_function\n\nimport logging\nimport os\n\nFORMAT = '[%(asctime)s] %(name)-15s %(message)s'\nDATEFMT = \"%H:%M:%S\"\nlogging.basicConfig(format=FORMAT, datefmt=DATEFMT, level=logging.INFO)\n\n\nimport sys\nimport theano\n# Automatically detect we are debugging and turn on maximal Theano debugging\ndebug = sys.gettrace() is not None\nif debug:\n print(\"Debugging\")\n theano.config.optimizer = 'fast_compile' # or \"None\"\n theano.config.exception_verbosity = 'high'\n theano.config.compute_test_value = 'warn'\nelse:\n theano.config.compute_test_value = 'off'\n\n\nimport theano.tensor as T\nimport numpy as np\n\nimport fuel\n\nfrom argparse import ArgumentParser\n\nfrom fuel.streams import DataStream\nfrom fuel.schemes import SequentialScheme, ShuffledScheme\n\nfrom blocks.algorithms import GradientDescent, CompositeRule, StepClipping\nfrom blocks.algorithms import Adam, RMSProp, AdaGrad, Scale, AdaDelta\nfrom blocks.initialization import Constant\n\nfrom blocks.graph import ComputationGraph, apply_dropout\nfrom blocks.extensions import FinishAfter, Timing, Printing, ProgressBar\nfrom blocks.extensions.saveload import SimpleExtension\nfrom blocks.bricks import Random, Initializable\nfrom blocks.bricks.base import application\nfrom blocks.extensions.monitoring import DataStreamMonitoring\nfrom blocks.extensions.monitoring import TrainingDataMonitoring\nfrom blocks.main_loop import MainLoop\nfrom blocks.model import Model\nfrom blocks.bricks.recurrent import LSTM, GatedRecurrent\nfrom blocks.bricks.recurrent import RecurrentStack\nfrom blocks.bricks.sequence_generators import SequenceGenerator, Readout\nfrom fuel.datasets import H5PYDataset\nfrom blocks.filter import VariableFilter\nfrom blocks.extensions.saveload import Checkpoint, Load\nimport cPickle as pickle\n\nfrom blocks_extras import OrthogonalGlorot\nfrom blocks.initialization import Uniform\n\nfloatX = theano.config.floatX\nfuel.config.floatX = floatX\nfrom fuel.transformers import Mapping\nfrom blocks.utils import named_copy\nlogger = logging.getLogger(__name__)\nimport pprint\n\n#-----------------------------------------------------------------------------\n# this must be a global function so we can pickle it\nimport math\n\n\n#----------------------------------------------------------------------------\nimport matplotlib\nmatplotlib.use('Agg') # allow plotting without a graphic display\nfrom matplotlib import pylab as pl\nfrom pylab import cm\n\n\n\n\n#----------------------------------------------------------------------------\nfrom blocks.bricks.sequence_generators import AbstractEmitter\n\n\n#----------------------------------------------------------------------------\n\n#-----------------------------------------------------------------------------\n\nif __name__ == \"__main__\":\n parser = ArgumentParser()\n parser.add_argument(\"--name\", type=str,\n default=\"handwriting\", help=\"Name for this experiment\")\n parser.add_argument(\"--epochs\", type=int,\n default=500, help=\"Number of training epochs to do\")\n parser.add_argument(\"--bs\", \"--batch-size\", type=int, dest=\"batch_size\",\n default=56, help=\"Size of each mini-batch.\")\n parser.add_argument(\"--lr\", \"--learning-rate\", type=float,\n dest=\"learning_rate\",default=1e-4,\n help=\"Learning rate\")\n parser.add_argument(\"--dim\", type=int,\n default=700, help=\"RNN state dimension\")\n parser.add_argument(\"--mix-dim\", type=int,\n default=20, help=\"Number of gaussian mixtures\")\n parser.add_argument(\"--model\", type=str, dest=\"old_model_name\",\n metavar=\"old-model/continue\",\n help=\"Start from an old model created by a previous\"\n \" run. Or use continue\")\n parser.add_argument(\"--max-length\", type=int, default=600,\n help=\"Maximal number of steps in a single sequence\")\n parser.add_argument(\"--bokeh\", action='store_true', default=False,\n help=\"Set if you want to use Bokeh \")\n parser.add_argument(\"--GRU\", action='store_true', default=False,\n help=\"Use GatedRecurrent network instead of LSTM.\")\n parser.add_argument(\"-d\",\"--dropout\",type=float,default=0,\n help=\"Use dropout. Set to 0 for no dropout.\")\n parser.add_argument(\"--depth\", type=int,\n default=3,\n help=\"Number of recurrent layers to be stacked.\")\n parser.add_argument(\"-G\", \"--max-grad\", type=float,\n default=10.,\n help=\"Maximal gradient limit\")\n parser.add_argument(\"--step-method\", type=str, default=\"adam\",\n choices=[\"adam\", \"scale\", \"rmsprop\", \"adagrad\",\n \"adadelta\"],\n help=\"What gradient step rule to use. Default adam.\")\n parser.add_argument(\"--epsilon\",type=float,default=1e-5,\n help=\"Epsilon value for mixture of gaussians\")\n parser.add_argument(\"--sample\", action='store_true', default=False,\n help=\"Just generate a sample without traning.\")\n parser.add_argument(\"--skip\", action='store_true', default=False,\n help=\"To send the input to all layers and not just the\"\n \" first. Also to use the states of all layers as\"\n \" output and not just the last.\")\n parser.add_argument(\"--top\", action='store_true', default=False,\n help=\"Same as skip but use only the output of top layer.\")\n parser.add_argument(\"-u\",\"--uniform\",type=float,default=0,\n help=\"Use uniform weight initialization. \"\n \"Default use Orhtogonal / Glorot.\")\n\n args = parser.parse_args()\n\n main(**vars(args))\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def _is_nan(log):\n return any(v != v for v in log.current_row.itervalues())", "metadata": "root._is_nan", "header": "['module', '___EOS___']", "index": 69 }, { "content": "def _transpose(data):\n return tuple(np.swapaxes(array,0,1) for array in data)", "metadata": "root._transpose", "header": "['module', '___EOS___']", "index": 72 }, { "content": "def drawpoints(points, xmin=None, ymin=None, xmax=None, ymax=None):\n skips = np.hstack((np.array([0]),points[:,2]))\n xys = np.vstack((np.zeros((1,2)),np.cumsum(points[:,:2],axis=0)))\n xys[:,:2] -= xys[:,:2].mean(axis=0)\n# xys = points[:,:2]\n\n xs=[]\n ys=[]\n x=[]\n y=[]\n for xy,s in zip(xys, skips):\n if s:\n if len(x) > 1:\n xs.append(x)\n ys.append(y)\n x=[]\n y=[]\n else:\n x.append(xy[0])\n y.append(xy[1])\n\n for x,y in zip(xs, ys):\n pl.plot(x, y, 'k-')\n\n if xmin is None:\n xmin,ymin = xys.min(axis=0)\n xmax,ymax = xys.max(axis=0)\n ax = pl.gca()\n ax.set_xlim(xmin, xmax)\n ax.set_ylim(ymin, ymax)\n ax.invert_yaxis()\n ax.set_xticks([])\n ax.set_yticks([])", "metadata": "root.drawpoints", "header": "['module', '___EOS___']", "index": 81 }, { "content": "class Sample(SimpleExtension):\n \"\"\"Generate a sample sketch\n\n Parameters\n ----------\n steps : int Number of steps to samples\n path : prefix to all the files generated\n \"\"\"\n", "metadata": "root.Sample", "header": "['module', '___EOS___']", "index": 115 }, { "content": " def __init__(self, generator, N=8, steps=1200, path='samples', **kwargs):\n self.N = N\n self.path = path\n super(Sample, self).__init__(**kwargs)\n\n batch_size = self.N * self.N\n\n self.sample = ComputationGraph(generator.generate(\n n_steps=steps, batch_size=batch_size, iterate=True)\n ).get_theano_function()", "metadata": "root.Sample.__init__", "header": "['class', 'Sample', '(', 'SimpleExtension', ')', ':', '___EOS___']", "index": 123 }, { "content": " def do(self, callback_name, *args):\n batch_size = self.N * self.N\n\n epochstr = \"\"\n if self.main_loop:\n epochstr = \"-{:03d}\".format(self.main_loop.log.status['epochs_done'])\n\n res = self.sample()\n outputs = res[-2]\n\n mins = []\n maxs = []\n for i in range(batch_size):\n points = outputs[:,i,:]\n xys = np.vstack((np.zeros((1,2)),np.cumsum(points[:,:2],axis=0)))\n xys[:,:2] -= xys[:,:2].mean(axis=0)\n mins.append(xys.min(axis=0))\n maxs.append(xys.max(axis=0))\n xmin, ymin = np.array(mins).min(axis=0)\n xmax, ymax = np.array(maxs).max(axis=0)\n\n # find a new grid of subplot which best match the y/x ratio\n r = (ymax-ymin)/(xmax-xmin)\n reverse = r > 1.\n if reverse: r = 1./r\n bestapprox = 10\n for f in range(1,self.N):\n if self.N % f != 0:\n continue\n rapprox = 1./float(f*f)\n if abs(r-rapprox) < abs(r-bestapprox):\n bestapprox = rapprox\n bestf = f\n\n if reverse:\n h, w = self.N//bestf, self.N*bestf\n r = 1./r\n bestapprox = 1./bestapprox\n else:\n h, w = self.N*bestf, self.N//bestf\n\n if bestapprox > r:\n newydelta = (ymax-ymin)*bestapprox/r\n ymax += newydelta/2.\n ymin -= newydelta/2.\n else:\n newxdelta = (xmax-xmin)*r/bestapprox\n xmax += newxdelta/2.\n xmin -= newxdelta/2.\n\n pl.close('all')\n fig = pl.figure('Sample sketches')\n fig.set_size_inches(25,25)\n for i in range(batch_size):\n pl.subplot(h,w,i+1)\n drawpoints(outputs[:,i,:], xmin, ymin, xmax, ymax)\n fname = os.path.join(self.path,'sketch{}.png'.format(epochstr))\n print('Writting to %s'%fname)\n pl.subplots_adjust(left=0.005,right=0.995,bottom=0.005,top=0.995,\n wspace=0.01,hspace=0.01)\n pl.savefig(fname)\n\n fig = pl.figure('Pen down')\n fig.set_size_inches(17.5,17.5)\n img = 1-outputs[:,:,2]\n pl.imshow(img,cmap=cm.gray)\n pl.gca().set_xticks([])\n pl.gca().set_yticks([])\n pl.xlabel('iteration')\n pl.ylabel('sample')\n pl.title('Pen down for different samples vs. iteration step')\n if not os.path.exists(self.path):\n os.mkdir(self.path)\n fname = os.path.join(self.path,'pen{}.png'.format(epochstr))\n print('Writting to %s'%fname)\n pl.savefig(fname)", "metadata": "root.Sample.do", "header": "['class', 'Sample', '(', 'SimpleExtension', ')', ':', '___EOS___']", "index": 134 }, { "content": "class SketchEmitter(AbstractEmitter, Initializable, Random):\n \"\"\"A mixture of gaussians emitter for x,y and logistic for pen-up/down.\n\n Parameters\n ----------\n mix_dim : int the number of gaussians to mix\n\n \"\"\"\n\n\n\n\n", "metadata": "root.SketchEmitter", "header": "['module', '___EOS___']", "index": 214 }, { "content": " def __init__(self, mix_dim=20, epsilon=1e-5, **kwargs):\n self.mix_dim = mix_dim\n self.epsilon = epsilon\n super(SketchEmitter, self).__init__(**kwargs)", "metadata": "root.SketchEmitter.__init__", "header": "['class', 'SketchEmitter', '(', 'AbstractEmitter', ',', 'Initializable', ',', 'Random', ')', ':', '___EOS___']", "index": 222 }, { "content": " def components(self, readouts):\n \"\"\"\n Take components from readout.\n\n If we have steps flatten steps,bacth_size to steps*batch_size\n\n :param readouts: [batch_size,get_dim('inputs')] or\n [steps,batch_size,get_dim('inputs')]\n :return: mean=[steps*batch_size,mix_dim,2],\n sigma=[steps*batch_size,mix_dim,2],\n corr=[steps*batch_size,mix_dim],\n weight=[steps*batch_size,mix_dim],\n penup=[steps*batch_size,1]\n \"\"\"\n mix_dim = self.mix_dim # get_dim('mix')\n output_norm = 2*mix_dim # x,y\n readouts = readouts.reshape((-1, self.get_dim('inputs')))\n\n mean = readouts[:,0:output_norm].reshape((-1,mix_dim,2)) # 20\n sigma = T.exp(readouts[:,output_norm:2*output_norm]\n .reshape((-1,mix_dim,2))) # 21\n # [batch_size,mix_dim]\n corr = T.tanh(readouts[:,2*output_norm:2*output_norm+mix_dim]) # 22\n # [batch_size,mix_dim]\n weight = T.nnet.softmax(\n readouts[:,2*output_norm+mix_dim:2*output_norm+2*mix_dim]) # 19\n # [batch_size,1]\n penup = T.nnet.sigmoid(readouts[:,2*output_norm+2*mix_dim:]) # 18\n\n return mean, sigma, corr, weight, penup", "metadata": "root.SketchEmitter.components", "header": "['class', 'SketchEmitter', '(', 'AbstractEmitter', ',', 'Initializable', ',', 'Random', ')', ':', '___EOS___']", "index": 227 }, { "content": " @application\n def emit(self, readouts):\n \"\"\"\n Single step\n\n :param readouts: output of hidden layer [batch_size,get_dim('inputs')]\n \"\"\"\n mean, sigma, corr, weight, penup = self.components(readouts)\n mix_dim = self.mix_dim # get_dim('mix')\n batch_size = readouts.shape[0]\n\n nr = self.theano_rng.normal(\n size=(batch_size, mix_dim, 2),\n avg=0., std=1.) #, dtype=floatX)\n\n c = (1 - T.sqrt(1-corr**2))/(corr + self.epsilon)\n c = c.dimshuffle((0, 1, 'x')) # same for x and y\n nr = nr + nr[:,:,::-1]*c # x+c*y and y + c*x\n\n nr = nr / T.sqrt(1+c**2)\n nr = nr * sigma\n nr = nr + mean\n # If I dont do dtype=floatX in the next line I get an error\n weight = self.theano_rng.multinomial(pvals=weight, dtype=floatX)\n # an alternative is the following code:\n # right_boundry = T.cumsum(weight,axis=1) # [...,1]\n # left_boundry = right_boundry - weight # [0,...]\n # un0 = self.theano_rng.uniform(size=(batch_size,)).dimshuffle((0, 'x'))\n # weight = T.cast(left_boundry <= un0, floatX) * \\\n # T.cast(un0 < right_boundry, floatX) # 1 only in one bin\n\n xy = nr * weight[:,:,None] # [batch_size,mix_dim,2]\n\n xy = xy.sum(axis=1) # [batch_size,2]\n\n un = self.theano_rng.uniform(size=(batch_size, 1)) #, dtype=floatX)\n penup = T.cast(un < penup, floatX) # .astype(floatX) # [batch_size,1]\n\n res = T.concatenate([xy, penup], axis=1)\n return res", "metadata": "root.SketchEmitter.emit", "header": "['class', 'SketchEmitter', '(', 'AbstractEmitter', ',', 'Initializable', ',', 'Random', ')', ':', '___EOS___']", "index": 258 }, { "content": " def cost(self, readouts, outputs):\n \"\"\"\n All steps or single step\n\n :param readouts: output of hidden layer [batch_size,input_dim] or\n [steps,batch_size,input_dim]\n :param outputs: sketch cordinates of next time period batch_size,3] or\n [steps, batch_size,3]\n :return: NLL [batch_size] or [steps,batch_size]\n \"\"\"\n nll_ndim = readouts.ndim - 1\n nll_shape = readouts.shape[:-1]\n # if we have steps flatten steps,bacth_size to steps*batch_size\n outputs = outputs.reshape((-1,3))\n mean, sigma, corr, weight, penup = self.components(readouts)\n\n # duplicate the output over all mix_dim\n d = outputs[:,:2].dimshuffle((0, 'x', 1)) - mean # 25\n # [batch_size,mix_dim]\n sigma2 = sigma[:,:,0] * sigma[:,:,1] + self.epsilon # 25\n z = d ** 2 / sigma ** 2\n # [batch_size,mix_dim]\n z = z.sum(axis=-1) - 2 * corr * (d[:,:,0] * d[:,:,1]) / sigma2 # 25\n corr1 = 1 - corr ** 2 + self.epsilon # 24\n n = - z / (2 * corr1) # 24 [batch_size,mix_dim]\n nmax = n.max(axis=-1, keepdims=True)\n n = n - nmax\n n = T.exp(n) / (2*np.pi*sigma2*T.sqrt(corr1)) # 24\n # [batch_size]\n nll = -T.log((n * weight).sum(axis=-1, keepdims=True) + self.epsilon)\n nll -= nmax\n nll += T.nnet.binary_crossentropy(penup, outputs[:,2:]) # 26\n\n return nll.reshape(nll_shape, ndim=nll_ndim)", "metadata": "root.SketchEmitter.cost", "header": "['class', 'SketchEmitter', '(', 'AbstractEmitter', ',', 'Initializable', ',', 'Random', ')', ':', '___EOS___']", "index": 299 }, { "content": " @application\n def initial_outputs(self, batch_size):\n return T.zeros((batch_size,3))", "metadata": "root.SketchEmitter.initial_outputs", "header": "['class', 'SketchEmitter', '(', 'AbstractEmitter', ',', 'Initializable', ',', 'Random', ')', ':', '___EOS___']", "index": 334 }, { "content": " def get_dim(self, name):\n if name == 'inputs':\n return 2*(2*self.mix_dim)+2*self.mix_dim+1\n if name == 'outputs':\n return 3 # x,y,pen\n\n return super(SketchEmitter, self).get_dim(name)", "metadata": "root.SketchEmitter.get_dim", "header": "['class', 'SketchEmitter', '(', 'AbstractEmitter', ',', 'Initializable', ',', 'Random', ')', ':', '___EOS___']", "index": 338 }, { "content": "def main(name, epochs, batch_size, learning_rate,\n dim, mix_dim, old_model_name, max_length, bokeh, GRU, dropout,\n depth, max_grad, step_method, epsilon, sample, skip, uniform, top):\n\n #----------------------------------------------------------------------\n datasource = name\n\n def shnum(x):\n \"\"\" Convert a positive float into a short tag-usable string\n E.g.: 0 -> 0, 0.005 -> 53, 100 -> 1-2\n \"\"\"\n return '0' if x <= 0 else '%s%d' % ((\"%e\"%x)[0], -np.floor(np.log10(x)))\n\n jobname = \"%s-%dX%dm%dd%dr%sb%de%s\" % (datasource, depth, dim, mix_dim,\n int(dropout*10),\n shnum(learning_rate), batch_size,\n shnum(epsilon))\n if max_length != 600:\n jobname += '-L%d'%max_length\n\n if GRU:\n jobname += 'g'\n if max_grad != 5.:\n jobname += 'G%g'%max_grad\n if step_method != 'adam':\n jobname += step_method\n if skip:\n jobname += 'D'\n assert depth > 1\n if top:\n jobname += 'T'\n assert depth > 1\n if uniform > 0.:\n jobname += 'u%d'%int(uniform*100)\n\n if debug:\n jobname += \".debug\"\n\n if sample:\n print(\"Sampling\")\n else:\n print(\"\\nRunning experiment %s\" % jobname)\n if old_model_name:\n print(\"starting from model %s\"%old_model_name)\n\n #----------------------------------------------------------------------\n transitions = [GatedRecurrent(dim=dim) if GRU else LSTM(dim=dim)\n for _ in range(depth)]\n if depth > 1:\n transition = RecurrentStack(transitions, name=\"transition\",\n skip_connections=skip or top)\n if skip:\n source_names=[RecurrentStack.suffix('states', d) for d in range(depth)]\n else:\n source_names=[RecurrentStack.suffix('states', depth-1)]\n else:\n transition = transitions[0]\n transition.name = \"transition\"\n source_names=['states']\n\n emitter = SketchEmitter(mix_dim=mix_dim,\n epsilon=epsilon,\n name=\"emitter\")\n readout = Readout(\n readout_dim=emitter.get_dim('inputs'),\n source_names=source_names,\n emitter=emitter,\n name=\"readout\")\n generator = SequenceGenerator(readout=readout, transition=transition)\n\n # Initialization settings\n if uniform > 0.:\n generator.weights_init = Uniform(width=uniform*2.)\n else:\n generator.weights_init = OrthogonalGlorot()\n generator.biases_init = Constant(0)\n\n # Build the cost computation graph [steps, batch_size, 3]\n x = T.tensor3('features', dtype=floatX)\n if debug:\n x.tag.test_value = np.ones((max_length,batch_size,3)).astype(floatX)\n x = x[:max_length,:,:] # has to be after setting test_value\n cost = generator.cost(x)\n cost.name = \"sequence_log_likelihood\"\n\n # Give an idea of what's going on\n model = Model(cost)\n params = model.get_parameter_dict()\n logger.info(\"Parameters:\\n\" +\n pprint.pformat(\n [(key, value.get_value().shape) for key, value\n in params.items()],\n width=120))\n model_size = 0\n for v in params.itervalues():\n s = v.get_value().shape\n model_size += s[0] * (s[1] if len(s) > 1 else 1)\n logger.info(\"Total number of parameters %d\"%model_size)\n\n #------------------------------------------------------------\n extensions = []\n if old_model_name:\n if old_model_name == 'continue':\n old_model_name = jobname\n with open(old_model_name + '_model', \"rb\") as f:\n old_model = pickle.load(f)\n model.set_parameter_values(old_model.get_parameter_values())\n del old_model\n else:\n # Initialize parameters\n for brick in model.get_top_bricks():\n brick.initialize()\n\n if sample:\n assert old_model_name and old_model_name != 'continue'\n Sample(generator, steps=max_length, path=old_model_name).do(None)\n exit(0)\n\n #------------------------------------------------------------\n # Define the training algorithm.\n cg = ComputationGraph(cost)\n if dropout > 0.:\n from blocks.roles import INPUT, OUTPUT\n dropout_target = VariableFilter(roles=[OUTPUT],\n bricks=transitions,\n name_regex='states')(cg.variables)\n print('# dropout %d' % len(dropout_target))\n cg = apply_dropout(cg, dropout_target, dropout)\n opt_cost = cg.outputs[0]\n else:\n opt_cost = cost\n\n if step_method == 'adam':\n step_rule = Adam(learning_rate)\n elif step_method == 'rmsprop':\n step_rule = RMSProp(learning_rate, decay_rate=0.95)\n elif step_method == 'adagrad':\n step_rule = AdaGrad(learning_rate)\n elif step_method == 'adadelta':\n step_rule = AdaDelta()\n elif step_method == 'scale':\n step_rule = Scale(learning_rate)\n else:\n raise Exception('Unknown sttep method %s'%step_method)\n\n step_rule = CompositeRule([StepClipping(max_grad), step_rule])\n\n algorithm = GradientDescent(\n cost=opt_cost, parameters=cg.parameters,\n step_rule=step_rule)\n\n #------------------------------------------------------------\n observables = [cost]\n\n # Fetch variables useful for debugging\n (energies,) = VariableFilter(\n applications=[generator.readout.readout],\n name_regex=\"output\")(cg.variables)\n min_energy = named_copy(energies.min(), \"min_energy\")\n max_energy = named_copy(energies.max(), \"max_energy\")\n observables += [min_energy, max_energy]\n\n # (activations,) = VariableFilter(\n # applications=[generator.transition.apply],\n # name=generator.transition.apply.states[0])(cg.variables)\n # mean_activation = named_copy(abs(activations).mean(),\n # \"mean_activation\")\n # observables.append(mean_activation)\n\n observables += [algorithm.total_step_norm, algorithm.total_gradient_norm]\n for name, param in params.items():\n observables.append(named_copy(\n param.norm(2), name + \"_norm\"))\n observables.append(named_copy(\n algorithm.gradients[param].norm(2), name + \"_grad_norm\"))\n\n #------------------------------------------------------------\n datasource_fname = os.path.join(fuel.config.data_path, datasource,\n datasource+'.hdf5')\n\n train_ds = H5PYDataset(datasource_fname, #max_length=max_length,\n which_sets=['train'], sources=('features',),\n load_in_memory=True)\n train_stream = DataStream(train_ds,\n iteration_scheme=ShuffledScheme(\n train_ds.num_examples, batch_size))\n\n test_ds = H5PYDataset(datasource_fname, #max_length=max_length,\n which_sets=['test'], sources=('features',),\n load_in_memory=True)\n test_stream = DataStream(test_ds,\n iteration_scheme=SequentialScheme(\n test_ds.num_examples, batch_size))\n\n train_stream = Mapping(train_stream, _transpose)\n test_stream = Mapping(test_stream, _transpose)\n\n def stream_stats(ds, label):\n itr = ds.get_epoch_iterator(as_dict=True)\n batch_count = 0\n examples_count = 0\n for batch in itr:\n batch_count += 1\n examples_count += batch['features'].shape[1]\n print('%s #batch %d #examples %d' %\n (label, batch_count, examples_count))\n\n stream_stats(train_stream, 'train')\n stream_stats(test_stream, 'test')\n\n extensions += [Timing(every_n_batches=10),\n TrainingDataMonitoring(\n observables, prefix=\"train\",\n every_n_batches=10),\n DataStreamMonitoring(\n [cost], # without dropout\n test_stream,\n prefix=\"test\",\n on_resumption=True,\n after_epoch=False, # by default this is True\n every_n_batches=100),\n # all monitored data is ready so print it...\n # (next steps may take more time and we want to see the\n # results as soon as possible so print as soon as you can)\n Printing(every_n_batches=10),\n # perform multiple dumps at different intervals\n # so if one of them breaks (has nan) we can hopefully\n # find a model from few batches ago in the other\n Checkpoint(jobname,\n before_training=False, after_epoch=True,\n save_separately=['log', 'model']),\n Sample(generator, steps=max_length,\n path=jobname+'.test',\n every_n_batches=100),\n ProgressBar(),\n FinishAfter(after_n_epochs=epochs)\n # This shows a way to handle NaN emerging during\n # training: simply finish it.\n .add_condition([\"after_batch\"], _is_nan),\n ]\n\n if bokeh:\n from blocks.extras.extensions.plot import Plot\n extensions.append(Plot(\n 'sketch',\n channels=[['cost']], every_n_batches=10))\n\n # Construct the main loop and start training!\n main_loop = MainLoop(\n model=model,\n data_stream=train_stream,\n algorithm=algorithm,\n extensions=extensions\n )\n\n main_loop.run()", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 348 } ]
[ { "span": "from blocks.extensions.saveload import Checkpoint, Load", "start_line": 53, "start_column": 0, "end_line": 53, "end_column": 55 }, { "span": "import math", "start_line": 68, "start_column": 0, "end_line": 68, "end_column": 11 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "division_", ",_", "print", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "FORMAT_", "=_", "'[", "%", "(", "asc", "time", ")", "s", "]", " ", "%", "(", "name", ")-", "15", "s", " ", "%", "(", "message", ")", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DAT", "EF", "MT", "_", "=_", "\"%", "H", ":", "%", "M", ":", "%", "S", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "basic", "Config_", "(_", "format_", "=_", "FORMAT_", ",_", "datefmt_", "=_", "DAT", "EF", "MT", "_", ",_", "level_", "=_", "logging_", "._", "INFO_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "theano_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Automat", "ical", "ly", " ", "detect", " ", "we", " ", "are", " ", "debugg", "ing", " ", "and", " ", "turn", " ", "on", " ", "maximal", " ", "The", "ano", " ", "debugg", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "debug_", "=_", "sys_", "._", "gett", "race_", "(_", ")_", "is_", "not_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "debug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Deb", "ugg", "ing", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "theano_", "._", "config_", "._", "optimizer_", "=_", "'", "fast", "\\u", "compile", "'_", "#", " ", "or", " ", "\"", "Non", "e", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "theano_", "._", "config_", "._", "exception", "\\u", "verbosity_", "=_", "'", "high", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "theano_", "._", "config_", "._", "compute", "\\u", "test\\u", "value_", "=_", "'", "warn", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "theano_", "._", "config_", "._", "compute", "\\u", "test\\u", "value_", "=_", "'", "off", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "theano_", "._", "tensor_", "as_", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "fuel", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "argparse_", "import_", "Arg", "ument", "Parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "fuel", "_", "._", "streams_", "import_", "Data", "Stream_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "fuel", "_", "._", "schemes", "_", "import_", "Sequ", "ential", "Scheme_", ",_", "Shuffle", "d", "Scheme_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "blocks_", "._", "algorithms_", "import_", "Grad", "ient", "Descen", "t_", ",_", "Composit", "e", "Rule_", ",_", "Step", "Clip", "ping_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "blocks_", "._", "algorithms_", "import_", "Adam", "_", ",_", "RMS", "Prop_", ",_", "Ada", "Grad", "_", ",_", "Scale_", ",_", "Ada", "Delta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "blocks_", "._", "initialization", "_", "import_", "Constant_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "blocks_", "._", "graph_", "import_", "Computation", "Graph_", ",_", "appl", "y", "\\u", "dropout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "blocks_", "._", "extensions_", "import_", "Finish", "After_", ",_", "Tim", "ing_", ",_", "Printing", "_", ",_", "Progres", "s", "Bar_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "blocks_", "._", "extensions_", "._", "save", "load_", "import_", "Simple", "Extension_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "blocks_", "._", "bricks", "_", "import_", "Random_", ",_", "Initializ", "able_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "blocks_", "._", "bricks", "_", "._", "base_", "import_", "application_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "blocks_", "._", "extensions_", "._", "monitorin", "g_", "import_", "Data", "Stream", "Monitor", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "blocks_", "._", "extensions_", "._", "monitorin", "g_", "import_", "Train", "ing", "Data", "Monitor", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "blocks_", "._", "main", "\\u", "loop_", "import_", "Main", "Loop_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "blocks_", "._", "model_", "import_", "Model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "blocks_", "._", "bricks", "_", "._", "recurrent", "_", "import_", "LSTM", "_", ",_", "Gat", "ed", "Recurren", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "blocks_", "._", "bricks", "_", "._", "recurrent", "_", "import_", "Recurren", "t", "Stack_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "blocks_", "._", "bricks", "_", "._", "sequence", "\\u", "generators_", "import_", "Sequ", "ence", "Generator_", ",_", "Read", "out_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "fuel", "_", "._", "datasets_", "import_", "H", "5", "PY", "Dataset_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "blocks_", "._", "filter_", "import_", "Varia", "ble", "Filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "blocks_", "._", "extensions_", "._", "save", "load_", "import_", "Checkpoint", "_", ",_", "Load_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "c", "Pickle_", "as_", "pickle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "blocks", "\\u", "extras_", "import_", "Ortho", "gon", "al", "Glo", "rot_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "blocks_", "._", "initialization", "_", "import_", "Uniform", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "float", "X_", "=_", "theano_", "._", "config_", "._", "float", "X_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fuel", "_", "._", "config_", "._", "float", "X_", "=_", "float", "X_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "fuel", "_", "._", "transformers", "_", "import_", "Mapping_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "blocks_", "._", "utils_", "import_", "named", "\\u", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pprint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "------", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "must", " ", "be", " ", "a", " ", "global", " ", "function", " ", "so", " ", "we", " ", "can", " ", "pickle", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "math_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "-----", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "matplotlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matplotlib_", "._", "use_", "(_", "'", "Agg", "'_", ")_", "#", " ", "allow", " ", "plott", "ing", " ", "with", "out", " ", "a", " ", "graphic", " ", "display_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "matplotlib_", "import_", "pylab_", "as_", "pl_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pylab_", "import_", "cm_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "-----", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "blocks_", "._", "bricks", "_", "._", "sequence", "\\u", "generators_", "import_", "Abstract", "Emitte", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "-----", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "=_", "Arg", "ument", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"--", "name", "\"_", ",_", "type_", "=_", "str_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "\"", "hand", "writ", "ing", "\"_", ",_", "help_", "=_", "\"", "Name", " ", "for", " ", "this", " ", "experiment", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"--", "epoch", "s", "\"_", ",_", "type_", "=_", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "500_", ",_", "help_", "=_", "\"", "Number", " ", "of", " ", "train", "ing", " ", "epoch", "s", " ", "to", " ", "do", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"--", "bs", "\"_", ",_", "\"--", "batch", "-", "size", "\"_", ",_", "type_", "=_", "int_", ",_", "dest_", "=_", "\"", "batch", "\\u", "size", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "56_", ",_", "help_", "=_", "\"", "Size", " ", "of", " ", "each", " ", "mini", "-", "batch", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"--", "lr", "\"_", ",_", "\"--", "learn", "ing", "-", "rate", "\"_", ",_", "type_", "=_", "float_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dest_", "=_", "\"", "learn", "ing", "\\u", "rate", "\"_", ",_", "default_", "=_", "1e-4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Learn", "ing", " ", "rate", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"--", "dim", "\"_", ",_", "type_", "=_", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "700_", ",_", "help_", "=_", "\"", "RN", "N", " ", "state", " ", "dimension", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"--", "mix", "-", "dim", "\"_", ",_", "type_", "=_", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "20_", ",_", "help_", "=_", "\"", "Number", " ", "of", " ", "gauss", "ian", " ", "mixture", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"--", "model", "\"_", ",_", "type_", "=_", "str_", ",_", "dest_", "=_", "\"", "old", "\\u", "model", "\\u", "name", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "metavar_", "=_", "\"", "old", "-", "model", "/", "continue", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Start", " ", "from", " ", "an", " ", "old", " ", "model", " ", "created", " ", "by", " ", "a", " ", "previ", "ous", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "run", ".", " ", "Or", " ", "use", " ", "continue", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"--", "max", "-", "length", "\"_", ",_", "type_", "=_", "int_", ",_", "default_", "=_", "600_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Maxim", "al", " ", "number", " ", "of", " ", "step", "s", " ", "in", " ", "a", " ", "single", " ", "sequence", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"--", "bokeh", "\"_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "default_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Set", " ", "if", " ", "you", " ", "want", " ", "to", " ", "use", " ", "Bo", "ke", "h", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"--", "GRU", "\"_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "default_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Us", "e", " ", "Gat", "ed", "Recurren", "t", " ", "network", " ", "inst", "ead", " ", "of", " ", "LSTM", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"-", "d", "\"_", ",_", "\"--", "drop", "out", "\"_", ",_", "type_", "=_", "float_", ",_", "default_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Us", "e", " ", "drop", "out", ".", " ", "Set", " ", "to", " ", "0", " ", "for", " ", "no", " ", "drop", "out", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"--", "depth", "\"_", ",_", "type_", "=_", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Number", " ", "of", " ", "recurrent", " ", "layer", "s", " ", "to", " ", "be", " ", "stacked", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"-", "G", "\"_", ",_", "\"--", "max", "-", "grad", "\"_", ",_", "type_", "=_", "float_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "10._", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Maxim", "al", " ", "gradi", "ent", " ", "limit", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"--", "step", "-", "method", "\"_", ",_", "type_", "=_", "str_", ",_", "default_", "=_", "\"", "adam", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "choices_", "=_", "[_", "\"", "adam", "\"_", ",_", "\"", "scale", "\"_", ",_", "\"", "rms", "prop", "\"_", ",_", "\"", "ada", "grad", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ada", "delta", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "What", " ", "gradi", "ent", " ", "step", " ", "rule", " ", "to", " ", "use", ".", " ", "Default", " ", "adam", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"--", "eps", "ilon", "\"_", ",_", "type_", "=_", "float_", ",_", "default_", "=_", "1e-5_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Eps", "ilon", " ", "value", " ", "for", " ", "mixture", " ", "of", " ", "gauss", "ian", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"--", "sample", "\"_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "default_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Ju", "st", " ", "generat", "e", " ", "a", " ", "sample", " ", "with", "out", " ", "tran", "ing", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"--", "skip", "\"_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "default_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "To", " ", "send", " ", "the", " ", "input", " ", "to", " ", "all", " ", "layer", "s", " ", "and", " ", "not", " ", "just", " ", "the", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "first", ".", " ", "Al", "so", " ", "to", " ", "use", " ", "the", " ", "state", "s", " ", "of", " ", "all", " ", "layer", "s", " ", "as", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "output", " ", "and", " ", "not", " ", "just", " ", "the", " ", "last", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"--", "top", "\"_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "default_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Sam", "e", " ", "as", " ", "skip", " ", "but", " ", "use", " ", "only", " ", "the", " ", "output", " ", "of", " ", "top", " ", "layer", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"-", "u", "\"_", ",_", "\"--", "uniform", "\"_", ",_", "type_", "=_", "float_", ",_", "default_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Us", "e", " ", "uniform", " ", "weight", " ", "initialization", ".", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Default", " ", "use", " ", "Or", "ht", "ogo", "nal", " ", "/", " ", "Glo", "rot", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "parser_", "._", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "main_", "(_", "**_", "vars_", "(_", "args_", ")_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "is", "\\u", "nan_", "(_", "log_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "any_", "(_", "v_", "!=_", "v_", "for_", "v_", "in_", "log_", "._", "current", "\\u", "row_", "._", "itervalues_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "transpose_", "(_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "tuple_", "(_", "np_", "._", "swap", "axes_", "(_", "array_", ",_", "0_", ",_", "1_", ")_", "for_", "array_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "draw", "points_", "(_", "points_", ",_", "xmin_", "=_", "None_", ",_", "ymin_", "=_", "None_", ",_", "xmax_", "=_", "None_", ",_", "ymax_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "skips", "_", "=_", "np_", "._", "hstack_", "(_", "(_", "np_", "._", "array_", "(_", "[_", "0_", "]_", ")_", ",_", "points_", "[_", ":_", ",_", "2_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xy", "s_", "=_", "np_", "._", "vstack_", "(_", "(_", "np_", "._", "zeros_", "(_", "(_", "1_", ",_", "2_", ")_", ")_", ",_", "np_", "._", "cumsum_", "(_", "points_", "[_", ":_", ",_", ":_", "2_", "]_", ",_", "axis_", "=_", "0_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xy", "s_", "[_", ":_", ",_", ":_", "2_", "]_", "-=_", "xy", "s_", "[_", ":_", ",_", ":_", "2_", "]_", "._", "mean_", "(_", "axis_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "xy", "s", " ", "=", " ", "points", "[:,", ":", "2", "]_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "xs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ys_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "xy_", ",_", "s_", "in_", "zip_", "(_", "xy", "s_", ",_", "skips", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "x_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "xs_", "._", "append_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ys_", "._", "append_", "(_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "x_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "._", "append_", "(_", "xy_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "._", "append_", "(_", "xy_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "x_", ",_", "y_", "in_", "zip_", "(_", "xs_", ",_", "ys_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pl_", "._", "plot_", "(_", "x_", ",_", "y_", ",_", "'", "k", "-'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "xmin_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "xmin_", ",_", "ymin_", "=_", "xy", "s_", "._", "min_", "(_", "axis_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xmax_", ",_", "ymax_", "=_", "xy", "s_", "._", "max_", "(_", "axis_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ax_", "=_", "pl_", "._", "gca_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "._", "set\\u", "xlim_", "(_", "xmin_", ",_", "xmax_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "._", "set\\u", "ylim_", "(_", "ymin_", ",_", "ymax_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "._", "invert", "\\u", "yaxis_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "._", "set\\u", "xticks_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "._", "set\\u", "yticks_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Sample_", "(_", "Simple", "Extension_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Generate", " ", "a", " ", "sample", " ", "sketch", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", " ", " ", " ", " ", "step", "s", " ", ":", " ", "int", " ", "Number", " ", "of", " ", "step", "s", " ", "to", " ", "samples", "\\", "10", ";", " ", " ", " ", " ", "path", " ", ":", " ", "prefix", " ", "to", " ", "all", " ", "the", " ", "files", " ", "generat", "ed", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Sample_", "(_", "Simple", "Extension_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "generator_", ",_", "N_", "=_", "8_", ",_", "steps_", "=_", "1200_", ",_", "path_", "=_", "'", "samples", "'_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "N_", "=_", "N_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "path_", "=_", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Sample_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "batch", "\\u", "size_", "=_", "self_", "._", "N_", "*_", "self_", "._", "N_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "sample_", "=_", "Computation", "Graph_", "(_", "generator_", "._", "generate_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "steps_", "=_", "steps_", ",_", "batch", "\\u", "size_", "=_", "batch", "\\u", "size_", ",_", "iterate_", "=_", "True_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "._", "get", "\\u", "theano", "\\u", "function_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sample_", "(_", "Simple", "Extension_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "do_", "(_", "self_", ",_", "callback", "\\u", "name_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "batch", "\\u", "size_", "=_", "self_", "._", "N_", "*_", "self_", "._", "N_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "epoch", "str_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "main", "\\u", "loop_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "epoch", "str_", "=_", "\"-", "{:", "03", "d", "}\"_", "._", "format_", "(_", "self_", "._", "main", "\\u", "loop_", "._", "log_", "._", "status_", "[_", "'", "epoch", "s", "\\u", "don", "e", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "res_", "=_", "self_", "._", "sample_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "outputs_", "=_", "res_", "[_", "-_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mins_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "maxs", "_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "batch", "\\u", "size_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "points_", "=_", "outputs_", "[_", ":_", ",_", "i_", ",_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xy", "s_", "=_", "np_", "._", "vstack_", "(_", "(_", "np_", "._", "zeros_", "(_", "(_", "1_", ",_", "2_", ")_", ")_", ",_", "np_", "._", "cumsum_", "(_", "points_", "[_", ":_", ",_", ":_", "2_", "]_", ",_", "axis_", "=_", "0_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xy", "s_", "[_", ":_", ",_", ":_", "2_", "]_", "-=_", "xy", "s_", "[_", ":_", ",_", ":_", "2_", "]_", "._", "mean_", "(_", "axis_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mins_", "._", "append_", "(_", "xy", "s_", "._", "min_", "(_", "axis_", "=_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "maxs", "_", "._", "append_", "(_", "xy", "s_", "._", "max_", "(_", "axis_", "=_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "xmin_", ",_", "ymin_", "=_", "np_", "._", "array_", "(_", "mins_", ")_", "._", "min_", "(_", "axis_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xmax_", ",_", "ymax_", "=_", "np_", "._", "array_", "(_", "maxs", "_", ")_", "._", "max_", "(_", "axis_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "find", " ", "a", " ", "new", " ", "grid", " ", "of", " ", "subplot", " ", "whi", "ch", " ", "best", " ", "match", " ", "the", " ", "y", "/", "x", " ", "ratio_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "=_", "(_", "ymax_", "-_", "ymin_", ")_", "/_", "(_", "xmax_", "-_", "xmin_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reverse_", "=_", "r_", ">_", "1._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "reverse_", ":_", "r_", "=_", "1._", "/_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "approx_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "f_", "in_", "range_", "(_", "1_", ",_", "self_", "._", "N_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "N_", "%_", "f_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rapp", "ro", "x_", "=_", "1._", "/_", "float_", "(_", "f_", "*_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "abs_", "(_", "r_", "-_", "rapp", "ro", "x_", ")_", "<_", "abs_", "(_", "r_", "-_", "best", "approx_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "best", "approx_", "=_", "rapp", "ro", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "f_", "=_", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "reverse_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h_", ",_", "w_", "=_", "self_", "._", "N_", "//_", "best", "f_", ",_", "self_", "._", "N_", "*_", "best", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "1._", "/_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "approx_", "=_", "1._", "/_", "best", "approx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h_", ",_", "w_", "=_", "self_", "._", "N_", "*_", "best", "f_", ",_", "self_", "._", "N_", "//_", "best", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "best", "approx_", ">_", "r_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "yde", "lta", "_", "=_", "(_", "ymax_", "-_", "ymin_", ")_", "*_", "best", "approx_", "/_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ymax_", "+=_", "new", "yde", "lta", "_", "/_", "2._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ymin_", "-=_", "new", "yde", "lta", "_", "/_", "2._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "xde", "lta", "_", "=_", "(_", "xmax_", "-_", "xmin_", ")_", "*_", "r_", "/_", "best", "approx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xmax_", "+=_", "new", "xde", "lta", "_", "/_", "2._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xmin_", "-=_", "new", "xde", "lta", "_", "/_", "2._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pl_", "._", "close_", "(_", "'", "all", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fig_", "=_", "pl_", "._", "figure_", "(_", "'", "Sampl", "e", " ", "sketch", "es", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fig_", "._", "set\\u", "size", "\\u", "inches_", "(_", "25_", ",_", "25_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "batch", "\\u", "size_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pl_", "._", "subplot_", "(_", "h_", ",_", "w_", ",_", "i_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "draw", "points_", "(_", "outputs_", "[_", ":_", ",_", "i_", ",_", ":_", "]_", ",_", "xmin_", ",_", "ymin_", ",_", "xmax_", ",_", "ymax_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fname_", "=_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "path_", ",_", "'", "sketch", "{}.", "png", "'_", "._", "format_", "(_", "epoch", "str_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "Writ", "ting", " ", "to", " ", "%", "s", "'_", "%_", "fname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pl_", "._", "subplot", "s", "\\u", "adjust_", "(_", "left_", "=_", "0.005_", ",_", "right_", "=_", "0.99", "5_", ",_", "bottom_", "=_", "0.005_", ",_", "top_", "=_", "0.99", "5_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "wsp", "ace_", "=_", "0.01_", ",_", "hspace", "_", "=_", "0.01_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pl_", "._", "savefig_", "(_", "fname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fig_", "=_", "pl_", "._", "figure_", "(_", "'", "Pen", " ", "down", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fig_", "._", "set\\u", "size", "\\u", "inches_", "(_", "17.", "5_", ",_", "17.", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img_", "=_", "1_", "-_", "outputs_", "[_", ":_", ",_", ":_", ",_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pl_", "._", "imshow_", "(_", "img_", ",_", "cmap_", "=_", "cm_", "._", "gray_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pl_", "._", "gca_", "(_", ")_", "._", "set\\u", "xticks_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pl_", "._", "gca_", "(_", ")_", "._", "set\\u", "yticks_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pl_", "._", "xlabel_", "(_", "'", "iterati", "on", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pl_", "._", "ylabel_", "(_", "'", "sample", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pl_", "._", "title_", "(_", "'", "Pen", " ", "down", " ", "for", " ", "different", " ", "samples", " ", "vs", ".", " ", "iterati", "on", " ", "step", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "self_", "._", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "mkdir_", "(_", "self_", "._", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fname_", "=_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "path_", ",_", "'", "pen", "{}.", "png", "'_", "._", "format_", "(_", "epoch", "str_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "Writ", "ting", " ", "to", " ", "%", "s", "'_", "%_", "fname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pl_", "._", "savefig_", "(_", "fname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Sketch", "Emitte", "r_", "(_", "Abstract", "Emitte", "r_", ",_", "Initializ", "able_", ",_", "Random_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "mixture", " ", "of", " ", "gauss", "ian", "s", " ", "emitte", "r", " ", "for", " ", "x", ",", "y", " ", "and", " ", "logistic", " ", "for", " ", "pen", "-", "up", "/", "down", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", " ", " ", " ", " ", "mix", "\\u", "dim", " ", ":", " ", "int", " ", "the", " ", "number", " ", "of", " ", "gauss", "ian", "s", " ", "to", " ", "mix", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Sketch", "Emitte", "r_", "(_", "Abstract", "Emitte", "r_", ",_", "Initializ", "able_", ",_", "Random_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "mix", "\\u", "dim_", "=_", "20_", ",_", "epsilon_", "=_", "1e-5_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "mix", "\\u", "dim_", "=_", "mix", "\\u", "dim_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "epsilon_", "=_", "epsilon_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Sketch", "Emitte", "r_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sketch", "Emitte", "r_", "(_", "Abstract", "Emitte", "r_", ",_", "Initializ", "able_", ",_", "Random_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "components_", "(_", "self_", ",_", "readout", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Tak", "e", " ", "component", "s", " ", "from", " ", "readout", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "we", " ", "have", " ", "step", "s", " ", "flat", "ten", " ", "step", "s", ",", "bac", "th", "\\u", "size", " ", "to", " ", "step", "s", "*", "batch", "\\u", "size", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "readout", "s", ":", " ", "[", "batch", "\\u", "size", ",", "get", "\\u", "dim", "('", "inputs", "')]", " ", "or", "\\", "10", ";", " ", " ", " ", " ", " ", "[", "step", "s", ",", "batch", "\\u", "size", ",", "get", "\\u", "dim", "('", "inputs", "')]", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "mean", "=[", "step", "s", "*", "batch", "\\u", "size", ",", "mix", "\\u", "dim", ",", "2", "],", "\\", "10", ";", " ", " ", " ", " ", " ", "sigma", "=[", "step", "s", "*", "batch", "\\u", "size", ",", "mix", "\\u", "dim", ",", "2", "],", "\\", "10", ";", " ", " ", " ", " ", " ", "corr", "=[", "step", "s", "*", "batch", "\\u", "size", ",", "mix", "\\u", "dim", "],", "\\", "10", ";", " ", " ", " ", " ", " ", "weight", "=[", "step", "s", "*", "batch", "\\u", "size", ",", "mix", "\\u", "dim", "],", "\\", "10", ";", " ", " ", " ", " ", " ", "pen", "up", "=[", "step", "s", "*", "batch", "\\u", "size", ",", "1", "]", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mix", "\\u", "dim_", "=_", "self_", "._", "mix", "\\u", "dim_", "#", " ", "get", "\\u", "dim", "('", "mix", "')", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "\\u", "norm_", "=_", "2_", "*_", "mix", "\\u", "dim_", "#", " ", "x", ",", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "readout", "s_", "=_", "readout", "s_", "._", "reshape_", "(_", "(_", "-_", "1_", ",_", "self_", "._", "get", "\\u", "dim_", "(_", "'", "inputs", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mean_", "=_", "readout", "s_", "[_", ":_", ",_", "0_", ":_", "output", "\\u", "norm_", "]_", "._", "reshape_", "(_", "(_", "-_", "1_", ",_", "mix", "\\u", "dim_", ",_", "2_", ")_", ")_", "#", " ", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sigma_", "=_", "T_", "._", "exp_", "(_", "readout", "s_", "[_", ":_", ",_", "output", "\\u", "norm_", ":_", "2_", "*_", "output", "\\u", "norm_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "._", "reshape_", "(_", "(_", "-_", "1_", ",_", "mix", "\\u", "dim_", ",_", "2_", ")_", ")_", ")_", "#", " ", "21_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "[", "batch", "\\u", "size", ",", "mix", "\\u", "dim", "]_", "\\u\\u\\uNL\\u\\u\\u_", "corr_", "=_", "T_", "._", "tanh_", "(_", "readout", "s_", "[_", ":_", ",_", "2_", "*_", "output", "\\u", "norm_", ":_", "2_", "*_", "output", "\\u", "norm_", "+_", "mix", "\\u", "dim_", "]_", ")_", "#", " ", "22_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "[", "batch", "\\u", "size", ",", "mix", "\\u", "dim", "]_", "\\u\\u\\uNL\\u\\u\\u_", "weight_", "=_", "T_", "._", "nnet", "_", "._", "softmax_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "readout", "s_", "[_", ":_", ",_", "2_", "*_", "output", "\\u", "norm_", "+_", "mix", "\\u", "dim_", ":_", "2_", "*_", "output", "\\u", "norm_", "+_", "2_", "*_", "mix", "\\u", "dim_", "]_", ")_", "#", " ", "19_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "[", "batch", "\\u", "size", ",", "1", "]_", "\\u\\u\\uNL\\u\\u\\u_", "pen", "up_", "=_", "T_", "._", "nnet", "_", "._", "sigmoid_", "(_", "readout", "s_", "[_", ":_", ",_", "2_", "*_", "output", "\\u", "norm_", "+_", "2_", "*_", "mix", "\\u", "dim_", ":_", "]_", ")_", "#", " ", "18_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "mean_", ",_", "sigma_", ",_", "corr_", ",_", "weight_", ",_", "pen", "up_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sketch", "Emitte", "r_", "(_", "Abstract", "Emitte", "r_", ",_", "Initializ", "able_", ",_", "Random_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "application_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "emit_", "(_", "self_", ",_", "readout", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Sing", "le", " ", "step", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "readout", "s", ":", " ", "output", " ", "of", " ", "hidden", " ", "layer", " ", "[", "batch", "\\u", "size", ",", "get", "\\u", "dim", "('", "inputs", "')]", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mean_", ",_", "sigma_", ",_", "corr_", ",_", "weight_", ",_", "pen", "up_", "=_", "self_", "._", "components_", "(_", "readout", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mix", "\\u", "dim_", "=_", "self_", "._", "mix", "\\u", "dim_", "#", " ", "get", "\\u", "dim", "('", "mix", "')", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "batch", "\\u", "size_", "=_", "readout", "s_", "._", "shape_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "nr_", "=_", "self_", "._", "theano", "\\u", "rng_", "._", "normal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "size_", "=_", "(_", "batch", "\\u", "size_", ",_", "mix", "\\u", "dim_", ",_", "2_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "avg_", "=_", "0._", ",_", "std_", "=_", "1._", ")_", "#", ",", " ", "dt", "ype", "=", "float", "X", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "=_", "(_", "1_", "-_", "T_", "._", "sqrt_", "(_", "1_", "-_", "corr_", "**_", "2_", ")_", ")_", "/_", "(_", "corr_", "+_", "self_", "._", "epsilon_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "c_", "._", "dims", "huff", "le_", "(_", "(_", "0_", ",_", "1_", ",_", "'", "x", "'_", ")_", ")_", "#", " ", "same", " ", "for", " ", "x", " ", "and", " ", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nr_", "=_", "nr_", "+_", "nr_", "[_", ":_", ",_", ":_", ",_", ":_", ":_", "-_", "1_", "]_", "*_", "c_", "#", " ", "x", "+", "c", "*", "y", " ", "and", " ", "y", " ", "+", " ", "c", "*", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "nr_", "=_", "nr_", "/_", "T_", "._", "sqrt_", "(_", "1_", "+_", "c_", "**_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nr_", "=_", "nr_", "*_", "sigma_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nr_", "=_", "nr_", "+_", "mean_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "I", " ", "don", "t", " ", "do", " ", "dt", "ype", "=", "float", "X", " ", "in", " ", "the", " ", "next", " ", "line", " ", "I", " ", "get", " ", "an", " ", "error_", "\\u\\u\\uNL\\u\\u\\u_", "weight_", "=_", "self_", "._", "theano", "\\u", "rng_", "._", "multin", "omial", "_", "(_", "pval", "s_", "=_", "weight_", ",_", "dtype_", "=_", "float", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "an", " ", "alternative", " ", "is", " ", "the", " ", "follow", "ing", " ", "code", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "right", "\\u", "bound", "ry", " ", "=", " ", "T", ".", "cum", "sum", "(", "weight", ",", "axis", "=", "1", ")", " ", " ", "#", " ", "[...", ",", "1", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "left", "\\u", "bound", "ry", " ", "=", " ", "right", "\\u", "bound", "ry", " ", "-", " ", "weight", " ", " ", "#", " ", "[", "0", ",...", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "un", "0", " ", "=", " ", "self", ".", "theano", "\\u", "rng", ".", "uniform", "(", "size", "=(", "batch", "\\u", "size", ",)", ").", "dims", "huff", "le", "((", "0", ",", " ", "'", "x", "'))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "weight", " ", "=", " ", "T", ".", "cast", "(", "left", "\\u", "bound", "ry", " ", "<=", " ", "un", "0", ",", " ", "float", "X", ")", " ", "*", " ", "\\\\_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "T", ".", "cast", "(", "un", "0", " ", "<", " ", "right", "\\u", "bound", "ry", ",", " ", "float", "X", ")", " ", " ", "#", " ", "1", " ", "only", " ", "in", " ", "one", " ", "bin_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "xy_", "=_", "nr_", "*_", "weight_", "[_", ":_", ",_", ":_", ",_", "None_", "]_", "#", " ", "[", "batch", "\\u", "size", ",", "mix", "\\u", "dim", ",", "2", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "xy_", "=_", "xy_", "._", "sum_", "(_", "axis_", "=_", "1_", ")_", "#", " ", "[", "batch", "\\u", "size", ",", "2", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "un_", "=_", "self_", "._", "theano", "\\u", "rng_", "._", "uniform_", "(_", "size_", "=_", "(_", "batch", "\\u", "size_", ",_", "1_", ")_", ")_", "#", ",", " ", "dt", "ype", "=", "float", "X", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pen", "up_", "=_", "T_", "._", "cast_", "(_", "un_", "<_", "pen", "up_", ",_", "float", "X_", ")_", "#", " ", ".", "ast", "ype", "(", "float", "X", ")", " ", " ", "#", " ", "[", "batch", "\\u", "size", ",", "1", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "res_", "=_", "T_", "._", "concatenate_", "(_", "[_", "xy_", ",_", "pen", "up_", "]_", ",_", "axis_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sketch", "Emitte", "r_", "(_", "Abstract", "Emitte", "r_", ",_", "Initializ", "able_", ",_", "Random_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "cost_", "(_", "self_", ",_", "readout", "s_", ",_", "outputs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "All", " ", "step", "s", " ", "or", " ", "single", " ", "step", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "readout", "s", ":", " ", "output", " ", "of", " ", "hidden", " ", "layer", " ", "[", "batch", "\\u", "size", ",", "input", "\\u", "dim", "]", " ", "or", "\\", "10", ";", " ", " ", " ", " ", " ", "[", "step", "s", ",", "batch", "\\u", "size", ",", "input", "\\u", "dim", "]", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "output", "s", ":", " ", "sketch", " ", "cord", "inat", "es", " ", "of", " ", "next", " ", "time", " ", "period", " ", "batch", "\\u", "size", ",", "3", "]", " ", "or", "\\", "10", ";", " ", " ", " ", " ", " ", "[", "step", "s", ",", " ", "batch", "\\u", "size", ",", "3", "]", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "NL", "L", " ", "[", "batch", "\\u", "size", "]", " ", "or", " ", "[", "step", "s", ",", "batch", "\\u", "size", "]", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nl", "l\\u", "ndim_", "=_", "readout", "s_", "._", "ndim_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nl", "l\\u", "shape_", "=_", "readout", "s_", "._", "shape_", "[_", ":_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "we", " ", "have", " ", "step", "s", " ", "flat", "ten", " ", "step", "s", ",", "bac", "th", "\\u", "size", " ", "to", " ", "step", "s", "*", "batch", "\\u", "size_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "outputs_", "._", "reshape_", "(_", "(_", "-_", "1_", ",_", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mean_", ",_", "sigma_", ",_", "corr_", ",_", "weight_", ",_", "pen", "up_", "=_", "self_", "._", "components_", "(_", "readout", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "duplicat", "e", " ", "the", " ", "output", " ", "over", " ", "all", " ", "mix", "\\u", "dim_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "=_", "outputs_", "[_", ":_", ",_", ":_", "2_", "]_", "._", "dims", "huff", "le_", "(_", "(_", "0_", ",_", "'", "x", "'_", ",_", "1_", ")_", ")_", "-_", "mean_", "#", " ", "25_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "[", "batch", "\\u", "size", ",", "mix", "\\u", "dim", "]_", "\\u\\u\\uNL\\u\\u\\u_", "sigma", "2_", "=_", "sigma_", "[_", ":_", ",_", ":_", ",_", "0_", "]_", "*_", "sigma_", "[_", ":_", ",_", ":_", ",_", "1_", "]_", "+_", "self_", "._", "epsilon_", "#", " ", "25_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z_", "=_", "d_", "**_", "2_", "/_", "sigma_", "**_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "[", "batch", "\\u", "size", ",", "mix", "\\u", "dim", "]_", "\\u\\u\\uNL\\u\\u\\u_", "z_", "=_", "z_", "._", "sum_", "(_", "axis_", "=_", "-_", "1_", ")_", "-_", "2_", "*_", "corr_", "*_", "(_", "d_", "[_", ":_", ",_", ":_", ",_", "0_", "]_", "*_", "d_", "[_", ":_", ",_", ":_", ",_", "1_", "]_", ")_", "/_", "sigma", "2_", "#", " ", "25_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "corr", "1_", "=_", "1_", "-_", "corr_", "**_", "2_", "+_", "self_", "._", "epsilon_", "#", " ", "24_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "=_", "-_", "z_", "/_", "(_", "2_", "*_", "corr", "1_", ")_", "#", " ", "24", " ", "[", "batch", "\\u", "size", ",", "mix", "\\u", "dim", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nma", "x_", "=_", "n_", "._", "max_", "(_", "axis_", "=_", "-_", "1_", ",_", "keepdims_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "=_", "n_", "-_", "nma", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "=_", "T_", "._", "exp_", "(_", "n_", ")_", "/_", "(_", "2_", "*_", "np_", "._", "pi_", "*_", "sigma", "2_", "*_", "T_", "._", "sqrt_", "(_", "corr", "1_", ")_", ")_", "#", " ", "24_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "[", "batch", "\\u", "size", "]_", "\\u\\u\\uNL\\u\\u\\u_", "nl", "l_", "=_", "-_", "T_", "._", "log_", "(_", "(_", "n_", "*_", "weight_", ")_", "._", "sum_", "(_", "axis_", "=_", "-_", "1_", ",_", "keepdims_", "=_", "True_", ")_", "+_", "self_", "._", "epsilon_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nl", "l_", "-=_", "nma", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nl", "l_", "+=_", "T_", "._", "nnet", "_", "._", "binar", "y", "\\u", "crossentropy", "_", "(_", "pen", "up_", ",_", "outputs_", "[_", ":_", ",_", "2_", ":_", "]_", ")_", "#", " ", "26_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "nl", "l_", "._", "reshape_", "(_", "nl", "l\\u", "shape_", ",_", "ndim_", "=_", "nl", "l\\u", "ndim_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sketch", "Emitte", "r_", "(_", "Abstract", "Emitte", "r_", ",_", "Initializ", "able_", ",_", "Random_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "application_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "initial", "\\u", "outputs_", "(_", "self_", ",_", "batch", "\\u", "size_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "T_", "._", "zeros_", "(_", "(_", "batch", "\\u", "size_", ",_", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sketch", "Emitte", "r_", "(_", "Abstract", "Emitte", "r_", ",_", "Initializ", "able_", ",_", "Random_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "dim_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "name_", "==_", "'", "inputs", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "2_", "*_", "(_", "2_", "*_", "self_", "._", "mix", "\\u", "dim_", ")_", "+_", "2_", "*_", "self_", "._", "mix", "\\u", "dim_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "name_", "==_", "'", "output", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "3_", "#", " ", "x", ",", "y", ",", "pen_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "super_", "(_", "Sketch", "Emitte", "r_", ",_", "self_", ")_", "._", "get", "\\u", "dim_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "main_", "(_", "name_", ",_", "epochs_", ",_", "batch", "\\u", "size_", ",_", "learn", "ing", "\\u", "rate_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dim_", ",_", "mix", "\\u", "dim_", ",_", "old", "\\u", "model", "\\u", "name_", ",_", "max", "\\u", "length_", ",_", "bokeh", "_", ",_", "GRU", "_", ",_", "dropout_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "depth_", ",_", "max", "\\u", "grad_", ",_", "step", "\\u", "method_", ",_", "epsilon_", ",_", "sample_", ",_", "skip_", ",_", "uniform_", ",_", "top_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "-------------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "datasource_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "sh", "num_", "(_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Convert", " ", "a", " ", "posit", "ive", " ", "float", " ", "int", "o", " ", "a", " ", "short", " ", "tag", "-", "usable", " ", "string", "\\", "10", ";", " ", " ", " ", " ", " ", "E", ".", "g", ".:", " ", "0", " ", "->", " ", "0", ",", " ", "0.005", " ", "->", " ", "5", "3", ",", " ", "100", " ", "->", " ", "1", "-", "2", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'", "0", "'_", "if_", "x_", "<=_", "0_", "else_", "'%", "s", "%", "d", "'_", "%_", "(_", "(_", "\"%", "e", "\"_", "%_", "x_", ")_", "[_", "0_", "]_", ",_", "-_", "np_", "._", "floor_", "(_", "np_", "._", "log10_", "(_", "x_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "jobn", "ame_", "=_", "\"%", "s", "-%", "d", "X", "%", "dm", "%", "dd", "%", "dr", "%", "sb", "%", "de", "%", "s", "\"_", "%_", "(_", "datasource_", ",_", "depth_", ",_", "dim_", ",_", "mix", "\\u", "dim_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "int_", "(_", "dropout_", "*_", "10_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sh", "num_", "(_", "learn", "ing", "\\u", "rate_", ")_", ",_", "batch", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sh", "num_", "(_", "epsilon_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "max", "\\u", "length_", "!=_", "600_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "jobn", "ame_", "+=_", "'-", "L", "%", "d", "'_", "%_", "max", "\\u", "length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "GRU", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "jobn", "ame_", "+=_", "'", "g", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "max", "\\u", "grad_", "!=_", "5._", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "jobn", "ame_", "+=_", "'", "G", "%", "g", "'_", "%_", "max", "\\u", "grad_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "step", "\\u", "method_", "!=_", "'", "adam", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "jobn", "ame_", "+=_", "step", "\\u", "method_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "skip_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "jobn", "ame_", "+=_", "'", "D", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "depth_", ">_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "top_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "jobn", "ame_", "+=_", "'", "T", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "depth_", ">_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "uniform_", ">_", "0._", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "jobn", "ame_", "+=_", "'", "u", "%", "d", "'_", "%_", "int_", "(_", "uniform_", "*_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "debug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "jobn", "ame_", "+=_", "\".", "debug", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "sample_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Sampl", "ing", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"\\\\", "n", "Run", "ning", " ", "experiment", " ", "%", "s", "\"_", "%_", "jobn", "ame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "old", "\\u", "model", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "startin", "g", " ", "from", " ", "model", " ", "%", "s", "\"_", "%_", "old", "\\u", "model", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "-------------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "transitions_", "=_", "[_", "Gat", "ed", "Recurren", "t_", "(_", "dim_", "=_", "dim_", ")_", "if_", "GRU", "_", "else_", "LSTM", "_", "(_", "dim_", "=_", "dim_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "\\u_", "in_", "range_", "(_", "depth_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "depth_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "transition_", "=_", "Recurren", "t", "Stack_", "(_", "transitions_", ",_", "name_", "=_", "\"", "transiti", "on", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "skip", "\\u", "connections_", "=_", "skip_", "or_", "top_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "skip_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "source", "\\u", "names_", "=_", "[_", "Recurren", "t", "Stack_", "._", "suffix_", "(_", "'", "state", "s", "'_", ",_", "d_", ")_", "for_", "d_", "in_", "range_", "(_", "depth_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "source", "\\u", "names_", "=_", "[_", "Recurren", "t", "Stack_", "._", "suffix_", "(_", "'", "state", "s", "'_", ",_", "depth_", "-_", "1_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "transition_", "=_", "transitions_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "transition_", "._", "name_", "=_", "\"", "transiti", "on", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source", "\\u", "names_", "=_", "[_", "'", "state", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "emitter_", "=_", "Sketch", "Emitte", "r_", "(_", "mix", "\\u", "dim_", "=_", "mix", "\\u", "dim_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "epsilon_", "=_", "epsilon_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "\"", "emitte", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "readout", "_", "=_", "Read", "out_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "readout", "\\u", "dim_", "=_", "emitter_", "._", "get", "\\u", "dim_", "(_", "'", "inputs", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "source", "\\u", "names_", "=_", "source", "\\u", "names_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "emitter_", "=_", "emitter_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "\"", "readout", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "generator_", "=_", "Sequ", "ence", "Generator_", "(_", "readout", "_", "=_", "readout", "_", ",_", "transition_", "=_", "transition_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initializ", "ation", " ", "settings_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "uniform_", ">_", "0._", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "generator_", "._", "weight", "s", "\\u", "init_", "=_", "Uniform", "_", "(_", "width_", "=_", "uniform_", "*_", "2._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "generator_", "._", "weight", "s", "\\u", "init_", "=_", "Ortho", "gon", "al", "Glo", "rot_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "generator_", "._", "bias", "es", "\\u", "init_", "=_", "Constant_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Build", " ", "the", " ", "cost", " ", "computation", " ", "graph", " ", "[", "step", "s", ",", " ", "batch", "\\u", "size", ",", " ", "3", "]_", "\\u\\u\\uNL\\u\\u\\u_", "x_", "=_", "T_", "._", "tensor", "3_", "(_", "'", "features", "'_", ",_", "dtype_", "=_", "float", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "debug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "._", "tag_", "._", "test\\u", "value_", "=_", "np_", "._", "ones_", "(_", "(_", "max", "\\u", "length_", ",_", "batch", "\\u", "size_", ",_", "3_", ")_", ")_", "._", "astype_", "(_", "float", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "x_", "=_", "x_", "[_", ":_", "max", "\\u", "length_", ",_", ":_", ",_", ":_", "]_", "#", " ", "has", " ", "to", " ", "be", " ", "after", " ", "setti", "ng", " ", "test\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cost_", "=_", "generator_", "._", "cost_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cost_", "._", "name_", "=_", "\"", "sequence", "\\u", "log", "\\u", "likelihood", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Give", " ", "an", " ", "idea", " ", "of", " ", "what", "'", "s", " ", "goi", "ng", " ", "on_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "=_", "Model_", "(_", "cost_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "=_", "model_", "._", "get", "\\u", "parameter", "\\u", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "info_", "(_", "\"", "Parameter", "s", ":\\\\", "n", "\"_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "pprint_", "._", "pformat_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "key_", ",_", "value_", "._", "get", "\\u", "value_", "(_", ")_", "._", "shape_", ")_", "for_", "key_", ",_", "value_", "\\u\\u\\uNL\\u\\u\\u_", "in_", "params_", "._", "items_", "(_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "width_", "=_", "120_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "\\u", "size_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "v_", "in_", "params_", "._", "itervalues_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "v_", "._", "get", "\\u", "value_", "(_", ")_", "._", "shape_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "\\u", "size_", "+=_", "s_", "[_", "0_", "]_", "*_", "(_", "s_", "[_", "1_", "]_", "if_", "len_", "(_", "s_", ")_", ">_", "1_", "else_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "logger_", "._", "info_", "(_", "\"", "Total", " ", "number", " ", "of", " ", "parameter", "s", " ", "%", "d", "\"_", "%_", "model", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "extensions_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "old", "\\u", "model", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "old", "\\u", "model", "\\u", "name_", "==_", "'", "continue", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old", "\\u", "model", "\\u", "name_", "=_", "jobn", "ame_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "open_", "(_", "old", "\\u", "model", "\\u", "name_", "+_", "'\\u", "model", "'_", ",_", "\"", "rb", "\"_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old", "\\u", "model_", "=_", "pickle_", "._", "load_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "model_", "._", "set\\u", "parameter", "\\u", "values_", "(_", "old", "\\u", "model_", "._", "get", "\\u", "parameter", "\\u", "values_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "old", "\\u", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Initializ", "e", " ", "parameters_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "brick_", "in_", "model_", "._", "get", "\\u", "top", "\\u", "bricks", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "brick_", "._", "initialize_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "sample_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "old", "\\u", "model", "\\u", "name_", "and_", "old", "\\u", "model", "\\u", "name_", "!=_", "'", "continue", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Sample_", "(_", "generator_", ",_", "steps_", "=_", "max", "\\u", "length_", ",_", "path_", "=_", "old", "\\u", "model", "\\u", "name_", ")_", "._", "do_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Define", " ", "the", " ", "train", "ing", " ", "algo", "rit", "hm", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cg_", "=_", "Computation", "Graph_", "(_", "cost_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "dropout_", ">_", "0._", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "blocks_", "._", "roles_", "import_", "INPUT_", ",_", "OUTPUT_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "drop", "out", "\\u", "target_", "=_", "Varia", "ble", "Filter_", "(_", "roles_", "=_", "[_", "OUTPUT_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bricks", "_", "=_", "transitions_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name", "\\u", "regex_", "=_", "'", "state", "s", "'_", ")_", "(_", "cg_", "._", "variables_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'#", " ", "drop", "out", " ", "%", "d", "'_", "%_", "len_", "(_", "drop", "out", "\\u", "target_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cg_", "=_", "appl", "y", "\\u", "dropout_", "(_", "cg_", ",_", "drop", "out", "\\u", "target_", ",_", "dropout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opt", "\\u", "cost_", "=_", "cg_", "._", "outputs_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "opt", "\\u", "cost_", "=_", "cost_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "step", "\\u", "method_", "==_", "'", "adam", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "step", "\\u", "rule_", "=_", "Adam", "_", "(_", "learn", "ing", "\\u", "rate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "step", "\\u", "method_", "==_", "'", "rms", "prop", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "step", "\\u", "rule_", "=_", "RMS", "Prop_", "(_", "learn", "ing", "\\u", "rate_", ",_", "deca", "y", "\\u", "rate_", "=_", "0.95_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "step", "\\u", "method_", "==_", "'", "ada", "grad", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "step", "\\u", "rule_", "=_", "Ada", "Grad", "_", "(_", "learn", "ing", "\\u", "rate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "step", "\\u", "method_", "==_", "'", "ada", "delta", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "step", "\\u", "rule_", "=_", "Ada", "Delta_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "step", "\\u", "method_", "==_", "'", "scale", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "step", "\\u", "rule_", "=_", "Scale_", "(_", "learn", "ing", "\\u", "rate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "Un", "know", "n", " ", "stt", "ep", " ", "method", " ", "%", "s", "'_", "%_", "step", "\\u", "method_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "step", "\\u", "rule_", "=_", "Composit", "e", "Rule_", "(_", "[_", "Step", "Clip", "ping_", "(_", "max", "\\u", "grad_", ")_", ",_", "step", "\\u", "rule_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "algorithm_", "=_", "Grad", "ient", "Descen", "t_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "cost_", "=_", "opt", "\\u", "cost_", ",_", "parameters_", "=_", "cg_", "._", "parameters_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "step", "\\u", "rule_", "=_", "step", "\\u", "rule_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "observable", "s_", "=_", "[_", "cost_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fe", "tch", " ", "variab", "les", " ", "usef", "ul", " ", "for", " ", "debugg", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "energies_", ",_", ")_", "=_", "Varia", "ble", "Filter_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "applications_", "=_", "[_", "generator_", "._", "readout", "_", "._", "readout", "_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name", "\\u", "regex_", "=_", "\"", "output", "\"_", ")_", "(_", "cg_", "._", "variables_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "min", "\\u", "energy_", "=_", "named", "\\u", "copy_", "(_", "energies_", "._", "min_", "(_", ")_", ",_", "\"", "min", "\\u", "energ", "y", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "\\u", "energy_", "=_", "named", "\\u", "copy_", "(_", "energies_", "._", "max_", "(_", ")_", ",_", "\"", "max", "\\u", "energ", "y", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "observable", "s_", "+=_", "[_", "min", "\\u", "energy_", ",_", "max", "\\u", "energy_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "activation", "s", ",)", " ", "=", " ", "Varia", "ble", "Filter", "(_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "applica", "tion", "s", "=[", "generat", "or", ".", "transiti", "on", ".", "appl", "y", "],", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "name", "=", "generat", "or", ".", "transiti", "on", ".", "appl", "y", ".", "state", "s", "[", "0", "])(", "cg", ".", "variab", "les", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "mean", "\\u", "activation", " ", "=", " ", "named", "\\u", "copy", "(", "abs", "(", "activation", "s", ").", "mean", "()", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "\"", "mean", "\\u", "activation", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "observable", "s", ".", "append", "(", "mean", "\\u", "activation", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "observable", "s_", "+=_", "[_", "algorithm_", "._", "total", "\\u", "step", "\\u", "norm_", ",_", "algorithm_", "._", "total", "\\u", "gradi", "ent", "\\u", "norm_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", ",_", "param_", "in_", "params_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "observable", "s_", "._", "append_", "(_", "named", "\\u", "copy_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "param_", "._", "norm_", "(_", "2_", ")_", ",_", "name_", "+_", "\"\\u", "norm", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "observable", "s_", "._", "append_", "(_", "named", "\\u", "copy_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "algorithm_", "._", "gradients_", "[_", "param_", "]_", "._", "norm_", "(_", "2_", ")_", ",_", "name_", "+_", "\"\\u", "grad", "\\u", "norm", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "datas", "ource", "\\u", "fname_", "=_", "os_", "._", "path_", "._", "join_", "(_", "fuel", "_", "._", "config_", "._", "data\\u", "path_", ",_", "datasource_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "datasource_", "+_", "'.", "hdf5", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "train", "\\u", "ds_", "=_", "H", "5", "PY", "Dataset_", "(_", "datas", "ource", "\\u", "fname_", ",_", "#", "max", "\\u", "length", "=", "max", "\\u", "length", ",_", "\\u\\u\\uNL\\u\\u\\u_", "whi", "ch", "\\u", "sets_", "=_", "[_", "'", "train", "'_", "]_", ",_", "sources_", "=_", "(_", "'", "features", "'_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "load", "\\u", "in", "\\u", "memory_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "\\u", "stream_", "=_", "Data", "Stream_", "(_", "train", "\\u", "ds_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "iterati", "on", "\\u", "scheme_", "=_", "Shuffle", "d", "Scheme_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "train", "\\u", "ds_", "._", "num", "\\u", "examples_", ",_", "batch", "\\u", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "ds_", "=_", "H", "5", "PY", "Dataset_", "(_", "datas", "ource", "\\u", "fname_", ",_", "#", "max", "\\u", "length", "=", "max", "\\u", "length", ",_", "\\u\\u\\uNL\\u\\u\\u_", "whi", "ch", "\\u", "sets_", "=_", "[_", "'", "test", "'_", "]_", ",_", "sources_", "=_", "(_", "'", "features", "'_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "load", "\\u", "in", "\\u", "memory_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "stream_", "=_", "Data", "Stream_", "(_", "test\\u", "ds_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "iterati", "on", "\\u", "scheme_", "=_", "Sequ", "ential", "Scheme_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "ds_", "._", "num", "\\u", "examples_", ",_", "batch", "\\u", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "train", "\\u", "stream_", "=_", "Mapping_", "(_", "train", "\\u", "stream_", ",_", "\\u", "transpose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "stream_", "=_", "Mapping_", "(_", "test\\u", "stream_", ",_", "\\u", "transpose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "stream", "\\u", "stats_", "(_", "ds_", ",_", "label_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "itr_", "=_", "ds_", "._", "get", "\\u", "epoch", "\\u", "iterator_", "(_", "as", "\\u", "dict_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "batch", "\\u", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "example", "s", "\\u", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "batch_", "in_", "itr_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "batch", "\\u", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "example", "s", "\\u", "count_", "+=_", "batch_", "[_", "'", "features", "'_", "]_", "._", "shape_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "'%", "s", " ", "#", "batch", " ", "%", "d", " ", "#", "example", "s", " ", "%", "d", "'_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "label_", ",_", "batch", "\\u", "count_", ",_", "example", "s", "\\u", "count_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "stream", "\\u", "stats_", "(_", "train", "\\u", "stream_", ",_", "'", "train", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stream", "\\u", "stats_", "(_", "test\\u", "stream_", ",_", "'", "test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "extensions_", "+=_", "[_", "Tim", "ing_", "(_", "every", "\\u", "n", "\\u", "batches_", "=_", "10_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Train", "ing", "Data", "Monitor", "ing_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "observable", "s_", ",_", "prefix_", "=_", "\"", "train", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "every", "\\u", "n", "\\u", "batches_", "=_", "10_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Data", "Stream", "Monitor", "ing_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "cost_", "]_", ",_", "#", " ", "with", "out", " ", "dropout_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "stream_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "prefix_", "=_", "\"", "test", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "resum", "ption_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "after", "\\u", "epoch_", "=_", "False_", ",_", "#", " ", "by", " ", "default", " ", "this", " ", "is", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "every", "\\u", "n", "\\u", "batches_", "=_", "100_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "all", " ", "monitored", " ", "data", " ", "is", " ", "read", "y", " ", "so", " ", "print", " ", "it", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "next", " ", "step", "s", " ", "may", " ", "take", " ", "more", " ", "time", " ", "and", " ", "we", " ", "want", " ", "to", " ", "see", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "results", " ", "as", " ", "soo", "n", " ", "as", " ", "possib", "le", " ", "so", " ", "print", " ", "as", " ", "soo", "n", " ", "as", " ", "you", " ", "can", ")_", "\\u\\u\\uNL\\u\\u\\u_", "Printing", "_", "(_", "every", "\\u", "n", "\\u", "batches_", "=_", "10_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "perform", " ", "multiple", " ", "dump", "s", " ", "at", " ", "different", " ", "intervals_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "if", " ", "one", " ", "of", " ", "them", " ", "breaks", " ", "(", "has", " ", "nan", ")", " ", "we", " ", "can", " ", "hop", "efu", "ll", "y_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "find", " ", "a", " ", "model", " ", "from", " ", "few", " ", "batche", "s", " ", "ago", " ", "in", " ", "the", " ", "other_", "\\u\\u\\uNL\\u\\u\\u_", "Checkpoint", "_", "(_", "jobn", "ame_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bef", "ore", "\\u", "training_", "=_", "False_", ",_", "after", "\\u", "epoch_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "save", "\\u", "separately", "_", "=_", "[_", "'", "log", "'_", ",_", "'", "model", "'_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Sample_", "(_", "generator_", ",_", "steps_", "=_", "max", "\\u", "length_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "path_", "=_", "jobn", "ame_", "+_", "'.", "test", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "every", "\\u", "n", "\\u", "batches_", "=_", "100_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Progres", "s", "Bar_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Finish", "After_", "(_", "after", "\\u", "n", "\\u", "epochs_", "=_", "epochs_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "show", "s", " ", "a", " ", "way", " ", "to", " ", "handle", " ", "Na", "N", " ", "emerg", "ing", " ", "dur", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "train", "ing", ":", " ", "simp", "ly", " ", "finish", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "._", "add", "\\u", "condition_", "(_", "[_", "\"", "after", "\\u", "batch", "\"_", "]_", ",_", "\\u", "is", "\\u", "nan_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "bokeh", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "blocks_", "._", "extras_", "._", "extensions_", "._", "plot_", "import_", "Plot_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extensions_", "._", "append_", "(_", "Plot_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sketch", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "channels_", "=_", "[_", "[_", "'", "cost", "'_", "]_", "]_", ",_", "every", "\\u", "n", "\\u", "batches_", "=_", "10_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Construct", " ", "the", " ", "main", " ", "loop", " ", "and", " ", "start", " ", "train", "ing", "!", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "main", "\\u", "loop_", "=_", "Main", "Loop_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "=_", "model_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data\\u", "stream_", "=_", "train", "\\u", "stream_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "algorithm_", "=_", "algorithm_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "extensions_", "=_", "extensions_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "main", "\\u", "loop_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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ture\ndef sql(url):\n ds = dshape('var * {A: string, B: int64}')\n try:\n t = data(url % next(names), dshape=ds)\n except sa.exc.OperationalError as e:\n pytest.skip(str(e))\n else:\n assert t.dshape == ds\n t = data(odo([('a', 1), ('b', 2)], t))\n try:\n yield t\n finally:\n drop(t)", "metadata": "root.sql", "header": "['module', '___EOS___']", "index": 51 }, { "content": "@pytest.yield_fixture\ndef big_sql(url):\n try:\n t = data(url % next(names), dshape='var * {A: string, B: int64}')\n except sa.exc.OperationalError as e:\n pytest.skip(str(e))\n else:\n t = odo(zip(list('a'*100), list(range(100))), t)\n try:\n yield t\n finally:\n drop(t)", "metadata": "root.big_sql", "header": "['module', '___EOS___']", "index": 84 }, { "content": "@pytest.yield_fixture\ndef sqla(url):\n try:\n t = data(url % next(names), dshape='var * {A: ?string, B: ?int32}')\n except sa.exc.OperationalError as e:\n pytest.skip(str(e))\n else:\n t = odo([('a', 1), (None, 1), ('c', None)], t)\n try:\n yield t\n finally:\n drop(t)", "metadata": "root.sqla", "header": "['module', '___EOS___']", "index": 98 }, { "content": "@pytest.yield_fixture\ndef sqlb(url):\n try:\n t = data(url % next(names), dshape='var * {A: string, B: int64}')\n except sa.exc.OperationalError as e:\n pytest.skip(str(e))\n else:\n t = odo([('a', 1), ('b', 2)], t)\n try:\n yield t\n finally:\n drop(t)", "metadata": "root.sqlb", "header": "['module', '___EOS___']", "index": 112 }, { "content": "@pytest.yield_fixture\ndef sql_with_dts(url):\n try:\n t = data(url % next(names), dshape='var * {A: datetime}')\n except sa.exc.OperationalError as e:\n pytest.skip(str(e))\n else:\n t = odo([(d,) for d in pd.date_range('2014-01-01', '2014-02-01')], t)\n try:\n yield t\n finally:\n drop(t)", "metadata": "root.sql_with_dts", "header": "['module', '___EOS___']", "index": 126 }, { "content": "@pytest.yield_fixture\ndef sql_with_timedeltas(url):\n try:\n t = data(url % next(names), dshape='var * {N: timedelta}')\n except sa.exc.OperationalError as e:\n pytest.skip(str(e))\n else:\n t = odo([(timedelta(seconds=n),) for n in range(10)], t)\n try:\n yield t\n finally:\n drop(t)", "metadata": "root.sql_with_timedeltas", "header": "['module', '___EOS___']", "index": 140 }, { "content": "@pytest.yield_fixture\ndef sql_two_tables(url):\n dshape = 'var * {a: int32}'\n try:\n t = data(url % next(names), dshape=dshape)\n u = data(url % next(names), dshape=dshape)\n except sa.exc.OperationalError as e:\n pytest.skip(str(e))\n else:\n try:\n yield u, t\n finally:\n drop(t)\n drop(u)", "metadata": "root.sql_two_tables", "header": "['module', '___EOS___']", "index": 154 }, { "content": "@pytest.yield_fixture\ndef sql_with_float(url):\n try:\n t = data(url % next(names), dshape='var * {c: float64}')\n except sa.exc.OperationalError as e:\n pytest.skip(str(e))\n else:\n try:\n yield t\n finally:\n drop(t)", "metadata": "root.sql_with_float", "header": "['module', '___EOS___']", "index": 270 } ]
[ { "span": "next(names),", "start_line": 55, "start_column": 23, "end_line": 55, "end_column": 34 }, { "span": "next(names),", "start_line": 87, "start_column": 23, "end_line": 87, "end_column": 34 }, { "span": "next(names),", "start_line": 101, "start_column": 23, "end_line": 101, "end_column": 34 }, { "span": "next(names),", "start_line": 115, "start_column": 23, "end_line": 115, "end_column": 34 }, { "span": "next(names),", "start_line": 129, "start_column": 23, "end_line": 129, "end_column": 34 }, { "span": "next(names),", "start_line": 143, "start_column": 23, "end_line": 143, "end_column": 34 }, { "span": "next(names),", "start_line": 158, "start_column": 23, "end_line": 158, "end_column": 34 }, { "span": "next(names),", "start_line": 159, "start_column": 23, "end_line": 159, "end_column": 34 }, { "span": "next(names),", "start_line": 273, "start_column": 23, "end_line": 273, "end_column": 34 } ]
[]
1
true
[ "[CLS]_", "Un", "guard", "ed_", "next_", "in_", "generator_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "pytest_", "._", "yield", "\\u", "fixture_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "sql_", "(_", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ds_", "=_", "dsh", "ape_", "(_", "'", "var", " ", "*", " ", "{", "A", ":", " ", "string", ",", " ", "B", ":", " ", "int", "64", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "data_", "(_", "url_", "%_", "next_", "(_", "names_", ")_", ",_", "dsh", "ape_", "=_", "ds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "sa_", "._", "exc_", "._", "Opera", "tion", "al", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pytest_", "._", "skip_", "(_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "t_", "._", "dsh", "ape_", "==_", "ds_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "data_", "(_", "odo", "_", "(_", "[_", "(_", "'", "a", "'_", ",_", "1_", ")_", ",_", "(_", "'", "b", "'_", ",_", "2_", ")_", "]_", ",_", "t_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "drop_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "pytest_", "._", "yield", "\\u", "fixture_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "big", "\\u", "sql_", "(_", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "data_", "(_", "url_", "%_", "next_", "(_", "names_", ")_", ",_", "dsh", "ape_", "=_", "'", "var", " ", "*", " ", "{", "A", ":", " ", "string", ",", " ", "B", ":", " ", "int", "64", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "sa_", "._", "exc_", "._", "Opera", "tion", "al", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pytest_", "._", "skip_", "(_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "odo", "_", "(_", "zip_", "(_", "list_", "(_", "'", "a", "'_", "*_", "100_", ")_", ",_", "list_", "(_", "range_", "(_", "100_", ")_", ")_", ")_", ",_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "drop_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "pytest_", "._", "yield", "\\u", "fixture_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "sqla", "_", "(_", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "data_", "(_", "url_", "%_", "next_", "(_", "names_", ")_", ",_", "dsh", "ape_", "=_", "'", "var", " ", "*", " ", "{", "A", ":", " ", "?", "string", ",", " ", "B", ":", " ", "?", "int", "32", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "sa_", "._", "exc_", "._", "Opera", "tion", "al", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pytest_", "._", "skip_", "(_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "odo", "_", "(_", "[_", "(_", "'", "a", "'_", ",_", "1_", ")_", ",_", "(_", "None_", ",_", "1_", ")_", ",_", "(_", "'", "c", "'_", ",_", "None_", ")_", "]_", ",_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "drop_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "pytest_", "._", "yield", "\\u", "fixture_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "sql", "b_", "(_", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "data_", "(_", "url_", "%_", "next_", "(_", "names_", ")_", ",_", "dsh", "ape_", "=_", "'", "var", " ", "*", " ", "{", "A", ":", " ", "string", ",", " ", "B", ":", " ", "int", "64", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "sa_", "._", "exc_", "._", "Opera", "tion", "al", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pytest_", "._", "skip_", "(_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "odo", "_", "(_", "[_", "(_", "'", "a", "'_", ",_", "1_", ")_", ",_", "(_", "'", "b", "'_", ",_", "2_", ")_", "]_", ",_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "drop_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "pytest_", "._", "yield", "\\u", "fixture_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "sql", "\\u", "with", "\\u", "dts_", "(_", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "data_", "(_", "url_", "%_", "next_", "(_", "names_", ")_", ",_", "dsh", "ape_", "=_", "'", "var", " ", "*", " ", "{", "A", ":", " ", "datetime", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "sa_", "._", "exc_", "._", "Opera", "tion", "al", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pytest_", "._", "skip_", "(_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "odo", "_", "(_", "[_", "(_", "d_", ",_", ")_", "for_", "d_", "in_", "pd_", "._", "date", "\\u", "range_", "(_", "'", "2014", "-0", "1", "-0", "1", "'_", ",_", "'", "2014", "-0", "2", "-0", "1", "'_", ")_", "]_", ",_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "drop_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "pytest_", "._", "yield", "\\u", "fixture_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "sql", "\\u", "with", "\\u", "timedelta", "s_", "(_", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "data_", "(_", "url_", "%_", "next_", "(_", "names_", ")_", ",_", "dsh", "ape_", "=_", "'", "var", " ", "*", " ", "{", "N", ":", " ", "timedelta", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "sa_", "._", "exc_", "._", "Opera", "tion", "al", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pytest_", "._", "skip_", "(_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "odo", "_", "(_", "[_", "(_", "timedelta_", "(_", "seconds_", "=_", "n_", ")_", ",_", ")_", "for_", "n_", "in_", "range_", "(_", "10_", ")_", "]_", ",_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "drop_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "pytest_", "._", "yield", "\\u", "fixture_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "sql", "\\u", "two", "\\u", "tables_", "(_", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dsh", "ape_", "=_", "'", "var", " ", "*", " ", "{", "a", ":", " ", "int", "32", "}'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "data_", "(_", "url_", "%_", "next_", "(_", "names_", ")_", ",_", "dsh", "ape_", "=_", "dsh", "ape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "=_", "data_", "(_", "url_", "%_", "next_", "(_", "names_", ")_", ",_", "dsh", "ape_", "=_", "dsh", "ape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "sa_", "._", "exc_", "._", "Opera", "tion", "al", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pytest_", "._", "skip_", "(_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "u_", ",_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "drop_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "drop_", "(_", "u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "pytest_", "._", "yield", "\\u", "fixture_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "sql", "\\u", "with", "\\u", "float_", "(_", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "data_", "(_", "url_", "%_", "next_", "(_", "names_", ")_", ",_", "dsh", "ape_", "=_", "'", "var", " ", "*", " ", "{", "c", ":", " ", "float", "64", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "sa_", "._", "exc_", "._", "Opera", "tion", "al", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pytest_", "._", "skip_", "(_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "drop_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
neuropoly/spinalcordtoolbox/dev/sct_register_graymatter/sct_register_graymatter.py
[ { "content": "def wm_registration(param, smooth=False, init=False):\n path, fixed_name, ext = sct.extract_fname(param.fname_fixed)\n path_moving, moving_name, ext = sct.extract_fname(param.fname_moving)\n path, fixed_seg_name, ext = sct.extract_fname(param.fname_seg_fixed)\n path_moving_seg, moving_seg_name, ext = sct.extract_fname(param.fname_seg_moving)\n\n # cropping in x & y directions\n fixed_name_temp = fixed_name + \"_crop\"\n cmd = \"sct_crop_image -i \" + fixed_name + ext + \" -o \" + fixed_name_temp + ext + \" -m \" + fixed_seg_name + ext + \" -shift 5,5 -dim 0,1\"\n sct.run(cmd)\n fixed_name = fixed_name_temp\n\n fixed_seg_name_temp = fixed_seg_name+\"_crop\"\n sct.run(\"sct_crop_image -i \" + fixed_seg_name + ext + \" -o \" + fixed_seg_name_temp + ext + \" -m \" + fixed_seg_name + ext + \" -shift 5,5 -dim 0,1\")\n fixed_seg_name = fixed_seg_name_temp\n\n # padding the images\n moving_name_pad = moving_name+\"_pad\"\n fixed_name_pad = fixed_name+\"_pad\"\n sct.run('sct_maths -i '+path_moving+moving_name+ext+' -o '+moving_name_pad+ext+' -pad 0,0,'+str(param.padding))\n sct.run('sct_maths -i '+fixed_name+ext+' -o '+fixed_name_pad+ext+' -pad 0,0,'+str(param.padding))\n moving_name = moving_name_pad\n fixed_name = fixed_name_pad\n\n moving_seg_name_pad = moving_seg_name+\"_pad\"\n sct.run('sct_maths -i '+path_moving_seg+moving_seg_name+ext+' -o '+moving_seg_name_pad+ext+' -pad 0,0,'+str(param.padding))\n moving_seg_name = moving_seg_name_pad\n\n fixed_seg_name_pad = fixed_seg_name+\"_pad\"\n sct.run('sct_maths -i '+fixed_seg_name+ext+' -o '+fixed_seg_name_pad+ext+' -pad 0,0,'+str(param.padding))\n fixed_seg_name = fixed_seg_name_pad\n\n if param.metric == 'MeanSquares':\n # offset\n old_min = 0\n old_max = 1\n new_min = 100\n new_max = 200\n\n fixed_im = Image(fixed_name+ext)\n fixed_im.data = (fixed_im.data - old_min)*(new_max - new_min)/(old_max - old_min) + new_min\n fixed_im.save()\n\n moving_im = Image(moving_name+ext)\n moving_im.data = (moving_im.data - old_min)*(new_max - new_min)/(old_max - old_min) + new_min\n moving_im.save()\n\n if smooth:\n # smoothing the images to register\n sct.printv('\\nSmoothing the images...', verbose, 'normal')\n fixed_smooth = fixed_name+'_smooth'\n moving_smooth = moving_name+'_smooth'\n sct.run('sct_maths -i '+fixed_name+ext+' -smooth 1 -o '+fixed_smooth+ext)\n sct.run('sct_maths -i '+moving_name+ext+' -smooth 1 -o '+moving_smooth+ext)\n fixed_name = fixed_smooth\n moving_name = moving_smooth\n\n # registration of the gray matter\n sct.printv('\\nDeforming the image...', verbose, 'normal')\n moving_name_reg = moving_name+\"_deformed\"\n\n param_multimodal_reg = 'step=1,type=seg,algo=slicereg,metric=MeanSquares:step=2,type=im,algo=bsplinesyn,metric=MeanSquares,iter=5,shrink=2'\n if param.transformation == 'BSplineSyN':\n transfo_params = ',3,0'\n elif param.transformation == 'SyN': # SyN gives bad results...\n transfo_params = ',1,1'\n else:\n transfo_params = ''\n\n cmd = 'sct_register_multimodal -i '+moving_name+ext+' -d '+fixed_name+ext+' -iseg '+moving_seg_name+ext+' -dseg '+fixed_seg_name+ext+' -p '+param_multimodal_reg+' -o '+moving_name_reg\n ext_multimodal = '.nii'\n '''\n cmd = 'isct_antsRegistration --dimensionality 3 --interpolation '+param.interpolation+' --transform '+param.transformation+'['+param.gradient_step+transfo_params+'] --metric '+param.metric+'['+fixed_name+ext+','+moving_name+ext+',1,4] --output ['+moving_name_reg+','+moving_name_reg+ext+'] --convergence '+param.iteration+' --shrink-factors 1x1 --smoothing-sigmas 0x0 '\n if init:\n # initialize the transformation using the intensity\n cmd += ' -r ['+fixed_name+ext+','+moving_name+ext+',1] '\n\n cmd += \" --masks [\"+fixed_seg_name+ext+\",\"+moving_seg_name + ext + \"]\"\n # cmd += \" -m [\"+fixed_seg_name+\".nii,\"+moving_seg_name+\".nii]\"\n '''\n sct.run(cmd)\n\n if init:\n # transform the .mat warping field into a nifti file:\n warp0_mat = moving_name_reg+'0GenericAffine.mat'\n warp0, warp0_inv = transform_mat_to_warp(warp0_mat, moving_name_reg+ext, fixed_name+ext)\n if param.transformation == 'Affine':\n warp_tot = warp0\n inverse_warp_tot = warp0_inv\n else:\n warp1 = moving_name_reg+'1Warp.nii.gz'\n warp1_inv = moving_name_reg+'1InverseWarp.nii.gz'\n\n # Concatenate the warping fields from the 2 steps into a warp total and an inverse\n warp_tot = moving_name_reg+'_warp_tot'+ext\n inverse_warp_tot = moving_name_reg+'_inverse_warp_tot'+ext\n\n sct.run('sct_concat_transfo -w '+warp0+','+warp1+' -d '+fixed_name+ext+' -o '+warp_tot)\n sct.run('sct_concat_transfo -w '+warp1_inv+','+warp0_inv+' -d '+moving_name+ext+' -o '+inverse_warp_tot)\n else:\n warp_tot = moving_name_reg+'0Warp.nii.gz'\n inverse_warp_tot = moving_name_reg+'0InverseWarp.nii.gz'\n\n\n if param.metric == 'MeanSquares':\n # removing offset\n fixed_im = Image(fixed_name+ext)\n fixed_im.data = (fixed_im.data - new_min)*(old_max - old_min)/(new_max - new_min) + old_min\n fixed_im.save()\n\n moving_im = Image(moving_name_reg+ext_multimodal)\n moving_im.data = (moving_im.data - new_min)*(old_max - old_min)/(new_max - new_min) + old_min\n moving_im.save()\n\n\n # un-padding the images\n moving_name_unpad = moving_name_reg+\"_unpadded\"\n fixed_name_unpad = fixed_name+\"_unpadded\"\n sct.run(\"sct_crop_image -i \"+moving_name_reg+ext+\" -dim 2 -start \"+str(int(param.padding))+\" -end -\"+param.padding+\" -o \"+moving_name_unpad+ext)\n sct.run(\"sct_crop_image -i \"+fixed_name+ext+\" -dim 2 -start \"+str(int(param.padding))+\" -end -\"+param.padding+\" -o \"+fixed_name_unpad+ext)\n\n '''\n # warp_tot = moving_name_reg+\"0Warp.nii.gz\"\n # inverse_warp_tot = moving_name_reg+\"0InverseWarp.nii.gz\"\n warp_unpad = sct.add_suffix(warp_tot, '_unpad') # moving_name_reg+\"0Warp_unpad.nii.gz\"\n inverse_warp_unpad = sct.add_suffix(inverse_warp_tot, '_unpad') # moving_name_reg+\"0InverseWarp_unpad.nii.gz\"\n sct.run(\"sct_crop_image -i \"+warp_tot+\" -dim 2 -start \"+str(int(param.padding))+\" -end -\"+param.padding+\" -o \"+warp_unpad)\n sct.run(\"sct_crop_image -i \"+inverse_warp_tot+\" -dim 2 -start \"+str(int(param.padding))+\" -end -\"+param.padding+\" -o \"+inverse_warp_unpad)\n '''\n\n\n path_output, file_output, ext_output = sct.extract_fname(param.fname_output)\n warp_output = file_output+\"_Warp\"+ext_output\n inverse_warp_output = file_output+\"_InverseWarp\"+ext_output\n\n\n # with multimodal_reg\n sct.run(\"mv warp_\"+moving_name+\"2\"+fixed_name+\".nii.gz \"+warp_output)\n sct.run(\"mv warp_\"+fixed_name+\"2\"+moving_name+\".nii.gz \"+inverse_warp_output)\n '''\n # with antsReg\n sct.run(\"mv \"+warp_unpad+\" \"+warp_output)\n sct.run(\"mv \"+inverse_warp_unpad+\" \"+inverse_warp_output)\n '''\n\n moving_name_out = file_output+ext_output\n # put the result and the reference in the same space using a registration with ANTs with no iteration:\n sct.run('isct_antsRegistration -d 3 -t Translation[0] -m MI['+fixed_name_unpad+ext+','+moving_name_unpad+ext+',1,16] -o [regAffine,'+moving_name_out+'] -n BSpline[3] -c 0 -f 1 -s 0')\n\n return warp_output, inverse_warp_output", "metadata": "root.wm_registration", "header": "['module', '___EOS___']", "index": 78 } ]
[ { "span": "transfo_params ", "start_line": 141, "start_column": 8, "end_line": 141, "end_column": 22 }, { "span": "transfo_params ", "start_line": 143, "start_column": 8, "end_line": 143, "end_column": 22 }, { "span": "transfo_params ", "start_line": 145, "start_column": 8, "end_line": 145, "end_column": 22 }, { "span": "warp_tot ", "start_line": 165, "start_column": 12, "end_line": 165, "end_column": 20 }, { "span": "inverse_warp_tot ", "start_line": 166, "start_column": 12, "end_line": 166, "end_column": 28 }, { "span": "warp_tot ", "start_line": 178, "start_column": 8, "end_line": 178, "end_column": 16 }, { "span": "inverse_warp_tot ", "start_line": 179, "start_column": 8, "end_line": 179, "end_column": 24 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "wm", "\\u", "registration_", "(_", "param_", ",_", "smooth_", "=_", "False_", ",_", "init_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path_", ",_", "fixed", "\\u", "name_", ",_", "ext_", "=_", "sct", "_", "._", "extract", "\\u", "fname_", "(_", "param_", "._", "fname", "\\u", "fixed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path", "\\u", "movin", "g_", ",_", "movin", "g", "\\u", "name_", ",_", "ext_", "=_", "sct", "_", "._", "extract", "\\u", "fname_", "(_", "param_", "._", "fname", "\\u", "movin", "g_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path_", ",_", "fixed", "\\u", "seg", "\\u", "name_", ",_", "ext_", "=_", "sct", "_", "._", "extract", "\\u", "fname_", "(_", "param_", "._", "fname", "\\u", "seg", "\\u", "fixed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path", "\\u", "movin", "g", "\\u", "seg_", ",_", "movin", "g", "\\u", "seg", "\\u", "name_", ",_", "ext_", "=_", "sct", "_", "._", "extract", "\\u", "fname_", "(_", "param_", "._", "fname", "\\u", "seg", "\\u", "movin", "g_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "crop", "ping", " ", "in", " ", "x", " ", "&", " ", "y", " ", "directions_", "\\u\\u\\uNL\\u\\u\\u_", "fixed", "\\u", "name", "\\u", "temp_", "=_", "fixed", "\\u", "name_", "+_", "\"\\u", "crop", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd_", "=_", "\"", "sct", "\\u", "crop", "\\u", "image", " ", "-", "i", " ", "\"_", "+_", "fixed", "\\u", "name_", "+_", "ext_", "+_", "\"", " ", "-", "o", " ", "\"_", "+_", "fixed", "\\u", "name", "\\u", "temp_", "+_", "ext_", "+_", "\"", " ", "-", "m", " ", "\"_", "+_", "fixed", "\\u", "seg", "\\u", "name_", "+_", "ext_", "+_", "\"", " ", "-", "shift", " ", "5", ",", "5", " ", "-", "dim", " ", "0", ",", "1", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixed", "\\u", "name_", "=_", "fixed", "\\u", "name", "\\u", "temp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fixed", "\\u", "seg", "\\u", "name", "\\u", "temp_", "=_", "fixed", "\\u", "seg", "\\u", "name_", "+_", "\"\\u", "crop", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "\"", "sct", "\\u", "crop", "\\u", "image", " ", "-", "i", " ", "\"_", "+_", "fixed", "\\u", "seg", "\\u", "name_", "+_", "ext_", "+_", "\"", " ", "-", "o", " ", "\"_", "+_", "fixed", "\\u", "seg", "\\u", "name", "\\u", "temp_", "+_", "ext_", "+_", "\"", " ", "-", "m", " ", "\"_", "+_", "fixed", "\\u", "seg", "\\u", "name_", "+_", "ext_", "+_", "\"", " ", "-", "shift", " ", "5", ",", "5", " ", "-", "dim", " ", "0", ",", "1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixed", "\\u", "seg", "\\u", "name_", "=_", "fixed", "\\u", "seg", "\\u", "name", "\\u", "temp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "padd", "ing", " ", "the", " ", "images_", "\\u\\u\\uNL\\u\\u\\u_", "movin", "g", "\\u", "name", "\\u", "pad_", "=_", "movin", "g", "\\u", "name_", "+_", "\"\\u", "pad", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixed", "\\u", "name", "\\u", "pad_", "=_", "fixed", "\\u", "name_", "+_", "\"\\u", "pad", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "maths", " ", "-", "i", " ", "'_", "+_", "path", "\\u", "movin", "g_", "+_", "movin", "g", "\\u", "name_", "+_", "ext_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "movin", "g", "\\u", "name", "\\u", "pad_", "+_", "ext_", "+_", "'", " ", "-", "pad", " ", "0", ",", "0", ",'_", "+_", "str_", "(_", "param_", "._", "padding_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "maths", " ", "-", "i", " ", "'_", "+_", "fixed", "\\u", "name_", "+_", "ext_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "fixed", "\\u", "name", "\\u", "pad_", "+_", "ext_", "+_", "'", " ", "-", "pad", " ", "0", ",", "0", ",'_", "+_", "str_", "(_", "param_", "._", "padding_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "movin", "g", "\\u", "name_", "=_", "movin", "g", "\\u", "name", "\\u", "pad_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixed", "\\u", "name_", "=_", "fixed", "\\u", "name", "\\u", "pad_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "movin", "g", "\\u", "seg", "\\u", "name", "\\u", "pad_", "=_", "movin", "g", "\\u", "seg", "\\u", "name_", "+_", "\"\\u", "pad", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "maths", " ", "-", "i", " ", "'_", "+_", "path", "\\u", "movin", "g", "\\u", "seg_", "+_", "movin", "g", "\\u", "seg", "\\u", "name_", "+_", "ext_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "movin", "g", "\\u", "seg", "\\u", "name", "\\u", "pad_", "+_", "ext_", "+_", "'", " ", "-", "pad", " ", "0", ",", "0", ",'_", "+_", "str_", "(_", "param_", "._", "padding_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "movin", "g", "\\u", "seg", "\\u", "name_", "=_", "movin", "g", "\\u", "seg", "\\u", "name", "\\u", "pad_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fixed", "\\u", "seg", "\\u", "name", "\\u", "pad_", "=_", "fixed", "\\u", "seg", "\\u", "name_", "+_", "\"\\u", "pad", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "maths", " ", "-", "i", " ", "'_", "+_", "fixed", "\\u", "seg", "\\u", "name_", "+_", "ext_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "fixed", "\\u", "seg", "\\u", "name", "\\u", "pad_", "+_", "ext_", "+_", "'", " ", "-", "pad", " ", "0", ",", "0", ",'_", "+_", "str_", "(_", "param_", "._", "padding_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixed", "\\u", "seg", "\\u", "name_", "=_", "fixed", "\\u", "seg", "\\u", "name", "\\u", "pad_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "param_", "._", "metric_", "==_", "'", "Mea", "n", "Square", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "offset_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old", "\\u", "min_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "\\u", "max_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "min_", "=_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "max_", "=_", "200_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fixed", "\\u", "im_", "=_", "Image_", "(_", "fixed", "\\u", "name_", "+_", "ext_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixed", "\\u", "im_", "._", "data_", "=_", "(_", "fixed", "\\u", "im_", "._", "data_", "-_", "old", "\\u", "min_", ")_", "*_", "(_", "new", "\\u", "max_", "-_", "new", "\\u", "min_", ")_", "/_", "(_", "old", "\\u", "max_", "-_", "old", "\\u", "min_", ")_", "+_", "new", "\\u", "min_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixed", "\\u", "im_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "movin", "g", "\\u", "im_", "=_", "Image_", "(_", "movin", "g", "\\u", "name_", "+_", "ext_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "movin", "g", "\\u", "im_", "._", "data_", "=_", "(_", "movin", "g", "\\u", "im_", "._", "data_", "-_", "old", "\\u", "min_", ")_", "*_", "(_", "new", "\\u", "max_", "-_", "new", "\\u", "min_", ")_", "/_", "(_", "old", "\\u", "max_", "-_", "old", "\\u", "min_", ")_", "+_", "new", "\\u", "min_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "movin", "g", "\\u", "im_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "smooth_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "smoothing", " ", "the", " ", "images", " ", "to", " ", "register_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Smooth", "ing", " ", "the", " ", "images", "...'_", ",_", "verbose_", ",_", "'", "normal", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixed", "\\u", "smooth_", "=_", "fixed", "\\u", "name_", "+_", "'\\u", "smooth", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "movin", "g", "\\u", "smooth_", "=_", "movin", "g", "\\u", "name_", "+_", "'\\u", "smooth", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "maths", " ", "-", "i", " ", "'_", "+_", "fixed", "\\u", "name_", "+_", "ext_", "+_", "'", " ", "-", "smooth", " ", "1", " ", "-", "o", " ", "'_", "+_", "fixed", "\\u", "smooth_", "+_", "ext_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "maths", " ", "-", "i", " ", "'_", "+_", "movin", "g", "\\u", "name_", "+_", "ext_", "+_", "'", " ", "-", "smooth", " ", "1", " ", "-", "o", " ", "'_", "+_", "movin", "g", "\\u", "smooth_", "+_", "ext_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixed", "\\u", "name_", "=_", "fixed", "\\u", "smooth_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "movin", "g", "\\u", "name_", "=_", "movin", "g", "\\u", "smooth_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "registration", " ", "of", " ", "the", " ", "gray", " ", "matte", "r_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Def", "orm", "ing", " ", "the", " ", "image", "...'_", ",_", "verbose_", ",_", "'", "normal", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "movin", "g", "\\u", "name", "\\u", "reg_", "=_", "movin", "g", "\\u", "name_", "+_", "\"\\u", "deform", "ed", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "param", "\\u", "multim", "oda", "l\\u", "reg_", "=_", "'", "step", "=", "1", ",", "type", "=", "seg", ",", "algo", "=", "slicer", "eg", ",", "metric", "=", "Mea", "n", "Square", "s", ":", "step", "=", "2", ",", "type", "=", "im", ",", "algo", "=", "bsp", "lines", "yn", ",", "metric", "=", "Mea", "n", "Square", "s", ",", "iter", "=", "5", ",", "shrink", "=", "2", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "param_", "._", "transformation_", "==_", "'", "BS", "plin", "e", "Sy", "N", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "transf", "o", "\\u", "params_", "=_", "',", "3", ",", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "param_", "._", "transformation_", "==_", "'", "Sy", "N", "'_", ":_", "#", " ", "Sy", "N", " ", "give", "s", " ", "bad", " ", "results", "..._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "transf", "o", "\\u", "params_", "=_", "',", "1", ",", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "transf", "o", "\\u", "params_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cmd_", "=_", "'", "sct", "\\u", "register", "\\u", "multim", "oda", "l", " ", "-", "i", " ", "'_", "+_", "movin", "g", "\\u", "name_", "+_", "ext_", "+_", "'", " ", "-", "d", " ", "'_", "+_", "fixed", "\\u", "name_", "+_", "ext_", "+_", "'", " ", "-", "ise", "g", " ", "'_", "+_", "movin", "g", "\\u", "seg", "\\u", "name_", "+_", "ext_", "+_", "'", " ", "-", "dse", "g", " ", "'_", "+_", "fixed", "\\u", "seg", "\\u", "name_", "+_", "ext_", "+_", "'", " ", "-", "p", " ", "'_", "+_", "param", "\\u", "multim", "oda", "l\\u", "reg_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "movin", "g", "\\u", "name", "\\u", "reg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ext", "\\u", "multim", "oda", "l_", "=_", "'.", "ni", "i", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "'''", "\\", "10", ";", " ", " ", " ", " ", "cmd", " ", "=", " ", "'", "isc", "t", "\\u", "ant", "s", "Registration", " ", "--", "dimensionality", " ", "3", " ", "--", "interpolati", "on", " ", "'+", "param", ".", "interpolati", "on", "+'", " ", "--", "transform", " ", "'+", "param", ".", "transformation", "+'", "['", "+", "param", ".", "gradi", "ent", "\\u", "step", "+", "transf", "o", "\\u", "params", "+'", "]", " ", "--", "metric", " ", "'+", "param", ".", "metric", "+'", "['", "+", "fixed", "\\u", "name", "+", "ext", "+'", ",'", "+", "movin", "g", "\\u", "name", "+", "ext", "+'", ",", "1", ",", "4", "]", " ", "--", "output", " ", "['", "+", "movin", "g", "\\u", "name", "\\u", "reg", "+'", ",'", "+", "movin", "g", "\\u", "name", "\\u", "reg", "+", "ext", "+'", "]", " ", " ", "--", "convergence", " ", "'+", "param", ".", "iterati", "on", "+'", " ", "--", "shrink", "-", "factor", "s", " ", "1x", "1", " ", "--", "smoothing", "-", "sigmas", " ", "0x0", " ", "'", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "init", ":", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "initialize", " ", "the", " ", "transformation", " ", "usi", "ng", " ", "the", " ", "intensity", "\\", "10", ";", " ", " ", " ", " ", "cmd", " ", "+=", " ", "'", " ", "-", "r", " ", "['", "+", "fixed", "\\u", "name", "+", "ext", "+'", ",'", "+", "movin", "g", "\\u", "name", "+", "ext", "+'", ",", "1", "]", " ", "'", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "cmd", " ", "+=", " ", "\"", " ", "--", "mask", "s", " ", "[\"", "+", "fixed", "\\u", "seg", "\\u", "name", "+", "ext", "+\"", ",\"", "+", "movin", "g", "\\u", "seg", "\\u", "name", " ", "+", " ", "ext", " ", "+", " ", "\"]", "\"", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "cmd", " ", "+=", " ", "\"", " ", "-", "m", " ", "[\"", "+", "fixed", "\\u", "seg", "\\u", "name", "+\"", ".", "ni", "i", ",\"", "+", "movin", "g", "\\u", "seg", "\\u", "name", "+\"", ".", "ni", "i", "]\"", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "init_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "transform", " ", "the", " ", ".", "mat", " ", "warp", "ing", " ", "field", " ", "int", "o", " ", "a", " ", "nif", "ti", " ", "file", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warp", "0", "\\u", "mat_", "=_", "movin", "g", "\\u", "name", "\\u", "reg_", "+_", "'", "0", "Gene", "ric", "Affi", "ne", ".", "mat", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warp", "0_", ",_", "warp", "0", "\\u", "inv_", "=_", "transform", "\\u", "mat", "\\u", "to", "\\u", "warp", "_", "(_", "warp", "0", "\\u", "mat_", ",_", "movin", "g", "\\u", "name", "\\u", "reg_", "+_", "ext_", ",_", "fixed", "\\u", "name_", "+_", "ext_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "param_", "._", "transformation_", "==_", "'", "Affi", "ne", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warp", "\\u", "tot_", "=_", "warp", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inv", "erse", "\\u", "warp", "\\u", "tot_", "=_", "warp", "0", "\\u", "inv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warp", "1_", "=_", "movin", "g", "\\u", "name", "\\u", "reg_", "+_", "'", "1", "War", "p", ".", "ni", "i", ".", "gz", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warp", "1", "\\u", "inv_", "=_", "movin", "g", "\\u", "name", "\\u", "reg_", "+_", "'", "1", "Inv", "erse", "War", "p", ".", "ni", "i", ".", "gz", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Concat", "enat", "e", " ", "the", " ", "warp", "ing", " ", "fields", " ", "from", " ", "the", " ", "2", " ", "step", "s", " ", "int", "o", " ", "a", " ", "warp", " ", "total", " ", "and", " ", "an", " ", "inverse_", "\\u\\u\\uNL\\u\\u\\u_", "warp", "\\u", "tot_", "=_", "movin", "g", "\\u", "name", "\\u", "reg_", "+_", "'\\u", "warp", "\\u", "tot", "'_", "+_", "ext_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inv", "erse", "\\u", "warp", "\\u", "tot_", "=_", "movin", "g", "\\u", "name", "\\u", "reg_", "+_", "'\\u", "inv", "erse", "\\u", "warp", "\\u", "tot", "'_", "+_", "ext_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "conc", "at", "\\u", "transf", "o", " ", "-", "w", " ", "'_", "+_", "warp", "0_", "+_", "','_", "+_", "warp", "1_", "+_", "'", " ", "-", "d", " ", "'_", "+_", "fixed", "\\u", "name_", "+_", "ext_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "warp", "\\u", "tot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "conc", "at", "\\u", "transf", "o", " ", "-", "w", " ", "'_", "+_", "warp", "1", "\\u", "inv_", "+_", "','_", "+_", "warp", "0", "\\u", "inv_", "+_", "'", " ", "-", "d", " ", "'_", "+_", "movin", "g", "\\u", "name_", "+_", "ext_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "inv", "erse", "\\u", "warp", "\\u", "tot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warp", "\\u", "tot_", "=_", "movin", "g", "\\u", "name", "\\u", "reg_", "+_", "'", "0", "War", "p", ".", "ni", "i", ".", "gz", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inv", "erse", "\\u", "warp", "\\u", "tot_", "=_", "movin", "g", "\\u", "name", "\\u", "reg_", "+_", "'", "0", "Inv", "erse", "War", "p", ".", "ni", "i", ".", "gz", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "param_", "._", "metric_", "==_", "'", "Mea", "n", "Square", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "remo", "ving", " ", "offset_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fixed", "\\u", "im_", "=_", "Image_", "(_", "fixed", "\\u", "name_", "+_", "ext_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixed", "\\u", "im_", "._", "data_", "=_", "(_", "fixed", "\\u", "im_", "._", "data_", "-_", "new", "\\u", "min_", ")_", "*_", "(_", "old", "\\u", "max_", "-_", "old", "\\u", "min_", ")_", "/_", "(_", "new", "\\u", "max_", "-_", "new", "\\u", "min_", ")_", "+_", "old", "\\u", "min_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixed", "\\u", "im_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "movin", "g", "\\u", "im_", "=_", "Image_", "(_", "movin", "g", "\\u", "name", "\\u", "reg_", "+_", "ext", "\\u", "multim", "oda", "l_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "movin", "g", "\\u", "im_", "._", "data_", "=_", "(_", "movin", "g", "\\u", "im_", "._", "data_", "-_", "new", "\\u", "min_", ")_", "*_", "(_", "old", "\\u", "max_", "-_", "old", "\\u", "min_", ")_", "/_", "(_", "new", "\\u", "max_", "-_", "new", "\\u", "min_", ")_", "+_", "old", "\\u", "min_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "movin", "g", "\\u", "im_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "un", "-", "padd", "ing", " ", "the", " ", "images_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "movin", "g", "\\u", "name", "\\u", "unpa", "d_", "=_", "movin", "g", "\\u", "name", "\\u", "reg_", "+_", "\"\\u", "unpa", "dde", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixed", "\\u", "name", "\\u", "unpa", "d_", "=_", "fixed", "\\u", "name_", "+_", "\"\\u", "unpa", "dde", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "\"", "sct", "\\u", "crop", "\\u", "image", " ", "-", "i", " ", "\"_", "+_", "movin", "g", "\\u", "name", "\\u", "reg_", "+_", "ext_", "+_", "\"", " ", "-", "dim", " ", "2", " ", "-", "start", " ", "\"_", "+_", "str_", "(_", "int_", "(_", "param_", "._", "padding_", ")_", ")_", "+_", "\"", " ", "-", "end", " ", "-\"_", "+_", "param_", "._", "padding_", "+_", "\"", " ", "-", "o", " ", "\"_", "+_", "movin", "g", "\\u", "name", "\\u", "unpa", "d_", "+_", "ext_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "\"", "sct", "\\u", "crop", "\\u", "image", " ", "-", "i", " ", "\"_", "+_", "fixed", "\\u", "name_", "+_", "ext_", "+_", "\"", " ", "-", "dim", " ", "2", " ", "-", "start", " ", "\"_", "+_", "str_", "(_", "int_", "(_", "param_", "._", "padding_", ")_", ")_", "+_", "\"", " ", "-", "end", " ", "-\"_", "+_", "param_", "._", "padding_", "+_", "\"", " ", "-", "o", " ", "\"_", "+_", "fixed", "\\u", "name", "\\u", "unpa", "d_", "+_", "ext_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "warp", "\\u", "tot", " ", "=", " ", "movin", "g", "\\u", "name", "\\u", "reg", "+\"", "0", "War", "p", ".", "ni", "i", ".", "gz", "\"", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "inv", "erse", "\\u", "warp", "\\u", "tot", " ", "=", " ", "movin", "g", "\\u", "name", "\\u", "reg", "+\"", "0", "Inv", "erse", "War", "p", ".", "ni", "i", ".", "gz", "\"", "\\", "10", ";", " ", " ", " ", " ", "warp", "\\u", "unpa", "d", " ", "=", " ", "sct", ".", "add", "\\u", "suff", "ix", "(", "warp", "\\u", "tot", ",", " ", "'\\u", "unpa", "d", "')", " ", " ", "#", " ", "movin", "g", "\\u", "name", "\\u", "reg", "+\"", "0", "War", "p", "\\u", "unpa", "d", ".", "ni", "i", ".", "gz", "\"", "\\", "10", ";", " ", " ", " ", " ", "inv", "erse", "\\u", "warp", "\\u", "unpa", "d", " ", "=", " ", " ", "sct", ".", "add", "\\u", "suff", "ix", "(", "inv", "erse", "\\u", "warp", "\\u", "tot", ",", " ", "'\\u", "unpa", "d", "')", " ", " ", "#", " ", "movin", "g", "\\u", "name", "\\u", "reg", "+\"", "0", "Inv", "erse", "War", "p", "\\u", "unpa", "d", ".", "ni", "i", ".", "gz", "\"", "\\", "10", ";", " ", " ", " ", " ", "sct", ".", "run", "(\"", "sct", "\\u", "crop", "\\u", "image", " ", "-", "i", " ", "\"+", "warp", "\\u", "tot", "+\"", " ", "-", "dim", " ", "2", " ", "-", "start", " ", "\"+", "str", "(", "int", "(", "param", ".", "padd", "ing", "))", "+\"", " ", "-", "end", " ", "-\"", "+", "param", ".", "padd", "ing", "+\"", " ", "-", "o", " ", "\"+", "warp", "\\u", "unpa", "d", ")", "\\", "10", ";", " ", " ", " ", " ", "sct", ".", "run", "(\"", "sct", "\\u", "crop", "\\u", "image", " ", "-", "i", " ", "\"+", "inv", "erse", "\\u", "warp", "\\u", "tot", "+\"", " ", "-", "dim", " ", "2", " ", "-", "start", " ", "\"+", "str", "(", "int", "(", "param", ".", "padd", "ing", "))", "+\"", " ", "-", "end", " ", "-\"", "+", "param", ".", "padd", "ing", "+\"", " ", "-", "o", " ", "\"+", "inv", "erse", "\\u", "warp", "\\u", "unpa", "d", ")", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "path", "\\u", "output_", ",_", "file", "\\u", "output_", ",_", "ext", "\\u", "output_", "=_", "sct", "_", "._", "extract", "\\u", "fname_", "(_", "param_", "._", "fname", "\\u", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warp", "\\u", "output_", "=_", "file", "\\u", "output_", "+_", "\"\\u", "War", "p", "\"_", "+_", "ext", "\\u", "output_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inv", "erse", "\\u", "warp", "\\u", "output_", "=_", "file", "\\u", "output_", "+_", "\"\\u", "Inv", "erse", "War", "p", "\"_", "+_", "ext", "\\u", "output_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "with", " ", "multim", "oda", "l\\u", "reg_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "\"", "mv", " ", "warp", "\\u\"_", "+_", "movin", "g", "\\u", "name_", "+_", "\"", "2", "\"_", "+_", "fixed", "\\u", "name_", "+_", "\".", "ni", "i", ".", "gz", " ", "\"_", "+_", "warp", "\\u", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "\"", "mv", " ", "warp", "\\u\"_", "+_", "fixed", "\\u", "name_", "+_", "\"", "2", "\"_", "+_", "movin", "g", "\\u", "name_", "+_", "\".", "ni", "i", ".", "gz", " ", "\"_", "+_", "inv", "erse", "\\u", "warp", "\\u", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "'''", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "with", " ", "ant", "s", "Reg", "\\", "10", ";", " ", " ", " ", " ", "sct", ".", "run", "(\"", "mv", " ", "\"+", "warp", "\\u", "unpa", "d", "+\"", " ", "\"+", "warp", "\\u", "output", ")", "\\", "10", ";", " ", " ", " ", " ", "sct", ".", "run", "(\"", "mv", " ", "\"+", "inv", "erse", "\\u", "warp", "\\u", "unpa", "d", "+\"", " ", "\"+", "inv", "erse", "\\u", "warp", "\\u", "output", ")", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "movin", "g", "\\u", "name", "\\u", "out_", "=_", "file", "\\u", "output_", "+_", "ext", "\\u", "output_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "put", " ", "the", " ", "result", " ", "and", " ", "the", " ", "reference", " ", "in", " ", "the", " ", "same", " ", "space", " ", "usi", "ng", " ", "a", " ", "registration", " ", "with", " ", "ANT", "s", " ", "with", " ", "no", " ", "iterati", "on", ":_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "isc", "t", "\\u", "ant", "s", "Registration", " ", "-", "d", " ", "3", " ", "-", "t", " ", "Translat", "ion", "[", "0", "]", " ", "-", "m", " ", "MI", "['_", "+_", "fixed", "\\u", "name", "\\u", "unpa", "d_", "+_", "ext_", "+_", "','_", "+_", "movin", "g", "\\u", "name", "\\u", "unpa", "d_", "+_", "ext_", "+_", "',", "1", ",", "16", "]", " ", "-", "o", " ", "[", "reg", "Affi", "ne", ",'_", "+_", "movin", "g", "\\u", "name", "\\u", "out_", "+_", "']", " ", "-", "n", " ", "BS", "plin", "e", "[", "3", "]", " ", "-", "c", " ", "0", " ", "-", "f", " ", "1", " ", "-", "s", " ", "0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "warp", "\\u", "output_", ",_", "inv", "erse", "\\u", "warp", "\\u", "output_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
fp7-ofelia/ocf/vt_manager/src/python/vt_manager/models/XenServer.py
[ { "content": "from django.db import models\nfrom django.contrib import auth\nfrom threading import Lock\nimport inspect \nfrom vt_manager.models.VTServer import VTServer\nfrom vt_manager.models.Action import Action\nfrom vt_manager.models.VirtualMachine import VirtualMachine\nfrom vt_manager.models.XenVM import XenVM\nfrom vt_manager.utils.MutexStore import MutexStore\nfrom vt_manager.models.utils.Choices import VirtTechClass\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def validateAgentURLwrapper():\n\tVTServer.validateAgentURL()", "metadata": "root.validateAgentURLwrapper", "header": "['module', '___EOS___']", "index": 11 }, { "content": "class XenServer(VTServer):\n\t\"\"\"Virtualization Server class\"\"\"\n\n\tclass Meta:\n\t\t\"\"\"Meta Class for your model.\"\"\"\n\t\tapp_label = 'vt_manager'\n\n\t''' VMs array '''\n\tvms = models.ManyToManyField(XenVM, blank = True, null = False, editable = False, related_name = \"Server\")\n\t\n\t#Stats of memory cpu and disk\n\t#TODO: Add here ManyToMany relation to statistics objects\n\n\n\t##Private methods\n\n\t\t\n\t'''Constructor'''\n\n\t'''Updater'''\n\n\t'''Destructor'''\n\t\n\t''' Public interface methods '''\n\n\t\n", "metadata": "root.XenServer", "header": "['module', '___EOS___']", "index": 14 }, { "content": "\tdef __tupleContainsKey(tu,key):\n\t\tfor val in tu:\n\t\t\tif val[0] == key:\n\t\t\t\treturn True\n\t\treturn False", "metadata": "root.XenServer.__tupleContainsKey", "header": "['class', 'XenServer', '(', 'VTServer', ')', ':', '___EOS___']", "index": 29 }, { "content": "\tdef __addInterface(self,interface):\n\t\t\n\t\tif not isinstance(interface,NetworkInterface):\n\t\t\traise Exception(\"Cannot add an interface if is not a NetworkInterface object instance\")\t", "metadata": "root.XenServer.__addInterface", "header": "['class', 'XenServer', '(', 'VTServer', ')', ':', '___EOS___']", "index": 35 }, { "content": "\t@staticmethod\n\tdef constructor(name,osType,osDistribution,osVersion,nCPUs,CPUfreq,memory,size,agentUrl,agentPassword,save=True):\n\t\tself = XenServer()\n\t\treturn self.updateServer(name,osType,osDistribution,osVersion,nCPUs,CPUfreq,memory,size,agentUrl,agentPassword,save=True)", "metadata": "root.XenServer.constructor", "header": "['class', 'XenServer', '(', 'VTServer', ')', ':', '___EOS___']", "index": 41 }, { "content": "\tdef updateServer(self,name,osType,osDistribution,osVersion,nCPUs,CPUfreq,memory,size,agentUrl,agentPassword,save=True):\n\t\ttry:\n\t\t\tself.setName(name)\n\t\t\tself.setVirtTech(VirtTechClass.VIRT_TECH_TYPE_XEN)\n\t\t\tself.setOSType(osType)\n\t\t\tself.setOSDistribution(osDistribution)\n\t\t\tself.setOSVersion(osVersion)\n\t\t\tself.setNumberOfCPUs(nCPUs)\n\t\t\tself.setCPUFrequency(CPUfreq)\n\t\t\tself.setMemory(memory)\n\t\t\tself.setDiscSpaceGB(size)\n\t\t\tself.setAgentURL(agentUrl)\n\t\t\tself.setAgentPassword(agentPassword)\n\t\t\tself.doSave = save\n\t\t\tif save:\n\t\t\t\tself.save()\n\t\t\treturn self\n\t\texcept Exception as e:\n\t\t\tprint e\n\t\t\tself.destroy()\n\t\t\traise e", "metadata": "root.XenServer.updateServer", "header": "['class', 'XenServer', '(', 'VTServer', ')', ':', '___EOS___']", "index": 47 }, { "content": "\tdef destroy(self):\t\n\t\twith MutexStore.getObjectLock(self.getLockIdentifier()):\n\t\t\t#destroy interfaces\n\t\t\tfor inter in self.networkInterfaces.all():\n\t\t\t\tinter.destroy()\n\t\t\tself.delete()", "metadata": "root.XenServer.destroy", "header": "['class', 'XenServer', '(', 'VTServer', ')', ':', '___EOS___']", "index": 70 }, { "content": "\tdef getVMs(self,**kwargs):\n\t\treturn self.vms.filter(**kwargs)", "metadata": "root.XenServer.getVMs", "header": "['class', 'XenServer', '(', 'VTServer', ')', ':', '___EOS___']", "index": 79 }, { "content": "\tdef getVM(self,**kwargs):\n\t\treturn self.vms.get(kwargs)", "metadata": "root.XenServer.getVM", "header": "['class', 'XenServer', '(', 'VTServer', ')', ':', '___EOS___']", "index": 81 }, { "content": "\tdef createVM(self,name,uuid,projectId,projectName,sliceId,sliceName,osType,osVersion,osDist,memory,discSpaceGB,numberOfCPUs,callBackUrl,hdSetupType,hdOriginPath,virtSetupType,save=True):\n\t\twith MutexStore.getObjectLock(self.getLockIdentifier()):\n\t\t\t\n\t\t\tif XenVM.objects.filter(uuid=uuid).count() > 0:\n\t\t\t\traise Exception(\"Cannot create a Virtual Machine with the same UUID as an existing one\")\n\n\t\t\t#Allocate interfaces for the VM\n\t\t\tinterfaces = self.createEnslavedVMInterfaces()\n\t\t\t\n\t\t\t#Call factory\n\t\t\tvm = XenVM.create(name,uuid,projectId,projectName,sliceId,sliceName,osType,osVersion,osDist,memory,discSpaceGB,numberOfCPUs,callBackUrl,interfaces,hdSetupType,hdOriginPath,virtSetupType,save)\n\t\t\tself.vms.add(vm)\t\n\t\t\tself.autoSave()\n\t\t\treturn vm", "metadata": "root.XenServer.createVM", "header": "['class', 'XenServer', '(', 'VTServer', ')', ':', '___EOS___']", "index": 84 }, { "content": "\tdef deleteVM(self,vm):\n\t\twith MutexStore.getObjectLock(self.getLockIdentifier()):\t\n\t\t\tif vm not in self.vms.all():\n\t\t\t\traise Exception(\"Cannot delete a VM from pool if it is not already in\") \n\t\t\tself.vms.remove(vm)\n\t\t\t# Delete related db entry\n\t\t\tAction.objects.all().filter(objectUUID=vm.uuid).delete()\n\t\t\t# Keep actions table up-to-date after each deletion\n\t\t\t#vm_uuids = [ x.uuid for x in VirtualMachine.objects.all() ]\n\t\t\t#Action.objects.all().exclude(objectUUID__in = vm_uuids).delete()\n\t\t\tvm.destroy()\t\n\t\t\tself.autoSave()", "metadata": "root.XenServer.deleteVM", "header": "['class', 'XenServer', '(', 'VTServer', ')', ':', '___EOS___']", "index": 99 } ]
[ { "span": "from django.contrib import auth", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 31 }, { "span": "from threading import Lock", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 26 }, { "span": "import inspect ", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 14 }, { "span": "from vt_manager.models.VirtualMachine import VirtualMachine", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 59 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "import_", "auth_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "threading_", "import_", "Lock_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "inspect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "models_", "._", "VT", "Server_", "import_", "VT", "Server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "models_", "._", "Action_", "import_", "Action_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "models_", "._", "Virt", "ual", "Machine_", "import_", "Virt", "ual", "Machine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "models_", "._", "Xen", "VM_", "import_", "Xen", "VM_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "utils_", "._", "Mute", "x", "Store_", "import_", "Mute", "x", "Store_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "models_", "._", "utils_", "._", "Choices_", "import_", "Virt", "Te", "ch", "Class_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "validat", "e", "Agent", "URL", "wrapper_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "VT", "Server_", "._", "validat", "e", "Agent", "URL_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Xen", "Server_", "(_", "VT", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\"\"\"", "Virt", "uali", "zatio", "n", " ", "Server", " ", "class", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Meta", " ", "Class", " ", "for", " ", "your", " ", "model", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app", "\\u", "label_", "=_", "'", "vt", "\\u", "manage", "r", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "'''", " ", "VM", "s", " ", "array", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vms_", "=_", "models_", "._", "Many", "To", "Many", "Field_", "(_", "Xen", "VM_", ",_", "blank_", "=_", "True_", ",_", "null_", "=_", "False_", ",_", "editable_", "=_", "False_", ",_", "relate", "d\\u", "name_", "=_", "\"", "Server", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Stat", "s", " ", "of", " ", "memory", " ", "cpu", " ", "and", " ", "disk_", "\\u\\u\\uNL\\u\\u\\u_", "#", "TOD", "O", ":", " ", "Add", " ", "here", " ", "Many", "To", "Many", " ", "relation", " ", "to", " ", "statistic", "s", " ", "objects_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", "Priva", "te", " ", "methods_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "'''", "Constructor", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "'''", "Update", "r", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "'''", "Destr", "uct", "or", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "'''", " ", "Public", " ", "interface", " ", "method", "s", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Xen", "Server_", "(_", "VT", "Server_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "tuple", "Contain", "s", "Key_", "(_", "tu_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "for_", "val_", "in_", "tu_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "val_", "[_", "0_", "]_", "==_", "key_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Xen", "Server_", "(_", "VT", "Server_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "add", "Interface_", "(_", "self_", ",_", "interface_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "not_", "isinstance_", "(_", "interface_", ",_", "Network", "Interface_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "Exception_", "(_", "\"", "Cann", "ot", " ", "add", " ", "an", " ", "interface", " ", "if", " ", "is", " ", "not", " ", "a", " ", "Network", "Interface", " ", "object", " ", "instance", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Xen", "Server_", "(_", "VT", "Server_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "constructor_", "(_", "name_", ",_", "os", "Type_", ",_", "os", "Distribution_", ",_", "os", "Version_", ",_", "n", "CPU", "s_", ",_", "CPU", "freq_", ",_", "memory_", ",_", "size_", ",_", "agent", "Url_", ",_", "agent", "Password_", ",_", "save_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "self_", "=_", "Xen", "Server_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "update", "Server_", "(_", "name_", ",_", "os", "Type_", ",_", "os", "Distribution_", ",_", "os", "Version_", ",_", "n", "CPU", "s_", ",_", "CPU", "freq_", ",_", "memory_", ",_", "size_", ",_", "agent", "Url_", ",_", "agent", "Password_", ",_", "save_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Xen", "Server_", "(_", "VT", "Server_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "update", "Server_", "(_", "self_", ",_", "name_", ",_", "os", "Type_", ",_", "os", "Distribution_", ",_", "os", "Version_", ",_", "n", "CPU", "s_", ",_", "CPU", "freq_", ",_", "memory_", ",_", "size_", ",_", "agent", "Url_", ",_", "agent", "Password_", ",_", "save_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "set", "Name_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set", "Virt", "Te", "ch_", "(_", "Virt", "Te", "ch", "Class_", "._", "VIR", "T", "\\u", "TECH", "\\u", "TYPE", "\\u", "XE", "N_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set", "OST", "ype_", "(_", "os", "Type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set", "OS", "Distribution_", "(_", "os", "Distribution_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set", "OS", "Version_", "(_", "os", "Version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set", "Number", "Of", "CPU", "s_", "(_", "n", "CPU", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set", "CPU", "Frequency_", "(_", "CPU", "freq_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set", "Memory_", "(_", "memory_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set", "Disc", "Spac", "e", "GB", "_", "(_", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set", "Agent", "URL_", "(_", "agent", "Url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set", "Agent", "Password_", "(_", "agent", "Password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "do", "Save_", "=_", "save_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "save_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "self_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "print_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "destroy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Xen", "Server_", "(_", "VT", "Server_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "destroy_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "with_", "Mute", "x", "Store_", "._", "get", "Object", "Lock_", "(_", "self_", "._", "get", "Lock", "Identifier_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "destroy", " ", "interfaces_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "for_", "inter_", "in_", "self_", "._", "network", "Interface", "s_", "._", "all_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "inter_", "._", "destroy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Xen", "Server_", "(_", "VT", "Server_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "VM", "s_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "return_", "self_", "._", "vms_", "._", "filter_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Xen", "Server_", "(_", "VT", "Server_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "VM_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "return_", "self_", "._", "vms_", "._", "get_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Xen", "Server_", "(_", "VT", "Server_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "VM_", "(_", "self_", ",_", "name_", ",_", "uuid_", ",_", "project", "Id_", ",_", "project", "Name_", ",_", "slice", "Id_", ",_", "slice", "Name_", ",_", "os", "Type_", ",_", "os", "Version_", ",_", "os", "Dist_", ",_", "memory_", ",_", "disc", "Spac", "e", "GB", "_", ",_", "number", "Of", "CPU", "s_", ",_", "call", "Back", "Url_", ",_", "hd", "Set", "up", "Type_", ",_", "hd", "Orig", "in", "Path_", ",_", "virt", "Set", "up", "Type_", ",_", "save_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "with_", "Mute", "x", "Store_", "._", "get", "Object", "Lock_", "(_", "self_", "._", "get", "Lock", "Identifier_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "Xen", "VM_", "._", "objects_", "._", "filter_", "(_", "uuid_", "=_", "uuid_", ")_", "._", "count_", "(_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "raise_", "Exception_", "(_", "\"", "Cann", "ot", " ", "create", " ", "a", " ", "Virt", "ual", " ", "Machine", " ", "with", " ", "the", " ", "same", " ", "UU", "ID", " ", "as", " ", "an", " ", "exist", "ing", " ", "one", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Allocate", " ", "interface", "s", " ", "for", " ", "the", " ", "VM_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "interfaces_", "=_", "self_", "._", "create", "Ens", "lav", "ed", "VM", "Interface", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Call", " ", "factory_", "\\u\\u\\uNL\\u\\u\\u_", "vm_", "=_", "Xen", "VM_", "._", "create_", "(_", "name_", ",_", "uuid_", ",_", "project", "Id_", ",_", "project", "Name_", ",_", "slice", "Id_", ",_", "slice", "Name_", ",_", "os", "Type_", ",_", "os", "Version_", ",_", "os", "Dist_", ",_", "memory_", ",_", "disc", "Spac", "e", "GB", "_", ",_", "number", "Of", "CPU", "s_", ",_", "call", "Back", "Url_", ",_", "interfaces_", ",_", "hd", "Set", "up", "Type_", ",_", "hd", "Orig", "in", "Path_", ",_", "virt", "Set", "up", "Type_", ",_", "save_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "vms_", "._", "add_", "(_", "vm_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "auto", "Save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "vm_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Xen", "Server_", "(_", "VT", "Server_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "VM_", "(_", "self_", ",_", "vm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "with_", "Mute", "x", "Store_", "._", "get", "Object", "Lock_", "(_", "self_", "._", "get", "Lock", "Identifier_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "vm_", "not_", "in_", "self_", "._", "vms_", "._", "all_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "raise_", "Exception_", "(_", "\"", "Cann", "ot", " ", "delete", " ", "a", " ", "VM", " ", "from", " ", "pool", " ", "if", " ", "it", " ", "is", " ", "not", " ", "alr", "ead", "y", " ", "in", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "vms_", "._", "remove_", "(_", "vm_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Delete", " ", "relate", "d", " ", "db", " ", "entry_", "\\u\\u\\uNL\\u\\u\\u_", "Action_", "._", "objects_", "._", "all_", "(_", ")_", "._", "filter_", "(_", "object", "UUID_", "=_", "vm_", "._", "uuid_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Keep", " ", "action", "s", " ", "table", " ", "up", "-", "to", "-", "date", " ", "after", " ", "each", " ", "deletion_", "\\u\\u\\uNL\\u\\u\\u_", "#", "vm", "\\u", "uuids", " ", "=", " ", "[", " ", "x", ".", "uuid", " ", "for", " ", "x", " ", "in", " ", "Virt", "ual", "Machine", ".", "object", "s", ".", "all", "()", " ", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Action", ".", "object", "s", ".", "all", "()", ".", "exclu", "de", "(", "object", "UU", "ID", "\\u\\u", "in", " ", "=", " ", "vm", "\\u", "uuids", ").", "delete", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "vm_", "._", "destroy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "auto", "Save_", "(_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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(self, parent):\n # create some child rows\n test_values = {}\n inserts = []\n child_values = {}\n for i in range(0, self.num_iterations):\n row = ChildRow()\n row.assignKeyAttr(\"childId\", i)\n values = self.randomizeRow(row)\n values['test_key'] = row.test_key = \"first\"\n child_values[i] = values\n inserts.append(self.reflector.insertRow(row))\n row = None\n #del inserts\n d = defer.gatherResults(inserts)\n values = [None]\n\n def _loadObjects(_):\n d = self.reflector.loadObjectsFrom(childTableName, parentRow=parent)\n return d.addCallback(self.gotData)\n\n def _checkLoadObjects(_):\n self.failUnless(len(self.data) == self.num_iterations,\n \"no rows on query\")\n self.failUnless(len(parent.childRows) == self.num_iterations,\n \"did not load child rows: %d\" % len(parent.childRows))\n for child in parent.childRows:\n self.failUnless(rowMatches(child, child_values[child.childId]),\n \"child %d does not match\" % child.childId)\n\n def _checkLoadObjects2(_):\n self.failUnless(len(self.data) == self.num_iterations,\n \"no rows on query\")\n self.failUnless(len(parent.childRows) == self.num_iterations,\n \"child rows added twice!: %d\" % len(parent.childRows))\n\n def _changeParent(_):\n # now change the parent\n values[0] = self.randomizeRow(parent)\n return self.reflector.updateRow(parent)\n\n def _loadBack(_):\n # now load it back in\n whereClause = [(\"key_string\", EQUAL, \"first\")]\n d = self.reflector.loadObjectsFrom(tableName, whereClause=whereClause)\n return d.addCallback(self.gotData)\n\n def _checkLoadBack(_):\n # make sure it came back as what we saved\n self.failUnless(len(self.data) == 1, \"no row\")\n parent = self.data[0]\n self.failUnless(rowMatches(parent, values[0]), \"no match\")\n # save parent\n test_values[parent.key_string] = values[0]\n parent = None\n\n def _saveMoreTestRows(_):\n # save some more test rows\n ds = []\n for i in range(0, self.num_iterations):\n row = TestRow()\n row.assignKeyAttr(\"key_string\", \"bulk%d\"%i)\n test_values[row.key_string] = self.randomizeRow(row)\n ds.append(self.reflector.insertRow(row))\n return defer.gatherResults(ds)\n\n def _loadRowsBack(_):\n # now load them all back in\n d = self.reflector.loadObjectsFrom(\"testTable\")\n return d.addCallback(self.gotData)\n\n def _checkRowsBack(_):\n # make sure they are the same\n self.failUnless(len(self.data) == self.num_iterations + 1,\n \"query did not get rows\")\n for row in self.data:\n self.failUnless(rowMatches(row, test_values[row.key_string]),\n \"child %s does not match\" % row.key_string)\n\n def _changeRows(_):\n # now change them all\n ds = []\n for row in self.data:\n test_values[row.key_string] = self.randomizeRow(row)\n ds.append(self.reflector.updateRow(row))\n d = defer.gatherResults(ds)\n return d.addCallback(_cbChangeRows)\n\n def _cbChangeRows(_):\n self.data = None\n\n def _deleteRows(_):\n # now delete them\n ds = []\n for row in self.data:\n ds.append(self.reflector.deleteRow(row))\n d = defer.gatherResults(ds)\n return d.addCallback(_cbChangeRows)\n\n def _checkRowsDeleted(_):\n self.failUnless(len(self.data) == 0, \"rows were not deleted\")\n\n d.addCallback(_loadObjects)\n d.addCallback(_checkLoadObjects)\n d.addCallback(_loadObjects)\n d.addCallback(_checkLoadObjects2)\n d.addCallback(_changeParent)\n d.addCallback(_loadBack)\n d.addCallback(_checkLoadBack)\n d.addCallback(_saveMoreTestRows)\n d.addCallback(_loadRowsBack)\n d.addCallback(_checkRowsBack)\n d.addCallback(_changeRows)\n d.addCallback(_loadRowsBack)\n d.addCallback(_checkRowsBack)\n d.addCallback(_deleteRows)\n d.addCallback(_loadRowsBack)\n d.addCallback(_checkRowsDeleted)\n return d", "metadata": "root.ReflectorTestBase._cbTestReflector", "header": "['class', 'ReflectorTestBase', ':', '___EOS___']", "index": 176 }, { "content": " def test_saveAndDelete(self):\n \"\"\"\n Create a row and then try to delete it.\n \"\"\"\n # create one row to work with\n row = TestRow()\n row.assignKeyAttr(\"key_string\", \"first\")\n values = self.randomizeRow(row)\n # save it\n d = self.reflector.insertRow(row)\n def _deleteRow(_):\n # delete it\n return self.reflector.deleteRow(row)\n d.addCallback(_deleteRow)\n return d", "metadata": "root.ReflectorTestBase.test_saveAndDelete", "header": "['class', 'ReflectorTestBase', ':', '___EOS___']", "index": 297 } ]
[ { "span": "parent ", "start_line": 230, "start_column": 12, "end_line": 230, "end_column": 18 }, { "span": "values ", "start_line": 304, "start_column": 8, "end_line": 304, "end_column": 14 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Reflect", "or", "Test", "Base_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "cb", "Test", "Reflect", "or_", "(_", "self_", ",_", "parent_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "create", " ", "some", " ", "child", " ", "rows_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "values_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inserts", "_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "child", "\\u", "values_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "0_", ",_", "self_", "._", "num", "\\u", "iterations_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "row_", "=_", "Chil", "d", "Row_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row_", "._", "assign", "Key", "Attr_", "(_", "\"", "child", "Id", "\"_", ",_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "=_", "self_", "._", "randomize", "Row_", "(_", "row_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "[_", "'", "test\\u", "key", "'_", "]_", "=_", "row_", "._", "test\\u", "key_", "=_", "\"", "first", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "child", "\\u", "values_", "[_", "i_", "]_", "=_", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inserts", "_", "._", "append_", "(_", "self_", "._", "reflect", "or_", "._", "insert", "Row_", "(_", "row_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "del", " ", "inserts", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "defer_", "._", "gather", "Results_", "(_", "inserts", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "=_", "[_", "None_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "load", "Objects_", "(_", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "reflect", "or_", "._", "load", "Object", "s", "From_", "(_", "child", "Table", "Name_", ",_", "parent", "Row_", "=_", "parent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "got", "Data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "check", "Load", "Objects_", "(_", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail", "Unless_", "(_", "len_", "(_", "self_", "._", "data_", ")_", "==_", "self_", "._", "num", "\\u", "iterations_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "no", " ", "rows", " ", "on", " ", "query", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "len_", "(_", "parent_", "._", "child", "Rows_", ")_", "==_", "self_", "._", "num", "\\u", "iterations_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "did", " ", "not", " ", "load", " ", "child", " ", "rows", ":", " ", "%", "d", "\"_", "%_", "len_", "(_", "parent_", "._", "child", "Rows_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "child_", "in_", "parent_", "._", "child", "Rows_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail", "Unless_", "(_", "row", "Matches_", "(_", "child_", ",_", "child", "\\u", "values_", "[_", "child_", "._", "child", "Id_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "child", " ", "%", "d", " ", "doe", "s", " ", "not", " ", "match", "\"_", "%_", "child_", "._", "child", "Id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "check", "Load", "Object", "s2_", "(_", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail", "Unless_", "(_", "len_", "(_", "self_", "._", "data_", ")_", "==_", "self_", "._", "num", "\\u", "iterations_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "no", " ", "rows", " ", "on", " ", "query", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "len_", "(_", "parent_", "._", "child", "Rows_", ")_", "==_", "self_", "._", "num", "\\u", "iterations_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "child", " ", "rows", " ", "adde", "d", " ", "twi", "ce", "!", ":", " ", "%", "d", "\"_", "%_", "len_", "(_", "parent_", "._", "child", "Rows_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "change", "Parent_", "(_", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "now", " ", "change", " ", "the", " ", "parent_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values_", "[_", "0_", "]_", "=_", "self_", "._", "randomize", "Row_", "(_", "parent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "reflect", "or_", "._", "update", "Row_", "(_", "parent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "load", "Back_", "(_", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "now", " ", "load", " ", "it", " ", "back", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "where", "Clause_", "=_", "[_", "(_", "\"", "key", "\\u", "string", "\"_", ",_", "EQUAL", "_", ",_", "\"", "first", "\"_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "self_", "._", "reflect", "or_", "._", "load", "Object", "s", "From_", "(_", "table", "Name_", ",_", "where", "Clause_", "=_", "where", "Clause_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "got", "Data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "check", "Load", "Back_", "(_", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "it", " ", "came", " ", "back", " ", "as", " ", "what", " ", "we", " ", "saved_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail", "Unless_", "(_", "len_", "(_", "self_", "._", "data_", ")_", "==_", "1_", ",_", "\"", "no", " ", "row", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parent_", "=_", "self_", "._", "data_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Unless_", "(_", "row", "Matches_", "(_", "parent_", ",_", "values_", "[_", "0_", "]_", ")_", ",_", "\"", "no", " ", "match", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "save", " ", "parent_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "values_", "[_", "parent_", "._", "key", "\\u", "string_", "]_", "=_", "values_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parent_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "save", "Mor", "e", "Test", "Rows_", "(_", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "save", " ", "some", " ", "more", " ", "test", " ", "rows_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ds_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "0_", ",_", "self_", "._", "num", "\\u", "iterations_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "row_", "=_", "Test", "Row_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row_", "._", "assign", "Key", "Attr_", "(_", "\"", "key", "\\u", "string", "\"_", ",_", "\"", "bul", "k", "%", "d", "\"_", "%_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "values_", "[_", "row_", "._", "key", "\\u", "string_", "]_", "=_", "self_", "._", "randomize", "Row_", "(_", "row_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ds_", "._", "append_", "(_", "self_", "._", "reflect", "or_", "._", "insert", "Row_", "(_", "row_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "defer_", "._", "gather", "Results_", "(_", "ds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "load", "Row", "s", "Back_", "(_", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "now", " ", "load", " ", "them", " ", "all", " ", "back", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "self_", "._", "reflect", "or_", "._", "load", "Object", "s", "From_", "(_", "\"", "test", "Table", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "add", "Callback_", "(_", "self_", "._", "got", "Data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "check", "Row", "s", "Back_", "(_", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "the", "y", " ", "are", " ", "the", " ", "same_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail", "Unless_", "(_", "len_", "(_", "self_", "._", "data_", ")_", "==_", "self_", "._", "num", "\\u", "iterations_", "+_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "query", " ", "did", " ", "not", " ", "get", " ", "rows", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "self_", "._", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail", "Unless_", "(_", "row", "Matches_", "(_", "row_", ",_", "test\\u", "values_", "[_", "row_", "._", "key", "\\u", "string_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "child", " ", "%", "s", " ", "doe", "s", " ", "not", " ", "match", "\"_", "%_", "row_", "._", "key", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "change", "Rows_", "(_", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "now", " ", "change", " ", "them", " ", "all_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ds_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "self_", "._", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "values_", "[_", "row_", "._", "key", "\\u", "string_", "]_", "=_", "self_", "._", "randomize", "Row_", "(_", "row_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ds_", "._", "append_", "(_", "self_", "._", "reflect", "or_", "._", "update", "Row_", "(_", "row_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "defer_", "._", "gather", "Results_", "(_", "ds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "add", "Callback_", "(_", "\\u", "cb", "Change", "Rows_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "cb", "Change", "Rows_", "(_", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "data_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "delete", "Rows_", "(_", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "now", " ", "delete", " ", "them", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ds_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "self_", "._", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ds_", "._", "append_", "(_", "self_", "._", "reflect", "or_", "._", "delete", "Row_", "(_", "row_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "defer_", "._", "gather", "Results_", "(_", "ds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "add", "Callback_", "(_", "\\u", "cb", "Change", "Rows_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "check", "Row", "s", "Delete", "d_", "(_", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail", "Unless_", "(_", "len_", "(_", "self_", "._", "data_", ")_", "==_", "0_", ",_", "\"", "rows", " ", "wer", "e", " ", "not", " ", "delete", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "\\u", "load", "Objects_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "\\u", "check", "Load", "Objects_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "\\u", "load", "Objects_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "\\u", "check", "Load", "Object", "s2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "\\u", "change", "Parent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "\\u", "load", "Back_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "\\u", "check", "Load", "Back_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "\\u", "save", "Mor", "e", "Test", "Rows_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "\\u", "load", "Row", "s", "Back_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "\\u", "check", "Row", "s", "Back_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "\\u", "change", "Rows_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "\\u", "load", "Row", "s", "Back_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "\\u", "check", "Row", "s", "Back_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "\\u", "delete", "Rows_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "\\u", "load", "Row", "s", "Back_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "\\u", "check", "Row", "s", "Delete", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Reflect", "or", "Test", "Base_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "save", "And", "Delete_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Creat", "e", " ", "a", " ", "row", " ", "and", " ", "then", " ", "try", " ", "to", " ", "delete", " ", "it", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "create", " ", "one", " ", "row", " ", "to", " ", "work", " ", "with_", "\\u\\u\\uNL\\u\\u\\u_", "row_", "=_", "Test", "Row_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row_", "._", "assign", "Key", "Attr_", "(_", "\"", "key", "\\u", "string", "\"_", ",_", "\"", "first", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "=_", "self_", "._", "randomize", "Row_", "(_", "row_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "save", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "=_", "self_", "._", "reflect", "or_", "._", "insert", "Row_", "(_", "row_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "delete", "Row_", "(_", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "delete", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "reflect", "or_", "._", "delete", "Row_", "(_", "row_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "._", "add", "Callback_", "(_", "\\u", "delete", "Row_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
ImageEngine/gaffer/python/GafferUI/__init__.py
[ { "content": "##########################################################################\n#\n# Copyright (c) 2011-2012, John Haddon. All rights reserved.\n# Copyright (c) 2011-2015, Image Engine Design Inc. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are\n# met:\n#\n# * Redistributions of source code must retain the above\n# copyright notice, this list of conditions and the following\n# disclaimer.\n#\n# * Redistributions in binary form must reproduce the above\n# copyright notice, this list of conditions and the following\n# disclaimer in the documentation and/or other materials provided with\n# the distribution.\n#\n# * Neither the name of John Haddon nor the names of\n# any other contributors to this software may be used to endorse or\n# promote products derived from this software without specific prior\n# written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\n# IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\n# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#\n##########################################################################\n\n# Work around a bug which causes segfaults if uuid is imported after\n# PyQt. See here for details :\n#\n# https://bugs.gentoo.org/show_bug.cgi?id=317557\n# http://www.riverbankcomputing.com/pipermail/pyqt/2010-December/028773.html\n#\n# Using __import__ rather than import so that we don't pollute the GafferUI\n# namespace.\n__import__( \"uuid\" )\n\n##########################################################################\n# Function to import a module from the qt bindings. This must be used\n# rather than importing the module directly. This allows us to support\n# the use of both PyQt and PySide.\n##########################################################################\n\n__qtModuleName = None\n\n##########################################################################\n# Function to return the C++ address of a wrapped Qt object. This can\n# be useful if needing to implement part of the UI in C++ and the rest\n# in Python.\n##########################################################################\n\n\n##########################################################################\n# Function to return a wrapped Qt object from the given C++ address.\n# This can be useful if needing to implement part of the UI in C++ and\n# the rest in Python.\n##########################################################################\n\n\n##########################################################################\n# now import our actual functionality\n##########################################################################\n\n# Import modules that must be imported before _GafferUI, using __import__\n# to avoid polluting the GafferUI namespace.\n__import__( \"IECore\" )\n__import__( \"Gaffer\" )\n\nfrom _GafferUI import *\n\n# general ui stuff first\n\nfrom Enums import *\nfrom Widget import Widget\nfrom LazyMethod import LazyMethod\nfrom Menu import Menu\nfrom ContainerWidget import ContainerWidget\nfrom Window import Window\nfrom SplitContainer import SplitContainer\nfrom ListContainer import ListContainer\nfrom GridContainer import GridContainer\nfrom MenuBar import MenuBar\nfrom EventLoop import EventLoop\nfrom TabbedContainer import TabbedContainer\nfrom TextWidget import TextWidget\nfrom NumericWidget import NumericWidget\nfrom Button import Button\nfrom MultiLineTextWidget import MultiLineTextWidget\nfrom Label import Label\nfrom GLWidget import GLWidget\nfrom ScrolledContainer import ScrolledContainer\nfrom PathWidget import PathWidget\nfrom PathListingWidget import PathListingWidget\nfrom PathChooserWidget import PathChooserWidget\nfrom Dialogue import Dialogue\nfrom PathChooserDialogue import PathChooserDialogue\nfrom TextInputDialogue import TextInputDialogue\nfrom Collapsible import Collapsible\nfrom ColorSwatch import ColorSwatch\nfrom Slider import Slider\nfrom ShowURL import showURL\nfrom Spacer import Spacer\nfrom BoolWidget import BoolWidget, CheckBox\nfrom Image import Image\nfrom ErrorDialogue import ErrorDialogue\nfrom _Variant import _Variant\nfrom VectorDataWidget import VectorDataWidget\nfrom PathVectorDataWidget import PathVectorDataWidget\nfrom ProgressBar import ProgressBar\nfrom SelectionMenu import SelectionMenu\nfrom PathFilterWidget import PathFilterWidget\nfrom CompoundPathFilterWidget import CompoundPathFilterWidget\nfrom InfoPathFilterWidget import InfoPathFilterWidget\nfrom MatchPatternPathFilterWidget import MatchPatternPathFilterWidget\nfrom FileSequencePathFilterWidget import FileSequencePathFilterWidget\nfrom BusyWidget import BusyWidget\nfrom NumericSlider import NumericSlider\nfrom ColorChooser import ColorChooser\nfrom ColorChooserDialogue import ColorChooserDialogue\nfrom MessageWidget import MessageWidget\nfrom NotificationMessageHandler import NotificationMessageHandler\nfrom MenuButton import MenuButton\nfrom MultiSelectionMenu import MultiSelectionMenu\nfrom PopupWindow import PopupWindow\nfrom ConfirmationDialogue import ConfirmationDialogue\nfrom DisplayTransform import DisplayTransform\nfrom Divider import Divider\nimport _Pointer\nfrom SplineWidget import SplineWidget\nfrom Bookmarks import Bookmarks\n\n# then all the PathPreviewWidgets. note that the order\n# of import controls the order of display.\n\nfrom PathPreviewWidget import PathPreviewWidget\nfrom CompoundPathPreview import CompoundPathPreview\nfrom DeferredPathPreview import DeferredPathPreview\nfrom InfoPathPreview import InfoPathPreview\nfrom HeaderPathPreview import HeaderPathPreview\nfrom DataPathPreview import DataPathPreview\n\n# then stuff specific to graph uis\n\nfrom PlugValueWidget import PlugValueWidget\nfrom StringPlugValueWidget import StringPlugValueWidget\nfrom NumericPlugValueWidget import NumericPlugValueWidget\nfrom BoolPlugValueWidget import BoolPlugValueWidget\nfrom PathPlugValueWidget import PathPlugValueWidget\nfrom FileSystemPathPlugValueWidget import FileSystemPathPlugValueWidget\nfrom VectorDataPlugValueWidget import VectorDataPlugValueWidget\nfrom PathVectorDataPlugValueWidget import PathVectorDataPlugValueWidget\nfrom PlugWidget import PlugWidget\nfrom PlugLayout import PlugLayout\nfrom EditorWidget import EditorWidget\nfrom ScriptEditor import ScriptEditor\nfrom GadgetWidget import GadgetWidget\nfrom NodeGraph import NodeGraph\nfrom ScriptWindow import ScriptWindow\nfrom CompoundEditor import CompoundEditor\nfrom NameWidget import NameWidget\nfrom NameLabel import NameLabel\nfrom NodeSetEditor import NodeSetEditor\nfrom NodeEditor import NodeEditor\nfrom Layouts import Layouts\nfrom NodeMenu import NodeMenu\nimport FileMenu\nimport LayoutMenu\nimport EditMenu\nimport UserPlugs\nfrom Frame import Frame\nfrom CompoundNumericPlugValueWidget import CompoundNumericPlugValueWidget\nfrom BoxPlugValueWidget import BoxPlugValueWidget\nfrom NodeUI import NodeUI\nfrom StandardNodeUI import StandardNodeUI\nfrom NodeToolbar import NodeToolbar\nfrom StandardNodeToolbar import StandardNodeToolbar\nfrom Viewer import Viewer\nfrom ColorSwatchPlugValueWidget import ColorSwatchPlugValueWidget\nfrom ColorPlugValueWidget import ColorPlugValueWidget\nfrom AboutWindow import AboutWindow\nimport ApplicationMenu\nfrom BrowserEditor import BrowserEditor\nfrom Timeline import Timeline\nfrom MultiLineStringPlugValueWidget import MultiLineStringPlugValueWidget\nfrom CompoundPlugValueWidget import CompoundPlugValueWidget\nfrom EnumPlugValueWidget import EnumPlugValueWidget\nfrom PresetsPlugValueWidget import PresetsPlugValueWidget\nfrom GraphComponentBrowserMode import GraphComponentBrowserMode\nfrom ToolPlugValueWidget import ToolPlugValueWidget\nfrom LabelPlugValueWidget import LabelPlugValueWidget\nfrom CompoundDataPlugValueWidget import CompoundDataPlugValueWidget\nfrom LayoutPlugValueWidget import LayoutPlugValueWidget\nimport ScriptNodeUI\nfrom IncrementingPlugValueWidget import IncrementingPlugValueWidget\nimport PreferencesUI\nfrom SplinePlugValueWidget import SplinePlugValueWidget\nfrom RampPlugValueWidget import RampPlugValueWidget\nfrom NodeFinderDialogue import NodeFinderDialogue\nfrom ConnectionPlugValueWidget import ConnectionPlugValueWidget\nimport View3DToolbar\nimport ViewUI\nfrom Playback import Playback\nfrom UIEditor import UIEditor\nimport GraphBookmarksUI\nimport DocumentationAlgo\n\n# and then specific node uis\n\nimport DependencyNodeUI\nimport ComputeNodeUI\nimport RandomUI\nimport ExpressionUI\nimport BoxUI\nimport ReferenceUI\nimport BackdropUI\nimport DotUI\nimport SubGraphUI\nimport SwitchUI\nimport ContextVariablesUI\nimport TimeWarpUI\nimport LoopUI\nimport AnimationUI\n\n# backwards compatibility\n## \\todo Remove me\nMetadata = __import__( \"Gaffer\" ).Metadata\n\n__import__( \"IECore\" ).loadConfig( \"GAFFER_STARTUP_PATHS\", {}, subdirectory = \"GafferUI\" )\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def _qtImport( name, lazy=False ) :\n\n\t# decide which qt bindings to use, and apply any fix-ups we need\n\t# to shield us from PyQt/PySide differences.\n\tglobal __qtModuleName\n\tif __qtModuleName is None :\n\t\timport os\n\t\tif \"GAFFERUI_QT_BINDINGS\" in os.environ :\n\t\t\t__qtModuleName = os.environ[\"GAFFERUI_QT_BINDINGS\"]\n\t\telse :\n\t\t\t# no preference stated via environment - see what we shipped with\n\t\t\tif os.path.exists( os.environ[\"GAFFER_ROOT\"] + \"/python/PySide\" ) :\n\t\t\t\t__qtModuleName = \"PySide\"\n\t\t\telse :\n\t\t\t\t__qtModuleName = \"PyQt4\"\n\n\t\t# PyQt unfortunately uses an implementation-specific\n\t\t# naming scheme for its new-style signal and slot classes.\n\t\t# We use this to make it compatible with PySide, according to :\n\t\t#\n\t\t# http://qt-project.org/wiki/Differences_Between_PySide_and_PyQt\n\t\tif \"PyQt\" in __qtModuleName :\n\t\t\tQtCore = __import__( __qtModuleName + \".QtCore\" ).QtCore\n\t\t\tQtCore.Signal = QtCore.pyqtSignal\n\n\t# import the submodule from those bindings and return it\n\tif lazy :\n\t\timport Gaffer\n\t\treturn Gaffer.lazyImport( __qtModuleName + \".\" + name )\n\telse :\n\t\tqtModule = __import__( __qtModuleName + \".\" + name )\n\t\treturn getattr( qtModule, name )", "metadata": "root._qtImport", "header": "['module', '___EOS___']", "index": 54 }, { "content": "def _qtAddress( o ) :\n\n\tglobal __qtModuleName\n\tif \"PyQt\" in __qtModuleName :\n\t\timport sip\n\t\treturn sip.unwrapinstance( o )\n\telse :\n\t\timport shiboken\n\t\treturn shiboken.getCppPointer( o )[0]", "metadata": "root._qtAddress", "header": "['module', '___EOS___']", "index": 93 }, { "content": "def _qtObject( address, type ) :\n\n\tglobal __qtModuleName\n\tif \"PyQt\" in __qtModuleName :\n\t\timport sip\n\t\treturn sip.wrapinstance( address, type )\n\telse :\n\t\timport shiboken\n\t\treturn shiboken.wrapInstance( address, type )", "metadata": "root._qtObject", "header": "['module', '___EOS___']", "index": 109 } ]
[ { "span": "from Widget import Widget", "start_line": 133, "start_column": 0, "end_line": 133, "end_column": 25 }, { "span": "from LazyMethod import LazyMethod", "start_line": 134, "start_column": 0, "end_line": 134, "end_column": 33 }, { "span": "from Menu import Menu", "start_line": 135, "start_column": 0, "end_line": 135, "end_column": 21 }, { "span": "from ContainerWidget import ContainerWidget", "start_line": 136, "start_column": 0, "end_line": 136, "end_column": 43 }, { "span": "from Window import Window", "start_line": 137, "start_column": 0, "end_line": 137, "end_column": 25 }, { "span": "from SplitContainer import SplitContainer", "start_line": 138, "start_column": 0, "end_line": 138, "end_column": 41 }, { "span": "from ListContainer import ListContainer", "start_line": 139, "start_column": 0, "end_line": 139, "end_column": 39 }, { "span": "from GridContainer import GridContainer", "start_line": 140, "start_column": 0, "end_line": 140, "end_column": 39 }, { "span": "from MenuBar import MenuBar", "start_line": 141, "start_column": 0, "end_line": 141, "end_column": 27 }, { "span": "from EventLoop import EventLoop", "start_line": 142, "start_column": 0, "end_line": 142, "end_column": 31 }, { "span": "from TabbedContainer import TabbedContainer", "start_line": 143, "start_column": 0, "end_line": 143, "end_column": 43 }, { "span": "from TextWidget import TextWidget", "start_line": 144, "start_column": 0, "end_line": 144, "end_column": 33 }, { "span": "from NumericWidget import NumericWidget", "start_line": 145, "start_column": 0, "end_line": 145, "end_column": 39 }, { "span": "from Button import Button", "start_line": 146, "start_column": 0, "end_line": 146, "end_column": 25 }, { "span": "from MultiLineTextWidget import MultiLineTextWidget", "start_line": 147, "start_column": 0, "end_line": 147, "end_column": 51 }, { "span": "from Label import Label", "start_line": 148, "start_column": 0, "end_line": 148, "end_column": 23 }, { "span": "from GLWidget import GLWidget", "start_line": 149, "start_column": 0, "end_line": 149, "end_column": 29 }, { "span": "from ScrolledContainer import ScrolledContainer", "start_line": 150, "start_column": 0, "end_line": 150, "end_column": 47 }, { "span": "from PathWidget import PathWidget", "start_line": 151, "start_column": 0, "end_line": 151, "end_column": 33 }, { "span": "from PathListingWidget import PathListingWidget", "start_line": 152, "start_column": 0, "end_line": 152, "end_column": 47 }, { "span": "from PathChooserWidget import PathChooserWidget", "start_line": 153, "start_column": 0, "end_line": 153, "end_column": 47 }, { "span": "from Dialogue import Dialogue", "start_line": 154, "start_column": 0, "end_line": 154, "end_column": 29 }, { "span": "from PathChooserDialogue import PathChooserDialogue", "start_line": 155, "start_column": 0, "end_line": 155, "end_column": 51 }, { "span": "from TextInputDialogue import TextInputDialogue", "start_line": 156, "start_column": 0, "end_line": 156, "end_column": 47 }, { "span": "from Collapsible import Collapsible", "start_line": 157, "start_column": 0, "end_line": 157, "end_column": 35 }, { "span": "from ColorSwatch import ColorSwatch", "start_line": 158, "start_column": 0, "end_line": 158, "end_column": 35 }, { "span": "from Slider import Slider", "start_line": 159, "start_column": 0, "end_line": 159, "end_column": 25 }, { "span": "from ShowURL import showURL", "start_line": 160, "start_column": 0, "end_line": 160, "end_column": 27 }, { "span": "from Spacer import Spacer", "start_line": 161, "start_column": 0, "end_line": 161, "end_column": 25 }, { "span": "from BoolWidget import BoolWidget, CheckBox", "start_line": 162, "start_column": 0, "end_line": 162, "end_column": 43 }, { "span": "from Image import Image", "start_line": 163, "start_column": 0, "end_line": 163, "end_column": 23 }, { "span": "from ErrorDialogue import ErrorDialogue", "start_line": 164, "start_column": 0, "end_line": 164, "end_column": 39 }, { "span": "from _Variant import _Variant", "start_line": 165, "start_column": 0, "end_line": 165, "end_column": 29 }, { "span": "from VectorDataWidget import VectorDataWidget", "start_line": 166, "start_column": 0, "end_line": 166, "end_column": 45 }, { "span": "from PathVectorDataWidget import PathVectorDataWidget", "start_line": 167, "start_column": 0, "end_line": 167, "end_column": 53 }, { "span": "from ProgressBar import ProgressBar", "start_line": 168, "start_column": 0, "end_line": 168, "end_column": 35 }, { "span": "from SelectionMenu import SelectionMenu", "start_line": 169, "start_column": 0, "end_line": 169, "end_column": 39 }, { "span": "from PathFilterWidget import PathFilterWidget", "start_line": 170, "start_column": 0, "end_line": 170, "end_column": 45 }, { "span": "from CompoundPathFilterWidget import CompoundPathFilterWidget", "start_line": 171, "start_column": 0, "end_line": 171, "end_column": 61 }, { "span": "from InfoPathFilterWidget import InfoPathFilterWidget", "start_line": 172, "start_column": 0, "end_line": 172, "end_column": 53 }, { "span": "from MatchPatternPathFilterWidget import MatchPatternPathFilterWidget", "start_line": 173, "start_column": 0, "end_line": 173, "end_column": 69 }, { "span": "from FileSequencePathFilterWidget import FileSequencePathFilterWidget", "start_line": 174, "start_column": 0, "end_line": 174, "end_column": 69 }, { "span": "from BusyWidget import BusyWidget", "start_line": 175, "start_column": 0, "end_line": 175, "end_column": 33 }, { "span": "from NumericSlider import NumericSlider", "start_line": 176, "start_column": 0, "end_line": 176, "end_column": 39 }, { "span": "from ColorChooser import ColorChooser", "start_line": 177, "start_column": 0, "end_line": 177, "end_column": 37 }, { "span": "from ColorChooserDialogue import ColorChooserDialogue", "start_line": 178, "start_column": 0, "end_line": 178, "end_column": 53 }, { "span": "from MessageWidget import MessageWidget", "start_line": 179, "start_column": 0, "end_line": 179, "end_column": 39 }, { "span": "from NotificationMessageHandler import NotificationMessageHandler", "start_line": 180, "start_column": 0, "end_line": 180, "end_column": 65 }, { "span": "from MenuButton import MenuButton", "start_line": 181, "start_column": 0, "end_line": 181, "end_column": 33 }, { "span": "from MultiSelectionMenu import MultiSelectionMenu", "start_line": 182, "start_column": 0, "end_line": 182, "end_column": 49 }, { "span": "from PopupWindow import PopupWindow", "start_line": 183, "start_column": 0, "end_line": 183, "end_column": 35 }, { "span": "from ConfirmationDialogue import ConfirmationDialogue", "start_line": 184, "start_column": 0, "end_line": 184, "end_column": 53 }, { "span": "from DisplayTransform import DisplayTransform", "start_line": 185, "start_column": 0, "end_line": 185, "end_column": 45 }, { "span": "from Divider import Divider", "start_line": 186, "start_column": 0, "end_line": 186, "end_column": 27 }, { "span": "import _Pointer", "start_line": 187, "start_column": 0, "end_line": 187, "end_column": 15 }, { "span": "from SplineWidget import SplineWidget", "start_line": 188, "start_column": 0, "end_line": 188, "end_column": 37 }, { "span": "from Bookmarks import Bookmarks", "start_line": 189, "start_column": 0, "end_line": 189, "end_column": 31 }, { "span": "from PathPreviewWidget import PathPreviewWidget", "start_line": 194, "start_column": 0, "end_line": 194, "end_column": 47 }, { "span": "from CompoundPathPreview import CompoundPathPreview", "start_line": 195, "start_column": 0, "end_line": 195, "end_column": 51 }, { "span": "from DeferredPathPreview import DeferredPathPreview", "start_line": 196, "start_column": 0, "end_line": 196, "end_column": 51 }, { "span": "from InfoPathPreview import InfoPathPreview", "start_line": 197, "start_column": 0, "end_line": 197, "end_column": 43 }, { "span": "from HeaderPathPreview import HeaderPathPreview", "start_line": 198, "start_column": 0, "end_line": 198, "end_column": 47 }, { "span": "from DataPathPreview import DataPathPreview", "start_line": 199, "start_column": 0, "end_line": 199, "end_column": 43 }, { "span": "from PlugValueWidget import PlugValueWidget", "start_line": 203, "start_column": 0, "end_line": 203, "end_column": 43 }, { "span": "from StringPlugValueWidget import StringPlugValueWidget", "start_line": 204, "start_column": 0, "end_line": 204, "end_column": 55 }, { "span": "from NumericPlugValueWidget import NumericPlugValueWidget", "start_line": 205, "start_column": 0, "end_line": 205, "end_column": 57 }, { "span": "from BoolPlugValueWidget import BoolPlugValueWidget", "start_line": 206, "start_column": 0, "end_line": 206, "end_column": 51 }, { "span": "from PathPlugValueWidget import PathPlugValueWidget", "start_line": 207, "start_column": 0, "end_line": 207, "end_column": 51 }, { "span": "from FileSystemPathPlugValueWidget import FileSystemPathPlugValueWidget", "start_line": 208, "start_column": 0, "end_line": 208, "end_column": 71 }, { "span": "from VectorDataPlugValueWidget import VectorDataPlugValueWidget", "start_line": 209, "start_column": 0, "end_line": 209, "end_column": 63 }, { "span": "from PathVectorDataPlugValueWidget import PathVectorDataPlugValueWidget", "start_line": 210, "start_column": 0, "end_line": 210, "end_column": 71 }, { "span": "from PlugWidget import PlugWidget", "start_line": 211, "start_column": 0, "end_line": 211, "end_column": 33 }, { "span": "from PlugLayout import PlugLayout", "start_line": 212, "start_column": 0, "end_line": 212, "end_column": 33 }, { "span": "from EditorWidget import EditorWidget", "start_line": 213, "start_column": 0, "end_line": 213, "end_column": 37 }, { "span": "from ScriptEditor import ScriptEditor", "start_line": 214, "start_column": 0, "end_line": 214, "end_column": 37 }, { "span": "from GadgetWidget import GadgetWidget", "start_line": 215, "start_column": 0, "end_line": 215, "end_column": 37 }, { "span": "from NodeGraph import NodeGraph", "start_line": 216, "start_column": 0, "end_line": 216, "end_column": 31 }, { "span": "from ScriptWindow import ScriptWindow", "start_line": 217, "start_column": 0, "end_line": 217, "end_column": 37 }, { "span": "from CompoundEditor import CompoundEditor", "start_line": 218, "start_column": 0, "end_line": 218, "end_column": 41 }, { "span": "from NameWidget import NameWidget", "start_line": 219, "start_column": 0, "end_line": 219, "end_column": 33 }, { "span": "from NameLabel import NameLabel", "start_line": 220, "start_column": 0, "end_line": 220, "end_column": 31 }, { "span": "from NodeSetEditor import NodeSetEditor", "start_line": 221, "start_column": 0, "end_line": 221, "end_column": 39 }, { "span": "from NodeEditor import NodeEditor", "start_line": 222, "start_column": 0, "end_line": 222, "end_column": 33 }, { "span": "from Layouts import Layouts", "start_line": 223, "start_column": 0, "end_line": 223, "end_column": 27 }, { "span": "from NodeMenu import NodeMenu", "start_line": 224, "start_column": 0, "end_line": 224, "end_column": 29 }, { "span": "import FileMenu", "start_line": 225, "start_column": 0, "end_line": 225, "end_column": 15 }, { "span": "import LayoutMenu", "start_line": 226, "start_column": 0, "end_line": 226, "end_column": 17 }, { "span": "import EditMenu", "start_line": 227, "start_column": 0, "end_line": 227, "end_column": 15 }, { "span": "import UserPlugs", "start_line": 228, "start_column": 0, "end_line": 228, "end_column": 16 }, { "span": "from Frame import Frame", "start_line": 229, "start_column": 0, "end_line": 229, "end_column": 23 }, { "span": "from CompoundNumericPlugValueWidget import CompoundNumericPlugValueWidget", "start_line": 230, "start_column": 0, "end_line": 230, "end_column": 73 }, { "span": "from BoxPlugValueWidget import BoxPlugValueWidget", "start_line": 231, "start_column": 0, "end_line": 231, "end_column": 49 }, { "span": "from NodeUI import NodeUI", "start_line": 232, "start_column": 0, "end_line": 232, "end_column": 25 }, { "span": "from StandardNodeUI import StandardNodeUI", "start_line": 233, "start_column": 0, "end_line": 233, "end_column": 41 }, { "span": "from NodeToolbar import NodeToolbar", "start_line": 234, "start_column": 0, "end_line": 234, "end_column": 35 }, { "span": "from StandardNodeToolbar import StandardNodeToolbar", "start_line": 235, "start_column": 0, "end_line": 235, "end_column": 51 }, { "span": "from Viewer import Viewer", "start_line": 236, "start_column": 0, "end_line": 236, "end_column": 25 }, { "span": "from ColorSwatchPlugValueWidget import ColorSwatchPlugValueWidget", "start_line": 237, "start_column": 0, "end_line": 237, "end_column": 65 }, { "span": "from ColorPlugValueWidget import ColorPlugValueWidget", "start_line": 238, "start_column": 0, "end_line": 238, "end_column": 53 }, { "span": "from AboutWindow import AboutWindow", "start_line": 239, "start_column": 0, "end_line": 239, "end_column": 35 }, { "span": "import ApplicationMenu", "start_line": 240, "start_column": 0, "end_line": 240, "end_column": 22 }, { "span": "from BrowserEditor import BrowserEditor", "start_line": 241, "start_column": 0, "end_line": 241, "end_column": 39 }, { "span": "from Timeline import Timeline", "start_line": 242, "start_column": 0, "end_line": 242, "end_column": 29 }, { "span": "from MultiLineStringPlugValueWidget import MultiLineStringPlugValueWidget", "start_line": 243, "start_column": 0, "end_line": 243, "end_column": 73 }, { "span": "from CompoundPlugValueWidget import CompoundPlugValueWidget", "start_line": 244, "start_column": 0, "end_line": 244, "end_column": 59 }, { "span": "from EnumPlugValueWidget import EnumPlugValueWidget", "start_line": 245, "start_column": 0, "end_line": 245, "end_column": 51 }, { "span": "from PresetsPlugValueWidget import PresetsPlugValueWidget", "start_line": 246, "start_column": 0, "end_line": 246, "end_column": 57 }, { "span": "from GraphComponentBrowserMode import GraphComponentBrowserMode", "start_line": 247, "start_column": 0, "end_line": 247, "end_column": 63 }, { "span": "from ToolPlugValueWidget import ToolPlugValueWidget", "start_line": 248, "start_column": 0, "end_line": 248, "end_column": 51 }, { "span": "from LabelPlugValueWidget import LabelPlugValueWidget", "start_line": 249, "start_column": 0, "end_line": 249, "end_column": 53 }, { "span": "from CompoundDataPlugValueWidget import CompoundDataPlugValueWidget", "start_line": 250, "start_column": 0, "end_line": 250, "end_column": 67 }, { "span": "from LayoutPlugValueWidget import LayoutPlugValueWidget", "start_line": 251, "start_column": 0, "end_line": 251, "end_column": 55 }, { "span": "import ScriptNodeUI", "start_line": 252, "start_column": 0, "end_line": 252, "end_column": 19 }, { "span": "from IncrementingPlugValueWidget import IncrementingPlugValueWidget", "start_line": 253, "start_column": 0, "end_line": 253, "end_column": 67 }, { "span": "import PreferencesUI", "start_line": 254, "start_column": 0, "end_line": 254, "end_column": 20 }, { "span": "from SplinePlugValueWidget import SplinePlugValueWidget", "start_line": 255, "start_column": 0, "end_line": 255, "end_column": 55 }, { "span": "from RampPlugValueWidget import RampPlugValueWidget", "start_line": 256, "start_column": 0, "end_line": 256, "end_column": 51 }, { "span": "from NodeFinderDialogue import NodeFinderDialogue", "start_line": 257, "start_column": 0, "end_line": 257, "end_column": 49 }, { "span": "from ConnectionPlugValueWidget import ConnectionPlugValueWidget", "start_line": 258, "start_column": 0, "end_line": 258, "end_column": 63 }, { "span": "import View3DToolbar", "start_line": 259, "start_column": 0, "end_line": 259, "end_column": 20 }, { "span": "import ViewUI", "start_line": 260, "start_column": 0, "end_line": 260, "end_column": 13 }, { "span": "from Playback import Playback", "start_line": 261, "start_column": 0, "end_line": 261, "end_column": 29 }, { "span": "from UIEditor import UIEditor", "start_line": 262, "start_column": 0, "end_line": 262, "end_column": 29 }, { "span": "import GraphBookmarksUI", "start_line": 263, "start_column": 0, "end_line": 263, "end_column": 23 }, { "span": "import DocumentationAlgo", "start_line": 264, "start_column": 0, "end_line": 264, "end_column": 24 }, { "span": "import DependencyNodeUI", "start_line": 268, "start_column": 0, "end_line": 268, "end_column": 23 }, { "span": "import ComputeNodeUI", "start_line": 269, "start_column": 0, "end_line": 269, "end_column": 20 }, { "span": "import RandomUI", "start_line": 270, "start_column": 0, "end_line": 270, "end_column": 15 }, { "span": "import ExpressionUI", "start_line": 271, "start_column": 0, "end_line": 271, "end_column": 19 }, { "span": "import BoxUI", "start_line": 272, "start_column": 0, "end_line": 272, "end_column": 12 }, { "span": "import ReferenceUI", "start_line": 273, "start_column": 0, "end_line": 273, "end_column": 18 }, { "span": "import BackdropUI", "start_line": 274, "start_column": 0, "end_line": 274, "end_column": 17 }, { "span": "import DotUI", "start_line": 275, "start_column": 0, "end_line": 275, "end_column": 12 }, { "span": "import SubGraphUI", "start_line": 276, "start_column": 0, "end_line": 276, "end_column": 17 }, { "span": "import SwitchUI", "start_line": 277, "start_column": 0, "end_line": 277, "end_column": 15 }, { "span": "import ContextVariablesUI", "start_line": 278, "start_column": 0, "end_line": 278, "end_column": 25 }, { "span": "import TimeWarpUI", "start_line": 279, "start_column": 0, "end_line": 279, "end_column": 17 }, { "span": "import LoopUI", "start_line": 280, "start_column": 0, "end_line": 280, "end_column": 13 }, { "span": "import AnimationUI", "start_line": 281, "start_column": 0, "end_line": 281, "end_column": 18 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Copy", "right", " ", "(", "c", ")", " ", "2011", "-", "2012", ",", " ", "Joh", "n", " ", "Had", "don", ".", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Copy", "right", " ", "(", "c", ")", " ", "2011", "-", "201", "5", ",", " ", "Image", " ", "Engine", " ", "Desig", "n", " ", "Inc", ".", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Redistributi", "on", " ", "and", " ", "use", " ", "in", " ", "source", " ", "and", " ", "binar", "y", " ", "forms", ",", " ", "with", " ", "or", " ", "with", "out_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "modification", ",", " ", "are", " ", "permit", "ted", " ", "provided", " ", "tha", "t", " ", "the", " ", "follow", "ing", " ", "condition", "s", " ", "are", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "met", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "*", " ", "Redistributi", "ons", " ", "of", " ", "source", " ", "code", " ", "must", " ", "retain", " ", "the", " ", "above_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "copyr", "ight", " ", "notice", ",", " ", "this", " ", "list", " ", "of", " ", "condition", "s", " ", "and", " ", "the", " ", "following_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "discl", "aime", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "*", " ", "Redistributi", "ons", " ", "in", " ", "binar", "y", " ", "form", " ", "must", " ", "reproduce", " ", "the", " ", "above_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "copyr", "ight", " ", "notice", ",", " ", "this", " ", "list", " ", "of", " ", "condition", "s", " ", "and", " ", "the", " ", "following_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "discl", "aime", "r", " ", "in", " ", "the", " ", "documentation", " ", "and", "/", "or", " ", "other", " ", "material", "s", " ", "provided", " ", "with_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "the", " ", "distribu", "tion", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "*", " ", "Nei", "ther", " ", "the", " ", "name", " ", "of", " ", "Joh", "n", " ", "Had", "don", " ", "nor", " ", "the", " ", "names", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "any", " ", "other", " ", "contributor", "s", " ", "to", " ", "this", " ", "software", " ", "may", " ", "be", " ", "used", " ", "to", " ", "endo", "rse", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "promote", " ", "products", " ", "derive", "d", " ", "from", " ", "this", " ", "software", " ", "with", "out", " ", "specific", " ", "prior_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "writt", "en", " ", "permissi", "on", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "THIS", " ", "SOFT", "WARE", " ", "IS", " ", "PROVI", "DED", " ", "BY", " ", "THE", " ", "COPY", "RIG", "HT", " ", "HOLD", "ERS", " ", "AND", " ", "CONTRIB", "UTO", "RS", " ", "\"", "AS_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "IS", "\"", " ", "AND", " ", "ANY", " ", "EXPR", "ESS", " ", "OR", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", ",", " ", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "THE", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", " ", "OF", " ", "MER", "CHAN", "TAB", "ILI", "TY", " ", "AND", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "PUR", "POS", "E", " ", "ARE", " ", "DISC", "LAI", "MED", ".", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", " ", "COPY", "RIG", "HT", " ", "OWNER", " ", "OR_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "CONTRIB", "UTO", "RS", " ", "BE", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY", " ", "DIRECT", ",", " ", "INDI", "RECT", ",", " ", "INC", "IDENT", "AL", ",", " ", "SPECIAL", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "EXE", "MPL", "ARY", ",", " ", "OR", " ", "CONS", "EQU", "ENTI", "AL", " ", "DA", "MAGE", "S", " ", "(", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "PROC", "URE", "MENT", " ", "OF", " ", "SUBST", "ITU", "TE", " ", "GOOD", "S", " ", "OR", " ", "SERVICES", ";", " ", "LOSS", " ", "OF", " ", "USE", ",", " ", "DATA", ",", " ", "OR_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "PROF", "IT", "S", ";", " ", "OR", " ", "BUS", "INE", "SS", " ", "INTER", "RU", "PTION", ")", " ", "HO", "WE", "VER", " ", "CAU", "SED", " ", "AND", " ", "ON", " ", "ANY", " ", "THE", "ORY", " ", "OF_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN", " ", "CONTR", "ACT", ",", " ", "STRI", "CT", " ", "LI", "ABI", "LIT", "Y", ",", " ", "OR", " ", "TOR", "T", " ", "(", "INC", "LU", "DING", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "NEG", "LIG", "ENCE", " ", "OR", " ", "OTHER", "WI", "SE", ")", " ", "ARI", "SIN", "G", " ", "IN", " ", "ANY", " ", "WAY", " ", "OUT", " ", "OF", " ", "THE", " ", "USE", " ", "OF", " ", "THIS", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "SOFT", "WARE", ",", " ", "EVE", "N", " ", "IF", " ", "ADV", "ISE", "D", " ", "OF", " ", "THE", " ", "POS", "SIB", "ILI", "TY", " ", "OF", " ", "SUC", "H", " ", "DA", "MAGE", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Work", " ", "aro", "und", " ", "a", " ", "bug", " ", "whi", "ch", " ", "caus", "es", " ", "seg", "faults", " ", "if", " ", "uuid", " ", "is", " ", "import", "ed", " ", "after_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Py", "Qt", ".", " ", "See", " ", "here", " ", "for", " ", "deta", "il", "s", " ", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "https", "://", "bug", "s", ".", "gent", "oo", ".", "org", "/", "show", "\\u", "bug", ".", "cgi", "?", "id", "=", "317", "557", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "www", ".", "river", "bank", "compu", "ting", ".", "com", "/", "pipe", "rma", "il", "/", "pyqt", "/", "2010", "-", "Dece", "mber", "/", "028", "773", ".", "html_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ing", " ", "\\u\\u", "import", "\\u\\u", " ", "rat", "her", " ", "than", " ", "import", " ", "so", " ", "tha", "t", " ", "we", " ", "don", "'", "t", " ", "poll", "ute", " ", "the", " ", "Ga", "ffer", "UI_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "namespace", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "import\\u\\u_", "(_", "\"", "uuid", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Function", " ", "to", " ", "import", " ", "a", " ", "module", " ", "from", " ", "the", " ", "qt", " ", "bindi", "ngs", ".", " ", "Thi", "s", " ", "must", " ", "be", " ", "used_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "rat", "her", " ", "than", " ", "import", "ing", " ", "the", " ", "module", " ", "direct", "ly", ".", " ", "Thi", "s", " ", "allow", "s", " ", "us", " ", "to", " ", "support_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "use", " ", "of", " ", "bot", "h", " ", "Py", "Qt", " ", "and", " ", "Py", "Side", "._", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "qt", "Modul", "e", "Name_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Function", " ", "to", " ", "return", " ", "the", " ", "C", "++", " ", "address", " ", "of", " ", "a", " ", "wrapp", "ed", " ", "Qt", " ", "object", ".", " ", "Thi", "s", " ", "can_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "be", " ", "usef", "ul", " ", "if", " ", "need", "ing", " ", "to", " ", "implement", " ", "part", " ", "of", " ", "the", " ", "UI", " ", "in", " ", "C", "++", " ", "and", " ", "the", " ", "rest_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "Pyth", "on", "._", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Function", " ", "to", " ", "return", " ", "a", " ", "wrapp", "ed", " ", "Qt", " ", "object", " ", "from", " ", "the", " ", "give", "n", " ", "C", "++", " ", "address", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "can", " ", "be", " ", "usef", "ul", " ", "if", " ", "need", "ing", " ", "to", " ", "implement", " ", "part", " ", "of", " ", "the", " ", "UI", " ", "in", " ", "C", "++", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "rest", " ", "in", " ", "Pyth", "on", "._", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "now", " ", "import", " ", "our", " ", "actual", " ", "functional", "ity_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Import", " ", "module", "s", " ", "tha", "t", " ", "must", " ", "be", " ", "import", "ed", " ", "bef", "ore", " ", "\\u", "Ga", "ffer", "UI", ",", " ", "usi", "ng", " ", "\\u\\u", "import\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "avoid", " ", "poll", "uti", "ng", " ", "the", " ", "Ga", "ffer", "UI", " ", "namespace", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u", "import\\u\\u_", "(_", "\"", "IE", "Core", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "import\\u\\u_", "(_", "\"", "Ga", "ffer", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u", "Ga", "ffer", "UI_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "genera", "l", " ", "ui", " ", "stu", "ff", " ", "first_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "Enum", "s_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Widget_", "import_", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "La", "zy", "Method_", "import_", "La", "zy", "Method_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Menu_", "import_", "Menu_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Containe", "r", "Widget_", "import_", "Containe", "r", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Window_", "import_", "Window_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Split", "Container_", "import_", "Split", "Container_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "List", "Container_", "import_", "List", "Container_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Grid", "Container_", "import_", "Grid", "Container_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Menu", "Bar_", "import_", "Menu", "Bar_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Event", "Loop_", "import_", "Event", "Loop_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Tab", "bed", "Container_", "import_", "Tab", "bed", "Container_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Text", "Widget_", "import_", "Text", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Numer", "ic", "Widget_", "import_", "Numer", "ic", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Button_", "import_", "Button_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Multi", "Line", "Text", "Widget_", "import_", "Multi", "Line", "Text", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Label_", "import_", "Label_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "GL", "Widget_", "import_", "GL", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Scroll", "ed", "Container_", "import_", "Scroll", "ed", "Container_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Path", "Widget_", "import_", "Path", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Path", "Listi", "ng", "Widget_", "import_", "Path", "Listi", "ng", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Path", "Choose", "r", "Widget_", "import_", "Path", "Choose", "r", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Dialog", "ue_", "import_", "Dialog", "ue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Path", "Choose", "r", "Dialog", "ue_", "import_", "Path", "Choose", "r", "Dialog", "ue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Text", "Inp", "ut", "Dialog", "ue_", "import_", "Text", "Inp", "ut", "Dialog", "ue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Collaps", "ible_", "import_", "Collaps", "ible_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Color", "Swa", "tch_", "import_", "Color", "Swa", "tch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Slider_", "import_", "Slider_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Show", "URL_", "import_", "show", "URL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Spacer_", "import_", "Spacer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Boo", "l", "Widget_", "import_", "Boo", "l", "Widget_", ",_", "Check", "Box_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Image_", "import_", "Image_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Error", "Dialog", "ue_", "import_", "Error", "Dialog", "ue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u", "Variant_", "import_", "\\u", "Variant_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Vector", "Data", "Widget_", "import_", "Vector", "Data", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Path", "Vector", "Data", "Widget_", "import_", "Path", "Vector", "Data", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Progres", "s", "Bar_", "import_", "Progres", "s", "Bar_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Selecti", "on", "Menu_", "import_", "Selecti", "on", "Menu_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Path", "Filter", "Widget_", "import_", "Path", "Filter", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Compo", "und", "Path", "Filter", "Widget_", "import_", "Compo", "und", "Path", "Filter", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Info", "Path", "Filter", "Widget_", "import_", "Info", "Path", "Filter", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Match", "Pat", "tern", "Path", "Filter", "Widget_", "import_", "Match", "Pat", "tern", "Path", "Filter", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "File", "Sequ", "ence", "Path", "Filter", "Widget_", "import_", "File", "Sequ", "ence", "Path", "Filter", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Busy", "Widget_", "import_", "Busy", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Numer", "ic", "Slider_", "import_", "Numer", "ic", "Slider_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Color", "Choose", "r_", "import_", "Color", "Choose", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Color", "Choose", "r", "Dialog", "ue_", "import_", "Color", "Choose", "r", "Dialog", "ue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Messag", "e", "Widget_", "import_", "Messag", "e", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Notifi", "cation", "Messag", "e", "Handler_", "import_", "Notifi", "cation", "Messag", "e", "Handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Menu", "Button_", "import_", "Menu", "Button_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Multi", "Selecti", "on", "Menu_", "import_", "Multi", "Selecti", "on", "Menu_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Pop", "up", "Window_", "import_", "Pop", "up", "Window_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Confirmation", "Dialog", "ue_", "import_", "Confirmation", "Dialog", "ue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Display", "Transform_", "import_", "Display", "Transform_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Divide", "r_", "import_", "Divide", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "\\u", "Pointer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Spline", "Widget_", "import_", "Spline", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Bookmark", "s_", "import_", "Bookmark", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "then", " ", "all", " ", "the", " ", "Path", "Preview", "Wid", "gets", ".", " ", "note", " ", "tha", "t", " ", "the", " ", "order_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "import", " ", "controls", " ", "the", " ", "order", " ", "of", " ", "display", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "Path", "Preview", "Widget_", "import_", "Path", "Preview", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Compo", "und", "Path", "Preview", "_", "import_", "Compo", "und", "Path", "Preview", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Defe", "rre", "d", "Path", "Preview", "_", "import_", "Defe", "rre", "d", "Path", "Preview", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Info", "Path", "Preview", "_", "import_", "Info", "Path", "Preview", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Head", "er", "Path", "Preview", "_", "import_", "Head", "er", "Path", "Preview", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Data", "Path", "Preview", "_", "import_", "Data", "Path", "Preview", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "then", " ", "stu", "ff", " ", "specific", " ", "to", " ", "graph", " ", "uis", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "Plug", "Value", "Widget_", "import_", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "String", "Plug", "Value", "Widget_", "import_", "String", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Numer", "ic", "Plug", "Value", "Widget_", "import_", "Numer", "ic", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Boo", "l", "Plug", "Value", "Widget_", "import_", "Boo", "l", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Path", "Plug", "Value", "Widget_", "import_", "Path", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "File", "System", "Path", "Plug", "Value", "Widget_", "import_", "File", "System", "Path", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Vector", "Data", "Plug", "Value", "Widget_", "import_", "Vector", "Data", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Path", "Vector", "Data", "Plug", "Value", "Widget_", "import_", "Path", "Vector", "Data", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Plug", "Widget_", "import_", "Plug", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Plug", "Layout_", "import_", "Plug", "Layout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Edit", "or", "Widget_", "import_", "Edit", "or", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Script", "Editor_", "import_", "Script", "Editor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Ga", "dget", "Widget_", "import_", "Ga", "dget", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Node", "Graph_", "import_", "Node", "Graph_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Script", "Window_", "import_", "Script", "Window_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Compo", "und", "Editor_", "import_", "Compo", "und", "Editor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Name", "Widget_", "import_", "Name", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Name", "Label_", "import_", "Name", "Label_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Node", "Set", "Editor_", "import_", "Node", "Set", "Editor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Node", "Editor_", "import_", "Node", "Editor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Lay", "outs_", "import_", "Lay", "outs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Node", "Menu_", "import_", "Node", "Menu_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "File", "Menu_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Lay", "out", "Menu_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Edit", "Menu_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "User", "Plug", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Frame_", "import_", "Frame_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Compo", "und", "Numer", "ic", "Plug", "Value", "Widget_", "import_", "Compo", "und", "Numer", "ic", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Box", "Plug", "Value", "Widget_", "import_", "Box", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Node", "UI_", "import_", "Node", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Standard", "Node", "UI_", "import_", "Standard", "Node", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Node", "Toolbar_", "import_", "Node", "Toolbar_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Standard", "Node", "Toolbar_", "import_", "Standard", "Node", "Toolbar_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Viewer_", "import_", "Viewer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Color", "Swa", "tch", "Plug", "Value", "Widget_", "import_", "Color", "Swa", "tch", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Color", "Plug", "Value", "Widget_", "import_", "Color", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Abo", "ut", "Window_", "import_", "Abo", "ut", "Window_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Applica", "tion", "Menu_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Brows", "er", "Editor_", "import_", "Brows", "er", "Editor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Time", "line_", "import_", "Time", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Multi", "Line", "String", "Plug", "Value", "Widget_", "import_", "Multi", "Line", "String", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Compo", "und", "Plug", "Value", "Widget_", "import_", "Compo", "und", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Enum", "Plug", "Value", "Widget_", "import_", "Enum", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Preset", "s", "Plug", "Value", "Widget_", "import_", "Preset", "s", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Graph", "Compo", "nent", "Brows", "er", "Mode_", "import_", "Graph", "Compo", "nent", "Brows", "er", "Mode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Tool", "Plug", "Value", "Widget_", "import_", "Tool", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Label", "Plug", "Value", "Widget_", "import_", "Label", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Compo", "und", "Data", "Plug", "Value", "Widget_", "import_", "Compo", "und", "Data", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Lay", "out", "Plug", "Value", "Widget_", "import_", "Lay", "out", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Script", "Node", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Increment", "ing", "Plug", "Value", "Widget_", "import_", "Increment", "ing", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Preference", "s", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Spline", "Plug", "Value", "Widget_", "import_", "Spline", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Ramp", "Plug", "Value", "Widget_", "import_", "Ramp", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Node", "Fin", "der", "Dialog", "ue_", "import_", "Node", "Fin", "der", "Dialog", "ue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Connect", "ion", "Plug", "Value", "Widget_", "import_", "Connect", "ion", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "View", "3", "DT", "ool", "bar_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "View", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Playb", "ack_", "import_", "Playb", "ack_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "UI", "Editor_", "import_", "UI", "Editor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Graph", "Bookmark", "s", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Document", "ation", "Algo", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "then", " ", "specific", " ", "node", " ", "uis", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "Dependenc", "y", "Node", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Compute", "Node", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Random", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Expression", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Box", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Reference", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Back", "drop", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Dot", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Sub", "Graph", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Switch", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Context", "Varia", "bles", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Time", "War", "p", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Loop", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Animat", "ion", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "back", "ward", "s", " ", "compatibility", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "\\\\", "todo", " ", "Remove", " ", "me_", "\\u\\u\\uNL\\u\\u\\u_", "Metadata_", "=_", "\\u\\u", "import\\u\\u_", "(_", "\"", "Ga", "ffer", "\"_", ")_", "._", "Metadata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "import\\u\\u_", "(_", "\"", "IE", "Core", "\"_", ")_", "._", "load", "Config_", "(_", "\"", "GA", "FFE", "R", "\\u", "START", "UP", "\\u", "PATH", "S", "\"_", ",_", "{_", "}_", ",_", "subdirectory", "_", "=_", "\"", "Ga", "ffer", "UI", "\"_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "qt", "Import_", "(_", "name_", ",_", "lazy_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "decide", " ", "whi", "ch", " ", "qt", " ", "bindi", "ngs", " ", "to", " ", "use", ",", " ", "and", " ", "appl", "y", " ", "any", " ", "fix", "-", "ups", " ", "we", " ", "need", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "shield", " ", "us", " ", "from", " ", "Py", "Qt", "/", "Py", "Side", " ", "difference", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "global_", "\\u\\u", "qt", "Modul", "e", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\\u\\u", "qt", "Modul", "e", "Name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\"", "GA", "FFE", "RU", "I", "\\u", "QT", "\\u", "BINDING", "S", "\"_", "in_", "os_", "._", "environ_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "\\u\\u", "qt", "Modul", "e", "Name_", "=_", "os_", "._", "environ_", "[_", "\"", "GA", "FFE", "RU", "I", "\\u", "QT", "\\u", "BINDING", "S", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "no", " ", "preference", " ", "state", "d", " ", "via", " ", "environ", "ment", " ", "-", " ", "see", " ", "what", " ", "we", " ", "ship", "ped", " ", "with_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "os_", "._", "environ_", "[_", "\"", "GA", "FFE", "R", "\\u", "ROO", "T", "\"_", "]_", "+_", "\"/", "python", "/", "Py", "Side", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "\\u\\u", "qt", "Modul", "e", "Name_", "=_", "\"", "Py", "Side", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "\\u\\u", "qt", "Modul", "e", "Name_", "=_", "\"", "Py", "Qt", "4", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Py", "Qt", " ", "unfo", "rtu", "nat", "el", "y", " ", "use", "s", " ", "an", " ", "implementation", "-", "specific_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "nami", "ng", " ", "sche", "me", " ", "for", " ", "its", " ", "new", "-", "style", " ", "signal", " ", "and", " ", "slot", " ", "classe", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "use", " ", "this", " ", "to", " ", "make", " ", "it", " ", "compatible", " ", "with", " ", "Py", "Side", ",", " ", "according", " ", "to", " ", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "qt", "-", "project", ".", "org", "/", "wiki", "/", "Difference", "s", "\\u", "Bet", "ween", "\\u", "Py", "Side", "\\u", "and", "\\u", "Py", "Qt_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\"", "Py", "Qt", "\"_", "in_", "\\u\\u", "qt", "Modul", "e", "Name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "Qt", "Core_", "=_", "\\u\\u", "import\\u\\u_", "(_", "\\u\\u", "qt", "Modul", "e", "Name_", "+_", "\".", "Qt", "Core", "\"_", ")_", "._", "Qt", "Core_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Qt", "Core_", "._", "Signal_", "=_", "Qt", "Core_", "._", "pyqt", "Signal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "import", " ", "the", " ", "submodule", " ", "from", " ", "tho", "se", " ", "bindi", "ngs", " ", "and", " ", "return", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "lazy_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "import_", "Ga", "ffer", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Ga", "ffer", "_", "._", "lazy", "Import_", "(_", "\\u\\u", "qt", "Modul", "e", "Name_", "+_", "\".\"_", "+_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "qt", "Module_", "=_", "\\u\\u", "import\\u\\u_", "(_", "\\u\\u", "qt", "Modul", "e", "Name_", "+_", "\".\"_", "+_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "getattr_", "(_", "qt", "Module_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "qt", "Address_", "(_", "o_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "global_", "\\u\\u", "qt", "Modul", "e", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\"", "Py", "Qt", "\"_", "in_", "\\u\\u", "qt", "Modul", "e", "Name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "import_", "sip_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "sip_", "._", "unwrap", "instance_", "(_", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "import_", "shi", "bo", "ken_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "shi", "bo", "ken_", "._", "get", "Cp", "p", "Pointer_", "(_", "o_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "qt", "Object_", "(_", "address_", ",_", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "global_", "\\u\\u", "qt", "Modul", "e", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\"", "Py", "Qt", "\"_", "in_", "\\u\\u", "qt", "Modul", "e", "Name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "import_", "sip_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "sip_", "._", "wrap", "instance_", "(_", "address_", ",_", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "import_", "shi", "bo", "ken_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "shi", "bo", "ken_", "._", "wrap", "Instance_", "(_", "address_", ",_", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
Ivaylo-Popov/Theano-Lights/models/cnn.py
[ { "content": " def __init__(self, data, hp):\n super(CNN, self).__init__(self.__class__.__name__, data, hp)\n \n self.n_h = 400\n\n self.params = Parameters()\n n_x = self.data['n_x']\n n_y = self.data['n_y']\n n_h = self.n_h\n scale = hp.init_scale\n\n if hp.load_model and os.path.isfile(self.filename):\n self.params.load(self.filename)\n else:\n with self.params:\n w = shared_normal((32, 1, 3, 3), scale=scale)\n w2 = shared_normal((64, 32, 3, 3), scale=scale)\n w3 = shared_normal((128, 64, 3, 3), scale=scale)\n w4 = shared_normal((128 * 3 * 3, 625), scale=scale)\n w_o = shared_normal((625, n_y), scale=scale)\n \n def model(X, params, p_drop_conv, p_drop_hidden):\n l1a = rectify(conv2d(X, params.w, border_mode='full'))\n l1 = max_pool_2d(l1a, (2, 2))\n l1 = dropout(l1, p_drop_conv)\n\n l2a = rectify(conv2d(l1, params.w2))\n l2 = max_pool_2d(l2a, (2, 2))\n l2 = dropout(l2, p_drop_conv)\n\n l3a = rectify(conv2d(l2, params.w3))\n l3b = max_pool_2d(l3a, (2, 2))\n l3 = T.flatten(l3b, outdim=2)\n l3 = dropout(l3, p_drop_conv)\n\n l4 = rectify(T.dot(l3, params.w4))\n l4 = dropout(l4, p_drop_hidden)\n\n py_x = softmax(T.dot(l4, params.w_o))\n return py_x\n \n x = T.reshape(self.X, (-1, 1, 28, 28))\n\n noise_py_x = model(x, self.params, 0.2, 0.5)\n cost = T.sum(T.nnet.categorical_crossentropy(noise_py_x, self.Y))\n\n pyx = model(x, self.params, 0., 0.)\n map_pyx = T.argmax(pyx, axis=1)\n error_map_pyx = T.sum(T.neq(map_pyx, T.argmax(self.Y, axis=1)))\n\n self.compile(cost, error_map_pyx)", "metadata": "root.CNN.__init__", "header": "['class', 'CNN', '(', 'ModelSLBase', ')', ':', '___EOS___']", "index": 19 } ]
[ { "span": "n_x ", "start_line": 25, "start_column": 8, "end_line": 25, "end_column": 11 }, { "span": "n_h ", "start_line": 27, "start_column": 8, "end_line": 27, "end_column": 11 }, { "span": "w ", "start_line": 34, "start_column": 16, "end_line": 34, "end_column": 17 }, { "span": "w2 ", "start_line": 35, "start_column": 16, "end_line": 35, "end_column": 18 }, { "span": "w3 ", "start_line": 36, "start_column": 16, "end_line": 36, "end_column": 18 }, { "span": "w4 ", "start_line": 37, "start_column": 16, "end_line": 37, "end_column": 18 }, { "span": "w_o ", "start_line": 38, "start_column": 16, "end_line": 38, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "CNN", "_", "(_", "Model", "SL", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "data_", ",_", "hp_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "CNN", "_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "data_", ",_", "hp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "n", "\\u", "h_", "=_", "400_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "params_", "=_", "Parameters_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n", "\\u", "x_", "=_", "self_", "._", "data_", "[_", "'", "n", "\\u", "x", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n", "\\u", "y_", "=_", "self_", "._", "data_", "[_", "'", "n", "\\u", "y", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n", "\\u", "h_", "=_", "self_", "._", "n", "\\u", "h_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scale_", "=_", "hp_", "._", "init", "\\u", "scale_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hp_", "._", "load", "\\u", "model_", "and_", "os_", "._", "path_", "._", "isfile_", "(_", "self_", "._", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "params_", "._", "load_", "(_", "self_", "._", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "self_", "._", "params_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "w_", "=_", "shared", "\\u", "normal_", "(_", "(_", "32_", ",_", "1_", ",_", "3_", ",_", "3_", ")_", ",_", "scale_", "=_", "scale_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w2_", "=_", "shared", "\\u", "normal_", "(_", "(_", "64_", ",_", "32_", ",_", "3_", ",_", "3_", ")_", ",_", "scale_", "=_", "scale_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w3", "_", "=_", "shared", "\\u", "normal_", "(_", "(_", "128_", ",_", "64_", ",_", "3_", ",_", "3_", ")_", ",_", "scale_", "=_", "scale_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w", "4_", "=_", "shared", "\\u", "normal_", "(_", "(_", "128_", "*_", "3_", "*_", "3_", ",_", "625_", ")_", ",_", "scale_", "=_", "scale_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w", "\\u", "o_", "=_", "shared", "\\u", "normal_", "(_", "(_", "625_", ",_", "n", "\\u", "y_", ")_", ",_", "scale_", "=_", "scale_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "model_", "(_", "X_", ",_", "params_", ",_", "p", "\\u", "drop", "\\u", "conv_", ",_", "p", "\\u", "drop", "\\u", "hidden_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "l1", "a_", "=_", "recti", "fy_", "(_", "conv2d_", "(_", "X_", ",_", "params_", "._", "w_", ",_", "border", "\\u", "mode_", "=_", "'", "full", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l1_", "=_", "max", "\\u", "pool", "\\u", "2d_", "(_", "l1", "a_", ",_", "(_", "2_", ",_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l1_", "=_", "dropout_", "(_", "l1_", ",_", "p", "\\u", "drop", "\\u", "conv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "l2", "a_", "=_", "recti", "fy_", "(_", "conv2d_", "(_", "l1_", ",_", "params_", "._", "w2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l2_", "=_", "max", "\\u", "pool", "\\u", "2d_", "(_", "l2", "a_", ",_", "(_", "2_", ",_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l2_", "=_", "dropout_", "(_", "l2_", ",_", "p", "\\u", "drop", "\\u", "conv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "l3", "a_", "=_", "recti", "fy_", "(_", "conv2d_", "(_", "l2_", ",_", "params_", "._", "w3", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l3", "b_", "=_", "max", "\\u", "pool", "\\u", "2d_", "(_", "l3", "a_", ",_", "(_", "2_", ",_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l3_", "=_", "T_", "._", "flatten_", "(_", "l3", "b_", ",_", "outd", "im_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l3_", "=_", "dropout_", "(_", "l3_", ",_", "p", "\\u", "drop", "\\u", "conv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "l4", "_", "=_", "recti", "fy_", "(_", "T_", "._", "dot_", "(_", "l3_", ",_", "params_", "._", "w", "4_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l4", "_", "=_", "dropout_", "(_", "l4", "_", ",_", "p", "\\u", "drop", "\\u", "hidden_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "py", "\\u", "x_", "=_", "softmax_", "(_", "T_", "._", "dot_", "(_", "l4", "_", ",_", "params_", "._", "w", "\\u", "o_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "py", "\\u", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "x_", "=_", "T_", "._", "reshape_", "(_", "self_", "._", "X_", ",_", "(_", "-_", "1_", ",_", "1_", ",_", "28_", ",_", "28_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "noise", "\\u", "py", "\\u", "x_", "=_", "model_", "(_", "x_", ",_", "self_", "._", "params_", ",_", "0.2_", ",_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cost_", "=_", "T_", "._", "sum_", "(_", "T_", "._", "nnet", "_", "._", "categor", "ical", "\\u", "crossentropy", "_", "(_", "noise", "\\u", "py", "\\u", "x_", ",_", "self_", "._", "Y_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pyx", "_", "=_", "model_", "(_", "x_", ",_", "self_", "._", "params_", ",_", "0._", ",_", "0._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "map", "\\u", "pyx", "_", "=_", "T_", "._", "argmax_", "(_", "pyx", "_", ",_", "axis_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "map", "\\u", "pyx", "_", "=_", "T_", "._", "sum_", "(_", "T_", "._", "neq", "_", "(_", "map", "\\u", "pyx", "_", ",_", "T_", "._", "argmax_", "(_", "self_", "._", "Y_", ",_", "axis_", "=_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "compile_", "(_", "cost_", ",_", "error", "\\u", "map", "\\u", "pyx", "_", ")_" ]
[ 4, 4, 4, 4, 4, 4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2, 2 ]
Except block handles 'BaseException'
garethr/django-test-extensions/src/test_extensions/testrunners/xmlunit/unittest.py
[ { "content": " def __call__(self, result=None):\n if result is not None: self.result = result\n result.startTest(self)\n testMethod = getattr(self, self.__testMethodName)\n try:\n try:\n self.setUp()\n except:\n result.addError(self,self.__exc_info())\n return\n\n ok = 0\n try:\n testMethod()\n ok = 1\n except self.failureException, e:\n result.addFailure(self,self.__exc_info())\n except:\n result.addError(self,self.__exc_info())\n\n try:\n self.tearDown()\n except:\n result.addError(self,self.__exc_info())\n ok = 0\n if ok: result.addSuccess(self)\n finally:\n result.stopTest(self)", "metadata": "root.TestCase.__call__", "header": "['class', 'TestCase', ':', '___EOS___']", "index": 224 } ]
[ { "span": "except:", "start_line": 231, "start_column": 12, "end_line": 231, "end_column": 19 }, { "span": "except:", "start_line": 241, "start_column": 12, "end_line": 241, "end_column": 19 }, { "span": "except:", "start_line": 246, "start_column": 12, "end_line": 246, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Test", "Case_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "call\\u\\u_", "(_", "self_", ",_", "result_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "result_", "is_", "not_", "None_", ":_", "self_", "._", "result_", "=_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "start", "Test_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test", "Method_", "=_", "getattr_", "(_", "self_", ",_", "self_", "._", "\\u\\u", "test", "Meth", "od", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "add", "Error_", "(_", "self_", ",_", "self_", "._", "\\u\\u", "exc", "\\u", "info_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ok_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test", "Method_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ok_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "self_", "._", "fail", "ure", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "add", "Failure_", "(_", "self_", ",_", "self_", "._", "\\u\\u", "exc", "\\u", "info_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "add", "Error_", "(_", "self_", ",_", "self_", "._", "\\u\\u", "exc", "\\u", "info_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "tear", "Down_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "add", "Error_", "(_", "self_", ",_", "self_", "._", "\\u\\u", "exc", "\\u", "info_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ok_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ok_", ":_", "result_", "._", "add", "Success_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "stop", "Test_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Modification of parameter with default
pandaproject/panda/api_examples/couchdb.py
[ { "content": "def panda_get(url, params={}):\n params.update(PANDA_AUTH_PARAMS)\n return requests.get(url, params=params)", "metadata": "root.panda_get", "header": "['module', '___EOS___']", "index": 32 }, { "content": "def panda_put(url, data, params={}):\n params.update(PANDA_AUTH_PARAMS)\n return requests.put(url, data, params=params, headers={ 'Content-Type': 'application/json' })", "metadata": "root.panda_put", "header": "['module', '___EOS___']", "index": 36 } ]
[ { "span": "params.", "start_line": 33, "start_column": 4, "end_line": 33, "end_column": 10 }, { "span": "params.", "start_line": 37, "start_column": 4, "end_line": 37, "end_column": 10 } ]
[ { "span": "params=", "start_line": 32, "start_column": 19, "end_line": 32, "end_column": 25 }, { "span": "params=", "start_line": 36, "start_column": 25, "end_line": 36, "end_column": 31 } ]
1
true
[ "[CLS]_", "Modifica", "tion_", "of_", "parameter_", "with_", "default_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "panda", "\\u", "get_", "(_", "url_", ",_", "params_", "=_", "{_", "}_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "._", "update_", "(_", "PAN", "DA", "\\u", "AUTH", "\\u", "PARAMS_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "requests_", "._", "get_", "(_", "url_", ",_", "params_", "=_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "panda", "\\u", "put_", "(_", "url_", ",_", "data_", ",_", "params_", "=_", "{_", "}_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "._", "update_", "(_", "PAN", "DA", "\\u", "AUTH", "\\u", "PARAMS_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "requests_", "._", "put_", "(_", "url_", ",_", "data_", ",_", "params_", "=_", "params_", ",_", "headers_", "=_", "{_", "'", "Conten", "t", "-", "Type", "'_", ":_", "'", "applica", "tion", "/", "json", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
google/grr/grr/parsers/registry_init.py
[ { "content": "#!/usr/bin/env python\n\"\"\"Loads all the parsers so they are visible in the registry.\"\"\"\n\n# pylint: disable=g-import-not-at-top\n# pylint: disable=unused-import\nfrom grr.parsers import config_file\nfrom grr.parsers import cron_file_parser\nfrom grr.parsers import ie_history\nfrom grr.parsers import linux_cmd_parser\nfrom grr.parsers import linux_file_parser\nfrom grr.parsers import linux_pam_parser\nfrom grr.parsers import linux_release_parser\nfrom grr.parsers import linux_service_parser\nfrom grr.parsers import linux_sysctl_parser\nfrom grr.parsers import local\nfrom grr.parsers import osx_file_parser\nfrom grr.parsers import osx_launchd\nfrom grr.parsers import rekall_artifact_parser\nfrom grr.parsers import windows_persistence\nfrom grr.parsers import windows_registry_parser\nfrom grr.parsers import wmi_parser\n\ntry:\n from grr.parsers import linux_software_parser\nexcept ImportError:\n pass\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from grr.parsers import config_file", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 35 }, { "span": "from grr.parsers import cron_file_parser", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 40 }, { "span": "from grr.parsers import ie_history", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 34 }, { "span": "from grr.parsers import linux_cmd_parser", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 40 }, { "span": "from grr.parsers import linux_file_parser", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 41 }, { "span": "from grr.parsers import linux_pam_parser", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 40 }, { "span": "from grr.parsers import linux_release_parser", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 44 }, { "span": "from grr.parsers import linux_service_parser", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 44 }, { "span": "from grr.parsers import linux_sysctl_parser", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 43 }, { "span": "from grr.parsers import local", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 29 }, { "span": "from grr.parsers import osx_file_parser", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 39 }, { "span": "from grr.parsers import osx_launchd", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 35 }, { "span": "from grr.parsers import rekall_artifact_parser", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 46 }, { "span": "from grr.parsers import windows_persistence", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 43 }, { "span": "from grr.parsers import windows_registry_parser", "start_line": 19, "start_column": 0, "end_line": 19, "end_column": 47 }, { "span": "from grr.parsers import wmi_parser", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 34 }, { "span": "from grr.parsers import linux_software_parser", "start_line": 23, "start_column": 2, "end_line": 23, "end_column": 47 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Load", "s", " ", "all", " ", "the", " ", "parser", "s", " ", "so", " ", "the", "y", " ", "are", " ", "visi", "ble", " ", "in", " ", "the", " ", "registr", "y", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pylint", ":", " ", "disable", "=", "g", "-", "import", "-", "not", "-", "at", "-", "top_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pylint", ":", " ", "disable", "=", "unu", "sed", "-", "import_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "grr_", "._", "parsers_", "import_", "config", "\\u", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "grr_", "._", "parsers_", "import_", "cron", "\\u", "file", "\\u", "parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "grr_", "._", "parsers_", "import_", "ie", "\\u", "history_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "grr_", "._", "parsers_", "import_", "linux", "\\u", "cmd", "\\u", "parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "grr_", "._", "parsers_", "import_", "linux", "\\u", "file", "\\u", "parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "grr_", "._", "parsers_", "import_", "linux", "\\u", "pam", "\\u", "parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "grr_", "._", "parsers_", "import_", "linux", "\\u", "release", "\\u", "parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "grr_", "._", "parsers_", "import_", "linux", "\\u", "service", "\\u", "parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "grr_", "._", "parsers_", "import_", "linux", "\\u", "sysc", "tl", "\\u", "parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "grr_", "._", "parsers_", "import_", "local_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "grr_", "._", "parsers_", "import_", "os", "x", "\\u", "file", "\\u", "parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "grr_", "._", "parsers_", "import_", "os", "x", "\\u", "launch", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "grr_", "._", "parsers_", "import_", "rek", "all", "\\u", "artifact", "\\u", "parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "grr_", "._", "parsers_", "import_", "windows", "\\u", "persistence_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "grr_", "._", "parsers_", "import_", "windows", "\\u", "registr", "y", "\\u", "parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "grr_", "._", "parsers_", "import_", "wmi", "\\u", "parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "grr_", "._", "parsers_", "import_", "linux", "\\u", "software", "\\u", "parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uDEDENT\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Variable defined multiple times
OpenMDAO/OpenMDAO/openmdao/core/test/test_problem.py
[ { "content": " def test_check_promotes(self):\n # verify we get an error at setup time if we have promoted a var that doesn't exist\n\n # valid case, no error\n prob = Problem(Group())\n G = prob.root.add('G', Group())\n C = G.add('C', SimpleComp(), promotes=['x*', 'y'])\n # ignore warning about the unconnected param\n with warnings.catch_warnings(record=True) as w:\n warnings.simplefilter(\"ignore\")\n prob.setup(check=False)\n\n # promoting a non-existent variable should throw an error\n prob = Problem(Group())\n G = prob.root.add('G', Group())\n C = G.add('C', SimpleComp(), promotes=['spoon']) # there is no spoon\n try:\n prob.setup(check=False)\n except Exception as error:\n msg = \"'G.C' promotes 'spoon' but has no variables matching that specification\"\n self.assertEqual(text_type(error), msg)\n else:\n self.fail(\"Error expected\")\n\n # promoting a pattern with no matches should throw an error\n prob = Problem(Group())\n G = prob.root.add('G', Group())\n P = G.add('P', IndepVarComp('x', 5.), promotes=['a*']) # there is no match\n try:\n prob.setup(check=False)\n except Exception as error:\n msg = \"'G.P' promotes 'a*' but has no variables matching that specification\"\n self.assertEqual(text_type(error), msg)\n else:\n self.fail(\"Error expected\")", "metadata": "root.TestProblem.test_check_promotes", "header": "['class', 'TestProblem', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 59 }, { "content": " def test_src_idx_gt_src_size(self):\n class A(Component):\n def __init__(self):\n super(A, self).__init__()\n self.add_state('y', np.zeros((2,)), shape=(2,))\n\n class B(Component):\n def __init__(self):\n super(B, self).__init__()\n self.add_param('x', np.zeros((3,)), shape=(3,))\n\n # src_indices larger than src\n prob = Problem(root=Group())\n prob.root.add(\"A\", A())\n prob.root.add(\"B\", B())\n prob.root.connect(\"A.y\", \"B.x\", src_indices=[1,4,2])\n try:\n prob.setup(check=False)\n except Exception as err:\n self.assertEqual(str(err),\n \"'B.x' src_indices contains an index (4) that exceeds \"\n \"the bounds of source variable 'A.y' of size 2.\")\n else:\n self.fail(\"Exception expected\")", "metadata": "root.TestProblem.test_src_idx_gt_src_size", "header": "['class', 'TestProblem', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 480 }, { "content": " def test_src_idx_gt_src_size(self):\n class A(Component):\n def __init__(self):\n super(A, self).__init__()\n self.add_output('y', np.zeros((5,)), shape=(5,))\n\n class B(Component):\n def __init__(self):\n super(B, self).__init__()\n self.add_param('x', np.zeros((3,)), shape=(3,))\n\n # src_indices larger than src\n prob = Problem(root=Group())\n prob.root.add(\"A\", A())\n prob.root.add(\"B\", B())\n prob.root.connect(\"A.y\", \"B.x\", src_indices=[1,4,5])\n try:\n prob.setup(check=False)\n except Exception as err:\n self.assertTrue(\"'B.x' src_indices contains an index (5) that exceeds the bounds \"\n \"of source variable 'A.y' of size 5.\" in str(err))\n else:\n self.fail(\"Exception expected\")", "metadata": "root.TestProblem.test_src_idx_gt_src_size", "header": "['class', 'TestProblem', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 528 }, { "content": " def test_check_parallel_derivs(self):\n\n prob = Problem()\n root = prob.root = Group()\n\n root.add('p1', IndepVarComp('a', 1.0), promotes=['*'])\n root.add('p2', IndepVarComp('b', 1.0), promotes=['*'])\n sub1 = root.add('sub1', Group(), promotes=['*'])\n sub1.ln_solver = LinearGaussSeidel()\n sub2 = sub1.add('sub2', Group(), promotes=['*'])\n sub2.add('comp', ExecComp(['x = 2.0*a + 3.0*b', 'y=4.0*a - 1.0*b']), promotes=['*'])\n sub2.ln_solver = LinearGaussSeidel()\n\n root.ln_solver.options['mode'] = 'fwd'\n sub1.ln_solver.options['mode'] = 'fwd'\n sub2.ln_solver.options['mode'] = 'fwd'\n\n prob.setup(check=False)\n prob.run()\n\n root.ln_solver = LinearGaussSeidel()\n root.ln_solver.options['single_voi_relevance_reduction'] = True\n prob.driver.add_desvar('p1.a', 1.0)\n prob.driver.add_constraint('x', upper=0.0)\n prob.driver.add_constraint('y', upper=0.0)\n with warnings.catch_warnings(record=True) as w:\n if not MPI:\n # suppress warning about not running under MPI\n warnings.simplefilter(\"ignore\")\n prob.driver.parallel_derivs(['x','y'])\n\n root.ln_solver.options['mode'] = 'rev'\n sub1.ln_solver.options['mode'] = 'rev'\n\n prob._setup_errors = []\n mode = prob._check_for_parallel_derivs(['a'], ['x'], True, False)\n\n msg = \"Group 'sub2' has mode 'fwd' but the root group has mode 'rev'. Modes must match to use parallel derivative groups.\"\n self.assertTrue(msg in prob._setup_errors[0])\n\n\n sub1.ln_solver.options['mode'] = 'fwd'\n sub2.ln_solver.options['mode'] = 'rev'\n\n\n prob._setup_errors = []\n mode = prob._check_for_parallel_derivs(['a'], ['x'], True, False)\n\n msg = \"Group 'sub1' has mode 'fwd' but the root group has mode 'rev'. Modes must match to use parallel derivative groups.\"\n self.assertTrue(msg in prob._setup_errors[0])\n\n\n sub1.ln_solver.options['mode'] = 'rev'\n mode = prob._check_for_parallel_derivs(['a'], ['x'], True, False)", "metadata": "root.TestProblem.test_check_parallel_derivs", "header": "['class', 'TestProblem', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 779 } ]
[ { "span": "C ", "start_line": 65, "start_column": 8, "end_line": 65, "end_column": 9 }, { "span": "test_src_idx_gt_src_size(", "start_line": 480, "start_column": 8, "end_line": 480, "end_column": 32 }, { "span": "mode ", "start_line": 814, "start_column": 8, "end_line": 814, "end_column": 12 }, { "span": "mode ", "start_line": 825, "start_column": 8, "end_line": 825, "end_column": 12 } ]
[ { "span": "test_src_idx_gt_src_size(", "start_line": 528, "start_column": 8, "end_line": 528, "end_column": 32 }, { "span": "mode ", "start_line": 832, "start_column": 8, "end_line": 832, "end_column": 12 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Test", "Problem_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "check", "\\u", "promote", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "verify", " ", "we", " ", "get", " ", "an", " ", "error", " ", "at", " ", "setup", " ", "time", " ", "if", " ", "we", " ", "have", " ", "promote", "d", " ", "a", " ", "var", " ", "tha", "t", " ", "doe", "sn", "'", "t", " ", "exist_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "valid", " ", "case", ",", " ", "no", " ", "error_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prob_", "=_", "Problem_", "(_", "Group_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "G_", "=_", "prob_", "._", "root_", "._", "add_", "(_", "'", "G", "'_", ",_", "Group_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "C_", "=_", "G_", "._", "add_", "(_", "'", "C", "'_", ",_", "Simple", "Comp_", "(_", ")_", ",_", "promote", "s_", "=_", "[_", "'", "x", "*'_", ",_", "'", "y", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "ignore", " ", "warn", "ing", " ", "abo", "ut", " ", "the", " ", "uncon", "nect", "ed", " ", "param_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "warnings_", "._", "catch", "\\u", "warnings_", "(_", "record_", "=_", "True_", ")_", "as_", "w_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warnings_", "._", "simplefilter_", "(_", "\"", "ignore", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "setup_", "(_", "check_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "promo", "ting", " ", "a", " ", "non", "-", "existen", "t", " ", "variab", "le", " ", "shou", "ld", " ", "throw", " ", "an", " ", "error_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prob_", "=_", "Problem_", "(_", "Group_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "G_", "=_", "prob_", "._", "root_", "._", "add_", "(_", "'", "G", "'_", ",_", "Group_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "C_", "=_", "G_", "._", "add_", "(_", "'", "C", "'_", ",_", "Simple", "Comp_", "(_", ")_", ",_", "promote", "s_", "=_", "[_", "'", "spoo", "n", "'_", "]_", ")_", "#", " ", "there", " ", "is", " ", "no", " ", "spoo", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prob_", "._", "setup_", "(_", "check_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "\"'", "G", ".", "C", "'", " ", "promote", "s", " ", "'", "spoo", "n", "'", " ", "but", " ", "has", " ", "no", " ", "variab", "les", " ", "matchi", "ng", " ", "tha", "t", " ", "specifica", "tion", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "text", "\\u", "type_", "(_", "error_", ")_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Error", " ", "expected", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "promo", "ting", " ", "a", " ", "pattern", " ", "with", " ", "no", " ", "matche", "s", " ", "shou", "ld", " ", "throw", " ", "an", " ", "error_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prob_", "=_", "Problem_", "(_", "Group_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "G_", "=_", "prob_", "._", "root_", "._", "add_", "(_", "'", "G", "'_", ",_", "Group_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "=_", "G_", "._", "add_", "(_", "'", "P", "'_", ",_", "Inde", "p", "Var", "Comp_", "(_", "'", "x", "'_", ",_", "5._", ")_", ",_", "promote", "s_", "=_", "[_", "'", "a", "*'_", "]_", ")_", "#", " ", "there", " ", "is", " ", "no", " ", "match_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prob_", "._", "setup_", "(_", "check_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "\"'", "G", ".", "P", "'", " ", "promote", "s", " ", "'", "a", "*'", " ", "but", " ", "has", " ", "no", " ", "variab", "les", " ", "matchi", "ng", " ", "tha", "t", " ", "specifica", "tion", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "text", "\\u", "type_", "(_", "error_", ")_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Error", " ", "expected", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Problem_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "src", "\\u", "idx", "\\u", "gt", "\\u", "src", "\\u", "size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "A_", "(_", "Component_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "A_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "state_", "(_", "'", "y", "'_", ",_", "np_", "._", "zeros_", "(_", "(_", "2_", ",_", ")_", ")_", ",_", "shape_", "=_", "(_", "2_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "B_", "(_", "Component_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "B_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "param_", "(_", "'", "x", "'_", ",_", "np_", "._", "zeros_", "(_", "(_", "3_", ",_", ")_", ")_", ",_", "shape_", "=_", "(_", "3_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "src", "\\u", "indice", "s", " ", "large", "r", " ", "than", " ", "src_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prob_", "=_", "Problem_", "(_", "root_", "=_", "Group_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "\"", "A", "\"_", ",_", "A_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "\"", "B", "\"_", ",_", "B_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "connect_", "(_", "\"", "A", ".", "y", "\"_", ",_", "\"", "B", ".", "x", "\"_", ",_", "src", "\\u", "indices_", "=_", "[_", "1_", ",_", "4_", ",_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prob_", "._", "setup_", "(_", "check_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "err_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"'", "B", ".", "x", "'", " ", "src", "\\u", "indice", "s", " ", "contain", "s", " ", "an", " ", "index", " ", "(", "4", ")", " ", "tha", "t", " ", "exceed", "s", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "the", " ", "bound", "s", " ", "of", " ", "source", " ", "variab", "le", " ", "'", "A", ".", "y", "'", " ", "of", " ", "size", " ", "2", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Except", "ion", " ", "expected", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Problem_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "src", "\\u", "idx", "\\u", "gt", "\\u", "src", "\\u", "size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "A_", "(_", "Component_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "A_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "output_", "(_", "'", "y", "'_", ",_", "np_", "._", "zeros_", "(_", "(_", "5_", ",_", ")_", ")_", ",_", "shape_", "=_", "(_", "5_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "B_", "(_", "Component_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "B_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "param_", "(_", "'", "x", "'_", ",_", "np_", "._", "zeros_", "(_", "(_", "3_", ",_", ")_", ")_", ",_", "shape_", "=_", "(_", "3_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "src", "\\u", "indice", "s", " ", "large", "r", " ", "than", " ", "src_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prob_", "=_", "Problem_", "(_", "root_", "=_", "Group_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "\"", "A", "\"_", ",_", "A_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "\"", "B", "\"_", ",_", "B_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "connect_", "(_", "\"", "A", ".", "y", "\"_", ",_", "\"", "B", ".", "x", "\"_", ",_", "src", "\\u", "indices_", "=_", "[_", "1_", ",_", "4_", ",_", "5_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prob_", "._", "setup_", "(_", "check_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "\"'", "B", ".", "x", "'", " ", "src", "\\u", "indice", "s", " ", "contain", "s", " ", "an", " ", "index", " ", "(", "5", ")", " ", "tha", "t", " ", "exceed", "s", " ", "the", " ", "bound", "s", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "of", " ", "source", " ", "variab", "le", " ", "'", "A", ".", "y", "'", " ", "of", " ", "size", " ", "5", ".\"_", "in_", "str_", "(_", "err_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Except", "ion", " ", "expected", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Problem_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "check", "\\u", "parall", "el", "\\u", "deriv", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prob_", "=_", "Problem_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "=_", "prob_", "._", "root_", "=_", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "root_", "._", "add_", "(_", "'", "p1", "'_", ",_", "Inde", "p", "Var", "Comp_", "(_", "'", "a", "'_", ",_", "1.0_", ")_", ",_", "promote", "s_", "=_", "[_", "'*'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "add_", "(_", "'", "p2", "'_", ",_", "Inde", "p", "Var", "Comp_", "(_", "'", "b", "'_", ",_", "1.0_", ")_", ",_", "promote", "s_", "=_", "[_", "'*'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub", "1_", "=_", "root_", "._", "add_", "(_", "'", "sub", "1", "'_", ",_", "Group_", "(_", ")_", ",_", "promote", "s_", "=_", "[_", "'*'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub", "1_", "._", "ln", "\\u", "solver_", "=_", "Linea", "r", "Gau", "ss", "Sei", "del_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub", "2_", "=_", "sub", "1_", "._", "add_", "(_", "'", "sub", "2", "'_", ",_", "Group_", "(_", ")_", ",_", "promote", "s_", "=_", "[_", "'*'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub", "2_", "._", "add_", "(_", "'", "comp", "'_", ",_", "Exe", "c", "Comp_", "(_", "[_", "'", "x", " ", "=", " ", "2.0", "*", "a", " ", "+", " ", "3.0", "*", "b", "'_", ",_", "'", "y", "=", "4.0", "*", "a", " ", "-", " ", "1.0", "*", "b", "'_", "]_", ")_", ",_", "promote", "s_", "=_", "[_", "'*'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub", "2_", "._", "ln", "\\u", "solver_", "=_", "Linea", "r", "Gau", "ss", "Sei", "del_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "root_", "._", "ln", "\\u", "solver_", "._", "options_", "[_", "'", "mode", "'_", "]_", "=_", "'", "fw", "d", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub", "1_", "._", "ln", "\\u", "solver_", "._", "options_", "[_", "'", "mode", "'_", "]_", "=_", "'", "fw", "d", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub", "2_", "._", "ln", "\\u", "solver_", "._", "options_", "[_", "'", "mode", "'_", "]_", "=_", "'", "fw", "d", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "prob_", "._", "setup_", "(_", "check_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "root_", "._", "ln", "\\u", "solver_", "=_", "Linea", "r", "Gau", "ss", "Sei", "del_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "ln", "\\u", "solver_", "._", "options_", "[_", "'", "single", "\\u", "voi", "\\u", "relevance", "\\u", "reduc", "tion", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "driver_", "._", "add", "\\u", "des", "var_", "(_", "'", "p1", ".", "a", "'_", ",_", "1.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "driver_", "._", "add", "\\u", "constraint_", "(_", "'", "x", "'_", ",_", "upper_", "=_", "0.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "driver_", "._", "add", "\\u", "constraint_", "(_", "'", "y", "'_", ",_", "upper_", "=_", "0.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "warnings_", "._", "catch", "\\u", "warnings_", "(_", "record_", "=_", "True_", ")_", "as_", "w_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "MPI_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "suppress", " ", "warn", "ing", " ", "abo", "ut", " ", "not", " ", "runn", "ing", " ", "under", " ", "MPI_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warnings_", "._", "simplefilter_", "(_", "\"", "ignore", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prob_", "._", "driver_", "._", "parall", "el", "\\u", "deriv", "s_", "(_", "[_", "'", "x", "'_", ",_", "'", "y", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "root_", "._", "ln", "\\u", "solver_", "._", "options_", "[_", "'", "mode", "'_", "]_", "=_", "'", "rev", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub", "1_", "._", "ln", "\\u", "solver_", "._", "options_", "[_", "'", "mode", "'_", "]_", "=_", "'", "rev", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "prob_", "._", "\\u", "setup", "\\u", "errors_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mode_", "=_", "prob_", "._", "\\u", "check", "\\u", "for", "\\u", "parall", "el", "\\u", "deriv", "s_", "(_", "[_", "'", "a", "'_", "]_", ",_", "[_", "'", "x", "'_", "]_", ",_", "True_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "msg_", "=_", "\"", "Group", " ", "'", "sub", "2", "'", " ", "has", " ", "mode", " ", "'", "fw", "d", "'", " ", "but", " ", "the", " ", "root", " ", "group", " ", "has", " ", "mode", " ", "'", "rev", "'.", " ", "Mode", "s", " ", "must", " ", "match", " ", "to", " ", "use", " ", "parall", "el", " ", "deriv", "ative", " ", "group", "s", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "msg_", "in_", "prob_", "._", "\\u", "setup", "\\u", "errors_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sub", "1_", "._", "ln", "\\u", "solver_", "._", "options_", "[_", "'", "mode", "'_", "]_", "=_", "'", "fw", "d", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub", "2_", "._", "ln", "\\u", "solver_", "._", "options_", "[_", "'", "mode", "'_", "]_", "=_", "'", "rev", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "prob_", "._", "\\u", "setup", "\\u", "errors_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mode_", "=_", "prob_", "._", "\\u", "check", "\\u", "for", "\\u", "parall", "el", "\\u", "deriv", "s_", "(_", "[_", "'", "a", "'_", "]_", ",_", "[_", "'", "x", "'_", "]_", ",_", "True_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "msg_", "=_", "\"", "Group", " ", "'", "sub", "1", "'", " ", "has", " ", "mode", " ", "'", "fw", "d", "'", " ", "but", " ", "the", " ", "root", " ", "group", " ", "has", " ", "mode", " ", "'", "rev", "'.", " ", "Mode", "s", " ", "must", " ", "match", " ", "to", " ", "use", " ", "parall", "el", " ", "deriv", "ative", " ", "group", "s", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "msg_", "in_", "prob_", "._", "\\u", "setup", "\\u", "errors_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sub", "1_", "._", "ln", "\\u", "solver_", "._", "options_", "[_", "'", "mode", "'_", "]_", "=_", "'", "rev", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mode_", "=_", "prob_", "._", "\\u", "check", "\\u", "for", "\\u", "parall", "el", "\\u", "deriv", "s_", "(_", "[_", "'", "a", "'_", "]_", ",_", "[_", "'", "x", "'_", "]_", ",_", "True_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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globals import *\n\nimport life as lfe\n\nimport judgement\nimport numbers\nimport speech\nimport brain\nimport stats\n\nimport logging\n\nSTATE = 'surrender'\nTIER = TIER_SUBMIT\n\nSTATE_ICONS[STATE] = chr(25)\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def conditions(life, alife_seen, alife_not_seen, targets_seen, targets_not_seen, source_map):\n\tRETURN_VALUE = STATE_UNCHANGED\n\t\n\tif not lfe.execute_raw(life, 'state', 'surrender'):\n\t\treturn False\n\n\tif not life['state'] == STATE:\n\t\tlfe.stop(life)\n\t\tlfe.say(life, '@n gives up.', action=True)\n\t\t\n\t\tRETURN_VALUE = STATE_CHANGE\n\t\n\treturn RETURN_VALUE", "metadata": "root.conditions", "header": "['module', '___EOS___']", "index": 17 }, { "content": "def tick(life, alife_seen, alife_not_seen, targets_seen, targets_not_seen, source_map):\n\tif lfe.ticker(life, 'call_for_help', 160, fire=True):\n\t\t_target = judgement.get_nearest_threat(life)\n\t\t_knows = brain.knows_alife_by_id(life, _target)\n\t\tif _target and judgement.get_nearest_trusted_target(life):\n\t\t\tif _knows:\n\t\t\t\tspeech.announce(life, 'attacked_by_hostile', public=True, target_id=_target, last_seen_at=_knows['last_seen_at'])\n\t\t\telse:\n\t\t\t\tspeech.announce(life, 'attacked_by_hostile', public=True, target_id=_target)", "metadata": "root.tick", "header": "['module', '___EOS___']", "index": 31 } ]
[ { "span": "import numbers", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 14 }, { "span": "import stats", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 12 }, { "span": "import logging", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 14 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "globals_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "life_", "as_", "lf", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "judge", "ment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numbers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "speech_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "brain_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "stats_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "STATE_", "=_", "'", "sur", "render", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TI", "ER_", "=_", "TI", "ER", "\\u", "SUBMIT", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "STATE", "\\u", "ICON", "S_", "[_", "STATE_", "]_", "=_", "chr_", "(_", "25_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "conditions_", "(_", "life_", ",_", "ali", "fe", "\\u", "seen_", ",_", "ali", "fe", "\\u", "not", "\\u", "seen_", ",_", "target", "s", "\\u", "seen_", ",_", "target", "s", "\\u", "not", "\\u", "seen_", ",_", "source", "\\u", "map_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "RETURN", "\\u", "VALUE_", "=_", "STATE", "\\u", "UNC", "HAN", "GED_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "lf", "e_", "._", "execute", "\\u", "raw_", "(_", "life_", ",_", "'", "state", "'_", ",_", "'", "sur", "render", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "life_", "[_", "'", "state", "'_", "]_", "==_", "STATE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "lf", "e_", "._", "stop_", "(_", "life_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lf", "e_", "._", "say_", "(_", "life_", ",_", "'@", "n", " ", "give", "s", " ", "up", ".'_", ",_", "action_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "RETURN", "\\u", "VALUE_", "=_", "STATE", "\\u", "CHANGE", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "RETURN", "\\u", "VALUE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tick_", "(_", "life_", ",_", "ali", "fe", "\\u", "seen_", ",_", "ali", "fe", "\\u", "not", "\\u", "seen_", ",_", "target", "s", "\\u", "seen_", ",_", "target", "s", "\\u", "not", "\\u", "seen_", ",_", "source", "\\u", "map_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "if_", "lf", "e_", "._", "ticker_", "(_", "life_", ",_", "'", "call", "\\u", "for", "\\u", "help", "'_", ",_", "160_", ",_", "fire_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "target_", "=_", "judge", "ment_", "._", "get", "\\u", "near", "est", "\\u", "threat", "_", "(_", "life_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "knows", "_", "=_", "brain_", "._", "knows", "\\u", "ali", "fe", "\\u", "by", "\\u", "id_", "(_", "life_", ",_", "\\u", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\\u", "target_", "and_", "judge", "ment_", "._", "get", "\\u", "near", "est", "\\u", "trusted", "\\u", "target_", "(_", "life_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "\\u", "knows", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "speech_", "._", "announce", "_", "(_", "life_", ",_", "'", "attac", "ked", "\\u", "by", "\\u", "hosti", "le", "'_", ",_", "public_", "=_", "True_", ",_", "target", "\\u", "id_", "=_", "\\u", "target_", ",_", "last", "\\u", "see", "n", "\\u", "at_", "=_", "\\u", "knows", "_", "[_", "'", "last", "\\u", "see", "n", "\\u", "at", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "speech_", "._", "announce", "_", "(_", "life_", ",_", "'", "attac", "ked", "\\u", "by", "\\u", "hosti", "le", "'_", ",_", "public_", "=_", "True_", ",_", "target", "\\u", "id_", "=_", "\\u", "target_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Module is imported more than once
codeupstudio/chipincode/modules/facebook.py
[ { "content": "#!/usr/bin/env python\n#\n# Copyright 2010 Facebook\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n# License for the specific language governing permissions and limitations\n# under the License.\n\n\"\"\"Python client library for the Facebook Platform.\n\nThis client library is designed to support the Graph API and the official\nFacebook JavaScript SDK, which is the canonical way to implement\nFacebook authentication. Read more about the Graph API at\nhttp://developers.facebook.com/docs/api. You can download the Facebook\nJavaScript SDK at http://github.com/facebook/connect-js/.\n\nIf your application is using Google AppEngine's webapp framework, your\nusage of this module might look like this:\n\n user = facebook.get_user_from_cookie(self.request.cookies, key, secret)\n if user:\n graph = facebook.GraphAPI(user[\"access_token\"])\n profile = graph.get_object(\"me\")\n friends = graph.get_connections(\"me\", \"friends\")\n\n\"\"\"\n\nimport cgi\nimport hashlib\nimport time\nimport urllib\nimport logging\nimport logging\nfrom gluon.tools import fetch\n\ntry:\n import json\n _parse_json = lambda s: json.loads(s)\nexcept ImportError:\n try:\n #import simplejson\n from gluon.contrib import simplejson\n _parse_json = lambda s: simplejson.loads(s)\n except ImportError:\n # For Google AppEngine\n from django.utils import simplejson\n _parse_json = lambda s: simplejson.loads(s)\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import logging", "start_line": 40, "start_column": 0, "end_line": 40, "end_column": 14 } ]
[ { "span": "import logging", "start_line": 39, "start_column": 0, "end_line": 39, "end_column": 14 } ]
1
true
[ "[CLS]_", "Module_", "is_", "imported_", "more_", "than_", "once_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2010", " ", "Face", "book_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", "d", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the", " ", "\"", "License", "\");", " ", "you", " ", "may", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "anc", "e", " ", "with", " ", "the", " ", "License", ".", " ", "You", " ", "may", " ", "obtain", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "License", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",", " ", "software", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "distributed", " ", "under", " ", "the", " ", "License", " ", "is", " ", "distributed", " ", "on", " ", "an", " ", "\"", "AS", " ", "IS", "\"", " ", "BAS", "IS", ",", " ", "WITH", "OUT_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", ".", " ", "See", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", " ", "for", " ", "the", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and", " ", "limit", "ations_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "under", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Pyth", "on", " ", "client", " ", "librar", "y", " ", "for", " ", "the", " ", "Face", "book", " ", "Plat", "form", ".", "\\", "10", ";", "\\", "10", ";", "Thi", "s", " ", "client", " ", "librar", "y", " ", "is", " ", "design", "ed", " ", "to", " ", "support", " ", "the", " ", "Graph", " ", "API", " ", "and", " ", "the", " ", "official", "\\", "10", ";", "Face", "book", " ", "Ja", "va", "Script", " ", "SD", "K", ",", " ", "whi", "ch", " ", "is", " ", "the", " ", "canonical", " ", "way", " ", "to", " ", "implement", "\\", "10", ";", "Face", "book", " ", "authenticat", "ion", ".", " ", "Read", " ", "more", " ", "abo", "ut", " ", "the", " ", "Graph", " ", "API", " ", "at", "\\", "10", ";", "http", "://", "developer", "s", ".", "facebook", ".", "com", "/", "docs", "/", "api", ".", " ", "You", " ", "can", " ", "download", " ", "the", " ", "Face", "book", "\\", "10", ";", "Ja", "va", "Script", " ", "SD", "K", " ", "at", " ", "http", "://", "git", "hub", ".", "com", "/", "facebook", "/", "connect", "-", "js", "/.", "\\", "10", ";", "\\", "10", ";", "If", " ", "your", " ", "applica", "tion", " ", "is", " ", "usi", "ng", " ", "Goo", "gle", " ", "App", "Engine", "'", "s", " ", "weba", "pp", " ", "frame", "work", ",", " ", "your", "\\", "10", ";", "usage", " ", "of", " ", "this", " ", "module", " ", "mig", "ht", " ", "look", " ", "like", " ", "this", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "user", " ", "=", " ", "facebook", ".", "get", "\\u", "user", "\\u", "from", "\\u", "cookie", "(", "self", ".", "request", ".", "cookie", "s", ",", " ", "key", ",", " ", "secret", ")", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "user", ":", "\\", "10", ";", " ", " ", " ", " ", "graph", " ", "=", " ", "facebook", ".", "Graph", "API", "(", "user", "[\"", "access", "\\u", "token", "\"]", ")", "\\", "10", ";", " ", " ", " ", " ", "profile", " ", "=", " ", "graph", ".", "get", "\\u", "object", "(\"", "me", "\")", "\\", "10", ";", " ", " ", " ", " ", "friends", " ", "=", " ", "graph", ".", "get", "\\u", "connections", "(\"", "me", "\",", " ", "\"", "friends", "\")", "\\", "10", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "cgi_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "hashlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "gluon_", "._", "tools_", "import_", "fetch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "parse", "\\u", "json_", "=_", "lambda_", "s_", ":_", "json_", "._", "loads_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "import", " ", "simplejson_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "gluon_", "._", "contrib_", "import_", "simplejson_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "parse", "\\u", "json_", "=_", "lambda_", "s_", ":_", "simplejson_", "._", "loads_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "For", " ", "Goo", "gle", " ", "App", "Engine_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "django_", "._", "utils_", "import_", "simplejson_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "parse", "\\u", "json_", "=_", "lambda_", "s_", ":_", "simplejson_", "._", "loads_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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courses/controllers/payments.py
[ { "content": "@auth.requires_login()\ndef pay_courses():\n\n\t\"\"\"\n\tThis function is responsible to redirect the user\n\tto the payment method it chose and process if\n\tthe amount to be paid is free. In this case, it will\n\tenroll the student to the class. Other way, the user\n\twill be redirected to pay.\n\t\"\"\"\n\n\torder = Order(id=session.order)\n\tif order.amount == 0:\n\t\tpending = Pending.insert(\n\t\t\t\t\t\t\t\torder_id = session.order,\n\t\t\t\t\t\t\t\tconfirmed = True\n\t\t\t\t\t\t\t\t)\n\t\tconfirmed = Confirmed.insert(\n\t\t\t\t\t\t\t\t\torder_id=order.id,\n\t\t\t\t\t\t\t\t\tpending_id=pending.id,\n\t\t\t\t\t\t\t\t\tconfirmation_time=request.now\n\t\t\t\t\t\t\t\t\t)\n\t\torder.update_record(status=2)\n\t\tsession.pending = pending\n\t\tredirect(URL('success'))\n\n\t\tmessage = T('We just confirmed your payment for order number %s.') % order.token\n\t\tmessage += '\\n'\n\t\tmessage += T('The total amount was R$%.2f.') % order.amount\n\t\tmessage += '\\n'\n\t\tmessage += T('You can check your payment history after login in to your profile.')\n\t\tmessage += '\\n\\n'\n\t\tmessage += T('Thank you!')\n\t\tmail.send(to=order.user_id.email,\n\t\t\t\tsubject=T(\"Payment confirmed!\"),\n\t\t\t\tmessage = message\n\t\t\t\t)\n\telse:\n\t\tpending = Pending.insert(order_id = order.id)\n\t\tsession.pending = pending\n\t\tredirect(URL('paypal'))", "metadata": "root.pay_courses", "header": "['module', '___EOS___']", "index": 81 }, { "content": "def ipn():\n\t\n\t\"\"\"\n\tThe IPN is the method that PayPal uses to\n\treturn information about the payment.\n\n\tThis function will receive this info and\n\tvalidate it, marking the user's order as\n\tconfirmed or not.\n\n\tPayPal only confirm the receipt of this\n\tinformation if you return the same info\n\tit passed to you. So, we return the\n\trequest.vars at the end of the function.\n\t\"\"\"\n\n\timport json\n\twrite_logs(request)\n\n\tpending = Pending(id=int(request.vars.invoice), confirmed=False)\n\tif not pending:\n\t\traise HTTP(404)\n\n\talready_confirmed = Confirmed(pending_id=pending.id)\n\tif already_confirmed:\n\t\treturn dict(status=\"Already Confirmed\", data=already_confirmed)\n\n\tif request.vars.payment_status == 'Completed':\n\t\tconfirmed = Confirmed.insert(\n\t\t\t\t\t\t\t\t\torder_id=pending.order_id,\n\t\t\t\t\t\t\t\t\tpending_id=pending.id,\n\t\t\t\t\t\t\t\t\tconfirmation_time=request.now\n\t\t\t\t\t\t\t\t\t)\n\n\t\tpending.update_record(confirmed=True)\n\t\tOrder(id=pending.order_id).update_record(status=2)\n\n\t\tmessage = T('We just confirmed your payment for order number %s.') % pending.order_id.token\n\t\tmessage += '\\n'\n\t\tmessage += T('The total amount was R$%.2f.') % pending.order_id.amount\n\t\tmessage += '\\n'\n\t\tmessage += T('You can check your payment history after login in to your profile.')\n\t\tmessage += '\\n\\n'\n\t\tmessage += T('Thank you!')\n\t\tmail.send(to=pending.order_id.user_id.email,\n\t\t\t\tsubject=T(\"Payment confirmed!\"),\n\t\t\t\tmessage = message\n\t\t\t\t)\n\telse:\n\t\tif request.is_local:\n\t\t\tpath = '/tmp/ipn_not_completed.txt'\n\t\telse:\n\t\t\t## common path for logs\n\t\t\tpath = '/var/log/ipn_not_completed.txt'\n\t\tmessage = '-'*80\n\t\tmessage += '\\nIPN NOT COMPLETED\\n'\n\t\tmessage += str(request.vars)\n\t\tmessage += '\\n'\n\t\tlog_in_file(message, path)\n\t\tOrder(id=pending.order_id).update_record(status=3)\n\t\tmail_message = T('There was a problem with your payment!')\n\t\tmail_message += '\\n\\n'\n\t\tmail_message += T(\"Something happened and we couldn't verify your payment.\")\n\t\tmail_message += '\\n'\n\t\tmail_message += T(\"If you're sure you paid the order, please contact us. Otherwise, try to pay again later.\")\n\t\tmail_message += '\\n\\n'\n\t\tmail_message += T(\"Thank you.\")\n\t\tmail.send(to=pending.order_id.user_id.email,\n\t\t\t\tsubject=T('Something went wrong!'),\n\t\t\t\tmessage = mail_message\n\t\t\t\t)\n\treturn json.dumps(request.vars)", "metadata": "root.ipn", "header": "['module', '___EOS___']", "index": 140 }, { "content": "@auth.requires_login()\ndef success():\n\t\n\t\"\"\"\n\tThis function is supposed to show a success or error message\n\tdepending of what PayPal IPN returns.\n\n\tSince in localhost we receive no return of PayPal, we can\n\thack a little bit in order to make the app continuous.\n\t\"\"\"\n\n\tif request.is_local:\n\t\tlog_in_file(str(request.vars), '/tmp/paypalreturn.txt')\n\telse:\n\t\tlog_in_file(str(request.vars), '/var/log/paypalreturn.txt')\n\n\tpending = Pending(id=session.pending)\n\tif request.is_local:\n\t\t## do what ipn was supposed to do\n\t\t## just for continuity purposes\n\t\tconfirmed = Confirmed.insert(\n\t\t\t\t\t\t\t\t\torder_id=pending.order_id,\n\t\t\t\t\t\t\t\t\tpending_id=pending.id,\n\t\t\t\t\t\t\t\t\tconfirmation_time=request.now\n\t\t\t\t\t\t\t\t\t)\n\t\tpending.update_record(confirmed=True)\n\t\tOrder(id=pending.order_id).update_record(status=2)\n\t\tmail_message = T('We just confirmed your payment for order number %s.') % pending.order_id.token\n\t\tmail_message += '\\n'\n\t\tmail_message += T('The total amount was R$%.2f.') % pending.order_id.amount\n\t\tmail_message += '\\n'\n\t\tmail_message += T('You can check your payment history after login in to your profile.')\n\t\tmail_message += '\\n\\n'\n\t\tmail_message += T('Thank you!')\n\t\tmail.send(to=pending.order_id.user_id.email,\n\t\t\t\tsubject=T(\"Payment confirmed!\"),\n\t\t\t\tmessage = mail_message\n\t\t\t\t)\n\n\tif pending.confirmed or request.is_local:\n\t\tmessage = T('Payment completed! Congratulations for your purchase!')\n\t\tfor cart_class in pending.order_id.products:\n\t\t\tStudent.insert(student = auth.user.id, class_id = cart_class)\n\telse:\n\t\tmessage = T('Sorry! Something bad happened!')\n\treturn dict(message=message)", "metadata": "root.success", "header": "['module', '___EOS___']", "index": 213 } ]
[ { "span": "confirmed ", "start_line": 98, "start_column": 2, "end_line": 98, "end_column": 11 }, { "span": "confirmed ", "start_line": 168, "start_column": 2, "end_line": 168, "end_column": 11 }, { "span": "confirmed ", "start_line": 233, "start_column": 2, "end_line": 233, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "auth_", "._", "require", "s", "\\u", "login_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "pay", "\\u", "courses_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\"\"\"", "\\", "10", ";", "\t", "Thi", "s", " ", "function", " ", "is", " ", "responsib", "le", " ", "to", " ", "redirec", "t", " ", "the", " ", "user", "\\", "10", ";", "\t", "to", " ", "the", " ", "pay", "ment", " ", "method", " ", "it", " ", "chos", "e", " ", "and", " ", "process", " ", "if", "\\", "10", ";", "\t", "the", " ", "amo", "unt", " ", "to", " ", "be", " ", "paid", " ", "is", " ", "free", ".", " ", "In", " ", "this", " ", "case", ",", " ", "it", " ", "will", "\\", "10", ";", "\t", "enroll", " ", "the", " ", "student", " ", "to", " ", "the", " ", "class", ".", " ", "Ot", "her", " ", "way", ",", " ", "the", " ", "user", "\\", "10", ";", "\t", "will", " ", "be", " ", "redirected", " ", "to", " ", "pay", ".", "\\", "10", ";", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "order_", "=_", "Order_", "(_", "id_", "=_", "session_", "._", "order_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "order_", "._", "amount_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "pending_", "=_", "Pend", "ing_", "._", "insert_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "order", "\\u", "id_", "=_", "session_", "._", "order_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "confirmed_", "=_", "True_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "confirmed_", "=_", "Confirm", "ed_", "._", "insert_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "order", "\\u", "id_", "=_", "order_", "._", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pend", "ing", "\\u", "id_", "=_", "pending_", "._", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "confirmation", "\\u", "time_", "=_", "request_", "._", "now_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "order_", "._", "update", "\\u", "record_", "(_", "status_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "pending_", "=_", "pending_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirect_", "(_", "URL_", "(_", "'", "success", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "=_", "T_", "(_", "'", "We", " ", "just", " ", "confirm", "ed", " ", "your", " ", "pay", "ment", " ", "for", " ", "order", " ", "number", " ", "%", "s", ".'_", ")_", "%_", "order_", "._", "token_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "+=_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "+=_", "T_", "(_", "'", "The", " ", "total", " ", "amo", "unt", " ", "was", " ", "R", "$%", ".2", "f", ".'_", ")_", "%_", "order_", "._", "amount_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "+=_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "+=_", "T_", "(_", "'", "You", " ", "can", " ", "check", " ", "your", " ", "pay", "ment", " ", "histo", "ry", " ", "after", " ", "login", " ", "in", " ", "to", " ", "your", " ", "profile", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "+=_", "'\\\\", "n", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "+=_", "T_", "(_", "'", "Than", "k", " ", "you", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mail_", "._", "send_", "(_", "to_", "=_", "order_", "._", "user", "\\u", "id_", "._", "email_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "subject_", "=_", "T_", "(_", "\"", "Payment", " ", "confirm", "ed", "!\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "=_", "message_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "pending_", "=_", "Pend", "ing_", "._", "insert_", "(_", "order", "\\u", "id_", "=_", "order_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "pending_", "=_", "pending_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirect_", "(_", "URL_", "(_", "'", "paypal", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ip", "n_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\"\"\"", "\\", "10", ";", "\t", "The", " ", "IP", "N", " ", "is", " ", "the", " ", "method", " ", "tha", "t", " ", "Pay", "Pal", " ", "use", "s", " ", "to", "\\", "10", ";", "\t", "return", " ", "informati", "on", " ", "abo", "ut", " ", "the", " ", "pay", "ment", ".", "\\", "10", ";", "\\", "10", ";", "\t", "Thi", "s", " ", "function", " ", "will", " ", "receive", " ", "this", " ", "info", " ", "and", "\\", "10", ";", "\t", "validat", "e", " ", "it", ",", " ", "marking", " ", "the", " ", "user", "'", "s", " ", "order", " ", "as", "\\", "10", ";", "\t", "confirm", "ed", " ", "or", " ", "not", ".", "\\", "10", ";", "\\", "10", ";", "\t", "Pay", "Pal", " ", "only", " ", "confirm", " ", "the", " ", "receipt", " ", "of", " ", "this", "\\", "10", ";", "\t", "informati", "on", " ", "if", " ", "you", " ", "return", " ", "the", " ", "same", " ", "info", "\\", "10", ";", "\t", "it", " ", "pass", "ed", " ", "to", " ", "you", ".", " ", "So", ",", " ", "we", " ", "return", " ", "the", "\\", "10", ";", "\t", "request", ".", "vars", " ", "at", " ", "the", " ", "end", " ", "of", " ", "the", " ", "function", ".", "\\", "10", ";", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "\\u", "logs_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pending_", "=_", "Pend", "ing_", "(_", "id_", "=_", "int_", "(_", "request_", "._", "vars_", "._", "invoice_", ")_", ",_", "confirmed_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "pending_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "HTTP_", "(_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "alr", "ead", "y", "\\u", "confirmed_", "=_", "Confirm", "ed_", "(_", "pend", "ing", "\\u", "id_", "=_", "pending_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "alr", "ead", "y", "\\u", "confirmed_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "return_", "dict_", "(_", "status_", "=_", "\"", "Al", "read", "y", " ", "Confirm", "ed", "\"_", ",_", "data_", "=_", "alr", "ead", "y", "\\u", "confirmed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "request_", "._", "vars_", "._", "pay", "ment", "\\u", "status_", "==_", "'", "Complete", "d", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "confirmed_", "=_", "Confirm", "ed_", "._", "insert_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "order", "\\u", "id_", "=_", "pending_", "._", "order", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pend", "ing", "\\u", "id_", "=_", "pending_", "._", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "confirmation", "\\u", "time_", "=_", "request_", "._", "now_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pending_", "._", "update", "\\u", "record_", "(_", "confirmed_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Order_", "(_", "id_", "=_", "pending_", "._", "order", "\\u", "id_", ")_", "._", "update", "\\u", "record_", "(_", "status_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "=_", "T_", "(_", "'", "We", " ", "just", " ", "confirm", "ed", " ", "your", " ", "pay", "ment", " ", "for", " ", "order", " ", "number", " ", "%", "s", ".'_", ")_", "%_", "pending_", "._", "order", "\\u", "id_", "._", "token_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "+=_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "+=_", "T_", "(_", "'", "The", " ", "total", " ", "amo", "unt", " ", "was", " ", "R", "$%", ".2", "f", ".'_", ")_", "%_", "pending_", "._", "order", "\\u", "id_", "._", "amount_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "+=_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "+=_", "T_", "(_", "'", "You", " ", "can", " ", "check", " ", "your", " ", "pay", "ment", " ", "histo", "ry", " ", "after", " ", "login", " ", "in", " ", "to", " ", "your", " ", "profile", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "+=_", "'\\\\", "n", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "+=_", "T_", "(_", "'", "Than", "k", " ", "you", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mail_", "._", "send_", "(_", "to_", "=_", "pending_", "._", "order", "\\u", "id_", "._", "user", "\\u", "id_", "._", "email_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "subject_", "=_", "T_", "(_", "\"", "Payment", " ", "confirm", "ed", "!\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "=_", "message_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "request_", "._", "is", "\\u", "local_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "path_", "=_", "'/", "tmp", "/", "ip", "n", "\\u", "not", "\\u", "complete", "d", ".", "txt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "##", " ", "common", " ", "path", " ", "for", " ", "logs_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "path_", "=_", "'/", "var", "/", "log", "/", "ip", "n", "\\u", "not", "\\u", "complete", "d", ".", "txt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "message_", "=_", "'-'_", "*_", "80_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "+=_", "'\\\\", "n", "IP", "N", " ", "NOT", " ", "COMPLETED", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "+=_", "str_", "(_", "request_", "._", "vars_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "+=_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log", "\\u", "in", "\\u", "file_", "(_", "message_", ",_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Order_", "(_", "id_", "=_", "pending_", "._", "order", "\\u", "id_", ")_", "._", "update", "\\u", "record_", "(_", "status_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mail", "\\u", "message_", "=_", "T_", "(_", "'", "There", " ", "was", " ", "a", " ", "problem", " ", "with", " ", "your", " ", "pay", "ment", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mail", "\\u", "message_", "+=_", "'\\\\", "n", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mail", "\\u", "message_", "+=_", "T_", "(_", "\"", "Some", "thing", " ", "happ", "ened", " ", "and", " ", "we", " ", "coul", "dn", "'", "t", " ", "verify", " ", "your", " ", "pay", "ment", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mail", "\\u", "message_", "+=_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mail", "\\u", "message_", "+=_", "T_", "(_", "\"", "If", " ", "you", "'", "re", " ", "sure", " ", "you", " ", "paid", " ", "the", " ", "order", ",", " ", "plea", "se", " ", "contact", " ", "us", ".", " ", "Ot", "her", "wis", "e", ",", " ", "try", " ", "to", " ", "pay", " ", "again", " ", "late", "r", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mail", "\\u", "message_", "+=_", "'\\\\", "n", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mail", "\\u", "message_", "+=_", "T_", "(_", "\"", "Than", "k", " ", "you", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mail_", "._", "send_", "(_", "to_", "=_", "pending_", "._", "order", "\\u", "id_", "._", "user", "\\u", "id_", "._", "email_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "subject_", "=_", "T_", "(_", "'", "Some", "thing", " ", "wen", "t", " ", "wrong", "!'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "=_", "mail", "\\u", "message_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "json_", "._", "dumps_", "(_", "request_", "._", "vars_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "auth_", "._", "require", "s", "\\u", "login_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "success_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\"\"\"", "\\", "10", ";", "\t", "Thi", "s", " ", "function", " ", "is", " ", "supposed", " ", "to", " ", "show", " ", "a", " ", "success", " ", "or", " ", "error", " ", "message", "\\", "10", ";", "\t", "depend", "ing", " ", "of", " ", "what", " ", "Pay", "Pal", " ", "IP", "N", " ", "return", "s", ".", "\\", "10", ";", "\\", "10", ";", "\t", "Sin", "ce", " ", "in", " ", "local", "host", " ", "we", " ", "receive", " ", "no", " ", "return", " ", "of", " ", "Pay", "Pal", ",", " ", "we", " ", "can", "\\", "10", ";", "\t", "hack", " ", "a", " ", "litt", "le", " ", "bit", " ", "in", " ", "order", " ", "to", " ", "make", " ", "the", " ", "app", " ", "continuous", ".", "\\", "10", ";", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "request_", "._", "is", "\\u", "local_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "log", "\\u", "in", "\\u", "file_", "(_", "str_", "(_", "request_", "._", "vars_", ")_", ",_", "'/", "tmp", "/", "paypal", "return", ".", "txt", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "log", "\\u", "in", "\\u", "file_", "(_", "str_", "(_", "request_", "._", "vars_", ")_", ",_", "'/", "var", "/", "log", "/", "paypal", "return", ".", "txt", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pending_", "=_", "Pend", "ing_", "(_", "id_", "=_", "session_", "._", "pending_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "request_", "._", "is", "\\u", "local_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "##", " ", "do", " ", "what", " ", "ip", "n", " ", "was", " ", "supposed", " ", "to", " ", "do_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "just", " ", "for", " ", "continui", "ty", " ", "purpose", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "confirmed_", "=_", "Confirm", "ed_", "._", "insert_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "order", "\\u", "id_", "=_", "pending_", "._", "order", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pend", "ing", "\\u", "id_", "=_", "pending_", "._", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "confirmation", "\\u", "time_", "=_", "request_", "._", "now_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pending_", "._", "update", "\\u", "record_", "(_", "confirmed_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Order_", "(_", "id_", "=_", "pending_", "._", "order", "\\u", "id_", ")_", "._", "update", "\\u", "record_", "(_", "status_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mail", "\\u", "message_", "=_", "T_", "(_", "'", "We", " ", "just", " ", "confirm", "ed", " ", "your", " ", "pay", "ment", " ", "for", " ", "order", " ", "number", " ", "%", "s", ".'_", ")_", "%_", "pending_", "._", "order", "\\u", "id_", "._", "token_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mail", "\\u", "message_", "+=_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mail", "\\u", "message_", "+=_", "T_", "(_", "'", "The", " ", "total", " ", "amo", "unt", " ", "was", " ", "R", "$%", ".2", "f", ".'_", ")_", "%_", "pending_", "._", "order", "\\u", "id_", "._", "amount_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mail", "\\u", "message_", "+=_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mail", "\\u", "message_", "+=_", "T_", "(_", "'", "You", " ", "can", " ", "check", " ", "your", " ", "pay", "ment", " ", "histo", "ry", " ", "after", " ", "login", " ", "in", " ", "to", " ", "your", " ", "profile", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mail", "\\u", "message_", "+=_", "'\\\\", "n", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mail", "\\u", "message_", "+=_", "T_", "(_", "'", "Than", "k", " ", "you", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mail_", "._", "send_", "(_", "to_", "=_", "pending_", "._", "order", "\\u", "id_", "._", "user", "\\u", "id_", "._", "email_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "subject_", "=_", "T_", "(_", "\"", "Payment", " ", "confirm", "ed", "!\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "=_", "mail", "\\u", "message_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "pending_", "._", "confirmed_", "or_", "request_", "._", "is", "\\u", "local_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "message_", "=_", "T_", "(_", "'", "Payment", " ", "complete", "d", "!", " ", "Cong", "rat", "ulation", "s", " ", "for", " ", "your", " ", "purchase", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "cart", "\\u", "class_", "in_", "pending_", "._", "order", "\\u", "id_", "._", "products_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "Student_", "._", "insert_", "(_", "student_", "=_", "auth_", "._", "user_", "._", "id_", ",_", "class", "\\u", "id_", "=_", "cart", "\\u", "class_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "message_", "=_", "T_", "(_", "'", "So", "rr", "y", "!", " ", "Some", "th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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Comparison of identical values
amrdraz/kodr/app/brython/www/src/Lib/test/test_richcmp.py
[ { "content": " def test_coverage(self):\n # exercise all comparisons for lists\n x = [42]\n self.assertIs(x<x, False)\n self.assertIs(x<=x, True)\n self.assertIs(x==x, True)\n self.assertIs(x!=x, False)\n self.assertIs(x>x, False)\n self.assertIs(x>=x, True)\n y = [42, 42]\n self.assertIs(x<y, True)\n self.assertIs(x<=y, True)\n self.assertIs(x==y, False)\n self.assertIs(x!=y, True)\n self.assertIs(x>y, False)\n self.assertIs(x>=y, False)", "metadata": "root.ListTest.test_coverage", "header": "['class', 'ListTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 282 } ]
[ { "span": "x<x,", "start_line": 285, "start_column": 22, "end_line": 285, "end_column": 25 }, { "span": "x<=x,", "start_line": 286, "start_column": 22, "end_line": 286, "end_column": 26 }, { "span": "x==x,", "start_line": 287, "start_column": 22, "end_line": 287, "end_column": 26 }, { "span": "x!=x,", "start_line": 288, "start_column": 22, "end_line": 288, "end_column": 26 }, { "span": "x>x,", "start_line": 289, "start_column": 22, "end_line": 289, "end_column": 25 }, { "span": "x>=x,", "start_line": 290, "start_column": 22, "end_line": 290, "end_column": 26 } ]
[]
1
true
[ "[CLS]_", "Compari", "son_", "of_", "identical_", "values_", "[SEP]_", "class_", "List", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "coverage_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "exercise", " ", "all", " ", "comparisons", " ", "for", " ", "lists_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "[_", "42_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "x_", "<_", "x_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "x_", "<=_", "x_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "x_", "==_", "x_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "x_", "!=_", "x_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "x_", ">_", "x_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "x_", ">=_", "x_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "[_", "42_", ",_", "42_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "x_", "<_", "y_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "x_", "<=_", "y_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "x_", "==_", "y_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "x_", "!=_", "y_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "x_", ">_", "y_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "x_", ">=_", "y_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
dropbox/grouper/tests/test_requests.py
[ { "content": "from fixtures import graph, groups, permissions, session, standard_graph, users\n\nfrom grouper.model_soup import Group, Request, User\nfrom util import add_member\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def test_basic_request(graph, groups, permissions, session, standard_graph, users):\n group_sre = groups[\"team-sre\"]\n group_not_sre = [g for name,g in groups.items() if name != \"team-sre\"]\n\n assert not any([group.my_requests(status=\"pending\").all() for group in groups.values()]), \\\n \"no group should start with pending requests\"\n\n group_sre.add_member(users[\"[email protected]\"], users[\"[email protected]\"], reason=\"for the lulz\")\n session.commit()\n\n request_not_sre = [group.my_requests(status=\"pending\").all() for group in group_not_sre]\n assert not any(request_not_sre), \"only affected group should show pending requests\"\n request_sre = group_sre.my_requests(status=\"pending\").all()\n assert len(request_sre) == 1, \"affected group should have request\"\n\n request = session.query(Request).filter_by(id=request_sre[0].id).scalar()\n request.update_status(users[\"[email protected]\"], \"actioned\", \"for being a good person\")\n session.commit()\n\n assert not any([group.my_requests(status=\"pending\").all() for group in groups.values()]), \\\n \"no group should have requests after being actioned\"", "metadata": "root.test_basic_request", "header": "['module', '___EOS___']", "index": 6 }, { "content": "def test_aggregate_request(graph, groups, permissions, session, standard_graph, users):\n gary = users[\"[email protected]\"]\n testuser = users[\"[email protected]\"]\n not_involved = [user for name,user in users.items() if name not in (\"[email protected]\",\n \"[email protected]\")]\n\n assert not any([u.my_requests_aggregate().all() for u in users.values()]), \\\n \"should have no pending requests to begin with\"\n\n # one request to one team\n groups[\"team-sre\"].add_member(users[\"[email protected]\"], users[\"[email protected]\"],\n reason=\"for the lulz\")\n session.commit()\n\n assert len(gary.my_requests_aggregate().all()) == 1, \"one pending request for owner\"\n assert not any([u.my_requests_aggregate().all() for u in not_involved]), \\\n \"no pending requests if you're not the owner\"\n\n # two request to two teams, same owner\n groups[\"team-infra\"].add_member(users[\"[email protected]\"], users[\"[email protected]\"],\n reason=\"for the lulz\")\n session.commit()\n\n request_gary = gary.my_requests_aggregate().all()\n assert len(request_gary) == 2, \"two pending request for owner\"\n assert not any([u.my_requests_aggregate().all() for u in not_involved]), \\\n \"no pending requests if you're not the owner\"\n\n # resolving one request should reflect\n request = session.query(Request).filter_by(id=request_gary[0].id).scalar()\n request.update_status(users[\"[email protected]\"], \"actioned\", \"for being a good person\")\n session.commit()\n\n assert len(gary.my_requests_aggregate().all()) == 1, \"one pending request for owner\"\n assert not any([u.my_requests_aggregate().all() for u in not_involved]), \\\n \"no pending requests if you're not the owner\"\n\n # requests to dependent teams should reflect apprpriately\n groups[\"security-team\"].add_member(users[\"[email protected]\"], users[\"[email protected]\"],\n reason=\"for the lulz\")\n session.commit()\n\n assert len(gary.my_requests_aggregate().all()) == 1, \"super owner should not get request\"\n assert len(users[\"[email protected]\"].my_requests_aggregate().all()) == 1, \"owner should get request\"\n user_not_gary_oliver = [u for n,u in users.items() if n not in (\"[email protected]\",\"[email protected]\")]\n assert not any([u.my_requests_aggregate().all() for u in user_not_gary_oliver])\n\n # manager and np-owner should get requests\n figurehead = users[\"[email protected]\"]\n add_member(groups[\"audited-team\"], figurehead, role=\"manager\")\n assert len(figurehead.my_requests_aggregate().all()) == 0, \"no request for np-owner at first\"\n\n groups[\"tech-ops\"].add_member(users[\"[email protected]\"], users[\"[email protected]\"],\n reason=\"for the lulz\")\n assert len(figurehead.my_requests_aggregate().all()) == 1, \"request for np-owner\"\n\n groups[\"audited-team\"].add_member(users[\"[email protected]\"], users[\"[email protected]\"],\n reason=\"for the lulz\")\n assert len(figurehead.my_requests_aggregate().all()) == 2, \"request for np-owner and manager\"", "metadata": "root.test_aggregate_request", "header": "['module', '___EOS___']", "index": 28 } ]
[ { "span": "from fixtures import graph, groups, permissions, session, standard_graph, users", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 79 }, { "span": "from grouper.model_soup import Group, Request, User", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 51 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "fixtures_", "import_", "graph_", ",_", "groups_", ",_", "permissions_", ",_", "session_", ",_", "standard", "\\u", "graph_", ",_", "users_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "groupe", "r_", "._", "model", "\\u", "soup_", "import_", "Group_", ",_", "Request_", ",_", "User_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "util_", "import_", "add", "\\u", "member_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "basic", "\\u", "request_", "(_", "graph_", ",_", "groups_", ",_", "permissions_", ",_", "session_", ",_", "standard", "\\u", "graph_", ",_", "users_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "group", "\\u", "sre", "_", "=_", "groups_", "[_", "\"", "team", "-", "sre", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "group", "\\u", "not", "\\u", "sre", "_", "=_", "[_", "g_", "for_", "name_", ",_", "g_", "in_", "groups_", "._", "items_", "(_", ")_", "if_", "name_", "!=_", "\"", "team", "-", "sre", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "not_", "any_", "(_", "[_", "group_", "._", "my", "\\u", "requests_", "(_", "status_", "=_", "\"", "pend", "ing", "\"_", ")_", "._", "all_", "(_", ")_", "for_", "group_", "in_", "groups_", "._", "values_", "(_", ")_", "]_", ")_", ",_", "\"", "no", " ", "group", " ", "shou", "ld", " ", "start", " ", "with", " ", "pend", "ing", " ", "request", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "group", "\\u", "sre", "_", "._", "add", "\\u", "member_", "(_", "users_", "[_", "\"", "testu", "ser", "@", "a", ".", "co", "\"_", "]_", ",_", "users_", "[_", "\"", "testu", "ser", "@", "a", ".", "co", "\"_", "]_", ",_", "reason_", "=_", "\"", "for", " ", "the", " ", "lu", "lz", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "request", "\\u", "not", "\\u", "sre", "_", "=_", "[_", "group_", "._", "my", "\\u", "requests_", "(_", "status_", "=_", "\"", "pend", "ing", "\"_", ")_", "._", "all_", "(_", ")_", "for_", "group_", "in_", "group", "\\u", "not", "\\u", "sre", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "any_", "(_", "request", "\\u", "not", "\\u", "sre", "_", ")_", ",_", "\"", "only", " ", "affect", "ed", " ", "group", " ", "shou", "ld", " ", "show", " ", "pend", "ing", " ", "request", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request", "\\u", "sre", "_", "=_", "group", "\\u", "sre", "_", "._", "my", "\\u", "requests_", "(_", "status_", "=_", "\"", "pend", "ing", "\"_", ")_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "request", "\\u", "sre", "_", ")_", "==_", "1_", ",_", "\"", "affect", "ed", " ", "group", " ", "shou", "ld", " ", "have", " ", "request", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "request_", "=_", "session_", "._", "query_", "(_", "Request_", ")_", "._", "filter", "\\u", "by_", "(_", "id_", "=_", "request", "\\u", "sre", "_", "[_", "0_", "]_", "._", "id_", ")_", "._", "scalar_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "update", "\\u", "status_", "(_", "users_", "[_", "\"", "gar", "y", "@", "a", ".", "co", "\"_", "]_", ",_", "\"", "action", "ed", "\"_", ",_", "\"", "for", " ", "bei", "ng", " ", "a", " ", "good", " ", "person", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "not_", "any_", "(_", "[_", "group_", "._", "my", "\\u", "requests_", "(_", "status_", "=_", "\"", "pend", "ing", "\"_", ")_", "._", "all_", "(_", ")_", "for_", "group_", "in_", "groups_", "._", "values_", "(_", ")_", "]_", ")_", ",_", "\"", "no", " ", "group", " ", "shou", "ld", " ", "have", " ", "request", "s", " ", "after", " ", "bei", "ng", " ", "action", "ed", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "aggre", "gate", "\\u", "request_", "(_", "graph_", ",_", "groups_", ",_", "permissions_", ",_", "session_", ",_", "standard", "\\u", "graph_", ",_", "users_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gar", "y_", "=_", "users_", "[_", "\"", "gar", "y", "@", "a", ".", "co", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "testu", "ser_", "=_", "users_", "[_", "\"", "testu", "ser", "@", "a", ".", "co", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "not", "\\u", "involved", "_", "=_", "[_", "user_", "for_", "name_", ",_", "user_", "in_", "users_", "._", "items_", "(_", ")_", "if_", "name_", "not_", "in_", "(_", "\"", "gar", "y", "@", "a", ".", "co", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "testu", "ser", "@", "a", ".", "co", "\"_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "not_", "any_", "(_", "[_", "u_", "._", "my", "\\u", "request", "s", "\\u", "aggregate_", "(_", ")_", "._", "all_", "(_", ")_", "for_", "u_", "in_", "users_", "._", "values_", "(_", ")_", "]_", ")_", ",_", "\"", "shou", "ld", " ", "have", " ", "no", " ", "pend", "ing", " ", "request", "s", " ", "to", " ", "begin", " ", "with", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "one", " ", "request", " ", "to", " ", "one", " ", "team_", "\\u\\u\\uNL\\u\\u\\u_", "groups_", "[_", "\"", "team", "-", "sre", "\"_", "]_", "._", "add", "\\u", "member_", "(_", "users_", "[_", "\"", "testu", "ser", "@", "a", ".", "co", "\"_", "]_", ",_", "users_", "[_", "\"", "testu", "ser", "@", "a", ".", "co", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reason_", "=_", "\"", "for", " ", "the", " ", "lu", "lz", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "len_", "(_", "gar", "y_", "._", "my", "\\u", "request", "s", "\\u", "aggregate_", "(_", ")_", "._", "all_", "(_", ")_", ")_", "==_", "1_", ",_", "\"", "one", " ", "pend", "ing", " ", "request", " ", "for", " ", "owner", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "any_", "(_", "[_", "u_", "._", "my", "\\u", "request", "s", "\\u", "aggregate_", "(_", ")_", "._", "all_", "(_", ")_", "for_", "u_", "in_", "not", "\\u", "involved", "_", "]_", ")_", ",_", "\"", "no", " ", "pend", "ing", " ", "request", "s", " ", "if", " ", "you", "'", "re", " ", "not", " ", "the", " ", "owner", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "two", " ", "request", " ", "to", " ", "two", " ", "team", "s", ",", " ", "same", " ", "owner_", "\\u\\u\\uNL\\u\\u\\u_", "groups_", "[_", "\"", "team", "-", "infra", "\"_", "]_", "._", "add", "\\u", "member_", "(_", "users_", "[_", "\"", "testu", "ser", "@", "a", ".", "co", "\"_", "]_", ",_", "users_", "[_", "\"", "testu", "ser", "@", "a", ".", "co", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reason_", "=_", "\"", "for", " ", "the", " ", "lu", "lz", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "request", "\\u", "gar", "y_", "=_", "gar", "y_", "._", "my", "\\u", "request", "s", "\\u", "aggregate_", "(_", ")_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "request", "\\u", "gar", "y_", ")_", "==_", "2_", ",_", "\"", "two", " ", "pend", "ing", " ", "request", " ", "for", " ", "owner", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "any_", "(_", "[_", "u_", "._", "my", "\\u", "request", "s", "\\u", "aggregate_", "(_", ")_", "._", "all_", "(_", ")_", "for_", "u_", "in_", "not", "\\u", "involved", "_", "]_", ")_", ",_", "\"", "no", " ", "pend", "ing", " ", "request", "s", " ", "if", " ", "you", "'", "re", " ", "not", " ", "the", " ", "owner", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "resolv", "ing", " ", "one", " ", "request", " ", "shou", "ld", " ", "reflect", "_", "\\u\\u\\uNL\\u\\u\\u_", "request_", "=_", "session_", "._", "query_", "(_", "Request_", ")_", "._", "filter", "\\u", "by_", "(_", "id_", "=_", "request", "\\u", "gar", "y_", "[_", "0_", "]_", "._", "id_", ")_", "._", "scalar_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "update", "\\u", "status_", "(_", "users_", "[_", "\"", "gar", "y", "@", "a", ".", "co", "\"_", "]_", ",_", "\"", "action", "ed", "\"_", ",_", "\"", "for", " ", "bei", "ng", " ", "a", " ", "good", " ", "person", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "len_", "(_", "gar", "y_", "._", "my", "\\u", "request", "s", "\\u", "aggregate_", "(_", ")_", "._", "all_", "(_", ")_", ")_", "==_", "1_", ",_", "\"", "one", " ", "pend", "ing", " ", "request", " ", "for", " ", "owner", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "any_", "(_", "[_", "u_", "._", "my", "\\u", "request", "s", "\\u", "aggregate_", "(_", ")_", "._", "all_", "(_", ")_", "for_", "u_", "in_", "not", "\\u", "involved", "_", "]_", ")_", ",_", "\"", "no", " ", "pend", "ing", " ", "request", "s", " ", "if", " ", "you", "'", "re", " ", "not", " ", "the", " ", "owner", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "request", "s", " ", "to", " ", "dependent", " ", "team", "s", " ", "shou", "ld", " ", "reflect", " ", "app", "rpr", "iate", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "groups_", "[_", "\"", "security", "-", "team", "\"_", "]_", "._", "add", "\\u", "member_", "(_", "users_", "[_", "\"", "testu", "ser", "@", "a", ".", "co", "\"_", "]_", ",_", "users_", "[_", "\"", "testu", "ser", "@", "a", ".", "co", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reason_", "=_", "\"", "for", " ", "the", " ", "lu", "lz", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "len_", "(_", "gar", "y_", "._", "my", "\\u", "request", "s", "\\u", "aggregate_", "(_", ")_", "._", "all_", "(_", ")_", ")_", "==_", "1_", ",_", "\"", "super", " ", "owner", " ", "shou", "ld", " ", "not", " ", "get", " ", "request", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "users_", "[_", "\"", "oli", "ver", "@", "a", ".", "co", "\"_", "]_", "._", "my", "\\u", "request", "s", "\\u", "aggregate_", "(_", ")_", "._", "all_", "(_", ")_", ")_", "==_", "1_", ",_", "\"", "owner", " ", "shou", "ld", " ", "get", " ", "request", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "not", "\\u", "gar", "y", "\\u", "oli", "ver_", "=_", "[_", "u_", "for_", "n_", ",_", "u_", "in_", "users_", "._", "items_", "(_", ")_", "if_", "n_", "not_", "in_", "(_", "\"", "gar", "y", "@", "a", ".", "co", "\"_", ",_", "\"", "oli", "ver", "@", "a", ".", "co", "\"_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "any_", "(_", "[_", "u_", "._", "my", "\\u", "request", "s", "\\u", "aggregate_", "(_", ")_", "._", "all_", "(_", ")_", "for_", "u_", "in_", "user", "\\u", "not", "\\u", "gar", "y", "\\u", "oli", "ver_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "manage", "r", " ", "and", " ", "np", "-", "owner", " ", "shou", "ld", " ", "get", " ", "requests_", "\\u\\u\\uNL\\u\\u\\u_", "figure", "head_", "=_", "users_", "[_", "\"", "figure", "head", "@", "a", ".", "co", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "add", "\\u", "member_", "(_", "groups_", "[_", "\"", "audit", "ed", "-", "team", "\"_", "]_", ",_", "figure", "head_", ",_", "role_", "=_", "\"", "manage", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "figure", "head_", "._", "my", "\\u", "request", "s", "\\u", "aggregate_", "(_", ")_", "._", "all_", "(_", ")_", ")_", "==_", "0_", ",_", "\"", "no", " ", "request", " ", "for", " ", "np", "-", "owner", " ", "at", " ", "first", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "groups_", "[_", "\"", "tech", "-", "ops", "\"_", "]_", "._", "add", "\\u", "member_", "(_", "users_", "[_", "\"", "testu", "ser", "@", "a", ".", "co", "\"_", "]_", ",_", "users_", "[_", "\"", "testu", "ser", "@", "a", ".", "co", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reason_", "=_", "\"", "for", " ", "the", " ", "lu", "lz", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "figure", "head_", "._", "my", "\\u", "request", "s", "\\u", "aggregate_", "(_", ")_", "._", "all_", "(_", ")_", ")_", "==_", "1_", ",_", "\"", "request", " ", "for", " ", "np", "-", "owner", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "groups_", "[_", "\"", "audit", "ed", "-", "team", "\"_", "]_", "._", "add", "\\u", "member_", "(_", "users_", "[_", "\"", "testu", "ser", "@", "a", ".", "co", "\"_", "]_", ",_", "users_", "[_", "\"", "testu", "ser", "@", "a", ".", "co", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reason_", "=_", "\"", "for", " ", "the", " ", "lu", "lz", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "figure", "head_", "._", "my", "\\u", "request", "s", "\\u", "aggregate_", "(_", ")_", "._", "all_", "(_", ")_", ")_", "==_", "2_", ",_", "\"", "request", " ", "for", " ", "np", "-", "owner", " ", "and", " ", "manage", "r", "\"_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
JasonGiedymin/Flask-Module-Scaffold/src/myapp/apps/dummy/__init__.py
[ { "content": "from myapp import utils\n\n## Required\nmodule_name = utils.getFinalName(__name__)\nmodule = utils.getModule(__name__, subdomain=module_name)\n\nimport views\nimport views.morepages", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import views", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 12 }, { "span": "import views.morepages", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 22 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "myapp", "_", "import_", "utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Required_", "\\u\\u\\uNL\\u\\u\\u_", "module", "\\u", "name_", "=_", "utils_", "._", "get", "Final", "Name_", "(_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module_", "=_", "utils_", "._", "get", "Module_", "(_", "\\u\\u", "name\\u\\u_", ",_", "subdomain_", "=_", "module", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "views_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "views_", "._", "more", "pages_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 0, 1, 1, 1, 1 ]
Unused local variable
grundprinzip/sublemacspro/jove.py
[ { "content": " def set_mark(self, regions=None, update_status=True, and_selection=True):\n view = self.view\n mark_ring = self.state.mark_ring\n if regions is None:\n regions = self.get_cursors()\n\n # update the mark ring\n mark_ring.set(regions)\n\n if self.state.active_mark:\n # make sure the existing selection disappears and is replaced with an empty selection or\n # selections.\n self.set_cursors(self.get_regions())\n\n # if and_selection:\n # self.set_selection(pos)\n if update_status:\n self.set_status(\"Mark Saved\")", "metadata": "root.CmdUtil.set_mark", "header": "['class', 'CmdUtil', ':', '___EOS___']", "index": 689 }, { "content": " def swap_point_and_mark(self):\n view = self.view\n mark_ring = self.state.mark_ring\n mark = mark_ring.exchange(self.get_cursors())\n if mark is not None:\n # set the cursors to where the mark was\n self.set_cursors(mark)\n if self.state.active_mark:\n # restore the visible region if there was one\n self.set_cursors(self.get_regions())\n else:\n self.set_status(\"No mark in this buffer\")", "metadata": "root.CmdUtil.swap_point_and_mark", "header": "['class', 'CmdUtil', ':', '___EOS___']", "index": 729 }, { "content": " def for_each_cursor(self, function, *args, **kwargs):\n view = self.view\n selection = view.sel()\n regions = list(selection)\n selection.clear()\n\n # REMIND: for delete-white-space and other commands that change the size of the\n # buffer, you need to keep the cursors in a named set of cursors (like the mark\n # ring) so that they are adjusted properly. Also if the function returns None,\n # grab the cursor from the selection.\n can_modify = kwargs.pop('can_modify', False)\n\n if can_modify:\n key = \"tmp_cursors\"\n view.add_regions(key, regions, \"tmp\", \"\", sublime.HIDDEN)\n for i in range(len(regions)):\n # Grab the region (whose position has been maintained/adjusted by\n # sublime). Unfortunately we need to assume one region might merge into\n # another at any time, and reload all regions to check.\n regions = view.get_regions(key)\n if i >= len(regions):\n # we've deleted some cursors along the way - we're done\n break\n selection.add(regions[i])\n cursor = function(regions[i], *args, **kwargs)\n selection.clear()\n cursors = view.get_regions(key)\n view.erase_regions(key)\n else:\n # run the command passing in each cursor and collecting the returned cursor\n cursors = []\n for i,cursor in enumerate(regions):\n selection.add(cursor)\n cursor = function(cursor, *args, **kwargs)\n selection.clear()\n cursors.append(cursor)\n\n # add them all back when we're done\n selection.add_all(cursors)", "metadata": "root.CmdUtil.for_each_cursor", "header": "['class', 'CmdUtil', ':', '___EOS___']", "index": 799 }, { "content": " def to_other_end(self, point, direction):\n brac = \"([{\"\n kets = \")]}\"\n\n view = self.view\n scope_name = view.scope_name(point)\n if scope_name.find(\"comment\") >= 0:\n return None\n\n ch = view.substr(point)\n if direction > 0 and view.substr(point) in brac:\n return self.run_command(\"move_to\", {\"to\": \"brackets\"}, point=point)\n elif direction < 0 and view.substr(point - 1) in kets:\n # this can be tricky due to inconsistencies with sublime bracket matching\n # we need to handle \"))\" and \"()[0]\" when between the ) and [\n if point < view.size() and view.substr(point) in brac:\n # go inside the bracket (point - 1), then to the inside of the match, then back one more\n return self.run_command(\"move_to\", {\"to\": \"brackets\"}, point=point - 1) - 1\n else:\n return self.run_command(\"move_to\", {\"to\": \"brackets\"}, point=point)\n\n # otherwise it's a string\n start = point + direction\n self.run_command(\"expand_selection\", {\"to\": \"scope\"}, point=start)\n r = view.sel()[0]\n return r.end() if direction > 0 else r.begin()", "metadata": "root.CmdUtil.to_other_end", "header": "['class', 'CmdUtil', ':', '___EOS___']", "index": 879 }, { "content": " def run_cmd(self, util, direction=1):\n view = self.view\n\n def to_indentation(cursor):\n start = cursor.begin()\n while util.is_one_of(start, \" \\t\"):\n start += 1\n return start\n\n util.run_command(\"move_to\", {\"to\": \"hardbol\", \"extend\": False})\n util.for_each_cursor(to_indentation)", "metadata": "root.SbpMoveBackToIndentation.run_cmd", "header": "['class', 'SbpMoveBackToIndentation', '(', 'SbpTextCommand', ')', ':', '___EOS___']", "index": 1073 }, { "content": " def run_cmd(self, util, mode, direction=1):\n # This works first by finding the bounds of the operation by executing a forward-word\n # command. Then it performs the case command.\n view = self.view\n count = util.get_count(True)\n\n # copy the cursors\n selection = view.sel()\n regions = list(selection)\n\n # If the regions are all empty, we just move from where we are to where we're going. If\n # there are regions, we use the regions and just do the cap, lower, upper within that\n # region. That's different from Emacs but I think this is better than emacs.\n empty = util.all_empty_regions(regions)\n\n if empty:\n # run the move-word command so we can create a region\n direction = -1 if count < 0 else 1\n util.run_command(\"sbp_move_word\", {\"direction\": 1})\n\n # now the selection is at the \"other end\" and so we create regions out of all the\n # cursors\n new_regions = []\n for r, s in zip(regions, selection):\n new_regions.append(r.cover(s))\n selection.clear()\n selection.add_all(new_regions)\n\n # perform the operation\n if mode in ('upper', 'lower'):\n util.run_command(mode + \"_case\", {})\n else:\n for r in selection:\n util.view.replace(util.edit, r, view.substr(r).title())\n\n if empty:\n if count < 0:\n # restore cursors to original state if direction was backward\n selection.clear()\n selection.add_all(regions)\n else:\n # otherwise we leave the cursors at the end of the regions\n for r in new_regions:\n r.a = r.b = r.end()\n selection.clear()\n selection.add_all(new_regions)", "metadata": "root.SbpCaseWordCommand.run_cmd", "header": "['class', 'SbpCaseWordCommand', '(', 'SbpTextCommand', ')', ':', '___EOS___']", "index": 1131 }, { "content": " def run_cmd(self, util, direction):\n view = self.view\n state = util.state\n regions = util.get_regions()\n if not regions:\n regions = util.get_cursors()\n if regions:\n util.save_cursors(\"shift\")\n util.toggle_active_mark_mode(False)\n selection = self.view.sel()\n selection.clear()\n\n # figure out how far we're moving\n if state.argument_supplied:\n cols = direction * util.get_count()\n else:\n cols = direction * util.get_tab_size()\n\n # now we know which way and how far we're shifting, create a cursor for each line we\n # want to shift\n amount = abs(cols)\n count = 0\n shifted = 0\n for region in regions:\n for line in util.for_each_line(region):\n count += 1\n if cols < 0 and (line.size() < amount or not util.is_blank(line.a, line.a + amount)):\n continue\n selection.add(sublime.Region(line.a, line.a))\n shifted += 1\n\n # shift the region\n if cols > 0:\n # shift right\n self.view.run_command(\"insert\", {\"characters\": \" \" * cols})\n else:\n for i in range(amount):\n self.view.run_command(\"right_delete\")\n\n # restore the region\n util.restore_cursors(\"shift\")\n sublime.set_timeout(lambda: util.set_status(\"Shifted %d of %d lines in the region\" % (shifted, count)), 100)", "metadata": "root.SbpShiftRegionCommand.run_cmd", "header": "['class', 'SbpShiftRegionCommand', '(', 'SbpTextCommand', ')', ':', '___EOS___']", "index": 1364 }, { "content": " def find(self, val):\n # determine if this is case sensitive search or not\n flags = 0 if self.regex else sublime.LITERAL\n if not re.search(r'[A-Z]', val):\n flags |= sublime.IGNORECASE\n\n # find all instances if we have a search string\n if len(val) > 0:\n regions = self.view.find_all(val, flags)\n\n # find the closest match to where we currently are\n pos = None\n if self.current:\n pos = self.current.get_point()\n if pos is None:\n pos = self.point[-1].b\n index = self.find_closest(regions, pos, self.forward)\n\n # push this new state onto the stack\n self.push(ISearchInfo.StackItem(val, regions, [], index, self.forward, self.current.wrapped))\n else:\n regions = None\n index = -1\n self.update()", "metadata": "root.ISearchInfo.find", "header": "['class', 'ISearchInfo', '(', ')', ':', '___EOS___']", "index": 1893 }, { "content": " def find_closest(self, regions, pos, forward):\n #\n # The regions are sorted so clearly this would benefit from a simple binary search ...\n #\n if len(regions) == 0:\n return -1\n # find the first region after the specified pos\n found = False\n if forward:\n for index,r in enumerate(regions):\n if r.end() >= pos:\n return index\n return -1\n else:\n for index,r in enumerate(regions):\n if r.begin() > pos:\n return index - 1\n return len(regions) - 1", "metadata": "root.ISearchInfo.find_closest", "header": "['class', 'ISearchInfo', '(', ')', ':', '___EOS___']", "index": 2126 } ]
[ { "span": "view ", "start_line": 690, "start_column": 8, "end_line": 690, "end_column": 12 }, { "span": "view ", "start_line": 730, "start_column": 8, "end_line": 730, "end_column": 12 }, { "span": "cursor ", "start_line": 823, "start_column": 16, "end_line": 823, "end_column": 22 }, { "span": "ch ", "start_line": 888, "start_column": 8, "end_line": 888, "end_column": 10 }, { "span": "view ", "start_line": 1074, "start_column": 8, "end_line": 1074, "end_column": 12 }, { "span": "direction ", "start_line": 1148, "start_column": 12, "end_line": 1148, "end_column": 21 }, { "span": "view ", "start_line": 1365, "start_column": 8, "end_line": 1365, "end_column": 12 }, { "span": "regions ", "start_line": 1914, "start_column": 12, "end_line": 1914, "end_column": 19 }, { "span": "index ", "start_line": 1915, "start_column": 12, "end_line": 1915, "end_column": 17 }, { "span": "found ", "start_line": 2133, "start_column": 8, "end_line": 2133, "end_column": 13 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Cmd", "Util_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "mark_", "(_", "self_", ",_", "regions_", "=_", "None_", ",_", "update", "\\u", "status_", "=_", "True_", ",_", "and", "\\u", "selection_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "view_", "=_", "self_", "._", "view_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mark", "\\u", "ring_", "=_", "self_", "._", "state_", "._", "mark", "\\u", "ring_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "regions_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "regions_", "=_", "self_", "._", "get", "\\u", "cursors", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "update", " ", "the", " ", "mark", " ", "ring_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mark", "\\u", "ring_", "._", "set_", "(_", "regions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "state_", "._", "active", "\\u", "mark_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "the", " ", "exist", "ing", " ", "selection", " ", "disapp", "ear", "s", " ", "and", " ", "is", " ", "replaced", " ", "with", " ", "an", " ", "empty", " ", "selection", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "selection", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "cursors", "_", "(_", "self_", "._", "get", "\\u", "regions_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "and", "\\u", "selection", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "set\\u", "selection", "(", "pos", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "update", "\\u", "status_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "status_", "(_", "\"", "Mark", " ", "Save", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cmd", "Util_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "swap", "\\u", "point", "\\u", "and", "\\u", "mark_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "view_", "=_", "self_", "._", "view_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mark", "\\u", "ring_", "=_", "self_", "._", "state_", "._", "mark", "\\u", "ring_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mark_", "=_", "mark", "\\u", "ring_", "._", "exchange_", "(_", "self_", "._", "get", "\\u", "cursors", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mark_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "set", " ", "the", " ", "cursors", " ", "to", " ", "where", " ", "the", " ", "mark", " ", "was", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "cursors", "_", "(_", "mark_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "state_", "._", "active", "\\u", "mark_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "restore", " ", "the", " ", "visi", "ble", " ", "region", " ", "if", " ", "there", " ", "was", " ", "one_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "cursors", "_", "(_", "self_", "._", "get", "\\u", "regions_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "status_", "(_", "\"", "No", " ", "mark", " ", "in", " ", "this", " ", "buffer", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cmd", "Util_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "for", "\\u", "each", "\\u", "cursor_", "(_", "self_", ",_", "function_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "view_", "=_", "self_", "._", "view_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "selection_", "=_", "view_", "._", "sel_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "regions_", "=_", "list_", "(_", "selection_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "selection_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "REM", "IND", ":", " ", "for", " ", "delete", "-", "white", "-", "space", " ", "and", " ", "other", " ", "command", "s", " ", "tha", "t", " ", "change", " ", "the", " ", "size", " ", "of", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "buffer", ",", " ", "you", " ", "need", " ", "to", " ", "keep", " ", "the", " ", "cursors", " ", "in", " ", "a", " ", "named", " ", "set", " ", "of", " ", "cursors", " ", "(", "like", " ", "the", " ", "mark_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ring", ")", " ", "so", " ", "tha", "t", " ", "the", "y", " ", "are", " ", "adjusted", " ", "proper", "ly", ".", " ", "Al", "so", " ", "if", " ", "the", " ", "function", " ", "return", "s", " ", "Non", "e", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "gra", "b", " ", "the", " ", "cursor", " ", "from", " ", "the", " ", "selection", "._", "\\u\\u\\uNL\\u\\u\\u_", "can", "\\u", "modify_", "=_", "kwargs_", "._", "pop_", "(_", "'", "can", "\\u", "modif", "y", "'_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "can", "\\u", "modify_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "\"", "tmp", "\\u", "cursors", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view_", "._", "add", "\\u", "regions_", "(_", "key_", ",_", "regions_", ",_", "\"", "tmp", "\"_", ",_", "\"\"_", ",_", "sublime_", "._", "HIDDEN", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "regions_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Grab", " ", "the", " ", "region", " ", "(", "who", "se", " ", "position", " ", "has", " ", "bee", "n", " ", "maintain", "ed", "/", "adjusted", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sublim", "e", ").", " ", "Unf", "ort", "unat", "el", "y", " ", "we", " ", "need", " ", "to", " ", "assume", " ", "one", " ", "region", " ", "mig", "ht", " ", "merge", " ", "into_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "anot", "her", " ", "at", " ", "any", " ", "time", ",", " ", "and", " ", "relo", "ad", " ", "all", " ", "regions", " ", "to", " ", "check", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "regions_", "=_", "view_", "._", "get", "\\u", "regions_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "i_", ">=_", "len_", "(_", "regions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "we", "'", "ve", " ", "delete", "d", " ", "some", " ", "cursors", " ", "along", " ", "the", " ", "way", " ", "-", " ", "we", "'", "re", " ", "done_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "selection_", "._", "add_", "(_", "regions_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cursor_", "=_", "function_", "(_", "regions_", "[_", "i_", "]_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "selection_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cursors", "_", "=_", "view_", "._", "get", "\\u", "regions_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view_", "._", "erase", "\\u", "regions_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "run", " ", "the", " ", "command", " ", "passi", "ng", " ", "in", " ", "each", " ", "cursor", " ", "and", " ", "collecti", "ng", " ", "the", " ", "return", "ed", " ", "cursor_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cursors", "_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "cursor_", "in_", "enumerate_", "(_", "regions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "selection_", "._", "add_", "(_", "cursor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cursor_", "=_", "function_", "(_", "cursor_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "selection_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cursors", "_", "._", "append_", "(_", "cursor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "them", " ", "all", " ", "back", " ", "whe", "n", " ", "we", "'", "re", " ", "done_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "selection_", "._", "add", "\\u", "all_", "(_", "cursors", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cmd", "Util_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "\\u", "other", "\\u", "end_", "(_", "self_", ",_", "point_", ",_", "direction_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bra", "c_", "=_", "\"([", "{\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ket", "s_", "=_", "\")]", "}\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "view_", "=_", "self_", "._", "view_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scope", "\\u", "name_", "=_", "view_", "._", "scope", "\\u", "name_", "(_", "point_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "scope", "\\u", "name_", "._", "find_", "(_", "\"", "comment", "\"_", ")_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ch_", "=_", "view_", "._", "substr_", "(_", "point_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "direction_", ">_", "0_", "and_", "view_", "._", "substr_", "(_", "point_", ")_", "in_", "bra", "c_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "run", "\\u", "command_", "(_", "\"", "move", "\\u", "to", "\"_", ",_", "{_", "\"", "to", "\"_", ":_", "\"", "brackets", "\"_", "}_", ",_", "point_", "=_", "point_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "direction_", "<_", "0_", "and_", "view_", "._", "substr_", "(_", "point_", "-_", "1_", ")_", "in_", "ket", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "this", " ", "can", " ", "be", " ", "trick", "y", " ", "due", " ", "to", " ", "incon", "siste", "ncie", "s", " ", "with", " ", "sublim", "e", " ", "bracket", " ", "matching_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "need", " ", "to", " ", "handle", " ", "\"))", "\"", " ", "and", " ", "\"(", ")[", "0", "]\"", " ", "whe", "n", " ", "bet", "ween", " ", "the", " ", ")", " ", "and", " ", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "point_", "<_", "view_", "._", "size_", "(_", ")_", "and_", "view_", "._", "substr_", "(_", "point_", ")_", "in_", "bra", "c_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "go", " ", "insi", "de", " ", "the", " ", "bracket", " ", "(", "point", " ", "-", " ", "1", "),", " ", "then", " ", "to", " ", "the", " ", "insi", "de", " ", "of", " ", "the", " ", "match", ",", " ", "then", " ", "back", " ", "one", " ", "more_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "run", "\\u", "command_", "(_", "\"", "move", "\\u", "to", "\"_", ",_", "{_", "\"", "to", "\"_", ":_", "\"", "brackets", "\"_", "}_", ",_", "point_", "=_", "point_", "-_", "1_", ")_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "run", "\\u", "command_", "(_", "\"", "move", "\\u", "to", "\"_", ",_", "{_", "\"", "to", "\"_", ":_", "\"", "brackets", "\"_", "}_", ",_", "point_", "=_", "point_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "other", "wis", "e", " ", "it", "'", "s", " ", "a", " ", "string_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "start_", "=_", "point_", "+_", "direction_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "run", "\\u", "command_", "(_", "\"", "expand", "\\u", "selection", "\"_", ",_", "{_", "\"", "to", "\"_", ":_", "\"", "scope", "\"_", "}_", ",_", "point_", "=_", "start_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "view_", "._", "sel_", "(_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "r_", "._", "end_", "(_", ")_", "if_", "direction_", ">_", "0_", "else_", "r_", "._", "begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sb", "p", "Move", "Back", "To", "Indent", "ation_", "(_", "Sb", "p", "Text", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "run", "\\u", "cmd_", "(_", "self_", ",_", "util_", ",_", "direction_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "view_", "=_", "self_", "._", "view_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "to", "\\u", "indentation_", "(_", "cursor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start_", "=_", "cursor_", "._", "begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "util_", "._", "is", "\\u", "one", "\\u", "of_", "(_", "start_", ",_", "\"", " ", "\\\\", "t", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "util_", "._", "run", "\\u", "command_", "(_", "\"", "move", "\\u", "to", "\"_", ",_", "{_", "\"", "to", "\"_", ":_", "\"", "hard", "bol", "\"_", ",_", "\"", "extend", "\"_", ":_", "False_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "util_", "._", "for", "\\u", "each", "\\u", "cursor_", "(_", "to", "\\u", "indentation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sb", "p", "Case", "Word", "Command_", "(_", "Sb", "p", "Text", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "run", "\\u", "cmd_", "(_", "self_", ",_", "util_", ",_", "mode_", ",_", "direction_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "works", " ", "first", " ", "by", " ", "finding", " ", "the", " ", "bound", "s", " ", "of", " ", "the", " ", "operati", "on", " ", "by", " ", "executi", "ng", " ", "a", " ", "forward", "-", "word_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "command", ".", " ", "The", "n", " ", "it", " ", "perform", "s", " ", "the", " ", "case", " ", "command", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "view_", "=_", "self_", "._", "view_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "util_", "._", "get", "\\u", "count_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "copy", " ", "the", " ", "cursors", "_", "\\u\\u\\uNL\\u\\u\\u_", "selection_", "=_", "view_", "._", "sel_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "regions_", "=_", "list_", "(_", "selection_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "regions", " ", "are", " ", "all", " ", "empty", ",", " ", "we", " ", "just", " ", "move", " ", "from", " ", "where", " ", "we", " ", "are", " ", "to", " ", "where", " ", "we", "'", "re", " ", "goi", "ng", ".", " ", "If_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "there", " ", "are", " ", "regions", ",", " ", "we", " ", "use", " ", "the", " ", "regions", " ", "and", " ", "just", " ", "do", " ", "the", " ", "cap", ",", " ", "lower", ",", " ", "upper", " ", "within", " ", "that_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "region", ".", " ", "Tha", "t", "'", "s", " ", "different", " ", "from", " ", "Ema", "cs", " ", "but", " ", "I", " ", "think", " ", "this", " ", "is", " ", "bett", "er", " ", "than", " ", "ema", "cs", "._", "\\u\\u\\uNL\\u\\u\\u_", "empty_", "=_", "util_", "._", "all", "\\u", "empty", "\\u", "regions_", "(_", "regions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "empty_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "run", " ", "the", " ", "move", "-", "word", " ", "command", " ", "so", " ", "we", " ", "can", " ", "create", " ", "a", " ", "region_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "direction_", "=_", "-_", "1_", "if_", "count_", "<_", "0_", "else_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "util_", "._", "run", "\\u", "command_", "(_", "\"", "sb", "p", "\\u", "move", "\\u", "word", "\"_", ",_", "{_", "\"", "direction", "\"_", ":_", "1_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "now", " ", "the", " ", "selection", " ", "is", " ", "at", " ", "the", " ", "\"", "other", " ", "end", "\"", " ", "and", " ", "so", " ", "we", " ", "create", " ", "regions", " ", "out", " ", "of", " ", "all", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "cursors", "_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "regions_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "r_", ",_", "s_", "in_", "zip_", "(_", "regions_", ",_", "selection_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "regions_", "._", "append_", "(_", "r_", "._", "cover_", "(_", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "selection_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "selection_", "._", "add", "\\u", "all_", "(_", "new", "\\u", "regions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "perform", " ", "the", " ", "operation_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "mode_", "in_", "(_", "'", "upper", "'_", ",_", "'", "lower", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "util_", "._", "run", "\\u", "command_", "(_", "mode_", "+_", "\"\\u", "case", "\"_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "r_", "in_", "selection_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "util_", "._", "view_", "._", "replace_", "(_", "util_", "._", "edit_", ",_", "r_", ",_", "view_", "._", "substr_", "(_", "r_", ")_", "._", "title_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "empty_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "count_", "<_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "restore", " ", "cursors", " ", "to", " ", "original", " ", "state", " ", "if", " ", "direction", " ", "was", " ", "backward_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "selection_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "selection_", "._", "add", "\\u", "all_", "(_", "regions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "other", "wis", "e", " ", "we", " ", "lea", "ve", " ", "the", " ", "cursors", " ", "at", " ", "the", " ", "end", " ", "of", " ", "the", " ", "regions_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "r_", "in_", "new", "\\u", "regions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "r_", "._", "a_", "=_", "r_", "._", "b_", "=_", "r_", "._", "end_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "selection_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "selection_", "._", "add", "\\u", "all_", "(_", "new", "\\u", "regions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sb", "p", "Shi", "ft", "Region", "Command_", "(_", "Sb", "p", "Text", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "run", "\\u", "cmd_", "(_", "self_", ",_", "util_", ",_", "direction_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "view_", "=_", "self_", "._", "view_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "state_", "=_", "util_", "._", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "regions_", "=_", "util_", "._", "get", "\\u", "regions_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "regions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "regions_", "=_", "util_", "._", "get", "\\u", "cursors", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "regions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "util_", "._", "save", "\\u", "cursors", "_", "(_", "\"", "shift", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "util_", "._", "toggle", "\\u", "active", "\\u", "mark", "\\u", "mode_", "(_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "selection_", "=_", "self_", "._", "view_", "._", "sel_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "selection_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "figure", " ", "out", " ", "how", " ", "far", " ", "we", "'", "re", " ", "movin", "g_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "state_", "._", "argu", "ment", "\\u", "supplie", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cols_", "=_", "direction_", "*_", "util_", "._", "get", "\\u", "count_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cols_", "=_", "direction_", "*_", "util_", "._", "get", "\\u", "tab", "\\u", "size_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "now", " ", "we", " ", "know", " ", "whi", "ch", " ", "way", " ", "and", " ", "how", " ", "far", " ", "we", "'", "re", " ", "shift", "ing", ",", " ", "create", " ", "a", " ", "cursor", " ", "for", " ", "each", " ", "line", " ", "we", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "want", " ", "to", " ", "shift_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "amount_", "=_", "abs_", "(_", "cols_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shifted", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "region_", "in_", "regions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "line_", "in_", "util_", "._", "for", "\\u", "each", "\\u", "line_", "(_", "region_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cols_", "<_", "0_", "and_", "(_", "line_", "._", "size_", "(_", ")_", "<_", "amount_", "or_", "not_", "util_", "._", "is", "\\u", "blank_", "(_", "line_", "._", "a_", ",_", "line_", "._", "a_", "+_", "amount_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "selection_", "._", "add_", "(_", "sublime_", "._", "Region_", "(_", "line_", "._", "a_", ",_", "line_", "._", "a_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shifted", "_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "shift", " ", "the", " ", "region_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "cols_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "shift", " ", "right_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "view_", "._", "run", "\\u", "command_", "(_", "\"", "insert", "\"_", ",_", "{_", "\"", "character", "s", "\"_", ":_", "\"", " ", "\"_", "*_", "cols_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "range_", "(_", "amount_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "view_", "._", "run", "\\u", "command_", "(_", "\"", "right", "\\u", "delete", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "restore", " ", "the", " ", "region_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "util_", "._", "restore", "\\u", "cursors", "_", "(_", "\"", "shift", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sublime_", "._", "set\\u", "timeout_", "(_", "lambda_", ":_", "util_", "._", "set\\u", "status_", "(_", "\"", "Shi", "fte", "d", " ", "%", "d", " ", "of", " ", "%", "d", " ", "lines", " ", "in", " ", "the", " ", "region", "\"_", "%_", "(_", "shifted", "_", ",_", "count_", ")_", ")_", ",_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "ear", "ch", "Info_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "find_", "(_", "self_", ",_", "val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "dete", "rmin", "e", " ", "if", " ", "this", " ", "is", " ", "case", " ", "sensi", "tiv", "e", " ", "search", " ", "or", " ", "not_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "flags_", "=_", "0_", "if_", "self_", "._", "regex_", "else_", "sublime_", "._", "LITERA", "L_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "re_", "._", "search_", "(_", "r", "'[", "A", "-", "Z", "]'_", ",_", "val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "flags_", "|=_", "sublime_", "._", "IGNORECASE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "find", " ", "all", " ", "instance", "s", " ", "if", " ", "we", " ", "have", " ", "a", " ", "search", " ", "string_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "val_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "regions_", "=_", "self_", "._", "view_", "._", "find", "\\u", "all_", "(_", "val_", ",_", "flags_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "find", " ", "the", " ", "closest", " ", "match", " ", "to", " ", "where", " ", "we", " ", "currentl", "y", " ", "are", "_", "\\u\\u\\uNL\\u\\u\\u_", "pos_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "current_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pos_", "=_", "self_", "._", "current_", "._", "get", "\\u", "point_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "pos_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pos_", "=_", "self_", "._", "point_", "[_", "-_", "1_", "]_", "._", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "index_", "=_", "self_", "._", "find", "\\u", "closest", "_", "(_", "regions_", ",_", "pos_", ",_", "self_", "._", "forward_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "push", " ", "this", " ", "new", " ", "state", " ", "onto", " ", "the", " ", "stack_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "push_", "(_", "IS", "ear", "ch", "Info_", "._", "Stack", "Item_", "(_", "val_", ",_", "regions_", ",_", "[_", "]_", ",_", "index_", ",_", "self_", "._", "forward_", ",_", "self_", "._", "current_", "._", "wrapped_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "regions_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "update_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "ear", "ch", "Info_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "find", "\\u", "closest", "_", "(_", "self_", ",_", "regions_", ",_", "pos_", ",_", "forward_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "regions", " ", "are", " ", "sorte", "d", " ", "so", " ", "clear", "ly", " ", "this", " ", "wou", "ld", " ", "benefit", " ", "from", " ", "a", " ", "simple", " ", "binar", "y", " ", "search", " ", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "regions_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "find", " ", "the", " ", "first", " ", "region", " ", "after", " ", "the", " ", "specified", " ", "pos_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "found_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "forward_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "index_", ",_", "r_", "in_", "enumerate_", "(_", "regions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "r_", "._", "end_", "(_", ")_", ">=_", "pos_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "index_", ",_", "r_", "in_", "enumerate_", "(_", "regions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "r_", "._", "begin_", "(_", ")_", ">_", "pos_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "index_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "len_", "(_", "regions_", ")_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
google/grr/grr/lib/flows/cron/system_test.py
[ { "content": " def testPurgeClientStats(self):\n max_age = system.PurgeClientStats.MAX_AGE\n\n for t in [1 * max_age, 1.5 * max_age, 2 * max_age]:\n with test_lib.FakeTime(t):\n urn = self.client_id.Add(\"stats\")\n\n stats_fd = aff4.FACTORY.Create(urn, \"ClientStats\", token=self.token,\n mode=\"rw\")\n st = client_rdf.ClientStats(RSS_size=int(t))\n stats_fd.AddAttribute(stats_fd.Schema.STATS(st))\n\n stats_fd.Close()\n\n stat_obj = aff4.FACTORY.Open(\n urn, age=aff4.ALL_TIMES, token=self.token, ignore_cache=True)\n stat_entries = list(stat_obj.GetValuesForAttribute(stat_obj.Schema.STATS))\n self.assertEqual(len(stat_entries), 3)\n self.assertTrue(max_age in [e.RSS_size for e in stat_entries])\n\n with test_lib.FakeTime(2.5 * max_age):\n for _ in test_lib.TestFlowHelper(\n \"PurgeClientStats\", None, client_id=self.client_id, token=self.token):\n pass\n\n stat_obj = aff4.FACTORY.Open(\n urn, age=aff4.ALL_TIMES, token=self.token, ignore_cache=True)\n stat_entries = list(stat_obj.GetValuesForAttribute(stat_obj.Schema.STATS))\n self.assertEqual(len(stat_entries), 1)\n self.assertTrue(max_age not in [e.RSS_size for e in stat_entries])", "metadata": "root.SystemCronFlowTest.testPurgeClientStats", "header": "['class', 'SystemCronFlowTest', '(', 'test_lib', '.', 'FlowTestsBaseclass', ')', ':', '___EOS___']", "index": 162 } ]
[ { "span": "self.assertTrue(max_age in [e.RSS_size for e in stat_entries])", "start_line": 180, "start_column": 4, "end_line": 180, "end_column": 66 }, { "span": "self.assertTrue(max_age not in [e.RSS_size for e in stat_entries])", "start_line": 191, "start_column": 4, "end_line": 191, "end_column": 70 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "System", "Cro", "n", "Flow", "Test_", "(_", "test\\u", "lib_", "._", "Flow", "Test", "s", "Base", "class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Purg", "e", "Client", "Stats_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "max", "\\u", "age_", "=_", "system_", "._", "Purg", "e", "Client", "Stats_", "._", "MAX", "\\u", "AGE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "t_", "in_", "[_", "1_", "*_", "max", "\\u", "age_", ",_", "1.5_", "*_", "max", "\\u", "age_", ",_", "2_", "*_", "max", "\\u", "age_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "test\\u", "lib_", "._", "Fake", "Time_", "(_", "t_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "urn_", "=_", "self_", "._", "client", "\\u", "id_", "._", "Add_", "(_", "\"", "stats", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stats", "\\u", "fd_", "=_", "aff4", "_", "._", "FACTORY", "_", "._", "Create_", "(_", "urn_", ",_", "\"", "Client", "Stat", "s", "\"_", ",_", "token_", "=_", "self_", "._", "token_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "\"", "rw", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "st_", "=_", "client", "\\u", "rdf", "_", "._", "Client", "Stats_", "(_", "RSS", "\\u", "size_", "=_", "int_", "(_", "t_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stats", "\\u", "fd_", "._", "Add", "Attribute_", "(_", "stats", "\\u", "fd_", "._", "Schema_", "._", "STATS", "_", "(_", "st_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stats", "\\u", "fd_", "._", "Close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "stat", "\\u", "obj_", "=_", "aff4", "_", "._", "FACTORY", "_", "._", "Open_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "urn_", ",_", "age_", "=_", "aff4", "_", "._", "ALL", "\\u", "TIMES", "_", ",_", "token_", "=_", "self_", "._", "token_", ",_", "ignore", "\\u", "cache_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stat", "\\u", "entries_", "=_", "list_", "(_", "stat", "\\u", "obj_", "._", "Get", "Value", "s", "For", "Attribute_", "(_", "stat", "\\u", "obj_", "._", "Schema_", "._", "STATS", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "stat", "\\u", "entries_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "max", "\\u", "age_", "in_", "[_", "e_", "._", "RSS", "\\u", "size_", "for_", "e_", "in_", "stat", "\\u", "entries_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "test\\u", "lib_", "._", "Fake", "Time_", "(_", "2.5_", "*_", "max", "\\u", "age_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "\\u_", "in_", "test\\u", "lib_", "._", "Test", "Flow", "Helper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Purg", "e", "Client", "Stat", "s", "\"_", ",_", "None_", ",_", "client", "\\u", "id_", "=_", "self_", "._", "client", "\\u", "id_", ",_", "token_", "=_", "self_", "._", "token_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "stat", "\\u", "obj_", "=_", "aff4", "_", "._", "FACTORY", "_", "._", "Open_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "urn_", ",_", "age_", "=_", "aff4", "_", "._", "ALL", "\\u", "TIMES", "_", ",_", "token_", "=_", "self_", "._", "token_", ",_", "ignore", "\\u", "cache_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stat", "\\u", "entries_", "=_", "list_", "(_", "stat", "\\u", "obj_", "._", "Get", "Value", "s", "For", "Attribute_", "(_", "stat", "\\u", "obj_", "._", "Schema_", "._", "STATS", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "stat", "\\u", "entries_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "max", "\\u", "age_", "not_", "in_", "[_", "e_", "._", "RSS", "\\u", "size_", "for_", "e_", "in_", "stat", "\\u", "entries_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused import
UDST/urbansim/setup.py
[ { "content": "# Install setuptools if not installed.\ntry:\n import setuptools\nexcept ImportError:\n from ez_setup import use_setuptools\n use_setuptools()\n\nfrom setuptools import setup, find_packages\n\n\n# read README as the long description\nwith open('README.rst', 'r') as f:\n long_description = f.read()\n\nsetup(\n name='urbansim',\n version='3.1dev',\n description='Tool for modeling metropolitan real estate markets',\n long_description=long_description,\n author='UrbanSim Inc.',\n author_email='[email protected]',\n license='BSD',\n url='https://github.com/udst/urbansim',\n classifiers=[\n 'Development Status :: 4 - Beta',\n 'Programming Language :: Python :: 2.7',\n 'License :: OSI Approved :: BSD License'\n ],\n package_data={\n '': ['*.html'],\n },\n packages=find_packages(exclude=['*.tests']),\n install_requires=[\n 'bottle>=0.12',\n 'matplotlib>=1.3.1',\n 'numpy>=1.8.0',\n 'orca>=1.1',\n 'pandas>=0.13.1',\n 'patsy>=0.2.1',\n 'prettytable>=0.7.2',\n 'pyyaml>=3.10',\n 'scipy>=0.13.3',\n 'simplejson>=3.3',\n 'statsmodels>=0.5.0',\n 'tables>=3.1.0',\n 'toolz>=0.7.0',\n 'zbox>=1.2'\n ],\n extras_require={\n 'pandana': ['pandana>=0.1']\n }\n)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import setuptools", "start_line": 2, "start_column": 4, "end_line": 2, "end_column": 21 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Install", " ", "setup", "tool", "s", " ", "if", " ", "not", " ", "install", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "setuptools_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "ez", "\\u", "setup_", "import_", "use", "\\u", "setuptools_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "use", "\\u", "setuptools_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "setuptools_", "import_", "setup_", ",_", "find", "\\u", "packages_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "read", " ", "READ", "ME", " ", "as", " ", "the", " ", "long", " ", "description_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "open_", "(_", "'", "READ", "ME", ".", "rst", "'_", ",_", "'", "r", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "long", "\\u", "description_", "=_", "f_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "setup_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "urban", "sim", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "'", "3.1", "dev", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "'", "Tool", " ", "for", " ", "modeling", " ", "metro", "poli", "tan", " ", "real", " ", "esta", "te", " ", "markets", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "long", "\\u", "description_", "=_", "long", "\\u", "description_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "author_", "=_", "'", "Ur", "ban", "Sim", " ", "Inc", ".'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "author", "\\u", "email_", "=_", "'", "info", "@", "urban", "sim", ".", "com", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "license_", "=_", "'", "BS", "D", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'", "https", "://", "git", "hub", ".", "com", "/", "ud", "st", "/", "urban", "sim", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "classifiers_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Dev", "elo", "pme", "nt", " ", "Status", " ", "::", " ", "4", " ", "-", " ", "Beta", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Programm", "ing", " ", "Lang", "ua", "ge", " ", "::", " ", "Pyth", "on", " ", "::", " ", "2.7", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "License", " ", "::", " ", "OSI", " ", "Appro", "ved", " ", "::", " ", "BS", "D", " ", "License", "'_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "''_", ":_", "[_", "'*", ".", "html", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "packages_", "=_", "find", "\\u", "packages_", "(_", "exclude_", "=_", "[_", "'*", ".", "tests", "'_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "install", "\\u", "requires_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bottle", ">=", "0.12", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mat", "plotlib", ">=", "1.3", ".1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "nump", "y", ">=", "1.8", ".0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "orca", ">=", "1.1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "panda", "s", ">=", "0.13", ".1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pat", "sy", ">=", "0.", "2.1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pretty", "table", ">=", "0.", "7.2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "py", "yaml", ">=", "3.1", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sci", "py", ">=", "0.13", ".3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "simple", "json", ">=", "3.3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "stats", "model", "s", ">=", "0.", "5.0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tables", ">=", "3.1", ".0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tool", "z", ">=", "0.", "7.0", "'_", ",_", "\\u\\u\\uNL\\u\\u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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Testing equality to None
rwl/muntjac/muntjac/ui/qtui2mj.py
[ { "content": " def __init__(self,parent,widget,mainUI=None,main=False):\n #when the initial widget is passed in main eq true so that A main object can be generated\n if mainUI==None:\n self.mainUI=MuntJacWindow()\n #when child widgets are created the original object reference is passed in.\n else:\n self.mainUI=mainUI\n \n self.main = main\n self.parent = parent # parent\n self.widget = widget # current widget\n self.cls = widget['class'] # for some reason class is a reserved word in python ( :) )\n self.mainwidget = None\n self.isLayout = False\n \n if self.main==False:\n if self.parent.wHandleSize==False:\n self.wHandleSize=False\n else:\n self.wHandleSize=True\n else:\n self.wHandleSize=False\n \n found, geometry = self.getProperty(\"geometry\")\n if found:\n self.geometry=geometry\n else:\n self.geometry=None\n \n self.makeWidget()\n self.makeChildren()", "metadata": "root.aWidget.__init__", "header": "['class', 'aWidget', '(', 'object', ')', ':', '___EOS___']", "index": 125 }, { "content": " def makeWidget(self):\n if not self.main:\n #TODO: handle the enabled disabled and readonly properties of all widgets\n \n if self.widget['class']==\"QWidget\":\n #the qwidget is like an Absolutelayout unless it has a layout defined inside of it\n if self.widget.layout!=None:\n if self.widget.layout[\"class\"]==\"QVBoxLayout\":\n self.mainUI.__dict__[self.widget.layout.name]=VerticalLayout()\n self.thiswidget = self.mainUI.__dict__[self.widget.layout.name]\n self.wHandleSize=False\n self.isLayout=True\n elif self.widget.layout[\"class\"]==\"QHBoxLayout\":\n self.mainUI.__dict__[self.widget.layout.name]=HorizontalLayout()\n self.thiswidget = self.mainUI.__dict__[self.widget.layout.name]\n self.wHandleSize=False\n self.isLayout=True\n \n elif self.widget.layout==None:\n self.mainUI.__dict__[self.widget.name]=AbsoluteLayout()\n self.thiswidget = self.mainUI.__dict__[self.widget.name]\n self.wHandleSize=True\n #if the parent of this qwidget is the mainwindow then use the geometry from the mainwindow for it\n if self.parent.widget['class']==\"QMainWindow\":\n self.parent.mainwidget = self.thiswidget\n self.mainUI.width = self.parent.geometry.rect.width\n self.mainUI.height = self.parent.geometry.rect.height\n \n elif self.widget['class']==\"QStackedWidget\":\n #there is not a stacked widget in munjac. So in mjextras i made one by removing the \n #tab headers from a tabsheet\n self.mainUI.__dict__[self.widget.name]=StackedSheet()\n self.thiswidget = self.mainUI.__dict__[self.widget.name]\n \n elif self.widget['class']==\"QGroupBox\":\n #for muntjac since there is no groupbox I am adding an AbsoluteLayout to a Panel\n title=str(self.getTitle())\n self.mainUI.__dict__[self.widget.name+'Panel']=Panel(title)\n self.thiswidget = self.mainUI.__dict__[self.widget.name+'Panel']\n self.mainUI.__dict__[self.widget.name]=AbsoluteLayout()\n self.thiswidget.setContent(self.mainUI.__dict__[self.widget.name])\n \n elif self.widget['class']==\"QLabel\":\n #QLabel makes a Label() they are alike\n text=str(self.getText())\n self.mainUI.__dict__[self.widget.name]=Label(text)\n self.thiswidget = self.mainUI.__dict__[self.widget.name]\n\n elif self.widget['class']==\"QLineEdit\":\n #conversion about the same only you cannot use the height or textfield gets \n #automatically converted to a TextArea by muntjac\n text=str(self.getText())\n self.mainUI.__dict__[self.widget.name]=TextField(\"\")\n self.thiswidget = self.mainUI.__dict__[self.widget.name]\n self.thiswidget.setValue(text)\n\n elif self.widget['class']==\"QPushButton\":\n #QPushButton converts to Button very well. In some of the widgetsets height doesnt translate well ie runo\n text=str(self.getText())\n self.mainUI.__dict__[self.widget.name]=Button(text)\n self.thiswidget = self.mainUI.__dict__[self.widget.name]\n\n elif self.widget['class']==\"QTextEdit\":\n #the difference with QTextEdit and TextArea is that textarea is resizeable\n #and as well QTextEdit has richtext in it.\n #TODO: convert richtext over to text for TextArea\n #TODO: figure out if richtextarea is needed\n html=str(self.getHtml())\n self.mainUI.__dict__[self.widget.name]=TextArea()\n self.thiswidget = self.mainUI.__dict__[self.widget.name]\n self.thiswidget.setValue(html)\n\n elif self.widget['class']==\"QTabWidget\":\n #QTabWidget and TabSheet are very similar\n self.mainUI.__dict__[self.widget.name]=TabSheet()\n self.thiswidget = self.mainUI.__dict__[self.widget.name]\n\n elif self.widget['class']==\"QTableView\" or self.widget['class']==\"QTableWidget\":\n #QTableView is more like Table than QTableWidget. But I convert both to Table\n self.mainUI.__dict__[self.widget.name]=Table()\n self.thiswidget = self.mainUI.__dict__[self.widget.name]\n \n elif self.widget['class']==\"QCheckBox\":\n #QCheckBox works pretty much like CheckBox only the state info is different.\n #TODO: set the correct state of the checkbox from the ui file\n self.mainUI.__dict__[self.widget.name]=CheckBox()\n self.thiswidget = self.mainUI.__dict__[self.widget.name]\n\n else:\n #left in print statement for unhandled widgets\n print \"could not handle \",self.widget['class']\n self.wHandleSize=False\n return\n \n if self.wHandleSize:\n self.handleSize()\n \n \n #determine the name and class name of the widget\n \n #handle if it is a layout\n if self.parent.widget['class']==\"QWidget\":\n if self.parent.widget.layout!=None:\n pnname=self.parent.widget.layout.name\n pnclass=self.parent.widget.layout['class']\n else:\n pnname=self.parent.widget.name\n pnclass=self.parent.widget['class']\n if self.widget.layout!=None:\n thname=self.widget.layout.name\n thclass=self.widget.layout['class']\n else:\n thname=self.widget.name\n thclass=self.widget['class']\n \n #handle if it is not a layout\n else:\n pnname=self.parent.widget.name\n pnclass=self.parent.widget['class']\n thname=self.widget.name\n thclass=self.widget['class']\n \n \n #handle adding the components to the parent\n #handle containers\n if pnclass==\"QVBoxLayout\" or \\\n pnclass==\"QHBoxLayout\" or \\\n pnclass==\"QTabWidget\" or \\\n pnclass==\"QStackedWidget\":\n if pnclass!=\"QMainWindow\":\n if self.parent.widget['class']==\"QStackedWidget\" or self.parent.widget['class']==\"QTabWidget\":\n self.parent.thiswidget.addTab(self.thiswidget)\n if thclass==\"QGroupBox\":\n self.thiswidget=self.mainUI.__dict__[thname]\n else:\n self.parent.thiswidget.addComponent(self.thiswidget)\n if thclass==\"QGroupBox\":\n self.thiswidget=self.mainUI.__dict__[thname]\n #handle widgets\n else:\n if pnclass!=\"QMainWindow\" and pnclass!=\"QVBoxLayout\" and pnclass!=\"QHBoxLayout\":\n if self.parent.geometry!=None:\n print \"adding\",thname,\"to\",pnname,\"is a\",pnclass,\"is a\",type(self.parent.thiswidget)\n xpos=\"%.2f\" % (((float(self.geometry.rect.x)+.001)/(float(self.parent.geometry.rect.width)+.001))*100)\n ypos=\"%.2f\" % (((float(self.geometry.rect.y)+.001)/(float(self.parent.geometry.rect.height)+.001))*100)\n self.parent.thiswidget.addComponent(self.thiswidget, \n \"top:\"+str(ypos)+\"%;left:\"+str(xpos)+\"%\")\n else:\n print \"adding\",thname,\"to\",pnname,\"is a\",pnclass,\"is a\",type(self.parent.thiswidget)\n self.parent.thiswidget.addComponent(self.thiswidget,\n \"top:\"+str(self.geometry.rect.y)+\"%;left:\"+str(self.geometry.rect.x)+\"%\")\n if thclass==\"QGroupBox\":\n self.thiswidget=self.mainUI.__dict__[thname]", "metadata": "root.aWidget.makeWidget", "header": "['class', 'aWidget', '(', 'object', ')', ':', '___EOS___']", "index": 157 }, { "content": " def handleSize(self):\n if self.geometry==None:\n self.geometry=self.parent.geometry\n wdth = \"%.2f\" % ((float(self.parent.geometry.rect.width)/float(self.parent.geometry.rect.width))*100)\n hgth = \"%.2f\" % ((float(self.parent.geometry.rect.height)/float(self.parent.geometry.rect.height))*100)\n if self.widget.name==\"gbValidation\":\n print self.widget.name,wdth,hgth\n if self.widget['class']!=\"QPanel\":\n self.thiswidget.setHeight(str(hgth)+\"%\")\n else:\n self.thiswidget.setHeight(str(self.parent.geometry.rect.height)+\"px\")\n self.thiswidget.setWidth(str(wdth)+\"%\")\n else:\n wdth = \"%.2f\" % ((float(self.geometry.rect.width)/(float(self.parent.geometry.rect.width)-float(self.geometry.rect.x)))*100)\n hgth = \"%.2f\" % ((float(self.geometry.rect.height)/(float(self.parent.geometry.rect.height)-float(self.geometry.rect.y)))*100)\n if self.widget.name==\"gbValidation\":\n print self.widget.name,wdth,hgth\n if self.widget['class']!=\"QLineEdit\":\n #if self.widget['class']!=\"QPanel\":\n self.thiswidget.setHeight(str(hgth)+\"%\")\n #else:\n # self.thiswidget.setHeight(str(self.geometry.rect.height)+\"px\")\n self.thiswidget.setWidth(str(wdth)+\"%\")", "metadata": "root.aWidget.handleSize", "header": "['class', 'aWidget', '(', 'object', ')', ':', '___EOS___']", "index": 312 } ]
[ { "span": "mainUI==None:", "start_line": 127, "start_column": 11, "end_line": 127, "end_column": 23 }, { "span": "self.widget.layout==None:", "start_line": 175, "start_column": 21, "end_line": 175, "end_column": 45 }, { "span": "self.geometry==None:", "start_line": 313, "start_column": 11, "end_line": 313, "end_column": 30 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "class_", "a", "Widget_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "parent_", ",_", "widget_", ",_", "main", "UI_", "=_", "None_", ",_", "main_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "whe", "n", " ", "the", " ", "initial", " ", "widget", " ", "is", " ", "pass", "ed", " ", "in", " ", "main", " ", "eq", " ", "true", " ", "so", " ", "tha", "t", " ", "A", " ", "main", " ", "object", " ", "can", " ", "be", " ", "generated_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "main", "UI_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "main", "UI_", "=_", "Mun", "t", "Ja", "c", "Window_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "whe", "n", " ", "child", " ", "widget", "s", " ", "are", " ", "created", " ", "the", " ", "original", " ", "object", " ", "reference", " ", "is", " ", "pass", "ed", " ", "in", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "main", "UI_", "=_", "main", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "main_", "=_", "main_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parent_", "=_", "parent_", "#", " ", "parent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "widget_", "=_", "widget_", "#", " ", "current", " ", "widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cls_", "=_", "widget_", "[_", "'", "class", "'_", "]_", "#", " ", "for", " ", "some", " ", "reason", " ", "class", " ", "is", " ", "a", " ", "reserve", "d", " ", "word", " ", "in", " ", "python", " ", "(", " ", ":)", " ", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "main", "widget_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "is", "Layout_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "main_", "==_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "parent_", "._", "w", "Handle", "Size_", "==_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "w", "Handle", "Size_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "w", "Handle", "Size_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "w", "Handle", "Size_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "found_", ",_", "geometry_", "=_", "self_", "._", "get", "Property_", "(_", "\"", "geom", "etry", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "found_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "geometry_", "=_", "geometry_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "geometry_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "make", "Widget_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "make", "Children_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "a", "Widget_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "make", "Widget_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "main_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "TOD", "O", ":", " ", "handle", " ", "the", " ", "enable", "d", " ", "disable", "d", " ", "and", " ", "read", "only", " ", "proper", "ties", " ", "of", " ", "all", " ", "widgets_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "widget_", "[_", "'", "class", "'_", "]_", "==_", "\"", "QW", "idge", "t", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "the", " ", "qw", "idge", "t", " ", "is", " ", "like", " ", "an", " ", "Abs", "olute", "layout", " ", "unl", "ess", " ", "it", " ", "has", " ", "a", " ", "layout", " ", "defin", "ed", " ", "insi", "de", " ", "of", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "widget_", "._", "layout_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "self_", "._", "widget_", "._", "layout_", "[_", "\"", "class", "\"_", "]_", "==_", "\"", "QV", "Box", "Lay", "out", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "layout_", "._", "name_", "]_", "=_", "Vertica", "l", "Layout_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "this", "widget_", "=_", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "layout_", "._", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "w", "Handle", "Size_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "is", "Layout_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "widget_", "._", "layout_", "[_", "\"", "class", "\"_", "]_", "==_", "\"", "Q", "HB", "ox", "Lay", "out", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "layout_", "._", "name_", "]_", "=_", "Horiz", "onta", "l", "Layout_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "this", "widget_", "=_", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "layout_", "._", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "w", "Handle", "Size_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "is", "Layout_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "widget_", "._", "layout_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "name_", "]_", "=_", "Abs", "olute", "Layout_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "this", "widget_", "=_", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "w", "Handle", "Size_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "the", " ", "parent", " ", "of", " ", "this", " ", "qw", "idge", "t", " ", "is", " ", "the", " ", "mainwindow", " ", "then", " ", "use", " ", "the", " ", "geom", "etry", " ", "from", " ", "the", " ", "mainwindow", " ", "for", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "parent_", "._", "widget_", "[_", "'", "class", "'_", "]_", "==_", "\"", "QM", "ain", "Window", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "parent_", "._", "main", "widget_", "=_", "self_", "._", "this", "widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "main", "UI_", "._", "width_", "=_", "self_", "._", "parent_", "._", "geometry_", "._", "rect_", "._", "width_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "main", "UI_", "._", "height_", "=_", "self_", "._", "parent_", "._", "geometry_", "._", "rect_", "._", "height_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "widget_", "[_", "'", "class", "'_", "]_", "==_", "\"", "QS", "tack", "ed", "Wid", "get", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "there", " ", "is", " ", "not", " ", "a", " ", "stacked", " ", "widget", " ", "in", " ", "mun", "jac", ".", " ", " ", "So", " ", "in", " ", "mj", "extra", "s", " ", "i", " ", "made", " ", "one", " ", "by", " ", "remo", "ving", " ", "the", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "tab", " ", "header", "s", " ", "from", " ", "a", " ", "tabs", "heet_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "name_", "]_", "=_", "Stack", "ed", "Sheet_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "this", "widget_", "=_", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "widget_", "[_", "'", "class", "'_", "]_", "==_", "\"", "QG", "roup", "Box", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "for", " ", "mun", "tj", "ac", " ", "sinc", "e", " ", "there", " ", "is", " ", "no", " ", "group", "box", " ", "I", " ", "am", " ", "addin", "g", " ", "an", " ", "Abs", "olute", "Lay", "out", " ", "to", " ", "a", " ", "Panel_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "title_", "=_", "str_", "(_", "self_", "._", "get", "Title_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "name_", "+_", "'", "Pane", "l", "'_", "]_", "=_", "Panel_", "(_", "title_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "this", "widget_", "=_", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "name_", "+_", "'", "Pane", "l", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "name_", "]_", "=_", "Abs", "olute", "Layout_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "this", "widget_", "._", "set", "Content_", "(_", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "name_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "widget_", "[_", "'", "class", "'_", "]_", "==_", "\"", "QL", "abel", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "QL", "abel", " ", "make", "s", " ", "a", " ", "Label", "()", " ", "the", "y", " ", "are", " ", "ali", "ke_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "str_", "(_", "self_", "._", "get", "Text_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "name_", "]_", "=_", "Label_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "this", "widget_", "=_", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "widget_", "[_", "'", "class", "'_", "]_", "==_", "\"", "QL", "ine", "Edit", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "conve", "rsi", "on", " ", "abo", "ut", " ", "the", " ", "same", " ", "only", " ", "you", " ", "cann", "ot", " ", "use", " ", "the", " ", "height", " ", "or", " ", "textfi", "eld", " ", "gets", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "automati", "call", "y", " ", "convert", "ed", " ", "to", " ", "a", " ", "Text", "Area", " ", "by", " ", "mun", "tj", "ac_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "str_", "(_", "self_", "._", "get", "Text_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "name_", "]_", "=_", "Text", "Field_", "(_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "this", "widget_", "=_", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "this", "widget_", "._", "set", "Value_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "widget_", "[_", "'", "class", "'_", "]_", "==_", "\"", "QP", "ush", "Butt", "on", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "QP", "ush", "Butt", "on", " ", "convert", "s", " ", "to", " ", "Butt", "on", " ", "very", " ", "well", ".", " ", " ", "In", " ", "some", " ", "of", " ", "the", " ", "widget", "sets", " ", "height", " ", "doesnt", " ", "translat", "e", " ", "well", " ", "ie", " ", "run", "o_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "str_", "(_", "self_", "._", "get", "Text_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "name_", "]_", "=_", "Button_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "this", "widget_", "=_", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "widget_", "[_", "'", "class", "'_", "]_", "==_", "\"", "QT", "ext", "Edit", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "the", " ", "difference", " ", "with", " ", "QT", "ext", "Edit", " ", "and", " ", "Text", "Area", " ", "is", " ", "tha", "t", " ", "text", "area", " ", "is", " ", "resiz", "eab", "le_", "\\u\\u\\uNL\\u\\u\\u_", "#", "and", " ", "as", " ", "well", " ", "QT", "ext", "Edit", " ", "has", " ", "rich", "text", " ", "in", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "TOD", "O", ":", " ", "convert", " ", "rich", "text", " ", "over", " ", "to", " ", "text", " ", "for", " ", "Text", "Area_", "\\u\\u\\uNL\\u\\u\\u_", "#", "TOD", "O", ":", " ", "figure", " ", "out", " ", "if", " ", "rich", "text", "area", " ", "is", " ", "needed_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "html_", "=_", "str_", "(_", "self_", "._", "get", "Html_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "name_", "]_", "=_", "Text", "Area_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "this", "widget_", "=_", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "this", "widget_", "._", "set", "Value_", "(_", "html_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "widget_", "[_", "'", "class", "'_", "]_", "==_", "\"", "QT", "ab", "Wid", "get", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "QT", "ab", "Wid", "get", " ", "and", " ", "Tab", "She", "et", " ", "are", " ", "very", " ", "similar_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "name_", "]_", "=_", "Tab", "Sheet_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "this", "widget_", "=_", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "widget_", "[_", "'", "class", "'_", "]_", "==_", "\"", "QT", "able", "View", "\"_", "or_", "self_", "._", "widget_", "[_", "'", "class", "'_", "]_", "==_", "\"", "QT", "able", "Wid", "get", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "QT", "able", "View", " ", "is", " ", "more", " ", "like", " ", "Table", " ", "than", " ", "QT", "able", "Wid", "get", ".", " ", " ", "Bu", "t", " ", "I", " ", "convert", " ", "bot", "h", " ", "to", " ", "Table_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "name_", "]_", "=_", "Table_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "this", "widget_", "=_", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "widget_", "[_", "'", "class", "'_", "]_", "==_", "\"", "QC", "heck", "Box", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "QC", "heck", "Box", " ", "works", " ", "pretty", " ", "muc", "h", " ", "like", " ", "Check", "Box", " ", "only", " ", "the", " ", "state", " ", "info", " ", "is", " ", "different", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "TOD", "O", ":", " ", "set", " ", "the", " ", "correct", " ", "state", " ", "of", " ", "the", " ", "checkb", "ox", " ", "from", " ", "the", " ", "ui", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "name_", "]_", "=_", "Check", "Box_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "this", "widget_", "=_", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "widget_", "._", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "left", " ", "in", " ", "print", " ", "statem", "ent", " ", "for", " ", "unhandled", " ", "widgets_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "coul", "d", " ", "not", " ", "handle", " ", "\"_", ",_", "self_", "._", "widget_", "[_", "'", "class", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "w", "Handle", "Size_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "w", "Handle", "Size_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "handle", "Size_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "dete", "rmin", "e", " ", "the", " ", "name", " ", "and", " ", "class", " ", "name", " ", "of", " ", "the", " ", "widget_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "handle", " ", "if", " ", "it", " ", "is", " ", "a", " ", "layout_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "parent_", "._", "widget_", "[_", "'", "class", "'_", "]_", "==_", "\"", "QW", "idge", "t", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "parent_", "._", "widget_", "._", "layout_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pn", "name_", "=_", "self_", "._", "parent_", "._", "widget_", "._", "layout_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pn", "class_", "=_", "self_", "._", "parent_", "._", "widget_", "._", "layout_", "[_", "'", "class", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pn", "name_", "=_", "self_", "._", "parent_", "._", "widget_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pn", "class_", "=_", "self_", "._", "parent_", "._", "widget_", "[_", "'", "class", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "widget_", "._", "layout_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "th", "name_", "=_", "self_", "._", "widget_", "._", "layout_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "th", "class_", "=_", "self_", "._", "widget_", "._", "layout_", "[_", "'", "class", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "th", "name_", "=_", "self_", "._", "widget_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "th", "class_", "=_", "self_", "._", "widget_", "[_", "'", "class", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "handle", " ", "if", " ", "it", " ", "is", " ", "not", " ", "a", " ", "layout_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pn", "name_", "=_", "self_", "._", "parent_", "._", "widget_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pn", "class_", "=_", "self_", "._", "parent_", "._", "widget_", "[_", "'", "class", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "th", "name_", "=_", "self_", "._", "widget_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "th", "class_", "=_", "self_", "._", "widget_", "[_", "'", "class", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "handle", " ", "addin", "g", " ", "the", " ", "component", "s", " ", "to", " ", "the", " ", "parent_", "\\u\\u\\uNL\\u\\u\\u_", "#", "handle", " ", "containers_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "pn", "class_", "==_", "\"", "QV", "Box", "Lay", "out", "\"_", "or_", "pn", "class_", "==_", "\"", "Q", "HB", "ox", "Lay", "out", "\"_", "or_", "pn", "class_", "==_", "\"", "QT", "ab", "Wid", "get", "\"_", "or_", "pn", "class_", "==_", "\"", "QS", "tack", "ed", "Wid", "get", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "pn", "class_", "!=_", "\"", "QM", "ain", "Window", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "parent_", "._", "widget_", "[_", "'", "class", "'_", "]_", "==_", "\"", "QS", "tack", "ed", "Wid", "get", "\"_", "or_", "self_", "._", "parent_", "._", "widget_", "[_", "'", "class", "'_", "]_", "==_", "\"", "QT", "ab", "Wid", "get", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "parent_", "._", "this", "widget_", "._", "add", "Tab_", "(_", "self_", "._", "this", "widget_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "th", "class_", "==_", "\"", "QG", "roup", "Box", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "this", "widget_", "=_", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "th", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "parent_", "._", "this", "widget_", "._", "add", "Component_", "(_", "self_", "._", "this", "widget_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "th", "class_", "==_", "\"", "QG", "roup", "Box", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "this", "widget_", "=_", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "th", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "handle", " ", "widgets_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "pn", "class_", "!=_", "\"", "QM", "ain", "Window", "\"_", "and_", "pn", "class_", "!=_", "\"", "QV", "Box", "Lay", "out", "\"_", "and_", "pn", "class_", "!=_", "\"", "Q", "HB", "ox", "Lay", "out", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "self_", "._", "parent_", "._", "geometry_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"", "addin", "g", "\"_", ",_", "th", "name_", ",_", "\"", "to", "\"_", ",_", "pn", "name_", ",_", "\"", "is", " ", "a", "\"_", ",_", "pn", "class_", ",_", "\"", "is", " ", "a", "\"_", ",_", "type_", "(_", "self_", "._", "parent_", "._", "this", "widget_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xpos_", "=_", "\"%", ".2", "f", "\"_", "%_", "(_", "(_", "(_", "float_", "(_", "self_", "._", "geometry_", "._", "rect_", "._", "x_", ")_", "+_", ".00", "1_", ")_", "/_", "(_", "float_", "(_", "self_", "._", "parent_", "._", "geometry_", "._", "rect_", "._", "width_", ")_", "+_", ".00", "1_", ")_", ")_", "*_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ypos_", "=_", "\"%", ".2", "f", "\"_", "%_", "(_", "(_", "(_", "float_", "(_", "self_", "._", "geometry_", "._", "rect_", "._", "y_", ")_", "+_", ".00", "1_", ")_", "/_", "(_", "float_", "(_", "self_", "._", "parent_", "._", "geometry_", "._", "rect_", "._", "height_", ")_", "+_", ".00", "1_", ")_", ")_", "*_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parent_", "._", "this", "widget_", "._", "add", "Component_", "(_", "self_", "._", "this", "widget_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "top", ":\"_", "+_", "str_", "(_", "ypos_", ")_", "+_", "\"%", ";", "left", ":\"_", "+_", "str_", "(_", "xpos_", ")_", "+_", "\"%\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "\"", "addin", "g", "\"_", ",_", "th", "name_", ",_", "\"", "to", "\"_", ",_", "pn", "name_", ",_", "\"", "is", " ", "a", "\"_", ",_", "pn", "class_", ",_", "\"", "is", " ", "a", "\"_", ",_", "type_", "(_", "self_", "._", "parent_", "._", "this", "widget_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parent_", "._", "this", "widget_", "._", "add", "Component_", "(_", "self_", "._", "this", "widget_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "top", ":\"_", "+_", "str_", "(_", "self_", "._", "geometry_", "._", "rect_", "._", "y_", ")_", "+_", "\"%", ";", "left", ":\"_", "+_", "str_", "(_", "self_", "._", "geometry_", "._", "rect_", "._", "x_", ")_", "+_", "\"%\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "th", "class_", "==_", "\"", "QG", "roup", "Box", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "this", "widget_", "=_", "self_", "._", "main", "UI_", "._", "\\u\\u", "dict\\u\\u_", "[_", "th", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "a", "Widget_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "Size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "geometry_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "geometry_", "=_", "self_", "._", "parent_", "._", "geometry_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wd", "th_", "=_", "\"%", ".2", "f", "\"_", "%_", "(_", "(_", "float_", "(_", "self_", "._", "parent_", "._", "geometry_", "._", "rect_", "._", "width_", ")_", "/_", "float_", "(_", "self_", "._", "parent_", "._", "geometry_", "._", "rect_", "._", "width_", ")_", ")_", "*_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hg", "th_", "=_", "\"%", ".2", "f", "\"_", "%_", "(_", "(_", "float_", "(_", "self_", "._", "parent_", "._", "geometry_", "._", "rect_", "._", "height_", ")_", "/_", "float_", "(_", "self_", "._", "parent_", "._", "geometry_", "._", "rect_", "._", "height_", ")_", ")_", "*_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "widget_", "._", "name_", "==_", "\"", "gb", "Validat", "ion", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "self_", "._", "widget_", "._", "name_", ",_", "wd", "th_", ",_", "hg", "th_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "widget_", "[_", "'", "class", "'_", "]_", "!=_", "\"", "QP", "ane", "l", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "this", "widget_", "._", "set", "Height_", "(_", "str_", "(_", "hg", "th_", ")_", "+_", "\"%\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "this", "widget_", "._", "set", "Height_", "(_", "str_", "(_", "self_", "._", "parent_", "._", "geometry_", "._", "rect_", "._", "height_", ")_", "+_", "\"", "px", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "this", "widget_", "._", "set", "Width_", "(_", "str_", "(_", "wd", "th_", ")_", "+_", "\"%\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "wd", "th_", "=_", "\"%", ".2", "f", "\"_", "%_", "(_", "(_", "float_", "(_", "self_", "._", "geometry_", "._", "rect_", "._", "width_", ")_", "/_", "(_", "float_", "(_", "self_", "._", "parent_", "._", "geometry_", "._", "rect_", "._", "width_", ")_", "-_", "float_", "(_", "self_", "._", "geometry_", "._", "rect_", "._", "x_", ")_", ")_", ")_", "*_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hg", "th_", "=_", "\"%", ".2", "f", "\"_", "%_", "(_", "(_", "float_", "(_", "self_", "._", "geometry_", "._", "rect_", "._", "height_", ")_", "/_", "(_", "float_", "(_", "self_", "._", "parent_", "._", "geometry_", "._", "rect_", "._", "height_", ")_", "-_", "float_", "(_", "self_", "._", "geometry_", "._", "rect_", "._", "y_", ")_", ")_", ")_", "*_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "widget_", "._", "name_", "==_", "\"", "gb", "Validat", "ion", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "self_", "._", "widget_", "._", "name_", ",_", "wd", "th_", ",_", "hg", "th_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "widget_", "[_", "'", "class", "'_", "]_", "!=_", "\"", "QL", "ine", "Edit", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "self", ".", "widget", "['", "class", "']", "!=", "\"", "QP", "ane", "l", "\":", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "this", "widget_", "._", "set", "Height_", "(_", "str_", "(_", "hg", "th_", ")_", "+_", "\"%\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "this", "widget", ".", "set", "Hei", "ght", "(", "str", "(", "self", ".", "geom", "etry", ".", "rect", ".", "height", ")+", "\"", "px", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "this", "widget_", "._", "set", "Width_", "(_", "str_", "(_", "wd", "th_", ")_", "+_", "\"%\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
pydata/pandas/pandas/io/tests/test_ga.py
[ { "content": " @with_connectivity_check(\"http://www.google.com\")\n def test_getdata(self):\n try:\n end_date = datetime.now()\n start_date = end_date - pd.offsets.Day() * 5\n end_date = end_date.strftime('%Y-%m-%d')\n start_date = start_date.strftime('%Y-%m-%d')\n\n reader = GAnalytics()\n df = reader.get_data(\n metrics=['avgTimeOnSite', 'visitors', 'newVisits',\n 'pageviewsPerVisit'],\n start_date=start_date,\n end_date=end_date,\n dimensions=['date', 'hour'],\n parse_dates={'ts': ['date', 'hour']},\n index_col=0)\n\n self.assertIsInstance(df, pd.DataFrame)\n self.assertIsInstance(df.index, pd.DatetimeIndex)\n self.assertGreater(len(df), 1)\n self.assertTrue('date' not in df)\n self.assertTrue('hour' not in df)\n self.assertEqual(df.index.name, 'ts')\n self.assertTrue('avgTimeOnSite' in df)\n self.assertTrue('visitors' in df)\n self.assertTrue('newVisits' in df)\n self.assertTrue('pageviewsPerVisit' in df)\n\n df2 = read_ga(\n metrics=['avgTimeOnSite', 'visitors', 'newVisits',\n 'pageviewsPerVisit'],\n start_date=start_date,\n end_date=end_date,\n dimensions=['date', 'hour'],\n parse_dates={'ts': ['date', 'hour']},\n index_col=0)\n\n assert_frame_equal(df, df2)\n\n except AuthenticationConfigError:\n raise nose.SkipTest(\"authentication error\")", "metadata": "root.TestGoogle.test_getdata", "header": "['class', 'TestGoogle', '(', 'tm', '.', 'TestCase', ')', ':', '___EOS___']", "index": 43 }, { "content": " @with_connectivity_check(\"http://www.google.com\")\n def test_iterator(self):\n try:\n reader = GAnalytics()\n\n it = reader.get_data(\n metrics='visitors',\n start_date='2005-1-1',\n dimensions='date',\n max_results=10, chunksize=5,\n index_col=0)\n\n df1 = next(it)\n df2 = next(it)\n\n for df in [df1, df2]:\n self.assertIsInstance(df, pd.DataFrame)\n self.assertIsInstance(df.index, pd.DatetimeIndex)\n self.assertEqual(len(df), 5)\n self.assertTrue('date' not in df)\n self.assertEqual(df.index.name, 'date')\n self.assertTrue('visitors' in df)\n\n self.assertTrue((df2.index > df1.index).all())\n\n except AuthenticationConfigError:\n raise nose.SkipTest(\"authentication error\")", "metadata": "root.TestGoogle.test_iterator", "header": "['class', 'TestGoogle', '(', 'tm', '.', 'TestCase', ')', ':', '___EOS___']", "index": 86 }, { "content": " @with_connectivity_check(\"http://www.google.com\")\n def test_segment(self):\n try:\n end_date = datetime.now()\n start_date = end_date - pd.offsets.Day() * 5\n end_date = end_date.strftime('%Y-%m-%d')\n start_date = start_date.strftime('%Y-%m-%d')\n\n reader = GAnalytics()\n df = reader.get_data(\n metrics=['avgTimeOnSite', 'visitors', 'newVisits',\n 'pageviewsPerVisit'],\n start_date=start_date,\n end_date=end_date,\n segment=-2,\n dimensions=['date', 'hour'],\n parse_dates={'ts': ['date', 'hour']},\n index_col=0)\n\n self.assertIsInstance(df, pd.DataFrame)\n self.assertIsInstance(df.index, pd.DatetimeIndex)\n self.assertGreater(len(df), 1)\n self.assertTrue('date' not in df)\n self.assertTrue('hour' not in df)\n self.assertEqual(df.index.name, 'ts')\n self.assertTrue('avgTimeOnSite' in df)\n self.assertTrue('visitors' in df)\n self.assertTrue('newVisits' in df)\n self.assertTrue('pageviewsPerVisit' in df)\n\n # dynamic\n df = read_ga(\n metrics=['avgTimeOnSite', 'visitors', 'newVisits',\n 'pageviewsPerVisit'],\n start_date=start_date,\n end_date=end_date,\n segment=\"source=~twitter\",\n dimensions=['date', 'hour'],\n parse_dates={'ts': ['date', 'hour']},\n index_col=0)\n\n assert isinstance(df, pd.DataFrame)\n assert isinstance(df.index, pd.DatetimeIndex)\n self.assertGreater(len(df), 1)\n self.assertTrue('date' not in df)\n self.assertTrue('hour' not in df)\n self.assertEqual(df.index.name, 'ts')\n self.assertTrue('avgTimeOnSite' in df)\n self.assertTrue('visitors' in df)\n self.assertTrue('newVisits' in df)\n self.assertTrue('pageviewsPerVisit' in df)\n\n except AuthenticationConfigError:\n raise nose.SkipTest(\"authentication error\")", "metadata": "root.TestGoogle.test_segment", "header": "['class', 'TestGoogle', '(', 'tm', '.', 'TestCase', ')', ':', '___EOS___']", "index": 139 } ]
[ { "span": "self.assertTrue('date' not in df)", "start_line": 64, "start_column": 12, "end_line": 64, "end_column": 45 }, { "span": "self.assertTrue('hour' not in df)", "start_line": 65, "start_column": 12, "end_line": 65, "end_column": 45 }, { "span": "self.assertTrue('avgTimeOnSite' in df)", "start_line": 67, "start_column": 12, "end_line": 67, "end_column": 50 }, { "span": "self.assertTrue('visitors' in df)", "start_line": 68, "start_column": 12, "end_line": 68, "end_column": 45 }, { "span": "self.assertTrue('newVisits' in df)", "start_line": 69, "start_column": 12, "end_line": 69, "end_column": 46 }, { "span": "self.assertTrue('pageviewsPerVisit' in df)", "start_line": 70, "start_column": 12, "end_line": 70, "end_column": 54 }, { "span": "self.assertTrue('date' not in df)", "start_line": 105, "start_column": 16, "end_line": 105, "end_column": 49 }, { "span": "self.assertTrue('visitors' in df)", "start_line": 107, "start_column": 16, "end_line": 107, "end_column": 49 }, { "span": "self.assertTrue('date' not in df)", "start_line": 161, "start_column": 12, "end_line": 161, "end_column": 45 }, { "span": "self.assertTrue('hour' not in df)", "start_line": 162, "start_column": 12, "end_line": 162, "end_column": 45 }, { "span": "self.assertTrue('avgTimeOnSite' in df)", "start_line": 164, "start_column": 12, "end_line": 164, "end_column": 50 }, { "span": "self.assertTrue('visitors' in df)", "start_line": 165, "start_column": 12, "end_line": 165, "end_column": 45 }, { "span": "self.assertTrue('newVisits' in df)", "start_line": 166, "start_column": 12, "end_line": 166, "end_column": 46 }, { "span": "self.assertTrue('pageviewsPerVisit' in df)", "start_line": 167, "start_column": 12, "end_line": 167, "end_column": 54 }, { "span": "self.assertTrue('date' not in df)", "start_line": 183, "start_column": 12, "end_line": 183, "end_column": 45 }, { "span": "self.assertTrue('hour' not in df)", "start_line": 184, "start_column": 12, "end_line": 184, "end_column": 45 }, { "span": "self.assertTrue('avgTimeOnSite' in df)", "start_line": 186, "start_column": 12, "end_line": 186, "end_column": 50 }, { "span": "self.assertTrue('visitors' in df)", "start_line": 187, "start_column": 12, "end_line": 187, "end_column": 45 }, { "span": "self.assertTrue('newVisits' in df)", "start_line": 188, "start_column": 12, "end_line": 188, "end_column": 46 }, { "span": "self.assertTrue('pageviewsPerVisit' in df)", "start_line": 189, "start_column": 12, "end_line": 189, "end_column": 54 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Goo", "gle_", "(_", "tm_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "with", "\\u", "connecti", "vity", "\\u", "check_", "(_", "\"", "http", "://", "www", ".", "google", ".", "com", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "getdata_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "end", "\\u", "date_", "=_", "datetime_", "._", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "\\u", "date_", "=_", "end", "\\u", "date_", "-_", "pd_", "._", "offsets_", "._", "Day_", "(_", ")_", "*_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end", "\\u", "date_", "=_", "end", "\\u", "date_", "._", "strftime_", "(_", "'%", "Y", "-%", "m", "-%", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "\\u", "date_", "=_", "start", "\\u", "date_", "._", "strftime_", "(_", "'%", "Y", "-%", "m", "-%", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "reader_", "=_", "GA", "nal", "yti", "cs_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "df_", "=_", "reader_", "._", "get", "\\u", "data_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "metrics_", "=_", "[_", "'", "avg", "Time", "On", "Site", "'_", ",_", "'", "visitor", "s", "'_", ",_", "'", "new", "Visit", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "page", "views", "Per", "Visit", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "\\u", "date_", "=_", "start", "\\u", "date_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "end", "\\u", "date_", "=_", "end", "\\u", "date_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dimensions_", "=_", "[_", "'", "date", "'_", ",_", "'", "hour", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "parse", "\\u", "dates_", "=_", "{_", "'", "ts", "'_", ":_", "[_", "'", "date", "'_", ",_", "'", "hour", "'_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "index", "\\u", "col_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "df_", ",_", "pd_", "._", "Data", "Frame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "df_", "._", "index_", ",_", "pd_", "._", "Date", "time", "Index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Greater_", "(_", "len_", "(_", "df_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "date", "'_", "not_", "in_", "df_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "hour", "'_", "not_", "in_", "df_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "df_", "._", "index_", "._", "name_", ",_", "'", "ts", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "avg", "Time", "On", "Site", "'_", "in_", "df_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "visitor", "s", "'_", "in_", "df_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "new", "Visit", "s", "'_", "in_", "df_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "page", "views", "Per", "Visit", "'_", "in_", "df_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "df2_", "=_", "read", "\\u", "ga_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "metrics_", "=_", "[_", "'", "avg", "Time", "On", "Site", "'_", ",_", "'", "visitor", "s", "'_", ",_", "'", "new", "Visit", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "page", "views", "Per", "Visit", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "\\u", "date_", "=_", "start", "\\u", "date_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "end", "\\u", "date_", "=_", "end", "\\u", "date_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dimensions_", "=_", "[_", "'", "date", "'_", ",_", "'", "hour", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "parse", "\\u", "dates_", "=_", "{_", "'", "ts", "'_", ":_", "[_", "'", "date", "'_", ",_", "'", "hour", "'_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "index", "\\u", "col_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "frame", "\\u", "equal_", "(_", "df_", ",_", "df2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Auth", "entica", "tion", "Config", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "nose_", "._", "Ski", "p", "Test_", "(_", "\"", "authenticat", "ion", " ", "error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Goo", "gle_", "(_", "tm_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "with", "\\u", "connecti", "vity", "\\u", "check_", "(_", "\"", "http", "://", "www", ".", "google", ".", "com", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "iterator_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "reader_", "=_", "GA", "nal", "yti", "cs_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "it_", "=_", "reader_", "._", "get", "\\u", "data_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "metrics_", "=_", "'", "visitor", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "\\u", "date_", "=_", "'", "2005", "-1", "-1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dimensions_", "=_", "'", "date", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "results_", "=_", "10_", ",_", "chunksize_", "=_", "5_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "index", "\\u", "col_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "df1_", "=_", "next_", "(_", "it_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "df2_", "=_", "next_", "(_", "it_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "df_", "in_", "[_", "df1_", ",_", "df2_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Is", "Instance_", "(_", "df_", ",_", "pd_", "._", "Data", "Frame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "df_", "._", "index_", ",_", "pd_", "._", "Date", "time", "Index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "df_", ")_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "date", "'_", "not_", "in_", "df_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "df_", "._", "index_", "._", "name_", ",_", "'", "date", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "visitor", "s", "'_", "in_", "df_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "df2_", "._", "index_", ">_", "df1_", "._", "index_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Auth", "entica", "tion", "Config", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "nose_", "._", "Ski", "p", "Test_", "(_", "\"", "authenticat", "ion", " ", "error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Goo", "gle_", "(_", "tm_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "with", "\\u", "connecti", "vity", "\\u", "check_", "(_", "\"", "http", "://", "www", ".", "google", ".", "com", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "segment_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "end", "\\u", "date_", "=_", "datetime_", "._", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "\\u", "date_", "=_", "end", "\\u", "date_", "-_", "pd_", "._", "offsets_", "._", "Day_", "(_", ")_", "*_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end", "\\u", "date_", "=_", "end", "\\u", "date_", "._", "strftime_", "(_", "'%", "Y", "-%", "m", "-%", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "\\u", "date_", "=_", "start", "\\u", "date_", "._", "strftime_", "(_", "'%", "Y", "-%", "m", "-%", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "reader_", "=_", "GA", "nal", "yti", "cs_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "df_", "=_", "reader_", "._", "get", "\\u", "data_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "metrics_", "=_", "[_", "'", "avg", "Time", "On", "Site", "'_", ",_", "'", "visitor", "s", "'_", ",_", "'", "new", "Visit", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "page", "views", "Per", "Visit", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "\\u", "date_", "=_", "start", "\\u", "date_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "end", "\\u", "date_", "=_", "end", "\\u", "date_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "segment_", "=_", "-_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dimensions_", "=_", "[_", "'", "date", "'_", ",_", "'", "hour", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "parse", "\\u", "dates_", "=_", "{_", "'", "ts", "'_", ":_", "[_", "'", "date", "'_", ",_", "'", "hour", "'_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "index", "\\u", "col_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "df_", ",_", "pd_", "._", "Data", "Frame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "df_", "._", "index_", ",_", "pd_", "._", "Date", "time", "Index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Greater_", "(_", "len_", "(_", "df_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "date", "'_", "not_", "in_", "df_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "hour", "'_", "not_", "in_", "df_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "df_", "._", "index_", "._", "name_", ",_", "'", "ts", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "avg", "Time", "On", "Site", "'_", "in_", "df_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "visitor", "s", "'_", "in_", "df_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "new", "Visit", "s", "'_", "in_", "df_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "page", "views", "Per", "Visit", "'_", "in_", "df_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "dynamic_", "\\u\\u\\uNL\\u\\u\\u_", "df_", "=_", "read", "\\u", "ga_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "metrics_", "=_", "[_", "'", "avg", "Time", "On", "Site", "'_", ",_", "'", "visitor", "s", "'_", ",_", "'", "new", "Visit", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "page", "views", "Per", "Visit", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "\\u", "date_", "=_", "start", "\\u", "date_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "end", "\\u", "date_", "=_", "end", "\\u", "date_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "segment_", "=_", "\"", "source", "=", "~", "twit", "ter", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dimensions_", "=_", "[_", "'", "date", "'_", ",_", "'", "hour", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "parse", "\\u", "dates_", "=_", "{_", "'", "ts", "'_", ":_", "[_", "'", "date", "'_", ",_", "'", "hour", "'_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "index", "\\u", "col_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "isinstance_", "(_", "df_", ",_", "pd_", "._", "Data", "Frame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "isinstance_", "(_", "df_", "._", "index_", ",_", "pd_", "._", "Date", "time", "Index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Greater_", "(_", "len_", "(_", "df_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "date", "'_", "not_", "in_", "df_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "hour", "'_", "not_", "in_", "df_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "df_", "._", "index_", "._", "name_", ",_", "'", "ts", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "avg", "Time", "On", "Site", "'_", "in_", "df_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "visitor", "s", "'_", "in_", "df_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "new", "Visit", "s", "'_", "in_", "df_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "page", "views", "Per", "Visit", "'_", "in_", "df_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Auth", "entica", "tion", "Config", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "nose_", "._", "Ski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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
scottrice/Ice/ice/logs.py
[ { "content": "def is_running_in_test():\n current_stack = inspect.stack()\n return any(map(is_test_stack_frame, inspect.stack()))", "metadata": "root.is_running_in_test", "header": "['module', '___EOS___']", "index": 28 } ]
[ { "span": "current_stack ", "start_line": 29, "start_column": 2, "end_line": 29, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "runn", "ing", "\\u", "in", "\\u", "test_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "current", "\\u", "stack_", "=_", "inspect_", "._", "stack_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "any_", "(_", "map_", "(_", "is", "\\u", "test\\u", "stack", "\\u", "frame_", ",_", "inspect_", "._", "stack_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]