","nodeType":"Function","startLoc":3,"text":"\"\"\"\nCompatibility code to be able to use `cookielib.CookieJar` with requests.\n\nrequests.utils imports from here, so be careful with imports.\n\"\"\"\n\ntry:\n import threading\n # grr, pyflakes: this fixes \"redefinition of unused 'threading'\"\n threading\nexcept ImportError:\n import dummy_threading as threading"},{"attributeType":"SSLObject","col":4,"comment":"null","endLoc":398,"id":1206,"name":"sslobject_class","nodeType":"Attribute","startLoc":398,"text":"sslobject_class"},{"fileName":"charsetgroupprober.py","filePath":"requests/packages/chardet","id":1207,"nodeType":"File","text":"######################## BEGIN LICENSE BLOCK ########################\n# The Original Code is Mozilla Communicator client code.\n# \n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 1998\n# the Initial Developer. All Rights Reserved.\n# \n# Contributor(s):\n# Mark Pilgrim - port to Python\n#\n# This library is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public\n# License as published by the Free Software Foundation; either\n# version 2.1 of the License, or (at your option) any later version.\n# \n# This library is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n# Lesser General Public License for more details.\n# \n# You should have received a copy of the GNU Lesser General Public\n# License along with this library; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n# 02110-1301 USA\n######################### END LICENSE BLOCK #########################\n\nfrom . import constants\nimport sys\nfrom .charsetprober import CharSetProber\n\n\nclass CharSetGroupProber(CharSetProber):\n def __init__(self):\n CharSetProber.__init__(self)\n self._mActiveNum = 0\n self._mProbers = []\n self._mBestGuessProber = None\n\n def reset(self):\n CharSetProber.reset(self)\n self._mActiveNum = 0\n for prober in self._mProbers:\n if prober:\n prober.reset()\n prober.active = True\n self._mActiveNum += 1\n self._mBestGuessProber = None\n\n def get_charset_name(self):\n if not self._mBestGuessProber:\n self.get_confidence()\n if not self._mBestGuessProber:\n return None\n# self._mBestGuessProber = self._mProbers[0]\n return self._mBestGuessProber.get_charset_name()\n\n def feed(self, aBuf):\n for prober in self._mProbers:\n if not prober:\n continue\n if not prober.active:\n continue\n st = prober.feed(aBuf)\n if not st:\n continue\n if st == constants.eFoundIt:\n self._mBestGuessProber = prober\n return self.get_state()\n elif st == constants.eNotMe:\n prober.active = False\n self._mActiveNum -= 1\n if self._mActiveNum <= 0:\n self._mState = constants.eNotMe\n return self.get_state()\n return self.get_state()\n\n def get_confidence(self):\n st = self.get_state()\n if st == constants.eFoundIt:\n return 0.99\n elif st == constants.eNotMe:\n return 0.01\n bestConf = 0.0\n self._mBestGuessProber = None\n for prober in self._mProbers:\n if not prober:\n continue\n if not prober.active:\n if constants._debug:\n sys.stderr.write(prober.get_charset_name()\n + ' not active\\n')\n continue\n cf = prober.get_confidence()\n if constants._debug:\n sys.stderr.write('%s confidence = %s\\n' %\n (prober.get_charset_name(), cf))\n if bestConf < cf:\n bestConf = cf\n self._mBestGuessProber = prober\n if not self._mBestGuessProber:\n return 0.0\n return bestConf\n# else:\n# self._mBestGuessProber = self._mProbers[0]\n# return self._mBestGuessProber.get_confidence()\n"},{"attributeType":"SSLSocket","col":4,"comment":"null","endLoc":399,"id":1208,"name":"sslsocket_class","nodeType":"Attribute","startLoc":399,"text":"sslsocket_class"},{"id":1209,"name":"theme.conf","nodeType":"TextFile","path":"docs/_themes/kr","text":"[theme]\ninherit = basic\nstylesheet = flasky.css\npygments_style = flask_theme_support.FlaskyStyle\n\n[options]\ntouch_icon =\n"},{"attributeType":"bool","col":0,"comment":"null","endLoc":244,"id":1210,"name":"HAS_SNI","nodeType":"Attribute","startLoc":244,"text":"HAS_SNI"},{"col":0,"comment":"\n Checks if given fingerprint matches the supplied certificate.\n\n :param cert:\n Certificate as bytes object.\n :param fingerprint:\n Fingerprint as string of hexdigits, can be interspersed by colons.\n ","endLoc":52,"header":"def assert_fingerprint(cert, fingerprint)","id":1211,"name":"assert_fingerprint","nodeType":"Function","startLoc":19,"text":"def assert_fingerprint(cert, fingerprint):\n \"\"\"\n Checks if given fingerprint matches the supplied certificate.\n\n :param cert:\n Certificate as bytes object.\n :param fingerprint:\n Fingerprint as string of hexdigits, can be interspersed by colons.\n \"\"\"\n\n # Maps the length of a digest to a possible hash function producing\n # this digest.\n hashfunc_map = {\n 16: md5,\n 20: sha1\n }\n\n fingerprint = fingerprint.replace(':', '').lower()\n digest_length, odd = divmod(len(fingerprint), 2)\n\n if odd or digest_length not in hashfunc_map:\n raise SSLError('Fingerprint is of invalid length.')\n\n # We need encode() here for py32; works on py2 and p33.\n fingerprint_bytes = unhexlify(fingerprint.encode())\n\n hashfunc = hashfunc_map[digest_length]\n\n cert_digest = hashfunc(cert).digest()\n\n if not cert_digest == fingerprint_bytes:\n raise SSLError('Fingerprints did not match. Expected \"{0}\", got \"{1}\".'\n .format(hexlify(fingerprint_bytes),\n hexlify(cert_digest)))"},{"id":1212,"name":"docs/_themes/kr_small","nodeType":"Package"},{"id":1213,"name":"layout.html","nodeType":"TextFile","path":"docs/_themes/kr_small","text":"{% extends \"basic/layout.html\" %}\n{% block header %}\n {{ super() }}\n {% if pagename == 'index' %}\n \n {% endif %}\n{% endblock %}\n{% block footer %}\n {% if pagename == 'index' %}\n
\n {% endif %}\n{% endblock %}\n{# do not display relbars #}\n{% block relbar1 %}{% endblock %}\n{% block relbar2 %}\n {% if theme_github_fork %}\n
\n {% endif %}\n{% endblock %}\n{% block sidebar1 %}{% endblock %}\n{% block sidebar2 %}{% endblock %}\n"},{"fileName":"__init__.py","filePath":"requests/packages/urllib3","id":1214,"nodeType":"File","text":"\"\"\"\nurllib3 - Thread-safe connection pooling and re-using.\n\"\"\"\n\n__author__ = 'Andrey Petrov (andrey.petrov@shazow.net)'\n__license__ = 'MIT'\n__version__ = 'dev'\n\n\nfrom .connectionpool import (\n HTTPConnectionPool,\n HTTPSConnectionPool,\n connection_from_url\n)\n\nfrom . import exceptions\nfrom .filepost import encode_multipart_formdata\nfrom .poolmanager import PoolManager, ProxyManager, proxy_from_url\nfrom .response import HTTPResponse\nfrom .util.request import make_headers\nfrom .util.url import get_host\nfrom .util.timeout import Timeout\nfrom .util.retry import Retry\n\n\n# Set default logging handler to avoid \"No handler found\" warnings.\nimport logging\ntry: # Python 2.7+\n from logging import NullHandler\nexcept ImportError:\n class NullHandler(logging.Handler):\n def emit(self, record):\n pass\n\nlogging.getLogger(__name__).addHandler(NullHandler())\n\ndef add_stderr_logger(level=logging.DEBUG):\n \"\"\"\n Helper for quickly adding a StreamHandler to the logger. Useful for\n debugging.\n\n Returns the handler after adding it.\n \"\"\"\n # This method needs to be in this __init__.py to get the __name__ correct\n # even if urllib3 is vendored within another package.\n logger = logging.getLogger(__name__)\n handler = logging.StreamHandler()\n handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(message)s'))\n logger.addHandler(handler)\n logger.setLevel(level)\n logger.debug('Added a stderr logging handler to logger: %s' % __name__)\n return handler\n\n# ... Clean up.\ndel NullHandler\n\n\n# Set security warning to only go off once by default.\nimport warnings\nwarnings.simplefilter('module', exceptions.InsecureRequestWarning)\n\ndef disable_warnings(category=exceptions.HTTPWarning):\n \"\"\"\n Helper for quickly disabling all urllib3 warnings.\n \"\"\"\n warnings.simplefilter('ignore', category)\n"},{"className":"HTTPConnectionPool","col":0,"comment":"\n Thread-safe connection pool for one host.\n\n :param host:\n Host used for this HTTP Connection (e.g. \"localhost\"), passed into\n :class:`httplib.HTTPConnection`.\n\n :param port:\n Port used for this HTTP Connection (None is equivalent to 80), passed\n into :class:`httplib.HTTPConnection`.\n\n :param strict:\n Causes BadStatusLine to be raised if the status line can't be parsed\n as a valid HTTP/1.0 or 1.1 status line, passed into\n :class:`httplib.HTTPConnection`.\n\n .. note::\n Only works in Python 2. This parameter is ignored in Python 3.\n\n :param timeout:\n Socket timeout in seconds for each individual connection. This can\n be a float or integer, which sets the timeout for the HTTP request,\n or an instance of :class:`urllib3.util.Timeout` which gives you more\n fine-grained control over request timeouts. After the constructor has\n been parsed, this is always a `urllib3.util.Timeout` object.\n\n :param maxsize:\n Number of connections to save that can be reused. More than 1 is useful\n in multithreaded situations. If ``block`` is set to false, more\n connections will be created but they will not be saved once they've\n been used.\n\n :param block:\n If set to True, no more than ``maxsize`` connections will be used at\n a time. When no free connections are available, the call will block\n until a connection has been released. This is a useful side effect for\n particular multithreaded situations where one does not want to use more\n than maxsize connections per host to prevent flooding.\n\n :param headers:\n Headers to include with all requests, unless other headers are given\n explicitly.\n\n :param retries:\n Retry configuration to use by default with requests in this pool.\n\n :param _proxy:\n Parsed proxy URL, should not be used directly, instead, see\n :class:`urllib3.connectionpool.ProxyManager`\"\n\n :param _proxy_headers:\n A dictionary with proxy headers, should not be used directly,\n instead, see :class:`urllib3.connectionpool.ProxyManager`\"\n\n :param \\**conn_kw:\n Additional parameters are used to create fresh :class:`urllib3.connection.HTTPConnection`,\n :class:`urllib3.connection.HTTPSConnection` instances.\n ","endLoc":612,"id":1215,"nodeType":"Class","startLoc":79,"text":"class HTTPConnectionPool(ConnectionPool, RequestMethods):\n \"\"\"\n Thread-safe connection pool for one host.\n\n :param host:\n Host used for this HTTP Connection (e.g. \"localhost\"), passed into\n :class:`httplib.HTTPConnection`.\n\n :param port:\n Port used for this HTTP Connection (None is equivalent to 80), passed\n into :class:`httplib.HTTPConnection`.\n\n :param strict:\n Causes BadStatusLine to be raised if the status line can't be parsed\n as a valid HTTP/1.0 or 1.1 status line, passed into\n :class:`httplib.HTTPConnection`.\n\n .. note::\n Only works in Python 2. This parameter is ignored in Python 3.\n\n :param timeout:\n Socket timeout in seconds for each individual connection. This can\n be a float or integer, which sets the timeout for the HTTP request,\n or an instance of :class:`urllib3.util.Timeout` which gives you more\n fine-grained control over request timeouts. After the constructor has\n been parsed, this is always a `urllib3.util.Timeout` object.\n\n :param maxsize:\n Number of connections to save that can be reused. More than 1 is useful\n in multithreaded situations. If ``block`` is set to false, more\n connections will be created but they will not be saved once they've\n been used.\n\n :param block:\n If set to True, no more than ``maxsize`` connections will be used at\n a time. When no free connections are available, the call will block\n until a connection has been released. This is a useful side effect for\n particular multithreaded situations where one does not want to use more\n than maxsize connections per host to prevent flooding.\n\n :param headers:\n Headers to include with all requests, unless other headers are given\n explicitly.\n\n :param retries:\n Retry configuration to use by default with requests in this pool.\n\n :param _proxy:\n Parsed proxy URL, should not be used directly, instead, see\n :class:`urllib3.connectionpool.ProxyManager`\"\n\n :param _proxy_headers:\n A dictionary with proxy headers, should not be used directly,\n instead, see :class:`urllib3.connectionpool.ProxyManager`\"\n\n :param \\**conn_kw:\n Additional parameters are used to create fresh :class:`urllib3.connection.HTTPConnection`,\n :class:`urllib3.connection.HTTPSConnection` instances.\n \"\"\"\n\n scheme = 'http'\n ConnectionCls = HTTPConnection\n\n def __init__(self, host, port=None, strict=False,\n timeout=Timeout.DEFAULT_TIMEOUT, maxsize=1, block=False,\n headers=None, retries=None,\n _proxy=None, _proxy_headers=None,\n **conn_kw):\n ConnectionPool.__init__(self, host, port)\n RequestMethods.__init__(self, headers)\n\n self.strict = strict\n\n if not isinstance(timeout, Timeout):\n timeout = Timeout.from_float(timeout)\n\n if retries is None:\n retries = Retry.DEFAULT\n\n self.timeout = timeout\n self.retries = retries\n\n self.pool = self.QueueCls(maxsize)\n self.block = block\n\n self.proxy = _proxy\n self.proxy_headers = _proxy_headers or {}\n\n # Fill the queue up so that doing get() on it will block properly\n for _ in xrange(maxsize):\n self.pool.put(None)\n\n # These are mostly for testing and debugging purposes.\n self.num_connections = 0\n self.num_requests = 0\n self.conn_kw = conn_kw\n\n if self.proxy:\n # Enable Nagle's algorithm for proxies, to avoid packet fragmentation.\n # We cannot know if the user has added default socket options, so we cannot replace the\n # list.\n self.conn_kw.setdefault('socket_options', [])\n\n def _new_conn(self):\n \"\"\"\n Return a fresh :class:`HTTPConnection`.\n \"\"\"\n self.num_connections += 1\n log.info(\"Starting new HTTP connection (%d): %s\" %\n (self.num_connections, self.host))\n\n conn = self.ConnectionCls(host=self.host, port=self.port,\n timeout=self.timeout.connect_timeout,\n strict=self.strict, **self.conn_kw)\n return conn\n\n def _get_conn(self, timeout=None):\n \"\"\"\n Get a connection. Will return a pooled connection if one is available.\n\n If no connections are available and :prop:`.block` is ``False``, then a\n fresh connection is returned.\n\n :param timeout:\n Seconds to wait before giving up and raising\n :class:`urllib3.exceptions.EmptyPoolError` if the pool is empty and\n :prop:`.block` is ``True``.\n \"\"\"\n conn = None\n try:\n conn = self.pool.get(block=self.block, timeout=timeout)\n\n except AttributeError: # self.pool is None\n raise ClosedPoolError(self, \"Pool is closed.\")\n\n except Empty:\n if self.block:\n raise EmptyPoolError(self,\n \"Pool reached maximum size and no more \"\n \"connections are allowed.\")\n pass # Oh well, we'll create a new connection then\n\n # If this is a persistent connection, check if it got disconnected\n if conn and is_connection_dropped(conn):\n log.info(\"Resetting dropped connection: %s\" % self.host)\n conn.close()\n if getattr(conn, 'auto_open', 1) == 0:\n # This is a proxied connection that has been mutated by\n # httplib._tunnel() and cannot be reused (since it would\n # attempt to bypass the proxy)\n conn = None\n\n return conn or self._new_conn()\n\n def _put_conn(self, conn):\n \"\"\"\n Put a connection back into the pool.\n\n :param conn:\n Connection object for the current host and port as returned by\n :meth:`._new_conn` or :meth:`._get_conn`.\n\n If the pool is already full, the connection is closed and discarded\n because we exceeded maxsize. If connections are discarded frequently,\n then maxsize should be increased.\n\n If the pool is closed, then the connection will be closed and discarded.\n \"\"\"\n try:\n self.pool.put(conn, block=False)\n return # Everything is dandy, done.\n except AttributeError:\n # self.pool is None.\n pass\n except Full:\n # This should never happen if self.block == True\n log.warning(\n \"Connection pool is full, discarding connection: %s\" %\n self.host)\n\n # Connection never got put back into the pool, close it.\n if conn:\n conn.close()\n\n def _validate_conn(self, conn):\n \"\"\"\n Called right before a request is made, after the socket is created.\n \"\"\"\n pass\n\n def _get_timeout(self, timeout):\n \"\"\" Helper that always returns a :class:`urllib3.util.Timeout` \"\"\"\n if timeout is _Default:\n return self.timeout.clone()\n\n if isinstance(timeout, Timeout):\n return timeout.clone()\n else:\n # User passed us an int/float. This is for backwards compatibility,\n # can be removed later\n return Timeout.from_float(timeout)\n\n def _make_request(self, conn, method, url, timeout=_Default,\n **httplib_request_kw):\n \"\"\"\n Perform a request on a given urllib connection object taken from our\n pool.\n\n :param conn:\n a connection from one of our connection pools\n\n :param timeout:\n Socket timeout in seconds for the request. This can be a\n float or integer, which will set the same timeout value for\n the socket connect and the socket read, or an instance of\n :class:`urllib3.util.Timeout`, which gives you more fine-grained\n control over your timeouts.\n \"\"\"\n self.num_requests += 1\n\n timeout_obj = self._get_timeout(timeout)\n timeout_obj.start_connect()\n conn.timeout = timeout_obj.connect_timeout\n\n # Trigger any extra validation we need to do.\n self._validate_conn(conn)\n\n # conn.request() calls httplib.*.request, not the method in\n # urllib3.request. It also calls makefile (recv) on the socket.\n conn.request(method, url, **httplib_request_kw)\n\n # Reset the timeout for the recv() on the socket\n read_timeout = timeout_obj.read_timeout\n\n # App Engine doesn't have a sock attr\n if getattr(conn, 'sock', None):\n # In Python 3 socket.py will catch EAGAIN and return None when you\n # try and read into the file pointer created by http.client, which\n # instead raises a BadStatusLine exception. Instead of catching\n # the exception and assuming all BadStatusLine exceptions are read\n # timeouts, check for a zero timeout before making the request.\n if read_timeout == 0:\n raise ReadTimeoutError(\n self, url, \"Read timed out. (read timeout=%s)\" % read_timeout)\n if read_timeout is Timeout.DEFAULT_TIMEOUT:\n conn.sock.settimeout(socket.getdefaulttimeout())\n else: # None or a value\n conn.sock.settimeout(read_timeout)\n\n # Receive the response from the server\n try:\n try: # Python 2.7+, use buffering of HTTP responses\n httplib_response = conn.getresponse(buffering=True)\n except TypeError: # Python 2.6 and older\n httplib_response = conn.getresponse()\n except SocketTimeout:\n raise ReadTimeoutError(\n self, url, \"Read timed out. (read timeout=%s)\" % read_timeout)\n\n except BaseSSLError as e:\n # Catch possible read timeouts thrown as SSL errors. If not the\n # case, rethrow the original. We need to do this because of:\n # http://bugs.python.org/issue10272\n if 'timed out' in str(e) or \\\n 'did not complete (read)' in str(e): # Python 2.6\n raise ReadTimeoutError(\n self, url, \"Read timed out. (read timeout=%s)\" % read_timeout)\n\n raise\n\n except SocketError as e: # Platform-specific: Python 2\n # See the above comment about EAGAIN in Python 3. In Python 2 we\n # have to specifically catch it and throw the timeout error\n if e.errno in _blocking_errnos:\n raise ReadTimeoutError(\n self, url, \"Read timed out. (read timeout=%s)\" % read_timeout)\n\n raise\n\n # AppEngine doesn't have a version attr.\n http_version = getattr(conn, '_http_vsn_str', 'HTTP/?')\n log.debug(\"\\\"%s %s %s\\\" %s %s\" % (method, url, http_version,\n httplib_response.status,\n httplib_response.length))\n return httplib_response\n\n def close(self):\n \"\"\"\n Close all pooled connections and disable the pool.\n \"\"\"\n # Disable access to the pool\n old_pool, self.pool = self.pool, None\n\n try:\n while True:\n conn = old_pool.get(block=False)\n if conn:\n conn.close()\n\n except Empty:\n pass # Done.\n\n def is_same_host(self, url):\n \"\"\"\n Check if the given ``url`` is a member of the same host as this\n connection pool.\n \"\"\"\n if url.startswith('/'):\n return True\n\n # TODO: Add optional support for socket.gethostbyname checking.\n scheme, host, port = get_host(url)\n\n # Use explicit default port for comparison when none is given\n if self.port and not port:\n port = port_by_scheme.get(scheme)\n elif not self.port and port == port_by_scheme.get(scheme):\n port = None\n\n return (scheme, host, port) == (self.scheme, self.host, self.port)\n\n def urlopen(self, method, url, body=None, headers=None, retries=None,\n redirect=True, assert_same_host=True, timeout=_Default,\n pool_timeout=None, release_conn=None, **response_kw):\n \"\"\"\n Get a connection from the pool and perform an HTTP request. This is the\n lowest level call for making a request, so you'll need to specify all\n the raw details.\n\n .. note::\n\n More commonly, it's appropriate to use a convenience method provided\n by :class:`.RequestMethods`, such as :meth:`request`.\n\n .. note::\n\n `release_conn` will only behave as expected if\n `preload_content=False` because we want to make\n `preload_content=False` the default behaviour someday soon without\n breaking backwards compatibility.\n\n :param method:\n HTTP request method (such as GET, POST, PUT, etc.)\n\n :param body:\n Data to send in the request body (useful for creating\n POST requests, see HTTPConnectionPool.post_url for\n more convenience).\n\n :param headers:\n Dictionary of custom headers to send, such as User-Agent,\n If-None-Match, etc. If None, pool headers are used. If provided,\n these headers completely replace any pool-specific headers.\n\n :param retries:\n Configure the number of retries to allow before raising a\n :class:`~urllib3.exceptions.MaxRetryError` exception.\n\n Pass ``None`` to retry until you receive a response. Pass a\n :class:`~urllib3.util.retry.Retry` object for fine-grained control\n over different types of retries.\n Pass an integer number to retry connection errors that many times,\n but no other types of errors. Pass zero to never retry.\n\n If ``False``, then retries are disabled and any exception is raised\n immediately. Also, instead of raising a MaxRetryError on redirects,\n the redirect response will be returned.\n\n :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int.\n\n :param redirect:\n If True, automatically handle redirects (status codes 301, 302,\n 303, 307, 308). Each redirect counts as a retry. Disabling retries\n will disable redirect, too.\n\n :param assert_same_host:\n If ``True``, will make sure that the host of the pool requests is\n consistent else will raise HostChangedError. When False, you can\n use the pool on an HTTP proxy and request foreign hosts.\n\n :param timeout:\n If specified, overrides the default timeout for this one\n request. It may be a float (in seconds) or an instance of\n :class:`urllib3.util.Timeout`.\n\n :param pool_timeout:\n If set and the pool is set to block=True, then this method will\n block for ``pool_timeout`` seconds and raise EmptyPoolError if no\n connection is available within the time period.\n\n :param release_conn:\n If False, then the urlopen call will not release the connection\n back into the pool once a response is received (but will release if\n you read the entire contents of the response such as when\n `preload_content=True`). This is useful if you're not preloading\n the response's content immediately. You will need to call\n ``r.release_conn()`` on the response ``r`` to return the connection\n back into the pool. If None, it takes the value of\n ``response_kw.get('preload_content', True)``.\n\n :param \\**response_kw:\n Additional parameters are passed to\n :meth:`urllib3.response.HTTPResponse.from_httplib`\n \"\"\"\n if headers is None:\n headers = self.headers\n\n if not isinstance(retries, Retry):\n retries = Retry.from_int(retries, redirect=redirect, default=self.retries)\n\n if release_conn is None:\n release_conn = response_kw.get('preload_content', True)\n\n # Check host\n if assert_same_host and not self.is_same_host(url):\n raise HostChangedError(self, url, retries)\n\n conn = None\n\n # Merge the proxy headers. Only do this in HTTP. We have to copy the\n # headers dict so we can safely change it without those changes being\n # reflected in anyone else's copy.\n if self.scheme == 'http':\n headers = headers.copy()\n headers.update(self.proxy_headers)\n\n # Must keep the exception bound to a separate variable or else Python 3\n # complains about UnboundLocalError.\n err = None\n\n try:\n # Request a connection from the queue.\n conn = self._get_conn(timeout=pool_timeout)\n\n # Make the request on the httplib connection object.\n httplib_response = self._make_request(conn, method, url,\n timeout=timeout,\n body=body, headers=headers)\n\n # If we're going to release the connection in ``finally:``, then\n # the request doesn't need to know about the connection. Otherwise\n # it will also try to release it and we'll have a double-release\n # mess.\n response_conn = not release_conn and conn\n\n # Import httplib's response into our own wrapper object\n response = HTTPResponse.from_httplib(httplib_response,\n pool=self,\n connection=response_conn,\n **response_kw)\n\n # else:\n # The connection will be put back into the pool when\n # ``response.release_conn()`` is called (implicitly by\n # ``response.read()``)\n\n except Empty:\n # Timed out by queue.\n raise EmptyPoolError(self, \"No pool connections are available.\")\n\n except (BaseSSLError, CertificateError) as e:\n # Release connection unconditionally because there is no way to\n # close it externally in case of exception.\n release_conn = True\n raise SSLError(e)\n\n except (TimeoutError, HTTPException, SocketError) as e:\n if conn:\n # Discard the connection for these exceptions. It will be\n # be replaced during the next _get_conn() call.\n conn.close()\n conn = None\n\n stacktrace = sys.exc_info()[2]\n if isinstance(e, SocketError) and self.proxy:\n e = ProxyError('Cannot connect to proxy.', e)\n elif isinstance(e, (SocketError, HTTPException)):\n e = ProtocolError('Connection aborted.', e)\n\n retries = retries.increment(method, url, error=e,\n _pool=self, _stacktrace=stacktrace)\n retries.sleep()\n\n # Keep track of the error for the retry warning.\n err = e\n\n finally:\n if release_conn:\n # Put the connection back to be reused. If the connection is\n # expired then it will be None, which will get replaced with a\n # fresh connection during _get_conn.\n self._put_conn(conn)\n\n if not conn:\n # Try again\n log.warning(\"Retrying (%r) after connection \"\n \"broken by '%r': %s\" % (retries, err, url))\n return self.urlopen(method, url, body, headers, retries,\n redirect, assert_same_host,\n timeout=timeout, pool_timeout=pool_timeout,\n release_conn=release_conn, **response_kw)\n\n # Handle redirect?\n redirect_location = redirect and response.get_redirect_location()\n if redirect_location:\n if response.status == 303:\n method = 'GET'\n\n try:\n retries = retries.increment(method, url, response=response, _pool=self)\n except MaxRetryError:\n if retries.raise_on_redirect:\n raise\n return response\n\n log.info(\"Redirecting %s -> %s\" % (url, redirect_location))\n return self.urlopen(method, redirect_location, body, headers,\n retries=retries, redirect=redirect,\n assert_same_host=assert_same_host,\n timeout=timeout, pool_timeout=pool_timeout,\n release_conn=release_conn, **response_kw)\n\n # Check if we should retry the HTTP response.\n if retries.is_forced_retry(method, status_code=response.status):\n retries = retries.increment(method, url, response=response, _pool=self)\n retries.sleep()\n log.info(\"Forced retry: %s\" % url)\n return self.urlopen(method, url, body, headers,\n retries=retries, redirect=redirect,\n assert_same_host=assert_same_host,\n timeout=timeout, pool_timeout=pool_timeout,\n release_conn=release_conn, **response_kw)\n\n return response"},{"className":"ConnectionPool","col":0,"comment":"\n Base class for all connection pools, such as\n :class:`.HTTPConnectionPool` and :class:`.HTTPSConnectionPool`.\n ","endLoc":73,"id":1218,"nodeType":"Class","startLoc":54,"text":"class ConnectionPool(object):\n \"\"\"\n Base class for all connection pools, such as\n :class:`.HTTPConnectionPool` and :class:`.HTTPSConnectionPool`.\n \"\"\"\n\n scheme = None\n QueueCls = LifoQueue\n\n def __init__(self, host, port=None):\n if not host:\n raise LocationValueError(\"No host specified.\")\n\n # httplib doesn't like it when we include brackets in ipv6 addresses\n self.host = host.strip('[]')\n self.port = port\n\n def __str__(self):\n return '%s(host=%r, port=%r)' % (type(self).__name__,\n self.host, self.port)"},{"col":4,"comment":"null","endLoc":69,"header":"def __init__(self, host, port=None)","id":1219,"name":"__init__","nodeType":"Function","startLoc":63,"text":"def __init__(self, host, port=None):\n if not host:\n raise LocationValueError(\"No host specified.\")\n\n # httplib doesn't like it when we include brackets in ipv6 addresses\n self.host = host.strip('[]')\n self.port = port"},{"col":4,"comment":"null","endLoc":73,"header":"def __str__(self)","id":1220,"name":"__str__","nodeType":"Function","startLoc":71,"text":"def __str__(self):\n return '%s(host=%r, port=%r)' % (type(self).__name__,\n self.host, self.port)"},{"attributeType":"null","col":4,"comment":"null","endLoc":60,"id":1221,"name":"scheme","nodeType":"Attribute","startLoc":60,"text":"scheme"},{"attributeType":"null","col":4,"comment":"null","endLoc":61,"id":1222,"name":"QueueCls","nodeType":"Attribute","startLoc":61,"text":"QueueCls"},{"attributeType":"null","col":8,"comment":"null","endLoc":69,"id":1223,"name":"port","nodeType":"Attribute","startLoc":69,"text":"self.port"},{"attributeType":"null","col":8,"comment":"null","endLoc":68,"id":1224,"name":"host","nodeType":"Attribute","startLoc":68,"text":"self.host"},{"col":4,"comment":"null","endLoc":180,"header":"def __init__(self, host, port=None, strict=False,\n timeout=Timeout.DEFAULT_TIMEOUT, maxsize=1, block=False,\n headers=None, retries=None,\n _proxy=None, _proxy_headers=None,\n **conn_kw)","id":1225,"name":"__init__","nodeType":"Function","startLoc":142,"text":"def __init__(self, host, port=None, strict=False,\n timeout=Timeout.DEFAULT_TIMEOUT, maxsize=1, block=False,\n headers=None, retries=None,\n _proxy=None, _proxy_headers=None,\n **conn_kw):\n ConnectionPool.__init__(self, host, port)\n RequestMethods.__init__(self, headers)\n\n self.strict = strict\n\n if not isinstance(timeout, Timeout):\n timeout = Timeout.from_float(timeout)\n\n if retries is None:\n retries = Retry.DEFAULT\n\n self.timeout = timeout\n self.retries = retries\n\n self.pool = self.QueueCls(maxsize)\n self.block = block\n\n self.proxy = _proxy\n self.proxy_headers = _proxy_headers or {}\n\n # Fill the queue up so that doing get() on it will block properly\n for _ in xrange(maxsize):\n self.pool.put(None)\n\n # These are mostly for testing and debugging purposes.\n self.num_connections = 0\n self.num_requests = 0\n self.conn_kw = conn_kw\n\n if self.proxy:\n # Enable Nagle's algorithm for proxies, to avoid packet fragmentation.\n # We cannot know if the user has added default socket options, so we cannot replace the\n # list.\n self.conn_kw.setdefault('socket_options', [])"},{"col":4,"comment":"\n Return a fresh :class:`HTTPConnection`.\n ","endLoc":193,"header":"def _new_conn(self)","id":1226,"name":"_new_conn","nodeType":"Function","startLoc":182,"text":"def _new_conn(self):\n \"\"\"\n Return a fresh :class:`HTTPConnection`.\n \"\"\"\n self.num_connections += 1\n log.info(\"Starting new HTTP connection (%d): %s\" %\n (self.num_connections, self.host))\n\n conn = self.ConnectionCls(host=self.host, port=self.port,\n timeout=self.timeout.connect_timeout,\n strict=self.strict, **self.conn_kw)\n return conn"},{"col":4,"comment":"\n Get a connection. Will return a pooled connection if one is available.\n\n If no connections are available and :prop:`.block` is ``False``, then a\n fresh connection is returned.\n\n :param timeout:\n Seconds to wait before giving up and raising\n :class:`urllib3.exceptions.EmptyPoolError` if the pool is empty and\n :prop:`.block` is ``True``.\n ","endLoc":231,"header":"def _get_conn(self, timeout=None)","id":1228,"name":"_get_conn","nodeType":"Function","startLoc":195,"text":"def _get_conn(self, timeout=None):\n \"\"\"\n Get a connection. Will return a pooled connection if one is available.\n\n If no connections are available and :prop:`.block` is ``False``, then a\n fresh connection is returned.\n\n :param timeout:\n Seconds to wait before giving up and raising\n :class:`urllib3.exceptions.EmptyPoolError` if the pool is empty and\n :prop:`.block` is ``True``.\n \"\"\"\n conn = None\n try:\n conn = self.pool.get(block=self.block, timeout=timeout)\n\n except AttributeError: # self.pool is None\n raise ClosedPoolError(self, \"Pool is closed.\")\n\n except Empty:\n if self.block:\n raise EmptyPoolError(self,\n \"Pool reached maximum size and no more \"\n \"connections are allowed.\")\n pass # Oh well, we'll create a new connection then\n\n # If this is a persistent connection, check if it got disconnected\n if conn and is_connection_dropped(conn):\n log.info(\"Resetting dropped connection: %s\" % self.host)\n conn.close()\n if getattr(conn, 'auto_open', 1) == 0:\n # This is a proxied connection that has been mutated by\n # httplib._tunnel() and cannot be reused (since it would\n # attempt to bypass the proxy)\n conn = None\n\n return conn or self._new_conn()"},{"col":0,"comment":"\n Resolves the argument to a numeric constant, which can be passed to\n the wrap_socket function/method from the ssl module.\n Defaults to :data:`ssl.CERT_NONE`.\n If given a string it is assumed to be the name of the constant in the\n :mod:`ssl` module or its abbrevation.\n (So you can specify `REQUIRED` instead of `CERT_REQUIRED`.\n If it's neither `None` nor a string we assume it is already the numeric\n constant which can directly be passed to wrap_socket.\n ","endLoc":75,"header":"def resolve_cert_reqs(candidate)","id":1229,"name":"resolve_cert_reqs","nodeType":"Function","startLoc":55,"text":"def resolve_cert_reqs(candidate):\n \"\"\"\n Resolves the argument to a numeric constant, which can be passed to\n the wrap_socket function/method from the ssl module.\n Defaults to :data:`ssl.CERT_NONE`.\n If given a string it is assumed to be the name of the constant in the\n :mod:`ssl` module or its abbrevation.\n (So you can specify `REQUIRED` instead of `CERT_REQUIRED`.\n If it's neither `None` nor a string we assume it is already the numeric\n constant which can directly be passed to wrap_socket.\n \"\"\"\n if candidate is None:\n return CERT_NONE\n\n if isinstance(candidate, str):\n res = getattr(ssl, candidate, None)\n if res is None:\n res = getattr(ssl, 'CERT_' + candidate)\n return res\n\n return candidate"},{"col":4,"comment":"\n Put a connection back into the pool.\n\n :param conn:\n Connection object for the current host and port as returned by\n :meth:`._new_conn` or :meth:`._get_conn`.\n\n If the pool is already full, the connection is closed and discarded\n because we exceeded maxsize. If connections are discarded frequently,\n then maxsize should be increased.\n\n If the pool is closed, then the connection will be closed and discarded.\n ","endLoc":261,"header":"def _put_conn(self, conn)","id":1230,"name":"_put_conn","nodeType":"Function","startLoc":233,"text":"def _put_conn(self, conn):\n \"\"\"\n Put a connection back into the pool.\n\n :param conn:\n Connection object for the current host and port as returned by\n :meth:`._new_conn` or :meth:`._get_conn`.\n\n If the pool is already full, the connection is closed and discarded\n because we exceeded maxsize. If connections are discarded frequently,\n then maxsize should be increased.\n\n If the pool is closed, then the connection will be closed and discarded.\n \"\"\"\n try:\n self.pool.put(conn, block=False)\n return # Everything is dandy, done.\n except AttributeError:\n # self.pool is None.\n pass\n except Full:\n # This should never happen if self.block == True\n log.warning(\n \"Connection pool is full, discarding connection: %s\" %\n self.host)\n\n # Connection never got put back into the pool, close it.\n if conn:\n conn.close()"},{"col":4,"comment":"\n Called right before a request is made, after the socket is created.\n ","endLoc":267,"header":"def _validate_conn(self, conn)","id":1231,"name":"_validate_conn","nodeType":"Function","startLoc":263,"text":"def _validate_conn(self, conn):\n \"\"\"\n Called right before a request is made, after the socket is created.\n \"\"\"\n pass"},{"col":4,"comment":" Helper that always returns a :class:`urllib3.util.Timeout` ","endLoc":279,"header":"def _get_timeout(self, timeout)","id":1232,"name":"_get_timeout","nodeType":"Function","startLoc":269,"text":"def _get_timeout(self, timeout):\n \"\"\" Helper that always returns a :class:`urllib3.util.Timeout` \"\"\"\n if timeout is _Default:\n return self.timeout.clone()\n\n if isinstance(timeout, Timeout):\n return timeout.clone()\n else:\n # User passed us an int/float. This is for backwards compatibility,\n # can be removed later\n return Timeout.from_float(timeout)"},{"col":0,"comment":"\n like resolve_cert_reqs\n ","endLoc":91,"header":"def resolve_ssl_version(candidate)","id":1233,"name":"resolve_ssl_version","nodeType":"Function","startLoc":78,"text":"def resolve_ssl_version(candidate):\n \"\"\"\n like resolve_cert_reqs\n \"\"\"\n if candidate is None:\n return PROTOCOL_SSLv23\n\n if isinstance(candidate, str):\n res = getattr(ssl, candidate, None)\n if res is None:\n res = getattr(ssl, 'PROTOCOL_' + candidate)\n return res\n\n return candidate"},{"col":4,"comment":"\n Perform a request on a given urllib connection object taken from our\n pool.\n\n :param conn:\n a connection from one of our connection pools\n\n :param timeout:\n Socket timeout in seconds for the request. This can be a\n float or integer, which will set the same timeout value for\n the socket connect and the socket read, or an instance of\n :class:`urllib3.util.Timeout`, which gives you more fine-grained\n control over your timeouts.\n ","endLoc":363,"header":"def _make_request(self, conn, method, url, timeout=_Default,\n **httplib_request_kw)","id":1234,"name":"_make_request","nodeType":"Function","startLoc":281,"text":"def _make_request(self, conn, method, url, timeout=_Default,\n **httplib_request_kw):\n \"\"\"\n Perform a request on a given urllib connection object taken from our\n pool.\n\n :param conn:\n a connection from one of our connection pools\n\n :param timeout:\n Socket timeout in seconds for the request. This can be a\n float or integer, which will set the same timeout value for\n the socket connect and the socket read, or an instance of\n :class:`urllib3.util.Timeout`, which gives you more fine-grained\n control over your timeouts.\n \"\"\"\n self.num_requests += 1\n\n timeout_obj = self._get_timeout(timeout)\n timeout_obj.start_connect()\n conn.timeout = timeout_obj.connect_timeout\n\n # Trigger any extra validation we need to do.\n self._validate_conn(conn)\n\n # conn.request() calls httplib.*.request, not the method in\n # urllib3.request. It also calls makefile (recv) on the socket.\n conn.request(method, url, **httplib_request_kw)\n\n # Reset the timeout for the recv() on the socket\n read_timeout = timeout_obj.read_timeout\n\n # App Engine doesn't have a sock attr\n if getattr(conn, 'sock', None):\n # In Python 3 socket.py will catch EAGAIN and return None when you\n # try and read into the file pointer created by http.client, which\n # instead raises a BadStatusLine exception. Instead of catching\n # the exception and assuming all BadStatusLine exceptions are read\n # timeouts, check for a zero timeout before making the request.\n if read_timeout == 0:\n raise ReadTimeoutError(\n self, url, \"Read timed out. (read timeout=%s)\" % read_timeout)\n if read_timeout is Timeout.DEFAULT_TIMEOUT:\n conn.sock.settimeout(socket.getdefaulttimeout())\n else: # None or a value\n conn.sock.settimeout(read_timeout)\n\n # Receive the response from the server\n try:\n try: # Python 2.7+, use buffering of HTTP responses\n httplib_response = conn.getresponse(buffering=True)\n except TypeError: # Python 2.6 and older\n httplib_response = conn.getresponse()\n except SocketTimeout:\n raise ReadTimeoutError(\n self, url, \"Read timed out. (read timeout=%s)\" % read_timeout)\n\n except BaseSSLError as e:\n # Catch possible read timeouts thrown as SSL errors. If not the\n # case, rethrow the original. We need to do this because of:\n # http://bugs.python.org/issue10272\n if 'timed out' in str(e) or \\\n 'did not complete (read)' in str(e): # Python 2.6\n raise ReadTimeoutError(\n self, url, \"Read timed out. (read timeout=%s)\" % read_timeout)\n\n raise\n\n except SocketError as e: # Platform-specific: Python 2\n # See the above comment about EAGAIN in Python 3. In Python 2 we\n # have to specifically catch it and throw the timeout error\n if e.errno in _blocking_errnos:\n raise ReadTimeoutError(\n self, url, \"Read timed out. (read timeout=%s)\" % read_timeout)\n\n raise\n\n # AppEngine doesn't have a version attr.\n http_version = getattr(conn, '_http_vsn_str', 'HTTP/?')\n log.debug(\"\\\"%s %s %s\\\" %s %s\" % (method, url, http_version,\n httplib_response.status,\n httplib_response.length))\n return httplib_response"},{"col":4,"comment":"\n All arguments except `server_hostname` have the same meaning as for\n :func:`ssl.wrap_socket`\n\n :param server_hostname:\n Hostname of the expected certificate\n ","endLoc":124,"header":"def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None,\n ca_certs=None, server_hostname=None,\n ssl_version=None)","id":1235,"name":"ssl_wrap_socket","nodeType":"Function","startLoc":95,"text":"def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None,\n ca_certs=None, server_hostname=None,\n ssl_version=None):\n \"\"\"\n All arguments except `server_hostname` have the same meaning as for\n :func:`ssl.wrap_socket`\n\n :param server_hostname:\n Hostname of the expected certificate\n \"\"\"\n context = SSLContext(ssl_version)\n context.verify_mode = cert_reqs\n\n # Disable TLS compression to migitate CRIME attack (issue #309)\n OP_NO_COMPRESSION = 0x20000\n context.options |= OP_NO_COMPRESSION\n\n if ca_certs:\n try:\n context.load_verify_locations(ca_certs)\n # Py32 raises IOError\n # Py33 raises FileNotFoundError\n except Exception as e: # Reraise as SSLError\n raise SSLError(e)\n if certfile:\n # FIXME: This block needs a test.\n context.load_cert_chain(certfile, keyfile)\n if HAS_SNI: # Platform-specific: OpenSSL with enabled SNI\n return context.wrap_socket(sock, server_hostname=server_hostname)\n return context.wrap_socket(sock)"},{"col":4,"comment":"\n Close all pooled connections and disable the pool.\n ","endLoc":379,"header":"def close(self)","id":1238,"name":"close","nodeType":"Function","startLoc":365,"text":"def close(self):\n \"\"\"\n Close all pooled connections and disable the pool.\n \"\"\"\n # Disable access to the pool\n old_pool, self.pool = self.pool, None\n\n try:\n while True:\n conn = old_pool.get(block=False)\n if conn:\n conn.close()\n\n except Empty:\n pass # Done."},{"col":4,"comment":"\n Check if the given ``url`` is a member of the same host as this\n connection pool.\n ","endLoc":398,"header":"def is_same_host(self, url)","id":1239,"name":"is_same_host","nodeType":"Function","startLoc":381,"text":"def is_same_host(self, url):\n \"\"\"\n Check if the given ``url`` is a member of the same host as this\n connection pool.\n \"\"\"\n if url.startswith('/'):\n return True\n\n # TODO: Add optional support for socket.gethostbyname checking.\n scheme, host, port = get_host(url)\n\n # Use explicit default port for comparison when none is given\n if self.port and not port:\n port = port_by_scheme.get(scheme)\n elif not self.port and port == port_by_scheme.get(scheme):\n port = None\n\n return (scheme, host, port) == (self.scheme, self.host, self.port)"},{"col":0,"comment":"\n Deprecated. Use :func:`.parse_url` instead.\n ","endLoc":171,"header":"def get_host(url)","id":1240,"name":"get_host","nodeType":"Function","startLoc":166,"text":"def get_host(url):\n \"\"\"\n Deprecated. Use :func:`.parse_url` instead.\n \"\"\"\n p = parse_url(url)\n return p.scheme or 'http', p.hostname, p.port"},{"col":4,"comment":"\n Get a connection from the pool and perform an HTTP request. This is the\n lowest level call for making a request, so you'll need to specify all\n the raw details.\n\n .. note::\n\n More commonly, it's appropriate to use a convenience method provided\n by :class:`.RequestMethods`, such as :meth:`request`.\n\n .. note::\n\n `release_conn` will only behave as expected if\n `preload_content=False` because we want to make\n `preload_content=False` the default behaviour someday soon without\n breaking backwards compatibility.\n\n :param method:\n HTTP request method (such as GET, POST, PUT, etc.)\n\n :param body:\n Data to send in the request body (useful for creating\n POST requests, see HTTPConnectionPool.post_url for\n more convenience).\n\n :param headers:\n Dictionary of custom headers to send, such as User-Agent,\n If-None-Match, etc. If None, pool headers are used. If provided,\n these headers completely replace any pool-specific headers.\n\n :param retries:\n Configure the number of retries to allow before raising a\n :class:`~urllib3.exceptions.MaxRetryError` exception.\n\n Pass ``None`` to retry until you receive a response. Pass a\n :class:`~urllib3.util.retry.Retry` object for fine-grained control\n over different types of retries.\n Pass an integer number to retry connection errors that many times,\n but no other types of errors. Pass zero to never retry.\n\n If ``False``, then retries are disabled and any exception is raised\n immediately. Also, instead of raising a MaxRetryError on redirects,\n the redirect response will be returned.\n\n :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int.\n\n :param redirect:\n If True, automatically handle redirects (status codes 301, 302,\n 303, 307, 308). Each redirect counts as a retry. Disabling retries\n will disable redirect, too.\n\n :param assert_same_host:\n If ``True``, will make sure that the host of the pool requests is\n consistent else will raise HostChangedError. When False, you can\n use the pool on an HTTP proxy and request foreign hosts.\n\n :param timeout:\n If specified, overrides the default timeout for this one\n request. It may be a float (in seconds) or an instance of\n :class:`urllib3.util.Timeout`.\n\n :param pool_timeout:\n If set and the pool is set to block=True, then this method will\n block for ``pool_timeout`` seconds and raise EmptyPoolError if no\n connection is available within the time period.\n\n :param release_conn:\n If False, then the urlopen call will not release the connection\n back into the pool once a response is received (but will release if\n you read the entire contents of the response such as when\n `preload_content=True`). This is useful if you're not preloading\n the response's content immediately. You will need to call\n ``r.release_conn()`` on the response ``r`` to return the connection\n back into the pool. If None, it takes the value of\n ``response_kw.get('preload_content', True)``.\n\n :param \\**response_kw:\n Additional parameters are passed to\n :meth:`urllib3.response.HTTPResponse.from_httplib`\n ","endLoc":612,"header":"def urlopen(self, method, url, body=None, headers=None, retries=None,\n redirect=True, assert_same_host=True, timeout=_Default,\n pool_timeout=None, release_conn=None, **response_kw)","id":1241,"name":"urlopen","nodeType":"Function","startLoc":400,"text":"def urlopen(self, method, url, body=None, headers=None, retries=None,\n redirect=True, assert_same_host=True, timeout=_Default,\n pool_timeout=None, release_conn=None, **response_kw):\n \"\"\"\n Get a connection from the pool and perform an HTTP request. This is the\n lowest level call for making a request, so you'll need to specify all\n the raw details.\n\n .. note::\n\n More commonly, it's appropriate to use a convenience method provided\n by :class:`.RequestMethods`, such as :meth:`request`.\n\n .. note::\n\n `release_conn` will only behave as expected if\n `preload_content=False` because we want to make\n `preload_content=False` the default behaviour someday soon without\n breaking backwards compatibility.\n\n :param method:\n HTTP request method (such as GET, POST, PUT, etc.)\n\n :param body:\n Data to send in the request body (useful for creating\n POST requests, see HTTPConnectionPool.post_url for\n more convenience).\n\n :param headers:\n Dictionary of custom headers to send, such as User-Agent,\n If-None-Match, etc. If None, pool headers are used. If provided,\n these headers completely replace any pool-specific headers.\n\n :param retries:\n Configure the number of retries to allow before raising a\n :class:`~urllib3.exceptions.MaxRetryError` exception.\n\n Pass ``None`` to retry until you receive a response. Pass a\n :class:`~urllib3.util.retry.Retry` object for fine-grained control\n over different types of retries.\n Pass an integer number to retry connection errors that many times,\n but no other types of errors. Pass zero to never retry.\n\n If ``False``, then retries are disabled and any exception is raised\n immediately. Also, instead of raising a MaxRetryError on redirects,\n the redirect response will be returned.\n\n :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int.\n\n :param redirect:\n If True, automatically handle redirects (status codes 301, 302,\n 303, 307, 308). Each redirect counts as a retry. Disabling retries\n will disable redirect, too.\n\n :param assert_same_host:\n If ``True``, will make sure that the host of the pool requests is\n consistent else will raise HostChangedError. When False, you can\n use the pool on an HTTP proxy and request foreign hosts.\n\n :param timeout:\n If specified, overrides the default timeout for this one\n request. It may be a float (in seconds) or an instance of\n :class:`urllib3.util.Timeout`.\n\n :param pool_timeout:\n If set and the pool is set to block=True, then this method will\n block for ``pool_timeout`` seconds and raise EmptyPoolError if no\n connection is available within the time period.\n\n :param release_conn:\n If False, then the urlopen call will not release the connection\n back into the pool once a response is received (but will release if\n you read the entire contents of the response such as when\n `preload_content=True`). This is useful if you're not preloading\n the response's content immediately. You will need to call\n ``r.release_conn()`` on the response ``r`` to return the connection\n back into the pool. If None, it takes the value of\n ``response_kw.get('preload_content', True)``.\n\n :param \\**response_kw:\n Additional parameters are passed to\n :meth:`urllib3.response.HTTPResponse.from_httplib`\n \"\"\"\n if headers is None:\n headers = self.headers\n\n if not isinstance(retries, Retry):\n retries = Retry.from_int(retries, redirect=redirect, default=self.retries)\n\n if release_conn is None:\n release_conn = response_kw.get('preload_content', True)\n\n # Check host\n if assert_same_host and not self.is_same_host(url):\n raise HostChangedError(self, url, retries)\n\n conn = None\n\n # Merge the proxy headers. Only do this in HTTP. We have to copy the\n # headers dict so we can safely change it without those changes being\n # reflected in anyone else's copy.\n if self.scheme == 'http':\n headers = headers.copy()\n headers.update(self.proxy_headers)\n\n # Must keep the exception bound to a separate variable or else Python 3\n # complains about UnboundLocalError.\n err = None\n\n try:\n # Request a connection from the queue.\n conn = self._get_conn(timeout=pool_timeout)\n\n # Make the request on the httplib connection object.\n httplib_response = self._make_request(conn, method, url,\n timeout=timeout,\n body=body, headers=headers)\n\n # If we're going to release the connection in ``finally:``, then\n # the request doesn't need to know about the connection. Otherwise\n # it will also try to release it and we'll have a double-release\n # mess.\n response_conn = not release_conn and conn\n\n # Import httplib's response into our own wrapper object\n response = HTTPResponse.from_httplib(httplib_response,\n pool=self,\n connection=response_conn,\n **response_kw)\n\n # else:\n # The connection will be put back into the pool when\n # ``response.release_conn()`` is called (implicitly by\n # ``response.read()``)\n\n except Empty:\n # Timed out by queue.\n raise EmptyPoolError(self, \"No pool connections are available.\")\n\n except (BaseSSLError, CertificateError) as e:\n # Release connection unconditionally because there is no way to\n # close it externally in case of exception.\n release_conn = True\n raise SSLError(e)\n\n except (TimeoutError, HTTPException, SocketError) as e:\n if conn:\n # Discard the connection for these exceptions. It will be\n # be replaced during the next _get_conn() call.\n conn.close()\n conn = None\n\n stacktrace = sys.exc_info()[2]\n if isinstance(e, SocketError) and self.proxy:\n e = ProxyError('Cannot connect to proxy.', e)\n elif isinstance(e, (SocketError, HTTPException)):\n e = ProtocolError('Connection aborted.', e)\n\n retries = retries.increment(method, url, error=e,\n _pool=self, _stacktrace=stacktrace)\n retries.sleep()\n\n # Keep track of the error for the retry warning.\n err = e\n\n finally:\n if release_conn:\n # Put the connection back to be reused. If the connection is\n # expired then it will be None, which will get replaced with a\n # fresh connection during _get_conn.\n self._put_conn(conn)\n\n if not conn:\n # Try again\n log.warning(\"Retrying (%r) after connection \"\n \"broken by '%r': %s\" % (retries, err, url))\n return self.urlopen(method, url, body, headers, retries,\n redirect, assert_same_host,\n timeout=timeout, pool_timeout=pool_timeout,\n release_conn=release_conn, **response_kw)\n\n # Handle redirect?\n redirect_location = redirect and response.get_redirect_location()\n if redirect_location:\n if response.status == 303:\n method = 'GET'\n\n try:\n retries = retries.increment(method, url, response=response, _pool=self)\n except MaxRetryError:\n if retries.raise_on_redirect:\n raise\n return response\n\n log.info(\"Redirecting %s -> %s\" % (url, redirect_location))\n return self.urlopen(method, redirect_location, body, headers,\n retries=retries, redirect=redirect,\n assert_same_host=assert_same_host,\n timeout=timeout, pool_timeout=pool_timeout,\n release_conn=release_conn, **response_kw)\n\n # Check if we should retry the HTTP response.\n if retries.is_forced_retry(method, status_code=response.status):\n retries = retries.increment(method, url, response=response, _pool=self)\n retries.sleep()\n log.info(\"Forced retry: %s\" % url)\n return self.urlopen(method, url, body, headers,\n retries=retries, redirect=redirect,\n assert_same_host=assert_same_host,\n timeout=timeout, pool_timeout=pool_timeout,\n release_conn=release_conn, **response_kw)\n\n return response"},{"col":4,"comment":"null","endLoc":132,"header":"def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None,\n ca_certs=None, server_hostname=None,\n ssl_version=None)","id":1242,"name":"ssl_wrap_socket","nodeType":"Function","startLoc":127,"text":"def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None,\n ca_certs=None, server_hostname=None,\n ssl_version=None):\n return wrap_socket(sock, keyfile=keyfile, certfile=certfile,\n ca_certs=ca_certs, cert_reqs=cert_reqs,\n ssl_version=ssl_version)"},{"attributeType":"None","col":4,"comment":"null","endLoc":8,"id":1243,"name":"SSLContext","nodeType":"Attribute","startLoc":8,"text":"SSLContext"},{"attributeType":"bool","col":4,"comment":"null","endLoc":9,"id":1244,"name":"HAS_SNI","nodeType":"Attribute","startLoc":9,"text":"HAS_SNI"},{"col":0,"comment":"","endLoc":1,"header":"ssl_.py#","id":1245,"name":"","nodeType":"Function","startLoc":1,"text":"try: # Test for SSL features\n SSLContext = None\n HAS_SNI = False\n\n import ssl\n from ssl import wrap_socket, CERT_NONE, PROTOCOL_SSLv23\n from ssl import SSLContext # Modern SSL?\n from ssl import HAS_SNI # Has SNI?\nexcept ImportError:\n pass\n\nif SSLContext is not None: # Python 3.2+\n def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None,\n ca_certs=None, server_hostname=None,\n ssl_version=None):\n \"\"\"\n All arguments except `server_hostname` have the same meaning as for\n :func:`ssl.wrap_socket`\n\n :param server_hostname:\n Hostname of the expected certificate\n \"\"\"\n context = SSLContext(ssl_version)\n context.verify_mode = cert_reqs\n\n # Disable TLS compression to migitate CRIME attack (issue #309)\n OP_NO_COMPRESSION = 0x20000\n context.options |= OP_NO_COMPRESSION\n\n if ca_certs:\n try:\n context.load_verify_locations(ca_certs)\n # Py32 raises IOError\n # Py33 raises FileNotFoundError\n except Exception as e: # Reraise as SSLError\n raise SSLError(e)\n if certfile:\n # FIXME: This block needs a test.\n context.load_cert_chain(certfile, keyfile)\n if HAS_SNI: # Platform-specific: OpenSSL with enabled SNI\n return context.wrap_socket(sock, server_hostname=server_hostname)\n return context.wrap_socket(sock)\n\nelse: # Python 3.1 and earlier\n def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None,\n ca_certs=None, server_hostname=None,\n ssl_version=None):\n return wrap_socket(sock, keyfile=keyfile, certfile=certfile,\n ca_certs=ca_certs, cert_reqs=cert_reqs,\n ssl_version=ssl_version)"},{"col":4,"comment":"null","endLoc":83,"header":"def __init__(self, pool, url, retries=3)","id":1246,"name":"__init__","nodeType":"Function","startLoc":80,"text":"def __init__(self, pool, url, retries=3):\n message = \"Tried to open a foreign host with url: %s\" % url\n RequestError.__init__(self, pool, url, message)\n self.retries = retries"},{"fileName":"chardistribution.py","filePath":"requests/packages/chardet","id":1247,"nodeType":"File","text":"######################## BEGIN LICENSE BLOCK ########################\n# The Original Code is Mozilla Communicator client code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 1998\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n# Mark Pilgrim - port to Python\n#\n# This library is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public\n# License as published by the Free Software Foundation; either\n# version 2.1 of the License, or (at your option) any later version.\n#\n# This library is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n# Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this library; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n# 02110-1301 USA\n######################### END LICENSE BLOCK #########################\n\nfrom .euctwfreq import (EUCTWCharToFreqOrder, EUCTW_TABLE_SIZE,\n EUCTW_TYPICAL_DISTRIBUTION_RATIO)\nfrom .euckrfreq import (EUCKRCharToFreqOrder, EUCKR_TABLE_SIZE,\n EUCKR_TYPICAL_DISTRIBUTION_RATIO)\nfrom .gb2312freq import (GB2312CharToFreqOrder, GB2312_TABLE_SIZE,\n GB2312_TYPICAL_DISTRIBUTION_RATIO)\nfrom .big5freq import (Big5CharToFreqOrder, BIG5_TABLE_SIZE,\n BIG5_TYPICAL_DISTRIBUTION_RATIO)\nfrom .jisfreq import (JISCharToFreqOrder, JIS_TABLE_SIZE,\n JIS_TYPICAL_DISTRIBUTION_RATIO)\nfrom .compat import wrap_ord\n\nENOUGH_DATA_THRESHOLD = 1024\nSURE_YES = 0.99\nSURE_NO = 0.01\nMINIMUM_DATA_THRESHOLD = 3\n\n\nclass CharDistributionAnalysis:\n def __init__(self):\n # Mapping table to get frequency order from char order (get from\n # GetOrder())\n self._mCharToFreqOrder = None\n self._mTableSize = None # Size of above table\n # This is a constant value which varies from language to language,\n # used in calculating confidence. See\n # http://www.mozilla.org/projects/intl/UniversalCharsetDetection.html\n # for further detail.\n self._mTypicalDistributionRatio = None\n self.reset()\n\n def reset(self):\n \"\"\"reset analyser, clear any state\"\"\"\n # If this flag is set to True, detection is done and conclusion has\n # been made\n self._mDone = False\n self._mTotalChars = 0 # Total characters encountered\n # The number of characters whose frequency order is less than 512\n self._mFreqChars = 0\n\n def feed(self, aBuf, aCharLen):\n \"\"\"feed a character with known length\"\"\"\n if aCharLen == 2:\n # we only care about 2-bytes character in our distribution analysis\n order = self.get_order(aBuf)\n else:\n order = -1\n if order >= 0:\n self._mTotalChars += 1\n # order is valid\n if order < self._mTableSize:\n if 512 > self._mCharToFreqOrder[order]:\n self._mFreqChars += 1\n\n def get_confidence(self):\n \"\"\"return confidence based on existing data\"\"\"\n # if we didn't receive any character in our consideration range,\n # return negative answer\n if self._mTotalChars <= 0 or self._mFreqChars <= MINIMUM_DATA_THRESHOLD:\n return SURE_NO\n\n if self._mTotalChars != self._mFreqChars:\n r = (self._mFreqChars / ((self._mTotalChars - self._mFreqChars)\n * self._mTypicalDistributionRatio))\n if r < SURE_YES:\n return r\n\n # normalize confidence (we don't want to be 100% sure)\n return SURE_YES\n\n def got_enough_data(self):\n # It is not necessary to receive all data to draw conclusion.\n # For charset detection, certain amount of data is enough\n return self._mTotalChars > ENOUGH_DATA_THRESHOLD\n\n def get_order(self, aBuf):\n # We do not handle characters based on the original encoding string,\n # but convert this encoding string to a number, here called order.\n # This allows multiple encodings of a language to share one frequency\n # table.\n return -1\n\n\nclass EUCTWDistributionAnalysis(CharDistributionAnalysis):\n def __init__(self):\n CharDistributionAnalysis.__init__(self)\n self._mCharToFreqOrder = EUCTWCharToFreqOrder\n self._mTableSize = EUCTW_TABLE_SIZE\n self._mTypicalDistributionRatio = EUCTW_TYPICAL_DISTRIBUTION_RATIO\n\n def get_order(self, aBuf):\n # for euc-TW encoding, we are interested\n # first byte range: 0xc4 -- 0xfe\n # second byte range: 0xa1 -- 0xfe\n # no validation needed here. State machine has done that\n first_char = wrap_ord(aBuf[0])\n if first_char >= 0xC4:\n return 94 * (first_char - 0xC4) + wrap_ord(aBuf[1]) - 0xA1\n else:\n return -1\n\n\nclass EUCKRDistributionAnalysis(CharDistributionAnalysis):\n def __init__(self):\n CharDistributionAnalysis.__init__(self)\n self._mCharToFreqOrder = EUCKRCharToFreqOrder\n self._mTableSize = EUCKR_TABLE_SIZE\n self._mTypicalDistributionRatio = EUCKR_TYPICAL_DISTRIBUTION_RATIO\n\n def get_order(self, aBuf):\n # for euc-KR encoding, we are interested\n # first byte range: 0xb0 -- 0xfe\n # second byte range: 0xa1 -- 0xfe\n # no validation needed here. State machine has done that\n first_char = wrap_ord(aBuf[0])\n if first_char >= 0xB0:\n return 94 * (first_char - 0xB0) + wrap_ord(aBuf[1]) - 0xA1\n else:\n return -1\n\n\nclass GB2312DistributionAnalysis(CharDistributionAnalysis):\n def __init__(self):\n CharDistributionAnalysis.__init__(self)\n self._mCharToFreqOrder = GB2312CharToFreqOrder\n self._mTableSize = GB2312_TABLE_SIZE\n self._mTypicalDistributionRatio = GB2312_TYPICAL_DISTRIBUTION_RATIO\n\n def get_order(self, aBuf):\n # for GB2312 encoding, we are interested\n # first byte range: 0xb0 -- 0xfe\n # second byte range: 0xa1 -- 0xfe\n # no validation needed here. State machine has done that\n first_char, second_char = wrap_ord(aBuf[0]), wrap_ord(aBuf[1])\n if (first_char >= 0xB0) and (second_char >= 0xA1):\n return 94 * (first_char - 0xB0) + second_char - 0xA1\n else:\n return -1\n\n\nclass Big5DistributionAnalysis(CharDistributionAnalysis):\n def __init__(self):\n CharDistributionAnalysis.__init__(self)\n self._mCharToFreqOrder = Big5CharToFreqOrder\n self._mTableSize = BIG5_TABLE_SIZE\n self._mTypicalDistributionRatio = BIG5_TYPICAL_DISTRIBUTION_RATIO\n\n def get_order(self, aBuf):\n # for big5 encoding, we are interested\n # first byte range: 0xa4 -- 0xfe\n # second byte range: 0x40 -- 0x7e , 0xa1 -- 0xfe\n # no validation needed here. State machine has done that\n first_char, second_char = wrap_ord(aBuf[0]), wrap_ord(aBuf[1])\n if first_char >= 0xA4:\n if second_char >= 0xA1:\n return 157 * (first_char - 0xA4) + second_char - 0xA1 + 63\n else:\n return 157 * (first_char - 0xA4) + second_char - 0x40\n else:\n return -1\n\n\nclass SJISDistributionAnalysis(CharDistributionAnalysis):\n def __init__(self):\n CharDistributionAnalysis.__init__(self)\n self._mCharToFreqOrder = JISCharToFreqOrder\n self._mTableSize = JIS_TABLE_SIZE\n self._mTypicalDistributionRatio = JIS_TYPICAL_DISTRIBUTION_RATIO\n\n def get_order(self, aBuf):\n # for sjis encoding, we are interested\n # first byte range: 0x81 -- 0x9f , 0xe0 -- 0xfe\n # second byte range: 0x40 -- 0x7e, 0x81 -- oxfe\n # no validation needed here. State machine has done that\n first_char, second_char = wrap_ord(aBuf[0]), wrap_ord(aBuf[1])\n if (first_char >= 0x81) and (first_char <= 0x9F):\n order = 188 * (first_char - 0x81)\n elif (first_char >= 0xE0) and (first_char <= 0xEF):\n order = 188 * (first_char - 0xE0 + 31)\n else:\n return -1\n order = order + second_char - 0x40\n if second_char > 0x7F:\n order = -1\n return order\n\n\nclass EUCJPDistributionAnalysis(CharDistributionAnalysis):\n def __init__(self):\n CharDistributionAnalysis.__init__(self)\n self._mCharToFreqOrder = JISCharToFreqOrder\n self._mTableSize = JIS_TABLE_SIZE\n self._mTypicalDistributionRatio = JIS_TYPICAL_DISTRIBUTION_RATIO\n\n def get_order(self, aBuf):\n # for euc-JP encoding, we are interested\n # first byte range: 0xa0 -- 0xfe\n # second byte range: 0xa1 -- 0xfe\n # no validation needed here. State machine has done that\n char = wrap_ord(aBuf[0])\n if char >= 0xA0:\n return 94 * (char - 0xA1) + wrap_ord(aBuf[1]) - 0xa1\n else:\n return -1\n"},{"attributeType":"null","col":0,"comment":"null","endLoc":46,"id":1248,"name":"EUCKRCharToFreqOrder","nodeType":"Attribute","startLoc":46,"text":"EUCKRCharToFreqOrder"},{"attributeType":"null","col":0,"comment":"null","endLoc":43,"id":1250,"name":"EUCKR_TABLE_SIZE","nodeType":"Attribute","startLoc":43,"text":"EUCKR_TABLE_SIZE"},{"attributeType":"null","col":0,"comment":"null","endLoc":41,"id":1251,"name":"EUCKR_TYPICAL_DISTRIBUTION_RATIO","nodeType":"Attribute","startLoc":41,"text":"EUCKR_TYPICAL_DISTRIBUTION_RATIO"},{"attributeType":"null","col":0,"comment":"null","endLoc":48,"id":1252,"name":"Big5CharToFreqOrder","nodeType":"Attribute","startLoc":48,"text":"Big5CharToFreqOrder"},{"attributeType":"null","col":4,"comment":"null","endLoc":139,"id":1253,"name":"scheme","nodeType":"Attribute","startLoc":139,"text":"scheme"},{"attributeType":"null","col":4,"comment":"null","endLoc":140,"id":1254,"name":"ConnectionCls","nodeType":"Attribute","startLoc":140,"text":"ConnectionCls"},{"attributeType":"null","col":8,"comment":"null","endLoc":159,"id":1255,"name":"retries","nodeType":"Attribute","startLoc":159,"text":"self.retries"},{"attributeType":"null","col":8,"comment":"null","endLoc":164,"id":1256,"name":"proxy","nodeType":"Attribute","startLoc":164,"text":"self.proxy"},{"attributeType":"null","col":8,"comment":"null","endLoc":165,"id":1257,"name":"proxy_headers","nodeType":"Attribute","startLoc":165,"text":"self.proxy_headers"},{"attributeType":"null","col":8,"comment":"null","endLoc":161,"id":1258,"name":"pool","nodeType":"Attribute","startLoc":161,"text":"self.pool"},{"attributeType":"null","col":8,"comment":"null","endLoc":173,"id":1259,"name":"num_requests","nodeType":"Attribute","startLoc":173,"text":"self.num_requests"},{"attributeType":"null","col":8,"comment":"null","endLoc":162,"id":1260,"name":"block","nodeType":"Attribute","startLoc":162,"text":"self.block"},{"attributeType":"null","col":8,"comment":"null","endLoc":172,"id":1261,"name":"num_connections","nodeType":"Attribute","startLoc":172,"text":"self.num_connections"},{"attributeType":"dict","col":8,"comment":"null","endLoc":174,"id":1262,"name":"conn_kw","nodeType":"Attribute","startLoc":174,"text":"self.conn_kw"},{"attributeType":"null","col":8,"comment":"null","endLoc":150,"id":1263,"name":"strict","nodeType":"Attribute","startLoc":150,"text":"self.strict"},{"attributeType":"null","col":8,"comment":"null","endLoc":158,"id":1264,"name":"timeout","nodeType":"Attribute","startLoc":158,"text":"self.timeout"},{"className":"HTTPSConnectionPool","col":0,"comment":"\n Same as :class:`.HTTPConnectionPool`, but HTTPS.\n\n When Python is compiled with the :mod:`ssl` module, then\n :class:`.VerifiedHTTPSConnection` is used, which *can* verify certificates,\n instead of :class:`.HTTPSConnection`.\n\n :class:`.VerifiedHTTPSConnection` uses one of ``assert_fingerprint``,\n ``assert_hostname`` and ``host`` in this order to verify connections.\n If ``assert_hostname`` is False, no verification is done.\n\n The ``key_file``, ``cert_file``, ``cert_reqs``, ``ca_certs`` and\n ``ssl_version`` are only used if :mod:`ssl` is available and are fed into\n :meth:`urllib3.util.ssl_wrap_socket` to upgrade the connection socket\n into an SSL socket.\n ","endLoc":730,"id":1265,"nodeType":"Class","startLoc":615,"text":"class HTTPSConnectionPool(HTTPConnectionPool):\n \"\"\"\n Same as :class:`.HTTPConnectionPool`, but HTTPS.\n\n When Python is compiled with the :mod:`ssl` module, then\n :class:`.VerifiedHTTPSConnection` is used, which *can* verify certificates,\n instead of :class:`.HTTPSConnection`.\n\n :class:`.VerifiedHTTPSConnection` uses one of ``assert_fingerprint``,\n ``assert_hostname`` and ``host`` in this order to verify connections.\n If ``assert_hostname`` is False, no verification is done.\n\n The ``key_file``, ``cert_file``, ``cert_reqs``, ``ca_certs`` and\n ``ssl_version`` are only used if :mod:`ssl` is available and are fed into\n :meth:`urllib3.util.ssl_wrap_socket` to upgrade the connection socket\n into an SSL socket.\n \"\"\"\n\n scheme = 'https'\n ConnectionCls = HTTPSConnection\n\n def __init__(self, host, port=None,\n strict=False, timeout=Timeout.DEFAULT_TIMEOUT, maxsize=1,\n block=False, headers=None, retries=None,\n _proxy=None, _proxy_headers=None,\n key_file=None, cert_file=None, cert_reqs=None,\n ca_certs=None, ssl_version=None,\n assert_hostname=None, assert_fingerprint=None,\n **conn_kw):\n\n HTTPConnectionPool.__init__(self, host, port, strict, timeout, maxsize,\n block, headers, retries, _proxy, _proxy_headers,\n **conn_kw)\n self.key_file = key_file\n self.cert_file = cert_file\n self.cert_reqs = cert_reqs\n self.ca_certs = ca_certs\n self.ssl_version = ssl_version\n self.assert_hostname = assert_hostname\n self.assert_fingerprint = assert_fingerprint\n\n def _prepare_conn(self, conn):\n \"\"\"\n Prepare the ``connection`` for :meth:`urllib3.util.ssl_wrap_socket`\n and establish the tunnel if proxy is used.\n \"\"\"\n\n if isinstance(conn, VerifiedHTTPSConnection):\n conn.set_cert(key_file=self.key_file,\n cert_file=self.cert_file,\n cert_reqs=self.cert_reqs,\n ca_certs=self.ca_certs,\n assert_hostname=self.assert_hostname,\n assert_fingerprint=self.assert_fingerprint)\n conn.ssl_version = self.ssl_version\n\n if self.proxy is not None:\n # Python 2.7+\n try:\n set_tunnel = conn.set_tunnel\n except AttributeError: # Platform-specific: Python 2.6\n set_tunnel = conn._set_tunnel\n\n if sys.version_info <= (2, 6, 4) and not self.proxy_headers: # Python 2.6.4 and older\n set_tunnel(self.host, self.port)\n else:\n set_tunnel(self.host, self.port, self.proxy_headers)\n\n # Establish tunnel connection early, because otherwise httplib\n # would improperly set Host: header to proxy's IP:port.\n conn.connect()\n\n return conn\n\n def _new_conn(self):\n \"\"\"\n Return a fresh :class:`httplib.HTTPSConnection`.\n \"\"\"\n self.num_connections += 1\n log.info(\"Starting new HTTPS connection (%d): %s\"\n % (self.num_connections, self.host))\n\n if not self.ConnectionCls or self.ConnectionCls is DummyConnection:\n # Platform-specific: Python without ssl\n raise SSLError(\"Can't connect to HTTPS URL because the SSL \"\n \"module is not available.\")\n\n actual_host = self.host\n actual_port = self.port\n if self.proxy is not None:\n actual_host = self.proxy.host\n actual_port = self.proxy.port\n\n conn = self.ConnectionCls(host=actual_host, port=actual_port,\n timeout=self.timeout.connect_timeout,\n strict=self.strict, **self.conn_kw)\n\n return self._prepare_conn(conn)\n\n def _validate_conn(self, conn):\n \"\"\"\n Called right before a request is made, after the socket is created.\n \"\"\"\n super(HTTPSConnectionPool, self)._validate_conn(conn)\n\n # Force connect early to allow us to validate the connection.\n if not conn.sock:\n conn.connect()\n\n if not conn.is_verified:\n warnings.warn((\n 'Unverified HTTPS request is being made. '\n 'Adding certificate verification is strongly advised. See: '\n 'https://urllib3.readthedocs.org/en/latest/security.html '\n '(This warning will only appear once by default.)'),\n InsecureRequestWarning)"},{"col":4,"comment":"null","endLoc":654,"header":"def __init__(self, host, port=None,\n strict=False, timeout=Timeout.DEFAULT_TIMEOUT, maxsize=1,\n block=False, headers=None, retries=None,\n _proxy=None, _proxy_headers=None,\n key_file=None, cert_file=None, cert_reqs=None,\n ca_certs=None, ssl_version=None,\n assert_hostname=None, assert_fingerprint=None,\n **conn_kw)","id":1266,"name":"__init__","nodeType":"Function","startLoc":636,"text":"def __init__(self, host, port=None,\n strict=False, timeout=Timeout.DEFAULT_TIMEOUT, maxsize=1,\n block=False, headers=None, retries=None,\n _proxy=None, _proxy_headers=None,\n key_file=None, cert_file=None, cert_reqs=None,\n ca_certs=None, ssl_version=None,\n assert_hostname=None, assert_fingerprint=None,\n **conn_kw):\n\n HTTPConnectionPool.__init__(self, host, port, strict, timeout, maxsize,\n block, headers, retries, _proxy, _proxy_headers,\n **conn_kw)\n self.key_file = key_file\n self.cert_file = cert_file\n self.cert_reqs = cert_reqs\n self.ca_certs = ca_certs\n self.ssl_version = ssl_version\n self.assert_hostname = assert_hostname\n self.assert_fingerprint = assert_fingerprint"},{"col":4,"comment":"\n Prepare the ``connection`` for :meth:`urllib3.util.ssl_wrap_socket`\n and establish the tunnel if proxy is used.\n ","endLoc":687,"header":"def _prepare_conn(self, conn)","id":1267,"name":"_prepare_conn","nodeType":"Function","startLoc":656,"text":"def _prepare_conn(self, conn):\n \"\"\"\n Prepare the ``connection`` for :meth:`urllib3.util.ssl_wrap_socket`\n and establish the tunnel if proxy is used.\n \"\"\"\n\n if isinstance(conn, VerifiedHTTPSConnection):\n conn.set_cert(key_file=self.key_file,\n cert_file=self.cert_file,\n cert_reqs=self.cert_reqs,\n ca_certs=self.ca_certs,\n assert_hostname=self.assert_hostname,\n assert_fingerprint=self.assert_fingerprint)\n conn.ssl_version = self.ssl_version\n\n if self.proxy is not None:\n # Python 2.7+\n try:\n set_tunnel = conn.set_tunnel\n except AttributeError: # Platform-specific: Python 2.6\n set_tunnel = conn._set_tunnel\n\n if sys.version_info <= (2, 6, 4) and not self.proxy_headers: # Python 2.6.4 and older\n set_tunnel(self.host, self.port)\n else:\n set_tunnel(self.host, self.port, self.proxy_headers)\n\n # Establish tunnel connection early, because otherwise httplib\n # would improperly set Host: header to proxy's IP:port.\n conn.connect()\n\n return conn"},{"col":4,"comment":"\n Return a fresh :class:`httplib.HTTPSConnection`.\n ","endLoc":712,"header":"def _new_conn(self)","id":1268,"name":"_new_conn","nodeType":"Function","startLoc":689,"text":"def _new_conn(self):\n \"\"\"\n Return a fresh :class:`httplib.HTTPSConnection`.\n \"\"\"\n self.num_connections += 1\n log.info(\"Starting new HTTPS connection (%d): %s\"\n % (self.num_connections, self.host))\n\n if not self.ConnectionCls or self.ConnectionCls is DummyConnection:\n # Platform-specific: Python without ssl\n raise SSLError(\"Can't connect to HTTPS URL because the SSL \"\n \"module is not available.\")\n\n actual_host = self.host\n actual_port = self.port\n if self.proxy is not None:\n actual_host = self.proxy.host\n actual_port = self.proxy.port\n\n conn = self.ConnectionCls(host=actual_host, port=actual_port,\n timeout=self.timeout.connect_timeout,\n strict=self.strict, **self.conn_kw)\n\n return self._prepare_conn(conn)"},{"col":4,"comment":"\n Called right before a request is made, after the socket is created.\n ","endLoc":730,"header":"def _validate_conn(self, conn)","id":1269,"name":"_validate_conn","nodeType":"Function","startLoc":714,"text":"def _validate_conn(self, conn):\n \"\"\"\n Called right before a request is made, after the socket is created.\n \"\"\"\n super(HTTPSConnectionPool, self)._validate_conn(conn)\n\n # Force connect early to allow us to validate the connection.\n if not conn.sock:\n conn.connect()\n\n if not conn.is_verified:\n warnings.warn((\n 'Unverified HTTPS request is being made. '\n 'Adding certificate verification is strongly advised. See: '\n 'https://urllib3.readthedocs.org/en/latest/security.html '\n '(This warning will only appear once by default.)'),\n InsecureRequestWarning)"},{"attributeType":"null","col":0,"comment":"null","endLoc":46,"id":1270,"name":"BIG5_TABLE_SIZE","nodeType":"Attribute","startLoc":46,"text":"BIG5_TABLE_SIZE"},{"attributeType":"null","col":0,"comment":"null","endLoc":43,"id":1271,"name":"BIG5_TYPICAL_DISTRIBUTION_RATIO","nodeType":"Attribute","startLoc":43,"text":"BIG5_TYPICAL_DISTRIBUTION_RATIO"},{"className":"CharDistributionAnalysis","col":0,"comment":"null","endLoc":108,"id":1272,"nodeType":"Class","startLoc":46,"text":"class CharDistributionAnalysis:\n def __init__(self):\n # Mapping table to get frequency order from char order (get from\n # GetOrder())\n self._mCharToFreqOrder = None\n self._mTableSize = None # Size of above table\n # This is a constant value which varies from language to language,\n # used in calculating confidence. See\n # http://www.mozilla.org/projects/intl/UniversalCharsetDetection.html\n # for further detail.\n self._mTypicalDistributionRatio = None\n self.reset()\n\n def reset(self):\n \"\"\"reset analyser, clear any state\"\"\"\n # If this flag is set to True, detection is done and conclusion has\n # been made\n self._mDone = False\n self._mTotalChars = 0 # Total characters encountered\n # The number of characters whose frequency order is less than 512\n self._mFreqChars = 0\n\n def feed(self, aBuf, aCharLen):\n \"\"\"feed a character with known length\"\"\"\n if aCharLen == 2:\n # we only care about 2-bytes character in our distribution analysis\n order = self.get_order(aBuf)\n else:\n order = -1\n if order >= 0:\n self._mTotalChars += 1\n # order is valid\n if order < self._mTableSize:\n if 512 > self._mCharToFreqOrder[order]:\n self._mFreqChars += 1\n\n def get_confidence(self):\n \"\"\"return confidence based on existing data\"\"\"\n # if we didn't receive any character in our consideration range,\n # return negative answer\n if self._mTotalChars <= 0 or self._mFreqChars <= MINIMUM_DATA_THRESHOLD:\n return SURE_NO\n\n if self._mTotalChars != self._mFreqChars:\n r = (self._mFreqChars / ((self._mTotalChars - self._mFreqChars)\n * self._mTypicalDistributionRatio))\n if r < SURE_YES:\n return r\n\n # normalize confidence (we don't want to be 100% sure)\n return SURE_YES\n\n def got_enough_data(self):\n # It is not necessary to receive all data to draw conclusion.\n # For charset detection, certain amount of data is enough\n return self._mTotalChars > ENOUGH_DATA_THRESHOLD\n\n def get_order(self, aBuf):\n # We do not handle characters based on the original encoding string,\n # but convert this encoding string to a number, here called order.\n # This allows multiple encodings of a language to share one frequency\n # table.\n return -1"},{"col":4,"comment":"null","endLoc":57,"header":"def __init__(self)","id":1273,"name":"__init__","nodeType":"Function","startLoc":47,"text":"def __init__(self):\n # Mapping table to get frequency order from char order (get from\n # GetOrder())\n self._mCharToFreqOrder = None\n self._mTableSize = None # Size of above table\n # This is a constant value which varies from language to language,\n # used in calculating confidence. See\n # http://www.mozilla.org/projects/intl/UniversalCharsetDetection.html\n # for further detail.\n self._mTypicalDistributionRatio = None\n self.reset()"},{"attributeType":"null","col":4,"comment":"null","endLoc":633,"id":1276,"name":"scheme","nodeType":"Attribute","startLoc":633,"text":"scheme"},{"attributeType":"null","col":4,"comment":"null","endLoc":634,"id":1277,"name":"ConnectionCls","nodeType":"Attribute","startLoc":634,"text":"ConnectionCls"},{"attributeType":"null","col":8,"comment":"null","endLoc":653,"id":1278,"name":"assert_hostname","nodeType":"Attribute","startLoc":653,"text":"self.assert_hostname"},{"attributeType":"null","col":8,"comment":"null","endLoc":651,"id":1279,"name":"ca_certs","nodeType":"Attribute","startLoc":651,"text":"self.ca_certs"},{"attributeType":"null","col":8,"comment":"null","endLoc":654,"id":1280,"name":"assert_fingerprint","nodeType":"Attribute","startLoc":654,"text":"self.assert_fingerprint"},{"attributeType":"null","col":8,"comment":"null","endLoc":648,"id":1281,"name":"key_file","nodeType":"Attribute","startLoc":648,"text":"self.key_file"},{"col":4,"comment":"reset analyser, clear any state","endLoc":66,"header":"def reset(self)","id":1282,"name":"reset","nodeType":"Function","startLoc":59,"text":"def reset(self):\n \"\"\"reset analyser, clear any state\"\"\"\n # If this flag is set to True, detection is done and conclusion has\n # been made\n self._mDone = False\n self._mTotalChars = 0 # Total characters encountered\n # The number of characters whose frequency order is less than 512\n self._mFreqChars = 0"},{"col":4,"comment":"feed a character with known length","endLoc":80,"header":"def feed(self, aBuf, aCharLen)","id":1283,"name":"feed","nodeType":"Function","startLoc":68,"text":"def feed(self, aBuf, aCharLen):\n \"\"\"feed a character with known length\"\"\"\n if aCharLen == 2:\n # we only care about 2-bytes character in our distribution analysis\n order = self.get_order(aBuf)\n else:\n order = -1\n if order >= 0:\n self._mTotalChars += 1\n # order is valid\n if order < self._mTableSize:\n if 512 > self._mCharToFreqOrder[order]:\n self._mFreqChars += 1"},{"attributeType":"null","col":8,"comment":"null","endLoc":650,"id":1284,"name":"cert_reqs","nodeType":"Attribute","startLoc":650,"text":"self.cert_reqs"},{"attributeType":"null","col":8,"comment":"null","endLoc":649,"id":1285,"name":"cert_file","nodeType":"Attribute","startLoc":649,"text":"self.cert_file"},{"attributeType":"null","col":8,"comment":"null","endLoc":652,"id":1286,"name":"ssl_version","nodeType":"Attribute","startLoc":652,"text":"self.ssl_version"},{"col":0,"comment":"\n Given a url, return an :class:`.ConnectionPool` instance of its host.\n\n This is a shortcut for not having to parse out the scheme, host, and port\n of the url before creating an :class:`.ConnectionPool` instance.\n\n :param url:\n Absolute URL string that must include the scheme. Port is optional.\n\n :param \\**kw:\n Passes additional parameters to the constructor of the appropriate\n :class:`.ConnectionPool`. Useful for specifying things like\n timeout, maxsize, headers, etc.\n\n Example::\n\n >>> conn = connection_from_url('http://google.com/')\n >>> r = conn.request('GET', '/')\n ","endLoc":757,"header":"def connection_from_url(url, **kw)","id":1287,"name":"connection_from_url","nodeType":"Function","startLoc":733,"text":"def connection_from_url(url, **kw):\n \"\"\"\n Given a url, return an :class:`.ConnectionPool` instance of its host.\n\n This is a shortcut for not having to parse out the scheme, host, and port\n of the url before creating an :class:`.ConnectionPool` instance.\n\n :param url:\n Absolute URL string that must include the scheme. Port is optional.\n\n :param \\**kw:\n Passes additional parameters to the constructor of the appropriate\n :class:`.ConnectionPool`. Useful for specifying things like\n timeout, maxsize, headers, etc.\n\n Example::\n\n >>> conn = connection_from_url('http://google.com/')\n >>> r = conn.request('GET', '/')\n \"\"\"\n scheme, host, port = get_host(url)\n if scheme == 'https':\n return HTTPSConnectionPool(host, port=port, **kw)\n else:\n return HTTPConnectionPool(host, port=port, **kw)"},{"col":4,"comment":"null","endLoc":108,"header":"def get_order(self, aBuf)","id":1288,"name":"get_order","nodeType":"Function","startLoc":103,"text":"def get_order(self, aBuf):\n # We do not handle characters based on the original encoding string,\n # but convert this encoding string to a number, here called order.\n # This allows multiple encodings of a language to share one frequency\n # table.\n return -1"},{"col":4,"comment":"return confidence based on existing data","endLoc":96,"header":"def get_confidence(self)","id":1289,"name":"get_confidence","nodeType":"Function","startLoc":82,"text":"def get_confidence(self):\n \"\"\"return confidence based on existing data\"\"\"\n # if we didn't receive any character in our consideration range,\n # return negative answer\n if self._mTotalChars <= 0 or self._mFreqChars <= MINIMUM_DATA_THRESHOLD:\n return SURE_NO\n\n if self._mTotalChars != self._mFreqChars:\n r = (self._mFreqChars / ((self._mTotalChars - self._mFreqChars)\n * self._mTypicalDistributionRatio))\n if r < SURE_YES:\n return r\n\n # normalize confidence (we don't want to be 100% sure)\n return SURE_YES"},{"col":4,"comment":"null","endLoc":101,"header":"def got_enough_data(self)","id":1290,"name":"got_enough_data","nodeType":"Function","startLoc":98,"text":"def got_enough_data(self):\n # It is not necessary to receive all data to draw conclusion.\n # For charset detection, certain amount of data is enough\n return self._mTotalChars > ENOUGH_DATA_THRESHOLD"},{"attributeType":"None","col":8,"comment":"null","endLoc":56,"id":1291,"name":"_mTypicalDistributionRatio","nodeType":"Attribute","startLoc":56,"text":"self._mTypicalDistributionRatio"},{"attributeType":"None","col":8,"comment":"null","endLoc":50,"id":1292,"name":"_mCharToFreqOrder","nodeType":"Attribute","startLoc":50,"text":"self._mCharToFreqOrder"},{"attributeType":"int","col":8,"comment":"null","endLoc":64,"id":1293,"name":"_mTotalChars","nodeType":"Attribute","startLoc":64,"text":"self._mTotalChars"},{"attributeType":"bool","col":8,"comment":"null","endLoc":63,"id":1294,"name":"_mDone","nodeType":"Attribute","startLoc":63,"text":"self._mDone"},{"attributeType":"int","col":8,"comment":"null","endLoc":66,"id":1295,"name":"_mFreqChars","nodeType":"Attribute","startLoc":66,"text":"self._mFreqChars"},{"attributeType":"None","col":8,"comment":"null","endLoc":51,"id":1296,"name":"_mTableSize","nodeType":"Attribute","startLoc":51,"text":"self._mTableSize"},{"className":"ProxyManager","col":0,"comment":"\n Behaves just like :class:`PoolManager`, but sends all requests through\n the defined proxy, using the CONNECT method for HTTPS URLs.\n\n :param proxy_url:\n The URL of the proxy to be used.\n\n :param proxy_headers:\n A dictionary contaning headers that will be sent to the proxy. In case\n of HTTP they are being sent with each request, while in the\n HTTPS/CONNECT case they are sent only once. Could be used for proxy\n authentication.\n\n Example:\n >>> proxy = urllib3.ProxyManager('http://localhost:3128/')\n >>> r1 = proxy.request('GET', 'http://google.com/')\n >>> r2 = proxy.request('GET', 'http://httpbin.org/')\n >>> len(proxy.pools)\n 1\n >>> r3 = proxy.request('GET', 'https://httpbin.org/')\n >>> r4 = proxy.request('GET', 'https://twitter.com/')\n >>> len(proxy.pools)\n 3\n\n ","endLoc":261,"id":1297,"nodeType":"Class","startLoc":177,"text":"class ProxyManager(PoolManager):\n \"\"\"\n Behaves just like :class:`PoolManager`, but sends all requests through\n the defined proxy, using the CONNECT method for HTTPS URLs.\n\n :param proxy_url:\n The URL of the proxy to be used.\n\n :param proxy_headers:\n A dictionary contaning headers that will be sent to the proxy. In case\n of HTTP they are being sent with each request, while in the\n HTTPS/CONNECT case they are sent only once. Could be used for proxy\n authentication.\n\n Example:\n >>> proxy = urllib3.ProxyManager('http://localhost:3128/')\n >>> r1 = proxy.request('GET', 'http://google.com/')\n >>> r2 = proxy.request('GET', 'http://httpbin.org/')\n >>> len(proxy.pools)\n 1\n >>> r3 = proxy.request('GET', 'https://httpbin.org/')\n >>> r4 = proxy.request('GET', 'https://twitter.com/')\n >>> len(proxy.pools)\n 3\n\n \"\"\"\n\n def __init__(self, proxy_url, num_pools=10, headers=None,\n proxy_headers=None, **connection_pool_kw):\n\n if isinstance(proxy_url, HTTPConnectionPool):\n proxy_url = '%s://%s:%i' % (proxy_url.scheme, proxy_url.host,\n proxy_url.port)\n proxy = parse_url(proxy_url)\n if not proxy.port:\n port = port_by_scheme.get(proxy.scheme, 80)\n proxy = proxy._replace(port=port)\n\n assert proxy.scheme in (\"http\", \"https\"), \\\n 'Not supported proxy scheme %s' % proxy.scheme\n\n self.proxy = proxy\n self.proxy_headers = proxy_headers or {}\n\n connection_pool_kw['_proxy'] = self.proxy\n connection_pool_kw['_proxy_headers'] = self.proxy_headers\n\n super(ProxyManager, self).__init__(\n num_pools, headers, **connection_pool_kw)\n\n def connection_from_host(self, host, port=None, scheme='http'):\n if scheme == \"https\":\n return super(ProxyManager, self).connection_from_host(\n host, port, scheme)\n\n return super(ProxyManager, self).connection_from_host(\n self.proxy.host, self.proxy.port, self.proxy.scheme)\n\n def _set_proxy_headers(self, url, headers=None):\n \"\"\"\n Sets headers needed by proxies: specifically, the Accept and Host\n headers. Only sets headers not provided by the user.\n \"\"\"\n headers_ = {'Accept': '*/*'}\n\n netloc = parse_url(url).netloc\n if netloc:\n headers_['Host'] = netloc\n\n if headers:\n headers_.update(headers)\n return headers_\n\n def urlopen(self, method, url, redirect=True, **kw):\n \"Same as HTTP(S)ConnectionPool.urlopen, ``url`` must be absolute.\"\n u = parse_url(url)\n\n if u.scheme == \"http\":\n # For proxied HTTPS requests, httplib sets the necessary headers\n # on the CONNECT to the proxy. For HTTP, we'll definitely\n # need to set 'Host' at the very least.\n headers = kw.get('headers', self.headers)\n kw['headers'] = self._set_proxy_headers(url, headers)\n\n return super(ProxyManager, self).urlopen(method, url, redirect=redirect, **kw)"},{"col":4,"comment":"null","endLoc":233,"header":"def connection_from_host(self, host, port=None, scheme='http')","id":1298,"name":"connection_from_host","nodeType":"Function","startLoc":227,"text":"def connection_from_host(self, host, port=None, scheme='http'):\n if scheme == \"https\":\n return super(ProxyManager, self).connection_from_host(\n host, port, scheme)\n\n return super(ProxyManager, self).connection_from_host(\n self.proxy.host, self.proxy.port, self.proxy.scheme)"},{"className":"EUCTWDistributionAnalysis","col":0,"comment":"null","endLoc":127,"id":1299,"nodeType":"Class","startLoc":111,"text":"class EUCTWDistributionAnalysis(CharDistributionAnalysis):\n def __init__(self):\n CharDistributionAnalysis.__init__(self)\n self._mCharToFreqOrder = EUCTWCharToFreqOrder\n self._mTableSize = EUCTW_TABLE_SIZE\n self._mTypicalDistributionRatio = EUCTW_TYPICAL_DISTRIBUTION_RATIO\n\n def get_order(self, aBuf):\n # for euc-TW encoding, we are interested\n # first byte range: 0xc4 -- 0xfe\n # second byte range: 0xa1 -- 0xfe\n # no validation needed here. State machine has done that\n first_char = wrap_ord(aBuf[0])\n if first_char >= 0xC4:\n return 94 * (first_char - 0xC4) + wrap_ord(aBuf[1]) - 0xA1\n else:\n return -1"},{"col":4,"comment":"null","endLoc":116,"header":"def __init__(self)","id":1300,"name":"__init__","nodeType":"Function","startLoc":112,"text":"def __init__(self):\n CharDistributionAnalysis.__init__(self)\n self._mCharToFreqOrder = EUCTWCharToFreqOrder\n self._mTableSize = EUCTW_TABLE_SIZE\n self._mTypicalDistributionRatio = EUCTW_TYPICAL_DISTRIBUTION_RATIO"},{"col":4,"comment":"null","endLoc":127,"header":"def get_order(self, aBuf)","id":1301,"name":"get_order","nodeType":"Function","startLoc":118,"text":"def get_order(self, aBuf):\n # for euc-TW encoding, we are interested\n # first byte range: 0xc4 -- 0xfe\n # second byte range: 0xa1 -- 0xfe\n # no validation needed here. State machine has done that\n first_char = wrap_ord(aBuf[0])\n if first_char >= 0xC4:\n return 94 * (first_char - 0xC4) + wrap_ord(aBuf[1]) - 0xA1\n else:\n return -1"},{"attributeType":"null","col":8,"comment":"null","endLoc":116,"id":1302,"name":"_mTypicalDistributionRatio","nodeType":"Attribute","startLoc":116,"text":"self._mTypicalDistributionRatio"},{"col":4,"comment":"\n Sets headers needed by proxies: specifically, the Accept and Host\n headers. Only sets headers not provided by the user.\n ","endLoc":248,"header":"def _set_proxy_headers(self, url, headers=None)","id":1303,"name":"_set_proxy_headers","nodeType":"Function","startLoc":235,"text":"def _set_proxy_headers(self, url, headers=None):\n \"\"\"\n Sets headers needed by proxies: specifically, the Accept and Host\n headers. Only sets headers not provided by the user.\n \"\"\"\n headers_ = {'Accept': '*/*'}\n\n netloc = parse_url(url).netloc\n if netloc:\n headers_['Host'] = netloc\n\n if headers:\n headers_.update(headers)\n return headers_"},{"col":4,"comment":"Same as HTTP(S)ConnectionPool.urlopen, ``url`` must be absolute.","endLoc":261,"header":"def urlopen(self, method, url, redirect=True, **kw)","id":1304,"name":"urlopen","nodeType":"Function","startLoc":250,"text":"def urlopen(self, method, url, redirect=True, **kw):\n \"Same as HTTP(S)ConnectionPool.urlopen, ``url`` must be absolute.\"\n u = parse_url(url)\n\n if u.scheme == \"http\":\n # For proxied HTTPS requests, httplib sets the necessary headers\n # on the CONNECT to the proxy. For HTTP, we'll definitely\n # need to set 'Host' at the very least.\n headers = kw.get('headers', self.headers)\n kw['headers'] = self._set_proxy_headers(url, headers)\n\n return super(ProxyManager, self).urlopen(method, url, redirect=redirect, **kw)"},{"attributeType":"null","col":8,"comment":"null","endLoc":114,"id":1305,"name":"_mCharToFreqOrder","nodeType":"Attribute","startLoc":114,"text":"self._mCharToFreqOrder"},{"attributeType":"null","col":8,"comment":"null","endLoc":218,"id":1306,"name":"proxy","nodeType":"Attribute","startLoc":218,"text":"self.proxy"},{"attributeType":"null","col":8,"comment":"null","endLoc":219,"id":1307,"name":"proxy_headers","nodeType":"Attribute","startLoc":219,"text":"self.proxy_headers"},{"attributeType":"null","col":8,"comment":"null","endLoc":115,"id":1308,"name":"_mTableSize","nodeType":"Attribute","startLoc":115,"text":"self._mTableSize"},{"col":0,"comment":"\n Shortcuts for generating request headers.\n\n :param keep_alive:\n If ``True``, adds 'connection: keep-alive' header.\n\n :param accept_encoding:\n Can be a boolean, list, or string.\n ``True`` translates to 'gzip,deflate'.\n List will get joined by comma.\n String will be used as provided.\n\n :param user_agent:\n String representing the user-agent you want, such as\n \"python-urllib3/0.6\"\n\n :param basic_auth:\n Colon-separated username:password string for 'authorization: basic ...'\n auth header.\n\n :param proxy_basic_auth:\n Colon-separated username:password string for 'proxy-authorization: basic ...'\n auth header.\n\n :param disable_cache:\n If ``True``, adds 'cache-control: no-cache' header.\n\n Example::\n\n >>> make_headers(keep_alive=True, user_agent=\"Batman/1.0\")\n {'connection': 'keep-alive', 'user-agent': 'Batman/1.0'}\n >>> make_headers(accept_encoding=True)\n {'accept-encoding': 'gzip,deflate'}\n ","endLoc":71,"header":"def make_headers(keep_alive=None, accept_encoding=None, user_agent=None,\n basic_auth=None, proxy_basic_auth=None, disable_cache=None)","id":1309,"name":"make_headers","nodeType":"Function","startLoc":8,"text":"def make_headers(keep_alive=None, accept_encoding=None, user_agent=None,\n basic_auth=None, proxy_basic_auth=None, disable_cache=None):\n \"\"\"\n Shortcuts for generating request headers.\n\n :param keep_alive:\n If ``True``, adds 'connection: keep-alive' header.\n\n :param accept_encoding:\n Can be a boolean, list, or string.\n ``True`` translates to 'gzip,deflate'.\n List will get joined by comma.\n String will be used as provided.\n\n :param user_agent:\n String representing the user-agent you want, such as\n \"python-urllib3/0.6\"\n\n :param basic_auth:\n Colon-separated username:password string for 'authorization: basic ...'\n auth header.\n\n :param proxy_basic_auth:\n Colon-separated username:password string for 'proxy-authorization: basic ...'\n auth header.\n\n :param disable_cache:\n If ``True``, adds 'cache-control: no-cache' header.\n\n Example::\n\n >>> make_headers(keep_alive=True, user_agent=\"Batman/1.0\")\n {'connection': 'keep-alive', 'user-agent': 'Batman/1.0'}\n >>> make_headers(accept_encoding=True)\n {'accept-encoding': 'gzip,deflate'}\n \"\"\"\n headers = {}\n if accept_encoding:\n if isinstance(accept_encoding, str):\n pass\n elif isinstance(accept_encoding, list):\n accept_encoding = ','.join(accept_encoding)\n else:\n accept_encoding = ACCEPT_ENCODING\n headers['accept-encoding'] = accept_encoding\n\n if user_agent:\n headers['user-agent'] = user_agent\n\n if keep_alive:\n headers['connection'] = 'keep-alive'\n\n if basic_auth:\n headers['authorization'] = 'Basic ' + \\\n b64encode(b(basic_auth)).decode('utf-8')\n\n if proxy_basic_auth:\n headers['proxy-authorization'] = 'Basic ' + \\\n b64encode(b(proxy_basic_auth)).decode('utf-8')\n\n if disable_cache:\n headers['cache-control'] = 'no-cache'\n\n return headers"},{"className":"EUCKRDistributionAnalysis","col":0,"comment":"null","endLoc":146,"id":1310,"nodeType":"Class","startLoc":130,"text":"class EUCKRDistributionAnalysis(CharDistributionAnalysis):\n def __init__(self):\n CharDistributionAnalysis.__init__(self)\n self._mCharToFreqOrder = EUCKRCharToFreqOrder\n self._mTableSize = EUCKR_TABLE_SIZE\n self._mTypicalDistributionRatio = EUCKR_TYPICAL_DISTRIBUTION_RATIO\n\n def get_order(self, aBuf):\n # for euc-KR encoding, we are interested\n # first byte range: 0xb0 -- 0xfe\n # second byte range: 0xa1 -- 0xfe\n # no validation needed here. State machine has done that\n first_char = wrap_ord(aBuf[0])\n if first_char >= 0xB0:\n return 94 * (first_char - 0xB0) + wrap_ord(aBuf[1]) - 0xA1\n else:\n return -1"},{"col":4,"comment":"null","endLoc":135,"header":"def __init__(self)","id":1311,"name":"__init__","nodeType":"Function","startLoc":131,"text":"def __init__(self):\n CharDistributionAnalysis.__init__(self)\n self._mCharToFreqOrder = EUCKRCharToFreqOrder\n self._mTableSize = EUCKR_TABLE_SIZE\n self._mTypicalDistributionRatio = EUCKR_TYPICAL_DISTRIBUTION_RATIO"},{"col":4,"comment":"null","endLoc":146,"header":"def get_order(self, aBuf)","id":1312,"name":"get_order","nodeType":"Function","startLoc":137,"text":"def get_order(self, aBuf):\n # for euc-KR encoding, we are interested\n # first byte range: 0xb0 -- 0xfe\n # second byte range: 0xa1 -- 0xfe\n # no validation needed here. State machine has done that\n first_char = wrap_ord(aBuf[0])\n if first_char >= 0xB0:\n return 94 * (first_char - 0xB0) + wrap_ord(aBuf[1]) - 0xA1\n else:\n return -1"},{"attributeType":"null","col":8,"comment":"null","endLoc":135,"id":1313,"name":"_mTypicalDistributionRatio","nodeType":"Attribute","startLoc":135,"text":"self._mTypicalDistributionRatio"},{"attributeType":"null","col":8,"comment":"null","endLoc":133,"id":1314,"name":"_mCharToFreqOrder","nodeType":"Attribute","startLoc":133,"text":"self._mCharToFreqOrder"},{"attributeType":"null","col":8,"comment":"null","endLoc":134,"id":1315,"name":"_mTableSize","nodeType":"Attribute","startLoc":134,"text":"self._mTableSize"},{"className":"GB2312DistributionAnalysis","col":0,"comment":"null","endLoc":165,"id":1317,"nodeType":"Class","startLoc":149,"text":"class GB2312DistributionAnalysis(CharDistributionAnalysis):\n def __init__(self):\n CharDistributionAnalysis.__init__(self)\n self._mCharToFreqOrder = GB2312CharToFreqOrder\n self._mTableSize = GB2312_TABLE_SIZE\n self._mTypicalDistributionRatio = GB2312_TYPICAL_DISTRIBUTION_RATIO\n\n def get_order(self, aBuf):\n # for GB2312 encoding, we are interested\n # first byte range: 0xb0 -- 0xfe\n # second byte range: 0xa1 -- 0xfe\n # no validation needed here. State machine has done that\n first_char, second_char = wrap_ord(aBuf[0]), wrap_ord(aBuf[1])\n if (first_char >= 0xB0) and (second_char >= 0xA1):\n return 94 * (first_char - 0xB0) + second_char - 0xA1\n else:\n return -1"},{"col":4,"comment":"null","endLoc":154,"header":"def __init__(self)","id":1318,"name":"__init__","nodeType":"Function","startLoc":150,"text":"def __init__(self):\n CharDistributionAnalysis.__init__(self)\n self._mCharToFreqOrder = GB2312CharToFreqOrder\n self._mTableSize = GB2312_TABLE_SIZE\n self._mTypicalDistributionRatio = GB2312_TYPICAL_DISTRIBUTION_RATIO"},{"col":4,"comment":"null","endLoc":165,"header":"def get_order(self, aBuf)","id":1319,"name":"get_order","nodeType":"Function","startLoc":156,"text":"def get_order(self, aBuf):\n # for GB2312 encoding, we are interested\n # first byte range: 0xb0 -- 0xfe\n # second byte range: 0xa1 -- 0xfe\n # no validation needed here. State machine has done that\n first_char, second_char = wrap_ord(aBuf[0]), wrap_ord(aBuf[1])\n if (first_char >= 0xB0) and (second_char >= 0xA1):\n return 94 * (first_char - 0xB0) + second_char - 0xA1\n else:\n return -1"},{"className":"NullHandler","col":0,"comment":"null","endLoc":838,"id":1320,"nodeType":"Class","startLoc":838,"text":"class NullHandler(Handler): ..."},{"attributeType":"null","col":8,"comment":"null","endLoc":154,"id":1321,"name":"_mTypicalDistributionRatio","nodeType":"Attribute","startLoc":154,"text":"self._mTypicalDistributionRatio"},{"attributeType":"null","col":8,"comment":"null","endLoc":152,"id":1322,"name":"_mCharToFreqOrder","nodeType":"Attribute","startLoc":152,"text":"self._mCharToFreqOrder"},{"attributeType":"null","col":8,"comment":"null","endLoc":153,"id":1323,"name":"_mTableSize","nodeType":"Attribute","startLoc":153,"text":"self._mTableSize"},{"className":"Big5DistributionAnalysis","col":0,"comment":"null","endLoc":187,"id":1324,"nodeType":"Class","startLoc":168,"text":"class Big5DistributionAnalysis(CharDistributionAnalysis):\n def __init__(self):\n CharDistributionAnalysis.__init__(self)\n self._mCharToFreqOrder = Big5CharToFreqOrder\n self._mTableSize = BIG5_TABLE_SIZE\n self._mTypicalDistributionRatio = BIG5_TYPICAL_DISTRIBUTION_RATIO\n\n def get_order(self, aBuf):\n # for big5 encoding, we are interested\n # first byte range: 0xa4 -- 0xfe\n # second byte range: 0x40 -- 0x7e , 0xa1 -- 0xfe\n # no validation needed here. State machine has done that\n first_char, second_char = wrap_ord(aBuf[0]), wrap_ord(aBuf[1])\n if first_char >= 0xA4:\n if second_char >= 0xA1:\n return 157 * (first_char - 0xA4) + second_char - 0xA1 + 63\n else:\n return 157 * (first_char - 0xA4) + second_char - 0x40\n else:\n return -1"},{"col":4,"comment":"null","endLoc":173,"header":"def __init__(self)","id":1325,"name":"__init__","nodeType":"Function","startLoc":169,"text":"def __init__(self):\n CharDistributionAnalysis.__init__(self)\n self._mCharToFreqOrder = Big5CharToFreqOrder\n self._mTableSize = BIG5_TABLE_SIZE\n self._mTypicalDistributionRatio = BIG5_TYPICAL_DISTRIBUTION_RATIO"},{"col":4,"comment":"null","endLoc":187,"header":"def get_order(self, aBuf)","id":1326,"name":"get_order","nodeType":"Function","startLoc":175,"text":"def get_order(self, aBuf):\n # for big5 encoding, we are interested\n # first byte range: 0xa4 -- 0xfe\n # second byte range: 0x40 -- 0x7e , 0xa1 -- 0xfe\n # no validation needed here. State machine has done that\n first_char, second_char = wrap_ord(aBuf[0]), wrap_ord(aBuf[1])\n if first_char >= 0xA4:\n if second_char >= 0xA1:\n return 157 * (first_char - 0xA4) + second_char - 0xA1 + 63\n else:\n return 157 * (first_char - 0xA4) + second_char - 0x40\n else:\n return -1"},{"attributeType":"null","col":8,"comment":"null","endLoc":173,"id":1327,"name":"_mTypicalDistributionRatio","nodeType":"Attribute","startLoc":173,"text":"self._mTypicalDistributionRatio"},{"attributeType":"null","col":8,"comment":"null","endLoc":171,"id":1328,"name":"_mCharToFreqOrder","nodeType":"Attribute","startLoc":171,"text":"self._mCharToFreqOrder"},{"attributeType":"null","col":8,"comment":"null","endLoc":172,"id":1329,"name":"_mTableSize","nodeType":"Attribute","startLoc":172,"text":"self._mTableSize"},{"className":"SJISDistributionAnalysis","col":0,"comment":"null","endLoc":212,"id":1330,"nodeType":"Class","startLoc":190,"text":"class SJISDistributionAnalysis(CharDistributionAnalysis):\n def __init__(self):\n CharDistributionAnalysis.__init__(self)\n self._mCharToFreqOrder = JISCharToFreqOrder\n self._mTableSize = JIS_TABLE_SIZE\n self._mTypicalDistributionRatio = JIS_TYPICAL_DISTRIBUTION_RATIO\n\n def get_order(self, aBuf):\n # for sjis encoding, we are interested\n # first byte range: 0x81 -- 0x9f , 0xe0 -- 0xfe\n # second byte range: 0x40 -- 0x7e, 0x81 -- oxfe\n # no validation needed here. State machine has done that\n first_char, second_char = wrap_ord(aBuf[0]), wrap_ord(aBuf[1])\n if (first_char >= 0x81) and (first_char <= 0x9F):\n order = 188 * (first_char - 0x81)\n elif (first_char >= 0xE0) and (first_char <= 0xEF):\n order = 188 * (first_char - 0xE0 + 31)\n else:\n return -1\n order = order + second_char - 0x40\n if second_char > 0x7F:\n order = -1\n return order"},{"col":4,"comment":"null","endLoc":195,"header":"def __init__(self)","id":1331,"name":"__init__","nodeType":"Function","startLoc":191,"text":"def __init__(self):\n CharDistributionAnalysis.__init__(self)\n self._mCharToFreqOrder = JISCharToFreqOrder\n self._mTableSize = JIS_TABLE_SIZE\n self._mTypicalDistributionRatio = JIS_TYPICAL_DISTRIBUTION_RATIO"},{"className":"Handler","col":0,"comment":"null","endLoc":332,"id":1332,"nodeType":"Class","startLoc":314,"text":"class Handler(Filterer):\n level: int # undocumented\n formatter: Formatter | None # undocumented\n lock: threading.Lock | None # undocumented\n name: str | None # undocumented\n def __init__(self, level: _Level = 0) -> None: ...\n def get_name(self) -> str: ... # undocumented\n def set_name(self, name: str) -> None: ... # undocumented\n def createLock(self) -> None: ...\n def acquire(self) -> None: ...\n def release(self) -> None: ...\n def setLevel(self, level: _Level) -> None: ...\n def setFormatter(self, fmt: Formatter | None) -> None: ...\n def flush(self) -> None: ...\n def close(self) -> None: ...\n def handle(self, record: LogRecord) -> bool: ...\n def handleError(self, record: LogRecord) -> None: ...\n def format(self, record: LogRecord) -> str: ...\n def emit(self, record: LogRecord) -> None: ..."},{"className":"Filterer","col":0,"comment":"null","endLoc":91,"id":1333,"nodeType":"Class","startLoc":84,"text":"class Filterer:\n filters: list[_FilterType]\n def addFilter(self, filter: _FilterType) -> None: ...\n def removeFilter(self, filter: _FilterType) -> None: ...\n if sys.version_info >= (3, 12):\n def filter(self, record: LogRecord) -> bool | LogRecord: ...\n else:\n def filter(self, record: LogRecord) -> bool: ..."},{"col":4,"comment":"null","endLoc":86,"header":"def addFilter(self, filter: _FilterType) -> None","id":1334,"name":"addFilter","nodeType":"Function","startLoc":86,"text":"def addFilter(self, filter: _FilterType) -> None: ..."},{"col":4,"comment":"null","endLoc":87,"header":"def removeFilter(self, filter: _FilterType) -> None","id":1335,"name":"removeFilter","nodeType":"Function","startLoc":87,"text":"def removeFilter(self, filter: _FilterType) -> None: ..."},{"col":8,"comment":"null","endLoc":89,"header":"def filter(self, record: LogRecord) -> bool | LogRecord","id":1336,"name":"filter","nodeType":"Function","startLoc":89,"text":"def filter(self, record: LogRecord) -> bool | LogRecord: ..."},{"col":8,"comment":"null","endLoc":91,"header":"def filter(self, record: LogRecord) -> bool","id":1337,"name":"filter","nodeType":"Function","startLoc":91,"text":"def filter(self, record: LogRecord) -> bool: ..."},{"attributeType":"list","col":4,"comment":"null","endLoc":85,"id":1338,"name":"filters","nodeType":"Attribute","startLoc":85,"text":"filters"},{"col":4,"comment":"null","endLoc":212,"header":"def get_order(self, aBuf)","id":1339,"name":"get_order","nodeType":"Function","startLoc":197,"text":"def get_order(self, aBuf):\n # for sjis encoding, we are interested\n # first byte range: 0x81 -- 0x9f , 0xe0 -- 0xfe\n # second byte range: 0x40 -- 0x7e, 0x81 -- oxfe\n # no validation needed here. State machine has done that\n first_char, second_char = wrap_ord(aBuf[0]), wrap_ord(aBuf[1])\n if (first_char >= 0x81) and (first_char <= 0x9F):\n order = 188 * (first_char - 0x81)\n elif (first_char >= 0xE0) and (first_char <= 0xEF):\n order = 188 * (first_char - 0xE0 + 31)\n else:\n return -1\n order = order + second_char - 0x40\n if second_char > 0x7F:\n order = -1\n return order"},{"attributeType":"null","col":8,"comment":"null","endLoc":195,"id":1340,"name":"_mTypicalDistributionRatio","nodeType":"Attribute","startLoc":195,"text":"self._mTypicalDistributionRatio"},{"attributeType":"null","col":8,"comment":"null","endLoc":193,"id":1341,"name":"_mCharToFreqOrder","nodeType":"Attribute","startLoc":193,"text":"self._mCharToFreqOrder"},{"col":4,"comment":"null","endLoc":319,"header":"def __init__(self, level: _Level = 0) -> None","id":1342,"name":"__init__","nodeType":"Function","startLoc":319,"text":"def __init__(self, level: _Level = 0) -> None: ..."},{"col":4,"comment":"null","endLoc":320,"header":"def get_name(self) -> str","id":1343,"name":"get_name","nodeType":"Function","startLoc":320,"text":"def get_name(self) -> str: ... # undocumented"},{"col":4,"comment":"null","endLoc":321,"header":"def set_name(self, name: str) -> None","id":1344,"name":"set_name","nodeType":"Function","startLoc":321,"text":"def set_name(self, name: str) -> None: ... # undocumented"},{"col":4,"comment":"null","endLoc":322,"header":"def createLock(self) -> None","id":1345,"name":"createLock","nodeType":"Function","startLoc":322,"text":"def createLock(self) -> None: ..."},{"col":4,"comment":"null","endLoc":323,"header":"def acquire(self) -> None","id":1346,"name":"acquire","nodeType":"Function","startLoc":323,"text":"def acquire(self) -> None: ..."},{"col":4,"comment":"null","endLoc":324,"header":"def release(self) -> None","id":1347,"name":"release","nodeType":"Function","startLoc":324,"text":"def release(self) -> None: ..."},{"col":4,"comment":"null","endLoc":325,"header":"def setLevel(self, level: _Level) -> None","id":1348,"name":"setLevel","nodeType":"Function","startLoc":325,"text":"def setLevel(self, level: _Level) -> None: ..."},{"col":4,"comment":"null","endLoc":326,"header":"def setFormatter(self, fmt: Formatter | None) -> None","id":1349,"name":"setFormatter","nodeType":"Function","startLoc":326,"text":"def setFormatter(self, fmt: Formatter | None) -> None: ..."},{"col":4,"comment":"null","endLoc":327,"header":"def flush(self) -> None","id":1350,"name":"flush","nodeType":"Function","startLoc":327,"text":"def flush(self) -> None: ..."},{"col":4,"comment":"null","endLoc":328,"header":"def close(self) -> None","id":1351,"name":"close","nodeType":"Function","startLoc":328,"text":"def close(self) -> None: ..."},{"col":4,"comment":"null","endLoc":329,"header":"def handle(self, record: LogRecord) -> bool","id":1352,"name":"handle","nodeType":"Function","startLoc":329,"text":"def handle(self, record: LogRecord) -> bool: ..."},{"col":4,"comment":"null","endLoc":330,"header":"def handleError(self, record: LogRecord) -> None","id":1353,"name":"handleError","nodeType":"Function","startLoc":330,"text":"def handleError(self, record: LogRecord) -> None: ..."},{"col":4,"comment":"null","endLoc":331,"header":"def format(self, record: LogRecord) -> str","id":1354,"name":"format","nodeType":"Function","startLoc":331,"text":"def format(self, record: LogRecord) -> str: ..."},{"col":4,"comment":"null","endLoc":332,"header":"def emit(self, record: LogRecord) -> None","id":1355,"name":"emit","nodeType":"Function","startLoc":332,"text":"def emit(self, record: LogRecord) -> None: ..."},{"attributeType":"null","col":8,"comment":"null","endLoc":194,"id":1356,"name":"_mTableSize","nodeType":"Attribute","startLoc":194,"text":"self._mTableSize"},{"attributeType":"int","col":4,"comment":"null","endLoc":315,"id":1357,"name":"level","nodeType":"Attribute","startLoc":315,"text":"level"},{"attributeType":"Formatter | None","col":4,"comment":"null","endLoc":316,"id":1358,"name":"formatter","nodeType":"Attribute","startLoc":316,"text":"formatter"},{"attributeType":"Lock | None","col":4,"comment":"null","endLoc":317,"id":1359,"name":"lock","nodeType":"Attribute","startLoc":317,"text":"lock"},{"className":"EUCJPDistributionAnalysis","col":0,"comment":"null","endLoc":231,"id":1360,"nodeType":"Class","startLoc":215,"text":"class EUCJPDistributionAnalysis(CharDistributionAnalysis):\n def __init__(self):\n CharDistributionAnalysis.__init__(self)\n self._mCharToFreqOrder = JISCharToFreqOrder\n self._mTableSize = JIS_TABLE_SIZE\n self._mTypicalDistributionRatio = JIS_TYPICAL_DISTRIBUTION_RATIO\n\n def get_order(self, aBuf):\n # for euc-JP encoding, we are interested\n # first byte range: 0xa0 -- 0xfe\n # second byte range: 0xa1 -- 0xfe\n # no validation needed here. State machine has done that\n char = wrap_ord(aBuf[0])\n if char >= 0xA0:\n return 94 * (char - 0xA1) + wrap_ord(aBuf[1]) - 0xa1\n else:\n return -1"},{"col":4,"comment":"null","endLoc":220,"header":"def __init__(self)","id":1361,"name":"__init__","nodeType":"Function","startLoc":216,"text":"def __init__(self):\n CharDistributionAnalysis.__init__(self)\n self._mCharToFreqOrder = JISCharToFreqOrder\n self._mTableSize = JIS_TABLE_SIZE\n self._mTypicalDistributionRatio = JIS_TYPICAL_DISTRIBUTION_RATIO"},{"attributeType":"str | None","col":4,"comment":"null","endLoc":318,"id":1362,"name":"name","nodeType":"Attribute","startLoc":318,"text":"name"},{"col":4,"comment":"null","endLoc":231,"header":"def get_order(self, aBuf)","id":1363,"name":"get_order","nodeType":"Function","startLoc":222,"text":"def get_order(self, aBuf):\n # for euc-JP encoding, we are interested\n # first byte range: 0xa0 -- 0xfe\n # second byte range: 0xa1 -- 0xfe\n # no validation needed here. State machine has done that\n char = wrap_ord(aBuf[0])\n if char >= 0xA0:\n return 94 * (char - 0xA1) + wrap_ord(aBuf[1]) - 0xa1\n else:\n return -1"},{"attributeType":"null","col":8,"comment":"null","endLoc":220,"id":1364,"name":"_mTypicalDistributionRatio","nodeType":"Attribute","startLoc":220,"text":"self._mTypicalDistributionRatio"},{"className":"NullHandler","col":4,"comment":"null","endLoc":33,"id":1365,"nodeType":"Class","startLoc":31,"text":"class NullHandler(logging.Handler):\n def emit(self, record):\n pass"},{"attributeType":"null","col":8,"comment":"null","endLoc":218,"id":1366,"name":"_mCharToFreqOrder","nodeType":"Attribute","startLoc":218,"text":"self._mCharToFreqOrder"},{"col":8,"comment":"null","endLoc":33,"header":"def emit(self, record)","id":1367,"name":"emit","nodeType":"Function","startLoc":32,"text":"def emit(self, record):\n pass"},{"col":0,"comment":"\n Helper for quickly adding a StreamHandler to the logger. Useful for\n debugging.\n\n Returns the handler after adding it.\n ","endLoc":52,"header":"def add_stderr_logger(level=logging.DEBUG)","id":1368,"name":"add_stderr_logger","nodeType":"Function","startLoc":37,"text":"def add_stderr_logger(level=logging.DEBUG):\n \"\"\"\n Helper for quickly adding a StreamHandler to the logger. Useful for\n debugging.\n\n Returns the handler after adding it.\n \"\"\"\n # This method needs to be in this __init__.py to get the __name__ correct\n # even if urllib3 is vendored within another package.\n logger = logging.getLogger(__name__)\n handler = logging.StreamHandler()\n handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(message)s'))\n logger.addHandler(handler)\n logger.setLevel(level)\n logger.debug('Added a stderr logging handler to logger: %s' % __name__)\n return handler"},{"attributeType":"null","col":8,"comment":"null","endLoc":219,"id":1369,"name":"_mTableSize","nodeType":"Attribute","startLoc":219,"text":"self._mTableSize"},{"attributeType":"int","col":0,"comment":"null","endLoc":40,"id":1370,"name":"ENOUGH_DATA_THRESHOLD","nodeType":"Attribute","startLoc":40,"text":"ENOUGH_DATA_THRESHOLD"},{"attributeType":"float","col":0,"comment":"null","endLoc":41,"id":1371,"name":"SURE_YES","nodeType":"Attribute","startLoc":41,"text":"SURE_YES"},{"attributeType":"float","col":0,"comment":"null","endLoc":42,"id":1372,"name":"SURE_NO","nodeType":"Attribute","startLoc":42,"text":"SURE_NO"},{"attributeType":"int","col":0,"comment":"null","endLoc":43,"id":1373,"name":"MINIMUM_DATA_THRESHOLD","nodeType":"Attribute","startLoc":43,"text":"MINIMUM_DATA_THRESHOLD"},{"col":0,"comment":"","endLoc":29,"header":"chardistribution.py#","id":1374,"name":"","nodeType":"Function","startLoc":28,"text":"ENOUGH_DATA_THRESHOLD = 1024\n\nSURE_YES = 0.99\n\nSURE_NO = 0.01\n\nMINIMUM_DATA_THRESHOLD = 3"},{"id":1375,"name":"docs/dev","nodeType":"Package"},{"id":1376,"name":"todo.rst","nodeType":"TextFile","path":"docs/dev","text":"How to Help\n===========\n\nRequests is under active development, and contributions are more than welcome!\n\n#. Check for open issues or open a fresh issue to start a discussion around a bug.\n There is a Contributor Friendly tag for issues that should be ideal for people who are not very\n familiar with the codebase yet.\n#. Fork `the repository `_ on GitHub and start making your\n changes to a new branch.\n#. Write a test which shows that the bug was fixed.\n#. Send a pull request and bug the maintainer until it gets merged and published. :)\n Make sure to add yourself to `AUTHORS `_.\n\nFeature Freeze\n--------------\n\nAs of v1.0.0, Requests has now entered a feature freeze. Requests for new\nfeatures and Pull Requests implementing those features will not be accepted.\n\nDevelopment Dependencies\n------------------------\n\nYou'll need to install py.test in order to run the Requests' test suite::\n\n $ pip install -r requirements.txt\n $ invoke test\n py.test\n platform darwin -- Python 2.7.3 -- pytest-2.3.4\n collected 25 items\n\n test_requests.py .........................\n 25 passed in 3.50 seconds\n\nRuntime Environments\n--------------------\n\nRequests currently supports the following versions of Python:\n\n- Python 2.6\n- Python 2.7\n- Python 3.1\n- Python 3.2\n- Python 3.3\n- PyPy 1.9\n\nSupport for Python 3.1 and 3.2 may be dropped at any time.\n\nGoogle App Engine will never be officially supported. Pull Requests for compatibility will be accepted, as long as they don't complicate the codebase.\n\n\nAre you crazy?\n--------------\n\n- SPDY support would be awesome. No C extensions.\n\nDownstream Repackaging\n----------------------\n\nIf you are repackaging Requests, please note that you must also redistribute the ``cacerts.pem`` file in order to get correct SSL functionality.\n"},{"id":1379,"name":"HISTORY.rst","nodeType":"TextFile","path":"","text":".. :changelog:\n\nRelease History\n---------------\n\n2.3.1 (?)\n+++++++++\n\n- Allow copying of PreparedRequests without headers/cookies\n\n2.3.0 (2014-05-16)\n++++++++++++++++++\n\n**API Changes**\n\n- New ``Response`` property ``is_redirect``, which is true when the\n library could have processed this response as a redirection (whether\n or not it actually did).\n- The ``timeout`` parameter now affects requests with both ``stream=True`` and\n ``stream=False`` equally.\n- The change in v2.0.0 to mandate explicit proxy schemes has been reverted.\n Proxy schemes now default to ``http://``.\n- The ``CaseInsensitiveDict`` used for HTTP headers now behaves like a normal\n dictionary when references as string or viewed in the interpreter.\n\n**Bugfixes**\n\n- No longer expose Authorization or Proxy-Authorization headers on redirect.\n Fix CVE-2014-1829 and CVE-2014-1830 respectively.\n- Authorization is re-evaluated each redirect.\n- On redirect, pass url as native strings.\n- Fall-back to autodetected encoding for JSON when Unicode detection fails.\n- Headers set to ``None`` on the ``Session`` are now correctly not sent.\n- Correctly honor ``decode_unicode`` even if it wasn't used earlier in the same\n response.\n- Stop advertising ``compress`` as a supported Content-Encoding.\n- The ``Response.history`` parameter is now always a list.\n- Many, many ``urllib3`` bugfixes.\n\n2.2.1 (2014-01-23)\n++++++++++++++++++\n\n**Bugfixes**\n\n- Fixes incorrect parsing of proxy credentials that contain a literal or encoded '#' character.\n- Assorted urllib3 fixes.\n\n2.2.0 (2014-01-09)\n++++++++++++++++++\n\n**API Changes**\n\n- New exception: ``ContentDecodingError``. Raised instead of ``urllib3``\n ``DecodeError`` exceptions.\n\n**Bugfixes**\n\n- Avoid many many exceptions from the buggy implementation of ``proxy_bypass`` on OS X in Python 2.6.\n- Avoid crashing when attempting to get authentication credentials from ~/.netrc when running as a user without a home directory.\n- Use the correct pool size for pools of connections to proxies.\n- Fix iteration of ``CookieJar`` objects.\n- Ensure that cookies are persisted over redirect.\n- Switch back to using chardet, since it has merged with charade.\n\n2.1.0 (2013-12-05)\n++++++++++++++++++\n\n- Updated CA Bundle, of course.\n- Cookies set on individual Requests through a ``Session`` (e.g. via ``Session.get()``) are no longer persisted to the ``Session``.\n- Clean up connections when we hit problems during chunked upload, rather than leaking them.\n- Return connections to the pool when a chunked upload is successful, rather than leaking it.\n- Match the HTTPbis recommendation for HTTP 301 redirects.\n- Prevent hanging when using streaming uploads and Digest Auth when a 401 is received.\n- Values of headers set by Requests are now always the native string type.\n- Fix previously broken SNI support.\n- Fix accessing HTTP proxies using proxy authentication.\n- Unencode HTTP Basic usernames and passwords extracted from URLs.\n- Support for IP address ranges for no_proxy environment variable\n- Parse headers correctly when users override the default ``Host:`` header.\n- Avoid munging the URL in case of case-sensitive servers.\n- Looser URL handling for non-HTTP/HTTPS urls.\n- Accept unicode methods in Python 2.6 and 2.7.\n- More resilient cookie handling.\n- Make ``Response`` objects pickleable.\n- Actually added MD5-sess to Digest Auth instead of pretending to like last time.\n- Updated internal urllib3.\n- Fixed @Lukasa's lack of taste.\n\n2.0.1 (2013-10-24)\n++++++++++++++++++\n\n- Updated included CA Bundle with new mistrusts and automated process for the future\n- Added MD5-sess to Digest Auth\n- Accept per-file headers in multipart file POST messages.\n- Fixed: Don't send the full URL on CONNECT messages.\n- Fixed: Correctly lowercase a redirect scheme.\n- Fixed: Cookies not persisted when set via functional API.\n- Fixed: Translate urllib3 ProxyError into a requests ProxyError derived from ConnectionError.\n- Updated internal urllib3 and chardet.\n\n2.0.0 (2013-09-24)\n++++++++++++++++++\n\n**API Changes:**\n\n- Keys in the Headers dictionary are now native strings on all Python versions,\n i.e. bytestrings on Python 2, unicode on Python 3.\n- Proxy URLs now *must* have an explicit scheme. A ``MissingSchema`` exception\n will be raised if they don't.\n- Timeouts now apply to read time if ``Stream=False``.\n- ``RequestException`` is now a subclass of ``IOError``, not ``RuntimeError``.\n- Added new method to ``PreparedRequest`` objects: ``PreparedRequest.copy()``.\n- Added new method to ``Session`` objects: ``Session.update_request()``. This\n method updates a ``Request`` object with the data (e.g. cookies) stored on\n the ``Session``.\n- Added new method to ``Session`` objects: ``Session.prepare_request()``. This\n method updates and prepares a ``Request`` object, and returns the\n corresponding ``PreparedRequest`` object.\n- Added new method to ``HTTPAdapter`` objects: ``HTTPAdapter.proxy_headers()``.\n This should not be called directly, but improves the subclass interface.\n- ``httplib.IncompleteRead`` exceptions caused by incorrect chunked encoding\n will now raise a Requests ``ChunkedEncodingError`` instead.\n- Invalid percent-escape sequences now cause a Requests ``InvalidURL``\n exception to be raised.\n- HTTP 208 no longer uses reason phrase ``\"im_used\"``. Correctly uses\n ``\"already_reported\"``.\n- HTTP 226 reason added (``\"im_used\"``).\n\n**Bugfixes:**\n\n- Vastly improved proxy support, including the CONNECT verb. Special thanks to\n the many contributors who worked towards this improvement.\n- Cookies are now properly managed when 401 authentication responses are\n received.\n- Chunked encoding fixes.\n- Support for mixed case schemes.\n- Better handling of streaming downloads.\n- Retrieve environment proxies from more locations.\n- Minor cookies fixes.\n- Improved redirect behaviour.\n- Improved streaming behaviour, particularly for compressed data.\n- Miscellaneous small Python 3 text encoding bugs.\n- ``.netrc`` no longer overrides explicit auth.\n- Cookies set by hooks are now correctly persisted on Sessions.\n- Fix problem with cookies that specify port numbers in their host field.\n- ``BytesIO`` can be used to perform streaming uploads.\n- More generous parsing of the ``no_proxy`` environment variable.\n- Non-string objects can be passed in data values alongside files.\n\n1.2.3 (2013-05-25)\n++++++++++++++++++\n\n- Simple packaging fix\n\n\n1.2.2 (2013-05-23)\n++++++++++++++++++\n\n- Simple packaging fix\n\n\n1.2.1 (2013-05-20)\n++++++++++++++++++\n\n- 301 and 302 redirects now change the verb to GET for all verbs, not just\n POST, improving browser compatibility.\n- Python 3.3.2 compatibility\n- Always percent-encode location headers\n- Fix connection adapter matching to be most-specific first\n- new argument to the default connection adapter for passing a block argument\n- prevent a KeyError when there's no link headers\n\n1.2.0 (2013-03-31)\n++++++++++++++++++\n\n- Fixed cookies on sessions and on requests\n- Significantly change how hooks are dispatched - hooks now receive all the\n arguments specified by the user when making a request so hooks can make a\n secondary request with the same parameters. This is especially necessary for\n authentication handler authors\n- certifi support was removed\n- Fixed bug where using OAuth 1 with body ``signature_type`` sent no data\n- Major proxy work thanks to @Lukasa including parsing of proxy authentication\n from the proxy url\n- Fix DigestAuth handling too many 401s\n- Update vendored urllib3 to include SSL bug fixes\n- Allow keyword arguments to be passed to ``json.loads()`` via the\n ``Response.json()`` method\n- Don't send ``Content-Length`` header by default on ``GET`` or ``HEAD``\n requests\n- Add ``elapsed`` attribute to ``Response`` objects to time how long a request\n took.\n- Fix ``RequestsCookieJar``\n- Sessions and Adapters are now picklable, i.e., can be used with the\n multiprocessing library\n- Update charade to version 1.0.3\n\nThe change in how hooks are dispatched will likely cause a great deal of\nissues.\n\n1.1.0 (2013-01-10)\n++++++++++++++++++\n\n- CHUNKED REQUESTS\n- Support for iterable response bodies\n- Assume servers persist redirect params\n- Allow explicit content types to be specified for file data\n- Make merge_kwargs case-insensitive when looking up keys\n\n1.0.3 (2012-12-18)\n++++++++++++++++++\n\n- Fix file upload encoding bug\n- Fix cookie behavior\n\n1.0.2 (2012-12-17)\n++++++++++++++++++\n\n- Proxy fix for HTTPAdapter.\n\n1.0.1 (2012-12-17)\n++++++++++++++++++\n\n- Cert verification exception bug.\n- Proxy fix for HTTPAdapter.\n\n1.0.0 (2012-12-17)\n++++++++++++++++++\n\n- Massive Refactor and Simplification\n- Switch to Apache 2.0 license\n- Swappable Connection Adapters\n- Mountable Connection Adapters\n- Mutable ProcessedRequest chain\n- /s/prefetch/stream\n- Removal of all configuration\n- Standard library logging\n- Make Response.json() callable, not property.\n- Usage of new charade project, which provides python 2 and 3 simultaneous chardet.\n- Removal of all hooks except 'response'\n- Removal of all authentication helpers (OAuth, Kerberos)\n\nThis is not a backwards compatible change.\n\n0.14.2 (2012-10-27)\n+++++++++++++++++++\n\n- Improved mime-compatible JSON handling\n- Proxy fixes\n- Path hack fixes\n- Case-Insensistive Content-Encoding headers\n- Support for CJK parameters in form posts\n\n\n0.14.1 (2012-10-01)\n+++++++++++++++++++\n\n- Python 3.3 Compatibility\n- Simply default accept-encoding\n- Bugfixes\n\n\n0.14.0 (2012-09-02)\n++++++++++++++++++++\n\n- No more iter_content errors if already downloaded.\n\n0.13.9 (2012-08-25)\n+++++++++++++++++++\n\n- Fix for OAuth + POSTs\n- Remove exception eating from dispatch_hook\n- General bugfixes\n\n0.13.8 (2012-08-21)\n+++++++++++++++++++\n\n- Incredible Link header support :)\n\n0.13.7 (2012-08-19)\n+++++++++++++++++++\n\n- Support for (key, value) lists everywhere.\n- Digest Authentication improvements.\n- Ensure proxy exclusions work properly.\n- Clearer UnicodeError exceptions.\n- Automatic casting of URLs to tsrings (fURL and such)\n- Bugfixes.\n\n0.13.6 (2012-08-06)\n+++++++++++++++++++\n\n- Long awaited fix for hanging connections!\n\n0.13.5 (2012-07-27)\n+++++++++++++++++++\n\n- Packaging fix\n\n0.13.4 (2012-07-27)\n+++++++++++++++++++\n\n- GSSAPI/Kerberos authentication!\n- App Engine 2.7 Fixes!\n- Fix leaking connections (from urllib3 update)\n- OAuthlib path hack fix\n- OAuthlib URL parameters fix.\n\n0.13.3 (2012-07-12)\n+++++++++++++++++++\n\n- Use simplejson if available.\n- Do not hide SSLErrors behind Timeouts.\n- Fixed param handling with urls containing fragments.\n- Significantly improved information in User Agent.\n- client certificates are ignored when verify=False\n\n0.13.2 (2012-06-28)\n+++++++++++++++++++\n\n- Zero dependencies (once again)!\n- New: Response.reason\n- Sign querystring parameters in OAuth 1.0\n- Client certificates no longer ignored when verify=False\n- Add openSUSE certificate support\n\n0.13.1 (2012-06-07)\n+++++++++++++++++++\n\n- Allow passing a file or file-like object as data.\n- Allow hooks to return responses that indicate errors.\n- Fix Response.text and Response.json for body-less responses.\n\n0.13.0 (2012-05-29)\n+++++++++++++++++++\n\n- Removal of Requests.async in favor of `grequests `_\n- Allow disabling of cookie persistiance.\n- New implimentation of safe_mode\n- cookies.get now supports default argument\n- Session cookies not saved when Session.request is called with return_response=False\n- Env: no_proxy support.\n- RequestsCookieJar improvements.\n- Various bug fixes.\n\n0.12.1 (2012-05-08)\n+++++++++++++++++++\n\n- New ``Response.json`` property.\n- Ability to add string file uploads.\n- Fix out-of-range issue with iter_lines.\n- Fix iter_content default size.\n- Fix POST redirects containing files.\n\n0.12.0 (2012-05-02)\n+++++++++++++++++++\n\n- EXPERIMENTAL OAUTH SUPPORT!\n- Proper CookieJar-backed cookies interface with awesome dict-like interface.\n- Speed fix for non-iterated content chunks.\n- Move ``pre_request`` to a more usable place.\n- New ``pre_send`` hook.\n- Lazily encode data, params, files.\n- Load system Certificate Bundle if ``certify`` isn't available.\n- Cleanups, fixes.\n\n0.11.2 (2012-04-22)\n+++++++++++++++++++\n\n- Attempt to use the OS's certificate bundle if ``certifi`` isn't available.\n- Infinite digest auth redirect fix.\n- Multi-part file upload improvements.\n- Fix decoding of invalid %encodings in URLs.\n- If there is no content in a response don't throw an error the second time that content is attempted to be read.\n- Upload data on redirects.\n\n0.11.1 (2012-03-30)\n+++++++++++++++++++\n\n* POST redirects now break RFC to do what browsers do: Follow up with a GET.\n* New ``strict_mode`` configuration to disable new redirect behavior.\n\n\n0.11.0 (2012-03-14)\n+++++++++++++++++++\n\n* Private SSL Certificate support\n* Remove select.poll from Gevent monkeypatching\n* Remove redundant generator for chunked transfer encoding\n* Fix: Response.ok raises Timeout Exception in safe_mode\n\n0.10.8 (2012-03-09)\n+++++++++++++++++++\n\n* Generate chunked ValueError fix\n* Proxy configuration by environment variables\n* Simplification of iter_lines.\n* New `trust_env` configuration for disabling system/environment hints.\n* Suppress cookie errors.\n\n0.10.7 (2012-03-07)\n+++++++++++++++++++\n\n* `encode_uri` = False\n\n0.10.6 (2012-02-25)\n+++++++++++++++++++\n\n* Allow '=' in cookies.\n\n0.10.5 (2012-02-25)\n+++++++++++++++++++\n\n* Response body with 0 content-length fix.\n* New async.imap.\n* Don't fail on netrc.\n\n\n0.10.4 (2012-02-20)\n+++++++++++++++++++\n\n* Honor netrc.\n\n0.10.3 (2012-02-20)\n+++++++++++++++++++\n\n* HEAD requests don't follow redirects anymore.\n* raise_for_status() doesn't raise for 3xx anymore.\n* Make Session objects picklable.\n* ValueError for invalid schema URLs.\n\n0.10.2 (2012-01-15)\n+++++++++++++++++++\n\n* Vastly improved URL quoting.\n* Additional allowed cookie key values.\n* Attempted fix for \"Too many open files\" Error\n* Replace unicode errors on first pass, no need for second pass.\n* Append '/' to bare-domain urls before query insertion.\n* Exceptions now inherit from RuntimeError.\n* Binary uploads + auth fix.\n* Bugfixes.\n\n\n0.10.1 (2012-01-23)\n+++++++++++++++++++\n\n* PYTHON 3 SUPPORT!\n* Dropped 2.5 Support. (*Backwards Incompatible*)\n\n0.10.0 (2012-01-21)\n+++++++++++++++++++\n\n* ``Response.content`` is now bytes-only. (*Backwards Incompatible*)\n* New ``Response.text`` is unicode-only.\n* If no ``Response.encoding`` is specified and ``chardet`` is available, ``Respoonse.text`` will guess an encoding.\n* Default to ISO-8859-1 (Western) encoding for \"text\" subtypes.\n* Removal of `decode_unicode`. (*Backwards Incompatible*)\n* New multiple-hooks system.\n* New ``Response.register_hook`` for registering hooks within the pipeline.\n* ``Response.url`` is now Unicode.\n\n0.9.3 (2012-01-18)\n++++++++++++++++++\n\n* SSL verify=False bugfix (apparent on windows machines).\n\n0.9.2 (2012-01-18)\n++++++++++++++++++\n\n* Asynchronous async.send method.\n* Support for proper chunk streams with boundaries.\n* session argument for Session classes.\n* Print entire hook tracebacks, not just exception instance.\n* Fix response.iter_lines from pending next line.\n* Fix but in HTTP-digest auth w/ URI having query strings.\n* Fix in Event Hooks section.\n* Urllib3 update.\n\n\n0.9.1 (2012-01-06)\n++++++++++++++++++\n\n* danger_mode for automatic Response.raise_for_status()\n* Response.iter_lines refactor\n\n0.9.0 (2011-12-28)\n++++++++++++++++++\n\n* verify ssl is default.\n\n\n0.8.9 (2011-12-28)\n++++++++++++++++++\n\n* Packaging fix.\n\n\n0.8.8 (2011-12-28)\n++++++++++++++++++\n\n* SSL CERT VERIFICATION!\n* Release of Cerifi: Mozilla's cert list.\n* New 'verify' argument for SSL requests.\n* Urllib3 update.\n\n0.8.7 (2011-12-24)\n++++++++++++++++++\n\n* iter_lines last-line truncation fix\n* Force safe_mode for async requests\n* Handle safe_mode exceptions more consistently\n* Fix iteration on null responses in safe_mode\n\n0.8.6 (2011-12-18)\n++++++++++++++++++\n\n* Socket timeout fixes.\n* Proxy Authorization support.\n\n0.8.5 (2011-12-14)\n++++++++++++++++++\n\n* Response.iter_lines!\n\n0.8.4 (2011-12-11)\n++++++++++++++++++\n\n* Prefetch bugfix.\n* Added license to installed version.\n\n0.8.3 (2011-11-27)\n++++++++++++++++++\n\n* Converted auth system to use simpler callable objects.\n* New session parameter to API methods.\n* Display full URL while logging.\n\n0.8.2 (2011-11-19)\n++++++++++++++++++\n\n* New Unicode decoding system, based on over-ridable `Response.encoding`.\n* Proper URL slash-quote handling.\n* Cookies with ``[``, ``]``, and ``_`` allowed.\n\n0.8.1 (2011-11-15)\n++++++++++++++++++\n\n* URL Request path fix\n* Proxy fix.\n* Timeouts fix.\n\n0.8.0 (2011-11-13)\n++++++++++++++++++\n\n* Keep-alive support!\n* Complete removal of Urllib2\n* Complete removal of Poster\n* Complete removal of CookieJars\n* New ConnectionError raising\n* Safe_mode for error catching\n* prefetch parameter for request methods\n* OPTION method\n* Async pool size throttling\n* File uploads send real names\n* Vendored in urllib3\n\n0.7.6 (2011-11-07)\n++++++++++++++++++\n\n* Digest authentication bugfix (attach query data to path)\n\n0.7.5 (2011-11-04)\n++++++++++++++++++\n\n* Response.content = None if there was an invalid repsonse.\n* Redirection auth handling.\n\n0.7.4 (2011-10-26)\n++++++++++++++++++\n\n* Session Hooks fix.\n\n0.7.3 (2011-10-23)\n++++++++++++++++++\n\n* Digest Auth fix.\n\n\n0.7.2 (2011-10-23)\n++++++++++++++++++\n\n* PATCH Fix.\n\n\n0.7.1 (2011-10-23)\n++++++++++++++++++\n\n* Move away from urllib2 authentication handling.\n* Fully Remove AuthManager, AuthObject, &c.\n* New tuple-based auth system with handler callbacks.\n\n\n0.7.0 (2011-10-22)\n++++++++++++++++++\n\n* Sessions are now the primary interface.\n* Deprecated InvalidMethodException.\n* PATCH fix.\n* New config system (no more global settings).\n\n\n0.6.6 (2011-10-19)\n++++++++++++++++++\n\n* Session parameter bugfix (params merging).\n\n\n0.6.5 (2011-10-18)\n++++++++++++++++++\n\n* Offline (fast) test suite.\n* Session dictionary argument merging.\n\n\n0.6.4 (2011-10-13)\n++++++++++++++++++\n\n* Automatic decoding of unicode, based on HTTP Headers.\n* New ``decode_unicode`` setting.\n* Removal of ``r.read/close`` methods.\n* New ``r.faw`` interface for advanced response usage.*\n* Automatic expansion of parameterized headers.\n\n\n0.6.3 (2011-10-13)\n++++++++++++++++++\n\n* Beautiful ``requests.async`` module, for making async requests w/ gevent.\n\n\n0.6.2 (2011-10-09)\n++++++++++++++++++\n\n* GET/HEAD obeys allow_redirects=False.\n\n\n0.6.1 (2011-08-20)\n++++++++++++++++++\n\n* Enhanced status codes experience ``\\o/``\n* Set a maximum number of redirects (``settings.max_redirects``)\n* Full Unicode URL support\n* Support for protocol-less redirects.\n* Allow for arbitrary request types.\n* Bugfixes\n\n\n0.6.0 (2011-08-17)\n++++++++++++++++++\n\n* New callback hook system\n* New persistient sessions object and context manager\n* Transparent Dict-cookie handling\n* Status code reference object\n* Removed Response.cached\n* Added Response.request\n* All args are kwargs\n* Relative redirect support\n* HTTPError handling improvements\n* Improved https testing\n* Bugfixes\n\n\n0.5.1 (2011-07-23)\n++++++++++++++++++\n\n* International Domain Name Support!\n* Access headers without fetching entire body (``read()``)\n* Use lists as dicts for parameters\n* Add Forced Basic Authentication\n* Forced Basic is default authentication type\n* ``python-requests.org`` default User-Agent header\n* CaseInsensitiveDict lower-case caching\n* Response.history bugfix\n\n\n0.5.0 (2011-06-21)\n++++++++++++++++++\n\n* PATCH Support\n* Support for Proxies\n* HTTPBin Test Suite\n* Redirect Fixes\n* settings.verbose stream writing\n* Querystrings for all methods\n* URLErrors (Connection Refused, Timeout, Invalid URLs) are treated as explicity raised\n ``r.requests.get('hwe://blah'); r.raise_for_status()``\n\n\n0.4.1 (2011-05-22)\n++++++++++++++++++\n\n* Improved Redirection Handling\n* New 'allow_redirects' param for following non-GET/HEAD Redirects\n* Settings module refactoring\n\n\n0.4.0 (2011-05-15)\n++++++++++++++++++\n\n* Response.history: list of redirected responses\n* Case-Insensitive Header Dictionaries!\n* Unicode URLs\n\n\n0.3.4 (2011-05-14)\n++++++++++++++++++\n\n* Urllib2 HTTPAuthentication Recursion fix (Basic/Digest)\n* Internal Refactor\n* Bytes data upload Bugfix\n\n\n\n0.3.3 (2011-05-12)\n++++++++++++++++++\n\n* Request timeouts\n* Unicode url-encoded data\n* Settings context manager and module\n\n\n0.3.2 (2011-04-15)\n++++++++++++++++++\n\n* Automatic Decompression of GZip Encoded Content\n* AutoAuth Support for Tupled HTTP Auth\n\n\n0.3.1 (2011-04-01)\n++++++++++++++++++\n\n* Cookie Changes\n* Response.read()\n* Poster fix\n\n\n0.3.0 (2011-02-25)\n++++++++++++++++++\n\n* Automatic Authentication API Change\n* Smarter Query URL Parameterization\n* Allow file uploads and POST data together\n* New Authentication Manager System\n - Simpler Basic HTTP System\n - Supports all build-in urllib2 Auths\n - Allows for custom Auth Handlers\n\n\n0.2.4 (2011-02-19)\n++++++++++++++++++\n\n* Python 2.5 Support\n* PyPy-c v1.4 Support\n* Auto-Authentication tests\n* Improved Request object constructor\n\n0.2.3 (2011-02-15)\n++++++++++++++++++\n\n* New HTTPHandling Methods\n - Response.__nonzero__ (false if bad HTTP Status)\n - Response.ok (True if expected HTTP Status)\n - Response.error (Logged HTTPError if bad HTTP Status)\n - Response.raise_for_status() (Raises stored HTTPError)\n\n\n0.2.2 (2011-02-14)\n++++++++++++++++++\n\n* Still handles request in the event of an HTTPError. (Issue #2)\n* Eventlet and Gevent Monkeypatch support.\n* Cookie Support (Issue #1)\n\n\n0.2.1 (2011-02-14)\n++++++++++++++++++\n\n* Added file attribute to POST and PUT requests for multipart-encode file uploads.\n* Added Request.url attribute for context and redirects\n\n\n0.2.0 (2011-02-14)\n++++++++++++++++++\n\n* Birth!\n\n\n0.0.1 (2011-02-13)\n++++++++++++++++++\n\n* Frustration\n* Conception\n\n"},{"fileName":"response.py","filePath":"requests/packages/urllib3/util","id":1380,"nodeType":"File","text":"def is_fp_closed(obj):\n \"\"\"\n Checks whether a given file-like object is closed.\n\n :param obj:\n The file-like object to check.\n \"\"\"\n if hasattr(obj, 'fp'):\n # Object is a container for another file-like object that gets released\n # on exhaustion (e.g. HTTPResponse)\n return obj.fp is None\n\n return obj.closed\n"},{"fileName":"gb2312prober.py","filePath":"requests/packages/chardet","id":1381,"nodeType":"File","text":"######################## BEGIN LICENSE BLOCK ########################\n# The Original Code is mozilla.org code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 1998\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n# Mark Pilgrim - port to Python\n#\n# This library is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public\n# License as published by the Free Software Foundation; either\n# version 2.1 of the License, or (at your option) any later version.\n# \n# This library is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n# Lesser General Public License for more details.\n# \n# You should have received a copy of the GNU Lesser General Public\n# License along with this library; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n# 02110-1301 USA\n######################### END LICENSE BLOCK #########################\n\nfrom .mbcharsetprober import MultiByteCharSetProber\nfrom .codingstatemachine import CodingStateMachine\nfrom .chardistribution import GB2312DistributionAnalysis\nfrom .mbcssm import GB2312SMModel\n\nclass GB2312Prober(MultiByteCharSetProber):\n def __init__(self):\n MultiByteCharSetProber.__init__(self)\n self._mCodingSM = CodingStateMachine(GB2312SMModel)\n self._mDistributionAnalyzer = GB2312DistributionAnalysis()\n self.reset()\n\n def get_charset_name(self):\n return \"GB2312\"\n"},{"className":"MultiByteCharSetProber","col":0,"comment":"null","endLoc":86,"id":1382,"nodeType":"Class","startLoc":35,"text":"class MultiByteCharSetProber(CharSetProber):\n def __init__(self):\n CharSetProber.__init__(self)\n self._mDistributionAnalyzer = None\n self._mCodingSM = None\n self._mLastChar = [0, 0]\n\n def reset(self):\n CharSetProber.reset(self)\n if self._mCodingSM:\n self._mCodingSM.reset()\n if self._mDistributionAnalyzer:\n self._mDistributionAnalyzer.reset()\n self._mLastChar = [0, 0]\n\n def get_charset_name(self):\n pass\n\n def feed(self, aBuf):\n aLen = len(aBuf)\n for i in range(0, aLen):\n codingState = self._mCodingSM.next_state(aBuf[i])\n if codingState == constants.eError:\n if constants._debug:\n sys.stderr.write(self.get_charset_name()\n + ' prober hit error at byte ' + str(i)\n + '\\n')\n self._mState = constants.eNotMe\n break\n elif codingState == constants.eItsMe:\n self._mState = constants.eFoundIt\n break\n elif codingState == constants.eStart:\n charLen = self._mCodingSM.get_current_charlen()\n if i == 0:\n self._mLastChar[1] = aBuf[0]\n self._mDistributionAnalyzer.feed(self._mLastChar, charLen)\n else:\n self._mDistributionAnalyzer.feed(aBuf[i - 1:i + 1],\n charLen)\n\n self._mLastChar[0] = aBuf[aLen - 1]\n\n if self.get_state() == constants.eDetecting:\n if (self._mDistributionAnalyzer.got_enough_data() and\n (self.get_confidence() > constants.SHORTCUT_THRESHOLD)):\n self._mState = constants.eFoundIt\n\n return self.get_state()\n\n def get_confidence(self):\n return self._mDistributionAnalyzer.get_confidence()"},{"col":4,"comment":"null","endLoc":40,"header":"def __init__(self)","id":1383,"name":"__init__","nodeType":"Function","startLoc":36,"text":"def __init__(self):\n CharSetProber.__init__(self)\n self._mDistributionAnalyzer = None\n self._mCodingSM = None\n self._mLastChar = [0, 0]"},{"col":4,"comment":"null","endLoc":48,"header":"def reset(self)","id":1384,"name":"reset","nodeType":"Function","startLoc":42,"text":"def reset(self):\n CharSetProber.reset(self)\n if self._mCodingSM:\n self._mCodingSM.reset()\n if self._mDistributionAnalyzer:\n self._mDistributionAnalyzer.reset()\n self._mLastChar = [0, 0]"},{"col":4,"comment":"null","endLoc":51,"header":"def get_charset_name(self)","id":1388,"name":"get_charset_name","nodeType":"Function","startLoc":50,"text":"def get_charset_name(self):\n pass"},{"col":4,"comment":"null","endLoc":83,"header":"def feed(self, aBuf)","id":1389,"name":"feed","nodeType":"Function","startLoc":53,"text":"def feed(self, aBuf):\n aLen = len(aBuf)\n for i in range(0, aLen):\n codingState = self._mCodingSM.next_state(aBuf[i])\n if codingState == constants.eError:\n if constants._debug:\n sys.stderr.write(self.get_charset_name()\n + ' prober hit error at byte ' + str(i)\n + '\\n')\n self._mState = constants.eNotMe\n break\n elif codingState == constants.eItsMe:\n self._mState = constants.eFoundIt\n break\n elif codingState == constants.eStart:\n charLen = self._mCodingSM.get_current_charlen()\n if i == 0:\n self._mLastChar[1] = aBuf[0]\n self._mDistributionAnalyzer.feed(self._mLastChar, charLen)\n else:\n self._mDistributionAnalyzer.feed(aBuf[i - 1:i + 1],\n charLen)\n\n self._mLastChar[0] = aBuf[aLen - 1]\n\n if self.get_state() == constants.eDetecting:\n if (self._mDistributionAnalyzer.got_enough_data() and\n (self.get_confidence() > constants.SHORTCUT_THRESHOLD)):\n self._mState = constants.eFoundIt\n\n return self.get_state()"},{"col":0,"comment":"\n Helper for quickly disabling all urllib3 warnings.\n ","endLoc":66,"header":"def disable_warnings(category=exceptions.HTTPWarning)","id":1392,"name":"disable_warnings","nodeType":"Function","startLoc":62,"text":"def disable_warnings(category=exceptions.HTTPWarning):\n \"\"\"\n Helper for quickly disabling all urllib3 warnings.\n \"\"\"\n warnings.simplefilter('ignore', category)"},{"attributeType":"str","col":0,"comment":"null","endLoc":5,"id":1394,"name":"__author__","nodeType":"Attribute","startLoc":5,"text":"__author__"},{"attributeType":"str","col":0,"comment":"null","endLoc":6,"id":1395,"name":"__license__","nodeType":"Attribute","startLoc":6,"text":"__license__"},{"attributeType":"str","col":0,"comment":"null","endLoc":7,"id":1396,"name":"__version__","nodeType":"Attribute","startLoc":7,"text":"__version__"},{"col":0,"comment":"","endLoc":3,"header":"__init__.py#","id":1397,"name":"","nodeType":"Function","startLoc":1,"text":"\"\"\"\nurllib3 - Thread-safe connection pooling and re-using.\n\"\"\"\n\n__author__ = 'Andrey Petrov (andrey.petrov@shazow.net)'\n\n__license__ = 'MIT'\n\n__version__ = 'dev'\n\ntry: # Python 2.7+\n from logging import NullHandler\nexcept ImportError:\n class NullHandler(logging.Handler):\n def emit(self, record):\n pass\n\nlogging.getLogger(__name__).addHandler(NullHandler())\n\ndel NullHandler\n\nwarnings.simplefilter('module', exceptions.InsecureRequestWarning)"},{"col":4,"comment":"null","endLoc":86,"header":"def get_confidence(self)","id":1398,"name":"get_confidence","nodeType":"Function","startLoc":85,"text":"def get_confidence(self):\n return self._mDistributionAnalyzer.get_confidence()"},{"attributeType":"null","col":8,"comment":"null","endLoc":40,"id":1399,"name":"_mLastChar","nodeType":"Attribute","startLoc":40,"text":"self._mLastChar"},{"attributeType":"null","col":8,"comment":"null","endLoc":39,"id":1400,"name":"_mCodingSM","nodeType":"Attribute","startLoc":39,"text":"self._mCodingSM"},{"attributeType":"null","col":16,"comment":"null","endLoc":62,"id":1401,"name":"_mState","nodeType":"Attribute","startLoc":62,"text":"self._mState"},{"attributeType":"null","col":8,"comment":"null","endLoc":38,"id":1402,"name":"_mDistributionAnalyzer","nodeType":"Attribute","startLoc":38,"text":"self._mDistributionAnalyzer"},{"attributeType":"null","col":0,"comment":"null","endLoc":331,"id":1403,"name":"GB2312SMModel","nodeType":"Attribute","startLoc":331,"text":"GB2312SMModel"},{"className":"GB2312Prober","col":0,"comment":"null","endLoc":41,"id":1404,"nodeType":"Class","startLoc":33,"text":"class GB2312Prober(MultiByteCharSetProber):\n def __init__(self):\n MultiByteCharSetProber.__init__(self)\n self._mCodingSM = CodingStateMachine(GB2312SMModel)\n self._mDistributionAnalyzer = GB2312DistributionAnalysis()\n self.reset()\n\n def get_charset_name(self):\n return \"GB2312\""},{"col":4,"comment":"null","endLoc":38,"header":"def __init__(self)","id":1405,"name":"__init__","nodeType":"Function","startLoc":34,"text":"def __init__(self):\n MultiByteCharSetProber.__init__(self)\n self._mCodingSM = CodingStateMachine(GB2312SMModel)\n self._mDistributionAnalyzer = GB2312DistributionAnalysis()\n self.reset()"},{"id":1406,"name":"layout.html","nodeType":"TextFile","path":"docs/_themes/kr","text":"{%- extends \"basic/layout.html\" %}\n{%- block extrahead %}\n {{ super() }}\n {% if theme_touch_icon %}\n \n {% endif %}\n \n \n{% endblock %}\n{%- block relbar2 %}{% endblock %}\n{%- block footer %}\n \n \n
\n \n \n \n\n \n\n\n \n\n \n\n\n{%- endblock %}\n"},{"id":1407,"name":"docs/_themes/kr_small/static","nodeType":"Package"},{"id":1408,"name":"flasky.css_t","nodeType":"TextFile","path":"docs/_themes/kr_small/static","text":"/*\n * flasky.css_t\n * ~~~~~~~~~~~~\n *\n * Sphinx stylesheet -- flasky theme based on nature theme.\n *\n * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.\n * :license: BSD, see LICENSE for details.\n *\n */\n\n@import url(\"basic.css\");\n\n/* -- page layout ----------------------------------------------------------- */\n\nbody {\n font-family: 'Georgia', serif;\n font-size: 17px;\n color: #000;\n background: white;\n margin: 0;\n padding: 0;\n}\n\ndiv.documentwrapper {\n float: left;\n width: 100%;\n}\n\ndiv.bodywrapper {\n margin: 40px auto 0 auto;\n width: 700px;\n}\n\nhr {\n border: 1px solid #B1B4B6;\n}\n\ndiv.body {\n background-color: #ffffff;\n color: #3E4349;\n padding: 0 30px 30px 30px;\n}\n\nimg.floatingflask {\n padding: 0 0 10px 10px;\n float: right;\n}\n\ndiv.footer {\n text-align: right;\n color: #888;\n padding: 10px;\n font-size: 14px;\n width: 650px;\n margin: 0 auto 40px auto;\n}\n\ndiv.footer a {\n color: #888;\n text-decoration: underline;\n}\n\ndiv.related {\n line-height: 32px;\n color: #888;\n}\n\ndiv.related ul {\n padding: 0 0 0 10px;\n}\n\ndiv.related a {\n color: #444;\n}\n\n/* -- body styles ----------------------------------------------------------- */\n\na {\n color: #004B6B;\n text-decoration: underline;\n}\n\na:hover {\n color: #6D4100;\n text-decoration: underline;\n}\n\ndiv.body {\n padding-bottom: 40px; /* saved for footer */\n}\n\ndiv.body h1,\ndiv.body h2,\ndiv.body h3,\ndiv.body h4,\ndiv.body h5,\ndiv.body h6 {\n font-family: 'Garamond', 'Georgia', serif;\n font-weight: normal;\n margin: 30px 0px 10px 0px;\n padding: 0;\n}\n\n{% if theme_index_logo %}\ndiv.indexwrapper h1 {\n text-indent: -999999px;\n background: url({{ theme_index_logo }}) no-repeat center center;\n height: {{ theme_index_logo_height }};\n}\n{% endif %}\n\ndiv.body h2 { font-size: 180%; }\ndiv.body h3 { font-size: 150%; }\ndiv.body h4 { font-size: 130%; }\ndiv.body h5 { font-size: 100%; }\ndiv.body h6 { font-size: 100%; }\n\na.headerlink {\n color: white;\n padding: 0 4px;\n text-decoration: none;\n}\n\na.headerlink:hover {\n color: #444;\n background: #eaeaea;\n}\n\ndiv.body p, div.body dd, div.body li {\n line-height: 1.4em;\n}\n\ndiv.admonition {\n background: #fafafa;\n margin: 20px -30px;\n padding: 10px 30px;\n border-top: 1px solid #ccc;\n border-bottom: 1px solid #ccc;\n}\n\ndiv.admonition p.admonition-title {\n font-family: 'Garamond', 'Georgia', serif;\n font-weight: normal;\n font-size: 24px;\n margin: 0 0 10px 0;\n padding: 0;\n line-height: 1;\n}\n\ndiv.admonition p.last {\n margin-bottom: 0;\n}\n\ndiv.highlight{\n background-color: white;\n}\n\ndt:target, .highlight {\n background: #FAF3E8;\n}\n\ndiv.note {\n background-color: #eee;\n border: 1px solid #ccc;\n}\n\ndiv.seealso {\n background-color: #ffc;\n border: 1px solid #ff6;\n}\n\ndiv.topic {\n background-color: #eee;\n}\n\ndiv.warning {\n background-color: #ffe4e4;\n border: 1px solid #f66;\n}\n\np.admonition-title {\n display: inline;\n}\n\np.admonition-title:after {\n content: \":\";\n}\n\npre, tt {\n font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace;\n font-size: 0.85em;\n}\n\nimg.screenshot {\n}\n\ntt.descname, tt.descclassname {\n font-size: 0.95em;\n}\n\ntt.descname {\n padding-right: 0.08em;\n}\n\nimg.screenshot {\n -moz-box-shadow: 2px 2px 4px #eee;\n -webkit-box-shadow: 2px 2px 4px #eee;\n box-shadow: 2px 2px 4px #eee;\n}\n\ntable.docutils {\n border: 1px solid #888;\n -moz-box-shadow: 2px 2px 4px #eee;\n -webkit-box-shadow: 2px 2px 4px #eee;\n box-shadow: 2px 2px 4px #eee;\n}\n\ntable.docutils td, table.docutils th {\n border: 1px solid #888;\n padding: 0.25em 0.7em;\n}\n\ntable.field-list, table.footnote {\n border: none;\n -moz-box-shadow: none;\n -webkit-box-shadow: none;\n box-shadow: none;\n}\n\ntable.footnote {\n margin: 15px 0;\n width: 100%;\n border: 1px solid #eee;\n}\n\ntable.field-list th {\n padding: 0 0.8em 0 0;\n}\n\ntable.field-list td {\n padding: 0;\n}\n\ntable.footnote td {\n padding: 0.5em;\n}\n\ndl {\n margin: 0;\n padding: 0;\n}\n\ndl dd {\n margin-left: 30px;\n}\n\npre {\n padding: 0;\n margin: 15px -30px;\n padding: 8px;\n line-height: 1.3em;\n padding: 7px 30px;\n background: #eee;\n border-radius: 2px;\n -moz-border-radius: 2px;\n -webkit-border-radius: 2px;\n}\n\ndl pre {\n margin-left: -60px;\n padding-left: 60px;\n}\n\ntt {\n background-color: #ecf0f3;\n color: #222;\n /* padding: 1px 2px; */\n}\n\ntt.xref, a tt {\n background-color: #FBFBFB;\n}\n\na:hover tt {\n background: #EEE;\n}\n"},{"col":4,"comment":"null","endLoc":41,"header":"def get_charset_name(self)","id":1409,"name":"get_charset_name","nodeType":"Function","startLoc":40,"text":"def get_charset_name(self):\n return \"GB2312\""},{"attributeType":"CodingStateMachine","col":8,"comment":"null","endLoc":36,"id":1410,"name":"_mCodingSM","nodeType":"Attribute","startLoc":36,"text":"self._mCodingSM"},{"attributeType":"GB2312DistributionAnalysis","col":8,"comment":"null","endLoc":37,"id":1411,"name":"_mDistributionAnalyzer","nodeType":"Attribute","startLoc":37,"text":"self._mDistributionAnalyzer"},{"fileName":"_collections.py","filePath":"requests/packages/urllib3","id":1412,"nodeType":"File","text":"from collections import Mapping, MutableMapping\ntry:\n from threading import RLock\nexcept ImportError: # Platform-specific: No threads available\n class RLock:\n def __enter__(self):\n pass\n\n def __exit__(self, exc_type, exc_value, traceback):\n pass\n\n\ntry: # Python 2.7+\n from collections import OrderedDict\nexcept ImportError:\n from .packages.ordered_dict import OrderedDict\nfrom .packages.six import itervalues\n\n\n__all__ = ['RecentlyUsedContainer', 'HTTPHeaderDict']\n\n\n_Null = object()\n\n\nclass RecentlyUsedContainer(MutableMapping):\n \"\"\"\n Provides a thread-safe dict-like container which maintains up to\n ``maxsize`` keys while throwing away the least-recently-used keys beyond\n ``maxsize``.\n\n :param maxsize:\n Maximum number of recent elements to retain.\n\n :param dispose_func:\n Every time an item is evicted from the container,\n ``dispose_func(value)`` is called. Callback which will get called\n \"\"\"\n\n ContainerCls = OrderedDict\n\n def __init__(self, maxsize=10, dispose_func=None):\n self._maxsize = maxsize\n self.dispose_func = dispose_func\n\n self._container = self.ContainerCls()\n self.lock = RLock()\n\n def __getitem__(self, key):\n # Re-insert the item, moving it to the end of the eviction line.\n with self.lock:\n item = self._container.pop(key)\n self._container[key] = item\n return item\n\n def __setitem__(self, key, value):\n evicted_value = _Null\n with self.lock:\n # Possibly evict the existing value of 'key'\n evicted_value = self._container.get(key, _Null)\n self._container[key] = value\n\n # If we didn't evict an existing value, we might have to evict the\n # least recently used item from the beginning of the container.\n if len(self._container) > self._maxsize:\n _key, evicted_value = self._container.popitem(last=False)\n\n if self.dispose_func and evicted_value is not _Null:\n self.dispose_func(evicted_value)\n\n def __delitem__(self, key):\n with self.lock:\n value = self._container.pop(key)\n\n if self.dispose_func:\n self.dispose_func(value)\n\n def __len__(self):\n with self.lock:\n return len(self._container)\n\n def __iter__(self):\n raise NotImplementedError('Iteration over this class is unlikely to be threadsafe.')\n\n def clear(self):\n with self.lock:\n # Copy pointers to all values, then wipe the mapping\n # under Python 2, this copies the list of values twice :-|\n values = list(self._container.values())\n self._container.clear()\n\n if self.dispose_func:\n for value in values:\n self.dispose_func(value)\n\n def keys(self):\n with self.lock:\n return self._container.keys()\n\n\nclass HTTPHeaderDict(MutableMapping):\n \"\"\"\n :param headers:\n An iterable of field-value pairs. Must not contain multiple field names\n when compared case-insensitively.\n\n :param kwargs:\n Additional field-value pairs to pass in to ``dict.update``.\n\n A ``dict`` like container for storing HTTP Headers.\n\n Field names are stored and compared case-insensitively in compliance with\n RFC 7230. Iteration provides the first case-sensitive key seen for each\n case-insensitive pair.\n\n Using ``__setitem__`` syntax overwrites fields that compare equal\n case-insensitively in order to maintain ``dict``'s api. For fields that\n compare equal, instead create a new ``HTTPHeaderDict`` and use ``.add``\n in a loop.\n\n If multiple fields that are equal case-insensitively are passed to the\n constructor or ``.update``, the behavior is undefined and some will be\n lost.\n\n >>> headers = HTTPHeaderDict()\n >>> headers.add('Set-Cookie', 'foo=bar')\n >>> headers.add('set-cookie', 'baz=quxx')\n >>> headers['content-length'] = '7'\n >>> headers['SET-cookie']\n 'foo=bar, baz=quxx'\n >>> headers['Content-Length']\n '7'\n\n If you want to access the raw headers with their original casing\n for debugging purposes you can access the private ``._data`` attribute\n which is a normal python ``dict`` that maps the case-insensitive key to a\n list of tuples stored as (case-sensitive-original-name, value). Using the\n structure from above as our example:\n\n >>> headers._data\n {'set-cookie': [('Set-Cookie', 'foo=bar'), ('set-cookie', 'baz=quxx')],\n 'content-length': [('content-length', '7')]}\n \"\"\"\n\n def __init__(self, headers=None, **kwargs):\n self._data = {}\n if headers is None:\n headers = {}\n self.update(headers, **kwargs)\n\n def add(self, key, value):\n \"\"\"Adds a (name, value) pair, doesn't overwrite the value if it already\n exists.\n\n >>> headers = HTTPHeaderDict(foo='bar')\n >>> headers.add('Foo', 'baz')\n >>> headers['foo']\n 'bar, baz'\n \"\"\"\n self._data.setdefault(key.lower(), []).append((key, value))\n\n def getlist(self, key):\n \"\"\"Returns a list of all the values for the named field. Returns an\n empty list if the key doesn't exist.\"\"\"\n return self[key].split(', ') if key in self else []\n\n def copy(self):\n h = HTTPHeaderDict()\n for key in self._data:\n for rawkey, value in self._data[key]:\n h.add(rawkey, value)\n return h\n\n def __eq__(self, other):\n if not isinstance(other, Mapping):\n return False\n other = HTTPHeaderDict(other)\n return dict((k1, self[k1]) for k1 in self._data) == \\\n dict((k2, other[k2]) for k2 in other._data)\n\n def __getitem__(self, key):\n values = self._data[key.lower()]\n return ', '.join(value[1] for value in values)\n\n def __setitem__(self, key, value):\n self._data[key.lower()] = [(key, value)]\n\n def __delitem__(self, key):\n del self._data[key.lower()]\n\n def __len__(self):\n return len(self._data)\n\n def __iter__(self):\n for headers in itervalues(self._data):\n yield headers[0][0]\n\n def __repr__(self):\n return '%s(%r)' % (self.__class__.__name__, dict(self.items()))\n"},{"attributeType":"_RLock","col":0,"comment":"null","endLoc":129,"id":1413,"name":"RLock","nodeType":"Attribute","startLoc":129,"text":"RLock"},{"id":1414,"name":"advanced.rst","nodeType":"TextFile","path":"docs/user","text":".. _advanced:\n\nAdvanced Usage\n==============\n\nThis document covers some of Requests more advanced features.\n\n\nSession Objects\n---------------\n\nThe Session object allows you to persist certain parameters across\nrequests. It also persists cookies across all requests made from the\nSession instance.\n\nA Session object has all the methods of the main Requests API.\n\nLet's persist some cookies across requests::\n\n s = requests.Session()\n\n s.get('http://httpbin.org/cookies/set/sessioncookie/123456789')\n r = s.get(\"http://httpbin.org/cookies\")\n\n print(r.text)\n # '{\"cookies\": {\"sessioncookie\": \"123456789\"}}'\n\n\nSessions can also be used to provide default data to the request methods. This\nis done by providing data to the properties on a Session object::\n\n s = requests.Session()\n s.auth = ('user', 'pass')\n s.headers.update({'x-test': 'true'})\n\n # both 'x-test' and 'x-test2' are sent\n s.get('http://httpbin.org/headers', headers={'x-test2': 'true'})\n\n\nAny dictionaries that you pass to a request method will be merged with the\nsession-level values that are set. The method-level parameters override session\nparameters.\n\n.. admonition:: Remove a Value From a Dict Parameter\n\n Sometimes you'll want to omit session-level keys from a dict parameter. To\n do this, you simply set that key's value to ``None`` in the method-level\n parameter. It will automatically be omitted.\n\nAll values that are contained within a session are directly available to you.\nSee the :ref:`Session API Docs ` to learn more.\n\nRequest and Response Objects\n----------------------------\n\nWhenever a call is made to ``requests.get()`` and friends you are doing two\nmajor things. First, you are constructing a ``Request`` object which will be\nsent off to a server to request or query some resource. Second, a ``Response``\nobject is generated once ``requests`` gets a response back from the server.\nThe Response object contains all of the information returned by the server and\nalso contains the ``Request`` object you created originally. Here is a simple\nrequest to get some very important information from Wikipedia's servers::\n\n >>> r = requests.get('http://en.wikipedia.org/wiki/Monty_Python')\n\nIf we want to access the headers the server sent back to us, we do this::\n\n >>> r.headers\n {'content-length': '56170', 'x-content-type-options': 'nosniff', 'x-cache':\n 'HIT from cp1006.eqiad.wmnet, MISS from cp1010.eqiad.wmnet', 'content-encoding':\n 'gzip', 'age': '3080', 'content-language': 'en', 'vary': 'Accept-Encoding,Cookie',\n 'server': 'Apache', 'last-modified': 'Wed, 13 Jun 2012 01:33:50 GMT',\n 'connection': 'close', 'cache-control': 'private, s-maxage=0, max-age=0,\n must-revalidate', 'date': 'Thu, 14 Jun 2012 12:59:39 GMT', 'content-type':\n 'text/html; charset=UTF-8', 'x-cache-lookup': 'HIT from cp1006.eqiad.wmnet:3128,\n MISS from cp1010.eqiad.wmnet:80'}\n\nHowever, if we want to get the headers we sent the server, we simply access the\nrequest, and then the request's headers::\n\n >>> r.request.headers\n {'Accept-Encoding': 'identity, deflate, compress, gzip',\n 'Accept': '*/*', 'User-Agent': 'python-requests/1.2.0'}\n\nPrepared Requests\n-----------------\n\nWhenever you receive a :class:`Response ` object\nfrom an API call or a Session call, the ``request`` attribute is actually the\n``PreparedRequest`` that was used. In some cases you may wish to do some extra\nwork to the body or headers (or anything else really) before sending a\nrequest. The simple recipe for this is the following::\n\n from requests import Request, Session\n\n s = Session()\n req = Request('GET', url,\n data=data,\n headers=header\n )\n prepped = req.prepare()\n\n # do something with prepped.body\n # do something with prepped.headers\n\n resp = s.send(prepped,\n stream=stream,\n verify=verify,\n proxies=proxies,\n cert=cert,\n timeout=timeout\n )\n\n print(resp.status_code)\n\nSince you are not doing anything special with the ``Request`` object, you\nprepare it immediately and modify the ``PreparedRequest`` object. You then\nsend that with the other parameters you would have sent to ``requests.*`` or\n``Session.*``.\n\nHowever, the above code will lose some of the advantages of having a Requests\n:class:`Session ` object. In particular,\n:class:`Session `-level state such as cookies will\nnot get applied to your request. To get a\n:class:`PreparedRequest ` with that state\napplied, replace the call to :meth:`Request.prepare()\n` with a call to\n:meth:`Session.prepare_request() `, like this::\n\n from requests import Request, Session\n\n s = Session()\n req = Request('GET', url,\n data=data\n headers=headers\n )\n\n prepped = s.prepare_request(req)\n\n # do something with prepped.body\n # do something with prepped.headers\n\n resp = s.send(prepped,\n stream=stream,\n verify=verify,\n proxies=proxies,\n cert=cert,\n timeout=timeout\n )\n\n print(resp.status_code)\n\n.. _verification:\n\nSSL Cert Verification\n---------------------\n\nRequests can verify SSL certificates for HTTPS requests, just like a web browser.\nTo check a host's SSL certificate, you can use the ``verify`` argument::\n\n >>> requests.get('https://kennethreitz.com', verify=True)\n requests.exceptions.SSLError: hostname 'kennethreitz.com' doesn't match either of '*.herokuapp.com', 'herokuapp.com'\n\nI don't have SSL setup on this domain, so it fails. Excellent. GitHub does though::\n\n >>> requests.get('https://github.com', verify=True)\n \n\nYou can also pass ``verify`` the path to a CA_BUNDLE file for private certs. You can also set the ``REQUESTS_CA_BUNDLE`` environment variable.\n\nRequests can also ignore verifying the SSL certificate if you set ``verify`` to False.\n\n::\n\n >>> requests.get('https://kennethreitz.com', verify=False)\n \n\nBy default, ``verify`` is set to True. Option ``verify`` only applies to host certs.\n\nYou can also specify a local cert to use as client side certificate, as a single\nfile (containing the private key and the certificate) or as a tuple of both\nfile's path::\n\n >>> requests.get('https://kennethreitz.com', cert=('/path/server.crt', '/path/key'))\n \n\nIf you specify a wrong path or an invalid cert::\n\n >>> requests.get('https://kennethreitz.com', cert='/wrong_path/server.pem')\n SSLError: [Errno 336265225] _ssl.c:347: error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib\n\n\nBody Content Workflow\n---------------------\n\nBy default, when you make a request, the body of the response is downloaded\nimmediately. You can override this behavior and defer downloading the response\nbody until you access the :class:`Response.content `\nattribute with the ``stream`` parameter::\n\n tarball_url = 'https://github.com/kennethreitz/requests/tarball/master'\n r = requests.get(tarball_url, stream=True)\n\nAt this point only the response headers have been downloaded and the connection\nremains open, hence allowing us to make content retrieval conditional::\n\n if int(r.headers['content-length']) < TOO_LONG:\n content = r.content\n ...\n\nYou can further control the workflow by use of the :class:`Response.iter_content `\nand :class:`Response.iter_lines ` methods.\nAlternatively, you can read the undecoded body from the underlying\nurllib3 :class:`urllib3.HTTPResponse ` at\n:class:`Response.raw `.\n\nIf you set ``stream`` to ``True`` when making a request, Requests cannot\nrelease the connection back to the pool unless you consume all the data or call\n:class:`Response.close `. This can lead to\ninefficiency with connections. If you find yourself partially reading request\nbodies (or not reading them at all) while using ``stream=True``, you should\nconsider using ``contextlib.closing`` (`documented here`_), like this::\n\n from contextlib import closing\n\n with closing(requests.get('http://httpbin.org/get', stream=True)) as r:\n # Do things with the response here.\n\n.. _`documented here`: http://docs.python.org/2/library/contextlib.html#contextlib.closing\n\n\nKeep-Alive\n----------\n\nExcellent news — thanks to urllib3, keep-alive is 100% automatic within a session!\nAny requests that you make within a session will automatically reuse the appropriate\nconnection!\n\nNote that connections are only released back to the pool for reuse once all body\ndata has been read; be sure to either set ``stream`` to ``False`` or read the\n``content`` property of the ``Response`` object.\n\n\nStreaming Uploads\n-----------------\n\nRequests supports streaming uploads, which allow you to send large streams or\nfiles without reading them into memory. To stream and upload, simply provide a\nfile-like object for your body::\n\n with open('massive-body', 'rb') as f:\n requests.post('http://some.url/streamed', data=f)\n\n\nChunk-Encoded Requests\n----------------------\n\nRequests also supports Chunked transfer encoding for outgoing and incoming requests.\nTo send a chunk-encoded request, simply provide a generator (or any iterator without\na length) for your body::\n\n\n def gen():\n yield 'hi'\n yield 'there'\n\n requests.post('http://some.url/chunked', data=gen())\n\n\nEvent Hooks\n-----------\n\nRequests has a hook system that you can use to manipulate portions of\nthe request process, or signal event handling.\n\nAvailable hooks:\n\n``response``:\n The response generated from a Request.\n\n\nYou can assign a hook function on a per-request basis by passing a\n``{hook_name: callback_function}`` dictionary to the ``hooks`` request\nparameter::\n\n hooks=dict(response=print_url)\n\nThat ``callback_function`` will receive a chunk of data as its first\nargument.\n\n::\n\n def print_url(r, *args, **kwargs):\n print(r.url)\n\nIf an error occurs while executing your callback, a warning is given.\n\nIf the callback function returns a value, it is assumed that it is to\nreplace the data that was passed in. If the function doesn't return\nanything, nothing else is effected.\n\nLet's print some request method arguments at runtime::\n\n >>> requests.get('http://httpbin.org', hooks=dict(response=print_url))\n http://httpbin.org\n \n\n\nCustom Authentication\n---------------------\n\nRequests allows you to use specify your own authentication mechanism.\n\nAny callable which is passed as the ``auth`` argument to a request method will\nhave the opportunity to modify the request before it is dispatched.\n\nAuthentication implementations are subclasses of ``requests.auth.AuthBase``,\nand are easy to define. Requests provides two common authentication scheme\nimplementations in ``requests.auth``: ``HTTPBasicAuth`` and ``HTTPDigestAuth``.\n\nLet's pretend that we have a web service that will only respond if the\n``X-Pizza`` header is set to a password value. Unlikely, but just go with it.\n\n::\n\n from requests.auth import AuthBase\n\n class PizzaAuth(AuthBase):\n \"\"\"Attaches HTTP Pizza Authentication to the given Request object.\"\"\"\n def __init__(self, username):\n # setup any auth-related data here\n self.username = username\n\n def __call__(self, r):\n # modify and return the request\n r.headers['X-Pizza'] = self.username\n return r\n\nThen, we can make a request using our Pizza Auth::\n\n >>> requests.get('http://pizzabin.org/admin', auth=PizzaAuth('kenneth'))\n \n\n.. _streaming-requests:\n\nStreaming Requests\n------------------\n\nWith :class:`requests.Response.iter_lines()` you can easily\niterate over streaming APIs such as the `Twitter Streaming\nAPI `_. Simply\nset ``stream`` to ``True`` and iterate over the response with\n:class:`~requests.Response.iter_lines()`::\n\n import json\n import requests\n\n r = requests.get('http://httpbin.org/stream/20', stream=True)\n\n for line in r.iter_lines():\n\n # filter out keep-alive new lines\n if line:\n print(json.loads(line))\n\n\nProxies\n-------\n\nIf you need to use a proxy, you can configure individual requests with the\n``proxies`` argument to any request method::\n\n import requests\n\n proxies = {\n \"http\": \"http://10.10.1.10:3128\",\n \"https\": \"http://10.10.1.10:1080\",\n }\n\n requests.get(\"http://example.org\", proxies=proxies)\n\nYou can also configure proxies by setting the environment variables\n``HTTP_PROXY`` and ``HTTPS_PROXY``.\n\n::\n\n $ export HTTP_PROXY=\"http://10.10.1.10:3128\"\n $ export HTTPS_PROXY=\"http://10.10.1.10:1080\"\n $ python\n >>> import requests\n >>> requests.get(\"http://example.org\")\n\nTo use HTTP Basic Auth with your proxy, use the `http://user:password@host/` syntax::\n\n proxies = {\n \"http\": \"http://user:pass@10.10.1.10:3128/\",\n }\n\nNote that proxy URLs must include the scheme.\n\nCompliance\n----------\n\nRequests is intended to be compliant with all relevant specifications and\nRFCs where that compliance will not cause difficulties for users. This\nattention to the specification can lead to some behaviour that may seem\nunusual to those not familiar with the relevant specification.\n\nEncodings\n^^^^^^^^^\n\nWhen you receive a response, Requests makes a guess at the encoding to\nuse for decoding the response when you access the :attr:`Response.text\n` attribute. Requests will first check for an\nencoding in the HTTP header, and if none is present, will use `chardet\n`_ to attempt to guess the encoding.\n\nThe only time Requests will not do this is if no explicit charset\nis present in the HTTP headers **and** the ``Content-Type``\nheader contains ``text``. In this situation, `RFC 2616\n`_ specifies\nthat the default charset must be ``ISO-8859-1``. Requests follows the\nspecification in this case. If you require a different encoding, you can\nmanually set the :attr:`Response.encoding `\nproperty, or use the raw :attr:`Response.content `.\n\nHTTP Verbs\n----------\n\nRequests provides access to almost the full range of HTTP verbs: GET, OPTIONS,\nHEAD, POST, PUT, PATCH and DELETE. The following provides detailed examples of\nusing these various verbs in Requests, using the GitHub API.\n\nWe will begin with the verb most commonly used: GET. HTTP GET is an idempotent\nmethod that returns a resource from a given URL. As a result, it is the verb\nyou ought to use when attempting to retrieve data from a web location. An\nexample usage would be attempting to get information about a specific commit\nfrom GitHub. Suppose we wanted commit ``a050faf`` on Requests. We would get it\nlike so::\n\n >>> import requests\n >>> r = requests.get('https://api.github.com/repos/kennethreitz/requests/git/commits/a050faf084662f3a352dd1a941f2c7c9f886d4ad')\n\nWe should confirm that GitHub responded correctly. If it has, we want to work\nout what type of content it is. Do this like so::\n\n >>> if r.status_code == requests.codes.ok:\n ... print(r.headers['content-type'])\n ...\n application/json; charset=utf-8\n\nSo, GitHub returns JSON. That's great, we can use the :meth:`r.json\n` method to parse it into Python objects.\n\n::\n\n >>> commit_data = r.json()\n >>> print(commit_data.keys())\n [u'committer', u'author', u'url', u'tree', u'sha', u'parents', u'message']\n >>> print(commit_data[u'committer'])\n {u'date': u'2012-05-10T11:10:50-07:00', u'email': u'me@kennethreitz.com', u'name': u'Kenneth Reitz'}\n >>> print(commit_data[u'message'])\n makin' history\n\nSo far, so simple. Well, let's investigate the GitHub API a little bit. Now,\nwe could look at the documentation, but we might have a little more fun if we\nuse Requests instead. We can take advantage of the Requests OPTIONS verb to\nsee what kinds of HTTP methods are supported on the url we just used.\n\n::\n\n >>> verbs = requests.options(r.url)\n >>> verbs.status_code\n 500\n\nUh, what? That's unhelpful! Turns out GitHub, like many API providers, don't\nactually implement the OPTIONS method. This is an annoying oversight, but it's\nOK, we can just use the boring documentation. If GitHub had correctly\nimplemented OPTIONS, however, they should return the allowed methods in the\nheaders, e.g.\n\n::\n\n >>> verbs = requests.options('http://a-good-website.com/api/cats')\n >>> print(verbs.headers['allow'])\n GET,HEAD,POST,OPTIONS\n\nTurning to the documentation, we see that the only other method allowed for\ncommits is POST, which creates a new commit. As we're using the Requests repo,\nwe should probably avoid making ham-handed POSTS to it. Instead, let's play\nwith the Issues feature of GitHub.\n\nThis documentation was added in response to Issue #482. Given that this issue\nalready exists, we will use it as an example. Let's start by getting it.\n\n::\n\n >>> r = requests.get('https://api.github.com/repos/kennethreitz/requests/issues/482')\n >>> r.status_code\n 200\n >>> issue = json.loads(r.text)\n >>> print(issue[u'title'])\n Feature any http verb in docs\n >>> print(issue[u'comments'])\n 3\n\nCool, we have three comments. Let's take a look at the last of them.\n\n::\n\n >>> r = requests.get(r.url + u'/comments')\n >>> r.status_code\n 200\n >>> comments = r.json()\n >>> print(comments[0].keys())\n [u'body', u'url', u'created_at', u'updated_at', u'user', u'id']\n >>> print(comments[2][u'body'])\n Probably in the \"advanced\" section\n\nWell, that seems like a silly place. Let's post a comment telling the poster\nthat he's silly. Who is the poster, anyway?\n\n::\n\n >>> print(comments[2][u'user'][u'login'])\n kennethreitz\n\nOK, so let's tell this Kenneth guy that we think this example should go in the\nquickstart guide instead. According to the GitHub API doc, the way to do this\nis to POST to the thread. Let's do it.\n\n::\n\n >>> body = json.dumps({u\"body\": u\"Sounds great! I'll get right on it!\"})\n >>> url = u\"https://api.github.com/repos/kennethreitz/requests/issues/482/comments\"\n >>> r = requests.post(url=url, data=body)\n >>> r.status_code\n 404\n\nHuh, that's weird. We probably need to authenticate. That'll be a pain, right?\nWrong. Requests makes it easy to use many forms of authentication, including\nthe very common Basic Auth.\n\n::\n\n >>> from requests.auth import HTTPBasicAuth\n >>> auth = HTTPBasicAuth('fake@example.com', 'not_a_real_password')\n >>> r = requests.post(url=url, data=body, auth=auth)\n >>> r.status_code\n 201\n >>> content = r.json()\n >>> print(content[u'body'])\n Sounds great! I'll get right on it.\n\nBrilliant. Oh, wait, no! I meant to add that it would take me a while, because\nI had to go feed my cat. If only I could edit this comment! Happily, GitHub\nallows us to use another HTTP verb, PATCH, to edit this comment. Let's do\nthat.\n\n::\n\n >>> print(content[u\"id\"])\n 5804413\n >>> body = json.dumps({u\"body\": u\"Sounds great! I'll get right on it once I feed my cat.\"})\n >>> url = u\"https://api.github.com/repos/kennethreitz/requests/issues/comments/5804413\"\n >>> r = requests.patch(url=url, data=body, auth=auth)\n >>> r.status_code\n 200\n\nExcellent. Now, just to torture this Kenneth guy, I've decided to let him\nsweat and not tell him that I'm working on this. That means I want to delete\nthis comment. GitHub lets us delete comments using the incredibly aptly named\nDELETE method. Let's get rid of it.\n\n::\n\n >>> r = requests.delete(url=url, auth=auth)\n >>> r.status_code\n 204\n >>> r.headers['status']\n '204 No Content'\n\nExcellent. All gone. The last thing I want to know is how much of my ratelimit\nI've used. Let's find out. GitHub sends that information in the headers, so\nrather than download the whole page I'll send a HEAD request to get the\nheaders.\n\n::\n\n >>> r = requests.head(url=url, auth=auth)\n >>> print(r.headers)\n ...\n 'x-ratelimit-remaining': '4995'\n 'x-ratelimit-limit': '5000'\n ...\n\nExcellent. Time to write a Python program that abuses the GitHub API in all\nkinds of exciting ways, 4995 more times.\n\nLink Headers\n------------\n\nMany HTTP APIs feature Link headers. They make APIs more self describing and\ndiscoverable.\n\nGitHub uses these for `pagination `_\nin their API, for example::\n\n >>> url = 'https://api.github.com/users/kennethreitz/repos?page=1&per_page=10'\n >>> r = requests.head(url=url)\n >>> r.headers['link']\n '; rel=\"next\", ; rel=\"last\"'\n\nRequests will automatically parse these link headers and make them easily consumable::\n\n >>> r.links[\"next\"]\n {'url': 'https://api.github.com/users/kennethreitz/repos?page=2&per_page=10', 'rel': 'next'}\n\n >>> r.links[\"last\"]\n {'url': 'https://api.github.com/users/kennethreitz/repos?page=7&per_page=10', 'rel': 'last'}\n\nTransport Adapters\n------------------\n\nAs of v1.0.0, Requests has moved to a modular internal design. Part of the\nreason this was done was to implement Transport Adapters, originally\n`described here`_. Transport Adapters provide a mechanism to define interaction\nmethods for an HTTP service. In particular, they allow you to apply per-service\nconfiguration.\n\nRequests ships with a single Transport Adapter, the :class:`HTTPAdapter\n`. This adapter provides the default Requests\ninteraction with HTTP and HTTPS using the powerful `urllib3`_ library. Whenever\na Requests :class:`Session ` is initialized, one of these is\nattached to the :class:`Session ` object for HTTP, and one\nfor HTTPS.\n\nRequests enables users to create and use their own Transport Adapters that\nprovide specific functionality. Once created, a Transport Adapter can be\nmounted to a Session object, along with an indication of which web services\nit should apply to.\n\n::\n\n >>> s = requests.Session()\n >>> s.mount('http://www.github.com', MyAdapter())\n\nThe mount call registers a specific instance of a Transport Adapter to a\nprefix. Once mounted, any HTTP request made using that session whose URL starts\nwith the given prefix will use the given Transport Adapter.\n\nMany of the details of implementing a Transport Adapter are beyond the scope of\nthis documentation, but take a look at the next example for a simple SSL use-\ncase. For more than that, you might look at subclassing\n``requests.adapters.BaseAdapter``.\n\nExample: Specific SSL Version\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Requests team has made a specific choice to use whatever SSL version is\ndefault in the underlying library (`urllib3`_). Normally this is fine, but from\ntime to time, you might find yourself needing to connect to a service-endpoint\nthat uses a version that isn't compatible with the default.\n\nYou can use Transport Adapters for this by taking most of the existing\nimplementation of HTTPAdapter, and adding a parameter *ssl_version* that gets\npassed-through to `urllib3`. We'll make a TA that instructs the library to use\nSSLv3:\n\n::\n\n import ssl\n\n from requests.adapters import HTTPAdapter\n from requests.packages.urllib3.poolmanager import PoolManager\n\n\n class Ssl3HttpAdapter(HTTPAdapter):\n \"\"\"\"Transport adapter\" that allows us to use SSLv3.\"\"\"\n\n def init_poolmanager(self, connections, maxsize, block=False):\n self.poolmanager = PoolManager(num_pools=connections,\n maxsize=maxsize,\n block=block,\n ssl_version=ssl.PROTOCOL_SSLv3)\n\n.. _`described here`: http://www.kennethreitz.org/essays/the-future-of-python-http\n.. _`urllib3`: https://github.com/shazow/urllib3\n\nBlocking Or Non-Blocking?\n-------------------------\n\nWith the default Transport Adapter in place, Requests does not provide any kind\nof non-blocking IO. The :attr:`Response.content `\nproperty will block until the entire response has been downloaded. If\nyou require more granularity, the streaming features of the library (see\n:ref:`streaming-requests`) allow you to retrieve smaller quantities of the\nresponse at a time. However, these calls will still block.\n\nIf you are concerned about the use of blocking IO, there are lots of projects\nout there that combine Requests with one of Python's asynchronicity frameworks.\nTwo excellent examples are `grequests`_ and `requests-futures`_.\n\n.. _`grequests`: https://github.com/kennethreitz/grequests\n.. _`requests-futures`: https://github.com/ross/requests-futures\n"},{"col":0,"comment":"Return an iterator over the values of a dictionary.","endLoc":269,"header":"def itervalues(d)","id":1415,"name":"itervalues","nodeType":"Function","startLoc":267,"text":"def itervalues(d):\n \"\"\"Return an iterator over the values of a dictionary.\"\"\"\n return iter(getattr(d, _itervalues)())"},{"className":"RecentlyUsedContainer","col":0,"comment":"\n Provides a thread-safe dict-like container which maintains up to\n ``maxsize`` keys while throwing away the least-recently-used keys beyond\n ``maxsize``.\n\n :param maxsize:\n Maximum number of recent elements to retain.\n\n :param dispose_func:\n Every time an item is evicted from the container,\n ``dispose_func(value)`` is called. Callback which will get called\n ","endLoc":98,"id":1416,"nodeType":"Class","startLoc":26,"text":"class RecentlyUsedContainer(MutableMapping):\n \"\"\"\n Provides a thread-safe dict-like container which maintains up to\n ``maxsize`` keys while throwing away the least-recently-used keys beyond\n ``maxsize``.\n\n :param maxsize:\n Maximum number of recent elements to retain.\n\n :param dispose_func:\n Every time an item is evicted from the container,\n ``dispose_func(value)`` is called. Callback which will get called\n \"\"\"\n\n ContainerCls = OrderedDict\n\n def __init__(self, maxsize=10, dispose_func=None):\n self._maxsize = maxsize\n self.dispose_func = dispose_func\n\n self._container = self.ContainerCls()\n self.lock = RLock()\n\n def __getitem__(self, key):\n # Re-insert the item, moving it to the end of the eviction line.\n with self.lock:\n item = self._container.pop(key)\n self._container[key] = item\n return item\n\n def __setitem__(self, key, value):\n evicted_value = _Null\n with self.lock:\n # Possibly evict the existing value of 'key'\n evicted_value = self._container.get(key, _Null)\n self._container[key] = value\n\n # If we didn't evict an existing value, we might have to evict the\n # least recently used item from the beginning of the container.\n if len(self._container) > self._maxsize:\n _key, evicted_value = self._container.popitem(last=False)\n\n if self.dispose_func and evicted_value is not _Null:\n self.dispose_func(evicted_value)\n\n def __delitem__(self, key):\n with self.lock:\n value = self._container.pop(key)\n\n if self.dispose_func:\n self.dispose_func(value)\n\n def __len__(self):\n with self.lock:\n return len(self._container)\n\n def __iter__(self):\n raise NotImplementedError('Iteration over this class is unlikely to be threadsafe.')\n\n def clear(self):\n with self.lock:\n # Copy pointers to all values, then wipe the mapping\n # under Python 2, this copies the list of values twice :-|\n values = list(self._container.values())\n self._container.clear()\n\n if self.dispose_func:\n for value in values:\n self.dispose_func(value)\n\n def keys(self):\n with self.lock:\n return self._container.keys()"},{"col":4,"comment":"null","endLoc":54,"header":"def __getitem__(self, key)","id":1417,"name":"__getitem__","nodeType":"Function","startLoc":49,"text":"def __getitem__(self, key):\n # Re-insert the item, moving it to the end of the eviction line.\n with self.lock:\n item = self._container.pop(key)\n self._container[key] = item\n return item"},{"fileName":"jpcntx.py","filePath":"requests/packages/chardet","id":1418,"nodeType":"File","text":"######################## BEGIN LICENSE BLOCK ########################\n# The Original Code is Mozilla Communicator client code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 1998\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n# Mark Pilgrim - port to Python\n#\n# This library is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public\n# License as published by the Free Software Foundation; either\n# version 2.1 of the License, or (at your option) any later version.\n#\n# This library is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n# Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this library; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n# 02110-1301 USA\n######################### END LICENSE BLOCK #########################\n\nfrom .compat import wrap_ord\n\nNUM_OF_CATEGORY = 6\nDONT_KNOW = -1\nENOUGH_REL_THRESHOLD = 100\nMAX_REL_THRESHOLD = 1000\nMINIMUM_DATA_THRESHOLD = 4\n\n# This is hiragana 2-char sequence table, the number in each cell represents its frequency category\njp2CharContext = (\n(0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1),\n(2,4,0,4,0,3,0,4,0,3,4,4,4,2,4,3,3,4,3,2,3,3,4,2,3,3,3,2,4,1,4,3,3,1,5,4,3,4,3,4,3,5,3,0,3,5,4,2,0,3,1,0,3,3,0,3,3,0,1,1,0,4,3,0,3,3,0,4,0,2,0,3,5,5,5,5,4,0,4,1,0,3,4),\n(0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0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3,5,3,3,2,4,2,4,3,4,3,1,4,0,2,3,4,4,4,3,3,3,4,4,4,3,4,1,3,4,3,2,1,2,1,3,3,3,4,4,3,3,5,0,4,0,3,0,4,3,3,3,2,1,0,3,0,0,3,3),\n(0,4,0,3,0,3,0,3,0,3,5,5,3,3,3,3,4,3,4,3,3,3,4,4,4,3,3,3,3,4,3,5,3,3,1,3,2,4,5,5,5,5,4,3,4,5,5,3,2,2,3,3,3,3,2,3,3,1,2,3,2,4,3,3,3,4,0,4,0,2,0,4,3,2,2,1,2,0,3,0,0,4,1),\n)\n\nclass JapaneseContextAnalysis:\n def __init__(self):\n self.reset()\n\n def reset(self):\n self._mTotalRel = 0 # total sequence received\n # category counters, each interger counts sequence in its category\n self._mRelSample = [0] * NUM_OF_CATEGORY\n # if last byte in current buffer is not the last byte of a character,\n # we need to know how many bytes to skip in next buffer\n self._mNeedToSkipCharNum = 0\n self._mLastCharOrder = -1 # The order of previous char\n # If this flag is set to True, detection is done and conclusion has\n # been made\n self._mDone = False\n\n def feed(self, aBuf, aLen):\n if self._mDone:\n return\n\n # The buffer we got is byte oriented, and a character may span in more than one\n # buffers. In case the last one or two byte in last buffer is not\n # complete, we record how many byte needed to complete that character\n # and skip these bytes here. We can choose to record those bytes as\n # well and analyse the character once it is complete, but since a\n # character will not make much difference, by simply skipping\n # this character will simply our logic and improve performance.\n i = self._mNeedToSkipCharNum\n while i < aLen:\n order, charLen = self.get_order(aBuf[i:i + 2])\n i += charLen\n if i > aLen:\n self._mNeedToSkipCharNum = i - aLen\n self._mLastCharOrder = -1\n else:\n if (order != -1) and (self._mLastCharOrder != -1):\n self._mTotalRel += 1\n if self._mTotalRel > MAX_REL_THRESHOLD:\n self._mDone = True\n break\n self._mRelSample[jp2CharContext[self._mLastCharOrder][order]] += 1\n self._mLastCharOrder = order\n\n def got_enough_data(self):\n return self._mTotalRel > ENOUGH_REL_THRESHOLD\n\n def get_confidence(self):\n # This is just one way to calculate confidence. It works well for me.\n if self._mTotalRel > MINIMUM_DATA_THRESHOLD:\n return (self._mTotalRel - self._mRelSample[0]) / self._mTotalRel\n else:\n return DONT_KNOW\n\n def get_order(self, aBuf):\n return -1, 1\n\nclass SJISContextAnalysis(JapaneseContextAnalysis):\n def get_order(self, aBuf):\n if not aBuf:\n return -1, 1\n # find out current char's byte length\n first_char = wrap_ord(aBuf[0])\n if ((0x81 <= first_char <= 0x9F) or (0xE0 <= first_char <= 0xFC)):\n charLen = 2\n else:\n charLen = 1\n\n # return its order if it is hiragana\n if len(aBuf) > 1:\n second_char = wrap_ord(aBuf[1])\n if (first_char == 202) and (0x9F <= second_char <= 0xF1):\n return second_char - 0x9F, charLen\n\n return -1, charLen\n\nclass EUCJPContextAnalysis(JapaneseContextAnalysis):\n def get_order(self, aBuf):\n if not aBuf:\n return -1, 1\n # find out current char's byte length\n first_char = wrap_ord(aBuf[0])\n if (first_char == 0x8E) or (0xA1 <= first_char <= 0xFE):\n charLen = 2\n elif first_char == 0x8F:\n charLen = 3\n else:\n charLen = 1\n\n # return its order if it is hiragana\n if len(aBuf) > 1:\n second_char = wrap_ord(aBuf[1])\n if (first_char == 0xA4) and (0xA1 <= second_char <= 0xF3):\n return second_char - 0xA1, charLen\n\n return -1, charLen\n\n# flake8: noqa\n"},{"className":"JapaneseContextAnalysis","col":0,"comment":"null","endLoc":177,"id":1419,"nodeType":"Class","startLoc":123,"text":"class JapaneseContextAnalysis:\n def __init__(self):\n self.reset()\n\n def reset(self):\n self._mTotalRel = 0 # total sequence received\n # category counters, each interger counts sequence in its category\n self._mRelSample = [0] * NUM_OF_CATEGORY\n # if last byte in current buffer is not the last byte of a character,\n # we need to know how many bytes to skip in next buffer\n self._mNeedToSkipCharNum = 0\n self._mLastCharOrder = -1 # The order of previous char\n # If this flag is set to True, detection is done and conclusion has\n # been made\n self._mDone = False\n\n def feed(self, aBuf, aLen):\n if self._mDone:\n return\n\n # The buffer we got is byte oriented, and a character may span in more than one\n # buffers. In case the last one or two byte in last buffer is not\n # complete, we record how many byte needed to complete that character\n # and skip these bytes here. We can choose to record those bytes as\n # well and analyse the character once it is complete, but since a\n # character will not make much difference, by simply skipping\n # this character will simply our logic and improve performance.\n i = self._mNeedToSkipCharNum\n while i < aLen:\n order, charLen = self.get_order(aBuf[i:i + 2])\n i += charLen\n if i > aLen:\n self._mNeedToSkipCharNum = i - aLen\n self._mLastCharOrder = -1\n else:\n if (order != -1) and (self._mLastCharOrder != -1):\n self._mTotalRel += 1\n if self._mTotalRel > MAX_REL_THRESHOLD:\n self._mDone = True\n break\n self._mRelSample[jp2CharContext[self._mLastCharOrder][order]] += 1\n self._mLastCharOrder = order\n\n def got_enough_data(self):\n return self._mTotalRel > ENOUGH_REL_THRESHOLD\n\n def get_confidence(self):\n # This is just one way to calculate confidence. It works well for me.\n if self._mTotalRel > MINIMUM_DATA_THRESHOLD:\n return (self._mTotalRel - self._mRelSample[0]) / self._mTotalRel\n else:\n return DONT_KNOW\n\n def get_order(self, aBuf):\n return -1, 1"},{"col":4,"comment":"null","endLoc":125,"header":"def __init__(self)","id":1420,"name":"__init__","nodeType":"Function","startLoc":124,"text":"def __init__(self):\n self.reset()"},{"col":4,"comment":"null","endLoc":137,"header":"def reset(self)","id":1421,"name":"reset","nodeType":"Function","startLoc":127,"text":"def reset(self):\n self._mTotalRel = 0 # total sequence received\n # category counters, each interger counts sequence in its category\n self._mRelSample = [0] * NUM_OF_CATEGORY\n # if last byte in current buffer is not the last byte of a character,\n # we need to know how many bytes to skip in next buffer\n self._mNeedToSkipCharNum = 0\n self._mLastCharOrder = -1 # The order of previous char\n # If this flag is set to True, detection is done and conclusion has\n # been made\n self._mDone = False"},{"col":4,"comment":"null","endLoc":164,"header":"def feed(self, aBuf, aLen)","id":1422,"name":"feed","nodeType":"Function","startLoc":139,"text":"def feed(self, aBuf, aLen):\n if self._mDone:\n return\n\n # The buffer we got is byte oriented, and a character may span in more than one\n # buffers. In case the last one or two byte in last buffer is not\n # complete, we record how many byte needed to complete that character\n # and skip these bytes here. We can choose to record those bytes as\n # well and analyse the character once it is complete, but since a\n # character will not make much difference, by simply skipping\n # this character will simply our logic and improve performance.\n i = self._mNeedToSkipCharNum\n while i < aLen:\n order, charLen = self.get_order(aBuf[i:i + 2])\n i += charLen\n if i > aLen:\n self._mNeedToSkipCharNum = i - aLen\n self._mLastCharOrder = -1\n else:\n if (order != -1) and (self._mLastCharOrder != -1):\n self._mTotalRel += 1\n if self._mTotalRel > MAX_REL_THRESHOLD:\n self._mDone = True\n break\n self._mRelSample[jp2CharContext[self._mLastCharOrder][order]] += 1\n self._mLastCharOrder = order"},{"col":4,"comment":"null","endLoc":177,"header":"def get_order(self, aBuf)","id":1423,"name":"get_order","nodeType":"Function","startLoc":176,"text":"def get_order(self, aBuf):\n return -1, 1"},{"col":4,"comment":"null","endLoc":167,"header":"def got_enough_data(self)","id":1424,"name":"got_enough_data","nodeType":"Function","startLoc":166,"text":"def got_enough_data(self):\n return self._mTotalRel > ENOUGH_REL_THRESHOLD"},{"col":4,"comment":"null","endLoc":174,"header":"def get_confidence(self)","id":1425,"name":"get_confidence","nodeType":"Function","startLoc":169,"text":"def get_confidence(self):\n # This is just one way to calculate confidence. It works well for me.\n if self._mTotalRel > MINIMUM_DATA_THRESHOLD:\n return (self._mTotalRel - self._mRelSample[0]) / self._mTotalRel\n else:\n return DONT_KNOW"},{"attributeType":"int","col":8,"comment":"null","endLoc":133,"id":1426,"name":"_mNeedToSkipCharNum","nodeType":"Attribute","startLoc":133,"text":"self._mNeedToSkipCharNum"},{"attributeType":"int","col":8,"comment":"null","endLoc":128,"id":1427,"name":"_mTotalRel","nodeType":"Attribute","startLoc":128,"text":"self._mTotalRel"},{"attributeType":"list","col":8,"comment":"null","endLoc":130,"id":1428,"name":"_mRelSample","nodeType":"Attribute","startLoc":130,"text":"self._mRelSample"},{"attributeType":"bool","col":8,"comment":"null","endLoc":137,"id":1429,"name":"_mDone","nodeType":"Attribute","startLoc":137,"text":"self._mDone"},{"attributeType":"int","col":8,"comment":"null","endLoc":134,"id":1430,"name":"_mLastCharOrder","nodeType":"Attribute","startLoc":134,"text":"self._mLastCharOrder"},{"className":"SJISContextAnalysis","col":0,"comment":"null","endLoc":196,"id":1431,"nodeType":"Class","startLoc":179,"text":"class SJISContextAnalysis(JapaneseContextAnalysis):\n def get_order(self, aBuf):\n if not aBuf:\n return -1, 1\n # find out current char's byte length\n first_char = wrap_ord(aBuf[0])\n if ((0x81 <= first_char <= 0x9F) or (0xE0 <= first_char <= 0xFC)):\n charLen = 2\n else:\n charLen = 1\n\n # return its order if it is hiragana\n if len(aBuf) > 1:\n second_char = wrap_ord(aBuf[1])\n if (first_char == 202) and (0x9F <= second_char <= 0xF1):\n return second_char - 0x9F, charLen\n\n return -1, charLen"},{"col":4,"comment":"null","endLoc":69,"header":"def __setitem__(self, key, value)","id":1432,"name":"__setitem__","nodeType":"Function","startLoc":56,"text":"def __setitem__(self, key, value):\n evicted_value = _Null\n with self.lock:\n # Possibly evict the existing value of 'key'\n evicted_value = self._container.get(key, _Null)\n self._container[key] = value\n\n # If we didn't evict an existing value, we might have to evict the\n # least recently used item from the beginning of the container.\n if len(self._container) > self._maxsize:\n _key, evicted_value = self._container.popitem(last=False)\n\n if self.dispose_func and evicted_value is not _Null:\n self.dispose_func(evicted_value)"},{"col":4,"comment":"null","endLoc":196,"header":"def get_order(self, aBuf)","id":1433,"name":"get_order","nodeType":"Function","startLoc":180,"text":"def get_order(self, aBuf):\n if not aBuf:\n return -1, 1\n # find out current char's byte length\n first_char = wrap_ord(aBuf[0])\n if ((0x81 <= first_char <= 0x9F) or (0xE0 <= first_char <= 0xFC)):\n charLen = 2\n else:\n charLen = 1\n\n # return its order if it is hiragana\n if len(aBuf) > 1:\n second_char = wrap_ord(aBuf[1])\n if (first_char == 202) and (0x9F <= second_char <= 0xF1):\n return second_char - 0x9F, charLen\n\n return -1, charLen"},{"className":"EUCJPContextAnalysis","col":0,"comment":"null","endLoc":217,"id":1434,"nodeType":"Class","startLoc":198,"text":"class EUCJPContextAnalysis(JapaneseContextAnalysis):\n def get_order(self, aBuf):\n if not aBuf:\n return -1, 1\n # find out current char's byte length\n first_char = wrap_ord(aBuf[0])\n if (first_char == 0x8E) or (0xA1 <= first_char <= 0xFE):\n charLen = 2\n elif first_char == 0x8F:\n charLen = 3\n else:\n charLen = 1\n\n # return its order if it is hiragana\n if len(aBuf) > 1:\n second_char = wrap_ord(aBuf[1])\n if (first_char == 0xA4) and (0xA1 <= second_char <= 0xF3):\n return second_char - 0xA1, charLen\n\n return -1, charLen"},{"col":4,"comment":"null","endLoc":217,"header":"def get_order(self, aBuf)","id":1435,"name":"get_order","nodeType":"Function","startLoc":199,"text":"def get_order(self, aBuf):\n if not aBuf:\n return -1, 1\n # find out current char's byte length\n first_char = wrap_ord(aBuf[0])\n if (first_char == 0x8E) or (0xA1 <= first_char <= 0xFE):\n charLen = 2\n elif first_char == 0x8F:\n charLen = 3\n else:\n charLen = 1\n\n # return its order if it is hiragana\n if len(aBuf) > 1:\n second_char = wrap_ord(aBuf[1])\n if (first_char == 0xA4) and (0xA1 <= second_char <= 0xF3):\n return second_char - 0xA1, charLen\n\n return -1, charLen"},{"attributeType":"int","col":0,"comment":"null","endLoc":30,"id":1436,"name":"NUM_OF_CATEGORY","nodeType":"Attribute","startLoc":30,"text":"NUM_OF_CATEGORY"},{"attributeType":"int","col":0,"comment":"null","endLoc":31,"id":1437,"name":"DONT_KNOW","nodeType":"Attribute","startLoc":31,"text":"DONT_KNOW"},{"attributeType":"int","col":0,"comment":"null","endLoc":32,"id":1438,"name":"ENOUGH_REL_THRESHOLD","nodeType":"Attribute","startLoc":32,"text":"ENOUGH_REL_THRESHOLD"},{"attributeType":"int","col":0,"comment":"null","endLoc":33,"id":1439,"name":"MAX_REL_THRESHOLD","nodeType":"Attribute","startLoc":33,"text":"MAX_REL_THRESHOLD"},{"attributeType":"int","col":0,"comment":"null","endLoc":34,"id":1440,"name":"MINIMUM_DATA_THRESHOLD","nodeType":"Attribute","startLoc":34,"text":"MINIMUM_DATA_THRESHOLD"},{"attributeType":"((int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int), (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int))","col":0,"comment":"null","endLoc":37,"id":1441,"name":"jp2CharContext","nodeType":"Attribute","startLoc":37,"text":"jp2CharContext"},{"col":4,"comment":"null","endLoc":76,"header":"def __delitem__(self, key)","id":1442,"name":"__delitem__","nodeType":"Function","startLoc":71,"text":"def __delitem__(self, key):\n with self.lock:\n value = self._container.pop(key)\n\n if self.dispose_func:\n self.dispose_func(value)"},{"col":4,"comment":"null","endLoc":80,"header":"def __len__(self)","id":1443,"name":"__len__","nodeType":"Function","startLoc":78,"text":"def __len__(self):\n with self.lock:\n return len(self._container)"},{"col":4,"comment":"null","endLoc":83,"header":"def __iter__(self)","id":1444,"name":"__iter__","nodeType":"Function","startLoc":82,"text":"def __iter__(self):\n raise NotImplementedError('Iteration over this class is unlikely to be threadsafe.')"},{"col":4,"comment":"null","endLoc":94,"header":"def clear(self)","id":1445,"name":"clear","nodeType":"Function","startLoc":85,"text":"def clear(self):\n with self.lock:\n # Copy pointers to all values, then wipe the mapping\n # under Python 2, this copies the list of values twice :-|\n values = list(self._container.values())\n self._container.clear()\n\n if self.dispose_func:\n for value in values:\n self.dispose_func(value)"},{"col":4,"comment":"null","endLoc":98,"header":"def keys(self)","id":1446,"name":"keys","nodeType":"Function","startLoc":96,"text":"def keys(self):\n with self.lock:\n return self._container.keys()"},{"attributeType":"OrderedDict | OrderedDict","col":4,"comment":"null","endLoc":40,"id":1447,"name":"ContainerCls","nodeType":"Attribute","startLoc":40,"text":"ContainerCls"},{"attributeType":"OrderedDict | OrderedDict","col":8,"comment":"null","endLoc":46,"id":1448,"name":"_container","nodeType":"Attribute","startLoc":46,"text":"self._container"},{"attributeType":"null","col":8,"comment":"null","endLoc":44,"id":1449,"name":"dispose_func","nodeType":"Attribute","startLoc":44,"text":"self.dispose_func"},{"attributeType":"RLock | _RLock","col":8,"comment":"null","endLoc":47,"id":1450,"name":"lock","nodeType":"Attribute","startLoc":47,"text":"self.lock"},{"attributeType":"int","col":8,"comment":"null","endLoc":43,"id":1451,"name":"_maxsize","nodeType":"Attribute","startLoc":43,"text":"self._maxsize"},{"className":"HTTPHeaderDict","col":0,"comment":"\n :param headers:\n An iterable of field-value pairs. Must not contain multiple field names\n when compared case-insensitively.\n\n :param kwargs:\n Additional field-value pairs to pass in to ``dict.update``.\n\n A ``dict`` like container for storing HTTP Headers.\n\n Field names are stored and compared case-insensitively in compliance with\n RFC 7230. Iteration provides the first case-sensitive key seen for each\n case-insensitive pair.\n\n Using ``__setitem__`` syntax overwrites fields that compare equal\n case-insensitively in order to maintain ``dict``'s api. For fields that\n compare equal, instead create a new ``HTTPHeaderDict`` and use ``.add``\n in a loop.\n\n If multiple fields that are equal case-insensitively are passed to the\n constructor or ``.update``, the behavior is undefined and some will be\n lost.\n\n >>> headers = HTTPHeaderDict()\n >>> headers.add('Set-Cookie', 'foo=bar')\n >>> headers.add('set-cookie', 'baz=quxx')\n >>> headers['content-length'] = '7'\n >>> headers['SET-cookie']\n 'foo=bar, baz=quxx'\n >>> headers['Content-Length']\n '7'\n\n If you want to access the raw headers with their original casing\n for debugging purposes you can access the private ``._data`` attribute\n which is a normal python ``dict`` that maps the case-insensitive key to a\n list of tuples stored as (case-sensitive-original-name, value). Using the\n structure from above as our example:\n\n >>> headers._data\n {'set-cookie': [('Set-Cookie', 'foo=bar'), ('set-cookie', 'baz=quxx')],\n 'content-length': [('content-length', '7')]}\n ","endLoc":199,"id":1452,"nodeType":"Class","startLoc":101,"text":"class HTTPHeaderDict(MutableMapping):\n \"\"\"\n :param headers:\n An iterable of field-value pairs. Must not contain multiple field names\n when compared case-insensitively.\n\n :param kwargs:\n Additional field-value pairs to pass in to ``dict.update``.\n\n A ``dict`` like container for storing HTTP Headers.\n\n Field names are stored and compared case-insensitively in compliance with\n RFC 7230. Iteration provides the first case-sensitive key seen for each\n case-insensitive pair.\n\n Using ``__setitem__`` syntax overwrites fields that compare equal\n case-insensitively in order to maintain ``dict``'s api. For fields that\n compare equal, instead create a new ``HTTPHeaderDict`` and use ``.add``\n in a loop.\n\n If multiple fields that are equal case-insensitively are passed to the\n constructor or ``.update``, the behavior is undefined and some will be\n lost.\n\n >>> headers = HTTPHeaderDict()\n >>> headers.add('Set-Cookie', 'foo=bar')\n >>> headers.add('set-cookie', 'baz=quxx')\n >>> headers['content-length'] = '7'\n >>> headers['SET-cookie']\n 'foo=bar, baz=quxx'\n >>> headers['Content-Length']\n '7'\n\n If you want to access the raw headers with their original casing\n for debugging purposes you can access the private ``._data`` attribute\n which is a normal python ``dict`` that maps the case-insensitive key to a\n list of tuples stored as (case-sensitive-original-name, value). Using the\n structure from above as our example:\n\n >>> headers._data\n {'set-cookie': [('Set-Cookie', 'foo=bar'), ('set-cookie', 'baz=quxx')],\n 'content-length': [('content-length', '7')]}\n \"\"\"\n\n def __init__(self, headers=None, **kwargs):\n self._data = {}\n if headers is None:\n headers = {}\n self.update(headers, **kwargs)\n\n def add(self, key, value):\n \"\"\"Adds a (name, value) pair, doesn't overwrite the value if it already\n exists.\n\n >>> headers = HTTPHeaderDict(foo='bar')\n >>> headers.add('Foo', 'baz')\n >>> headers['foo']\n 'bar, baz'\n \"\"\"\n self._data.setdefault(key.lower(), []).append((key, value))\n\n def getlist(self, key):\n \"\"\"Returns a list of all the values for the named field. Returns an\n empty list if the key doesn't exist.\"\"\"\n return self[key].split(', ') if key in self else []\n\n def copy(self):\n h = HTTPHeaderDict()\n for key in self._data:\n for rawkey, value in self._data[key]:\n h.add(rawkey, value)\n return h\n\n def __eq__(self, other):\n if not isinstance(other, Mapping):\n return False\n other = HTTPHeaderDict(other)\n return dict((k1, self[k1]) for k1 in self._data) == \\\n dict((k2, other[k2]) for k2 in other._data)\n\n def __getitem__(self, key):\n values = self._data[key.lower()]\n return ', '.join(value[1] for value in values)\n\n def __setitem__(self, key, value):\n self._data[key.lower()] = [(key, value)]\n\n def __delitem__(self, key):\n del self._data[key.lower()]\n\n def __len__(self):\n return len(self._data)\n\n def __iter__(self):\n for headers in itervalues(self._data):\n yield headers[0][0]\n\n def __repr__(self):\n return '%s(%r)' % (self.__class__.__name__, dict(self.items()))"},{"col":4,"comment":"Adds a (name, value) pair, doesn't overwrite the value if it already\n exists.\n\n >>> headers = HTTPHeaderDict(foo='bar')\n >>> headers.add('Foo', 'baz')\n >>> headers['foo']\n 'bar, baz'\n ","endLoc":160,"header":"def add(self, key, value)","id":1453,"name":"add","nodeType":"Function","startLoc":151,"text":"def add(self, key, value):\n \"\"\"Adds a (name, value) pair, doesn't overwrite the value if it already\n exists.\n\n >>> headers = HTTPHeaderDict(foo='bar')\n >>> headers.add('Foo', 'baz')\n >>> headers['foo']\n 'bar, baz'\n \"\"\"\n self._data.setdefault(key.lower(), []).append((key, value))"},{"col":0,"comment":"","endLoc":28,"header":"jpcntx.py#","id":1454,"name":"","nodeType":"Function","startLoc":28,"text":"NUM_OF_CATEGORY = 6\n\nDONT_KNOW = -1\n\nENOUGH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0,3,1,4,3,4,0,4,3,3,3,2,3,2,5,3,4,3,2,2,3,0,0,3,0,2,1,0,1,2,0,0,0,0,2,1,1,3,1,0,2,0,4,0,3,4,4,4,5,2,0,2,0,0,1,3),\n(0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,0,0,1,1,0,0,0,4,2,1,1,0,1,0,3,2,0,0,3,1,1,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,1,0,0,0,2,0,0,0,1,4,0,4,2,1,0,0,0,0,0,1),\n(0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,0,0,0,3,1,0,0,0,2,0,2,1,0,0,1,2,1,0,1,1,0,0,3,0,0,0,0,0,0,0,0,0,0,0,1,3,1,0,0,0,0,0,1,0,0,2,1,0,0,0,0,0,0,0,0,2),\n(0,4,0,4,0,4,0,3,0,4,4,3,4,2,4,3,2,0,4,4,4,3,5,3,5,3,3,2,4,2,4,3,4,3,1,4,0,2,3,4,4,4,3,3,3,4,4,4,3,4,1,3,4,3,2,1,2,1,3,3,3,4,4,3,3,5,0,4,0,3,0,4,3,3,3,2,1,0,3,0,0,3,3),\n(0,4,0,3,0,3,0,3,0,3,5,5,3,3,3,3,4,3,4,3,3,3,4,4,4,3,3,3,3,4,3,5,3,3,1,3,2,4,5,5,5,5,4,3,4,5,5,3,2,2,3,3,3,3,2,3,3,1,2,3,2,4,3,3,3,4,0,4,0,2,0,4,3,2,2,1,2,0,3,0,0,4,1),\n)"},{"col":4,"comment":"Returns a list of all the values for the named field. Returns an\n empty list if the key doesn't exist.","endLoc":165,"header":"def getlist(self, key)","id":1455,"name":"getlist","nodeType":"Function","startLoc":162,"text":"def getlist(self, key):\n \"\"\"Returns a list of all the values for the named field. Returns an\n empty list if the key doesn't exist.\"\"\"\n return self[key].split(', ') if key in self else []"},{"col":4,"comment":"null","endLoc":172,"header":"def copy(self)","id":1456,"name":"copy","nodeType":"Function","startLoc":167,"text":"def copy(self):\n h = HTTPHeaderDict()\n for key in self._data:\n for rawkey, value in self._data[key]:\n h.add(rawkey, value)\n return h"},{"fileName":"escprober.py","filePath":"requests/packages/chardet","id":1457,"nodeType":"File","text":"######################## BEGIN LICENSE BLOCK ########################\n# The Original Code is mozilla.org code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 1998\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n# Mark Pilgrim - port to Python\n#\n# This library is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public\n# License as published by the Free Software Foundation; either\n# version 2.1 of the License, or (at your option) any later version.\n#\n# This library is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n# Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this library; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n# 02110-1301 USA\n######################### END LICENSE BLOCK #########################\n\nfrom . import constants\nfrom .escsm import (HZSMModel, ISO2022CNSMModel, ISO2022JPSMModel,\n ISO2022KRSMModel)\nfrom .charsetprober import CharSetProber\nfrom .codingstatemachine import CodingStateMachine\nfrom .compat import wrap_ord\n\n\nclass EscCharSetProber(CharSetProber):\n def __init__(self):\n CharSetProber.__init__(self)\n self._mCodingSM = [\n CodingStateMachine(HZSMModel),\n CodingStateMachine(ISO2022CNSMModel),\n CodingStateMachine(ISO2022JPSMModel),\n CodingStateMachine(ISO2022KRSMModel)\n ]\n self.reset()\n\n def reset(self):\n CharSetProber.reset(self)\n for codingSM in self._mCodingSM:\n if not codingSM:\n continue\n codingSM.active = True\n codingSM.reset()\n self._mActiveSM = len(self._mCodingSM)\n self._mDetectedCharset = None\n\n def get_charset_name(self):\n return self._mDetectedCharset\n\n def get_confidence(self):\n if self._mDetectedCharset:\n return 0.99\n else:\n return 0.00\n\n def feed(self, aBuf):\n for c in aBuf:\n # PY3K: aBuf is a byte array, so c is an int, not a byte\n for codingSM in self._mCodingSM:\n if not codingSM:\n continue\n if not codingSM.active:\n continue\n codingState = codingSM.next_state(wrap_ord(c))\n if codingState == constants.eError:\n codingSM.active = False\n self._mActiveSM -= 1\n if self._mActiveSM <= 0:\n self._mState = constants.eNotMe\n return self.get_state()\n elif codingState == constants.eItsMe:\n self._mState = constants.eFoundIt\n self._mDetectedCharset = codingSM.get_coding_state_machine() # nopep8\n return self.get_state()\n\n return self.get_state()\n"},{"attributeType":"null","col":0,"comment":"null","endLoc":76,"id":1458,"name":"HZSMModel","nodeType":"Attribute","startLoc":76,"text":"HZSMModel"},{"col":4,"comment":"null","endLoc":179,"header":"def __eq__(self, other)","id":1459,"name":"__eq__","nodeType":"Function","startLoc":174,"text":"def __eq__(self, other):\n if not isinstance(other, Mapping):\n return False\n other = HTTPHeaderDict(other)\n return dict((k1, self[k1]) for k1 in self._data) == \\\n dict((k2, other[k2]) for k2 in other._data)"},{"attributeType":"null","col":0,"comment":"null","endLoc":130,"id":1460,"name":"ISO2022CNSMModel","nodeType":"Attribute","startLoc":130,"text":"ISO2022CNSMModel"},{"attributeType":"null","col":0,"comment":"null","endLoc":185,"id":1461,"name":"ISO2022JPSMModel","nodeType":"Attribute","startLoc":185,"text":"ISO2022JPSMModel"},{"attributeType":"null","col":0,"comment":"null","endLoc":236,"id":1462,"name":"ISO2022KRSMModel","nodeType":"Attribute","startLoc":236,"text":"ISO2022KRSMModel"},{"className":"EscCharSetProber","col":0,"comment":"null","endLoc":86,"id":1463,"nodeType":"Class","startLoc":36,"text":"class EscCharSetProber(CharSetProber):\n def __init__(self):\n CharSetProber.__init__(self)\n self._mCodingSM = [\n CodingStateMachine(HZSMModel),\n CodingStateMachine(ISO2022CNSMModel),\n CodingStateMachine(ISO2022JPSMModel),\n CodingStateMachine(ISO2022KRSMModel)\n ]\n self.reset()\n\n def reset(self):\n CharSetProber.reset(self)\n for codingSM in self._mCodingSM:\n if not codingSM:\n continue\n codingSM.active = True\n codingSM.reset()\n self._mActiveSM = len(self._mCodingSM)\n self._mDetectedCharset = None\n\n def get_charset_name(self):\n return self._mDetectedCharset\n\n def get_confidence(self):\n if self._mDetectedCharset:\n return 0.99\n else:\n return 0.00\n\n def feed(self, aBuf):\n for c in aBuf:\n # PY3K: aBuf is a byte array, so c is an int, not a byte\n for codingSM in self._mCodingSM:\n if not codingSM:\n continue\n if not codingSM.active:\n continue\n codingState = codingSM.next_state(wrap_ord(c))\n if codingState == constants.eError:\n codingSM.active = False\n self._mActiveSM -= 1\n if self._mActiveSM <= 0:\n self._mState = constants.eNotMe\n return self.get_state()\n elif codingState == constants.eItsMe:\n self._mState = constants.eFoundIt\n self._mDetectedCharset = codingSM.get_coding_state_machine() # nopep8\n return self.get_state()\n\n return self.get_state()"},{"col":4,"comment":"null","endLoc":45,"header":"def __init__(self)","id":1464,"name":"__init__","nodeType":"Function","startLoc":37,"text":"def __init__(self):\n CharSetProber.__init__(self)\n self._mCodingSM = [\n CodingStateMachine(HZSMModel),\n CodingStateMachine(ISO2022CNSMModel),\n CodingStateMachine(ISO2022JPSMModel),\n CodingStateMachine(ISO2022KRSMModel)\n ]\n self.reset()"},{"col":4,"comment":"null","endLoc":55,"header":"def reset(self)","id":1465,"name":"reset","nodeType":"Function","startLoc":47,"text":"def reset(self):\n CharSetProber.reset(self)\n for codingSM in self._mCodingSM:\n if not codingSM:\n continue\n codingSM.active = True\n codingSM.reset()\n self._mActiveSM = len(self._mCodingSM)\n self._mDetectedCharset = None"},{"col":4,"comment":"null","endLoc":58,"header":"def get_charset_name(self)","id":1466,"name":"get_charset_name","nodeType":"Function","startLoc":57,"text":"def get_charset_name(self):\n return self._mDetectedCharset"},{"col":4,"comment":"null","endLoc":64,"header":"def get_confidence(self)","id":1467,"name":"get_confidence","nodeType":"Function","startLoc":60,"text":"def get_confidence(self):\n if self._mDetectedCharset:\n return 0.99\n else:\n return 0.00"},{"col":4,"comment":"null","endLoc":86,"header":"def feed(self, aBuf)","id":1468,"name":"feed","nodeType":"Function","startLoc":66,"text":"def feed(self, aBuf):\n for c in aBuf:\n # PY3K: aBuf is a byte array, so c is an int, not a byte\n for codingSM in self._mCodingSM:\n if not codingSM:\n continue\n if not codingSM.active:\n continue\n codingState = codingSM.next_state(wrap_ord(c))\n if codingState == constants.eError:\n codingSM.active = False\n self._mActiveSM -= 1\n if self._mActiveSM <= 0:\n self._mState = constants.eNotMe\n return self.get_state()\n elif codingState == constants.eItsMe:\n self._mState = constants.eFoundIt\n self._mDetectedCharset = codingSM.get_coding_state_machine() # nopep8\n return self.get_state()\n\n return self.get_state()"},{"col":4,"comment":"null","endLoc":183,"header":"def __getitem__(self, key)","id":1469,"name":"__getitem__","nodeType":"Function","startLoc":181,"text":"def __getitem__(self, key):\n values = self._data[key.lower()]\n return ', '.join(value[1] for value in values)"},{"attributeType":"list","col":8,"comment":"null","endLoc":39,"id":1470,"name":"_mCodingSM","nodeType":"Attribute","startLoc":39,"text":"self._mCodingSM"},{"attributeType":"int","col":8,"comment":"null","endLoc":54,"id":1471,"name":"_mActiveSM","nodeType":"Attribute","startLoc":54,"text":"self._mActiveSM"},{"attributeType":"None","col":8,"comment":"null","endLoc":55,"id":1472,"name":"_mDetectedCharset","nodeType":"Attribute","startLoc":55,"text":"self._mDetectedCharset"},{"attributeType":"null","col":24,"comment":"null","endLoc":79,"id":1473,"name":"_mState","nodeType":"Attribute","startLoc":79,"text":"self._mState"},{"col":4,"comment":"null","endLoc":186,"header":"def __setitem__(self, key, value)","id":1474,"name":"__setitem__","nodeType":"Function","startLoc":185,"text":"def __setitem__(self, key, value):\n self._data[key.lower()] = [(key, value)]"},{"col":4,"comment":"null","endLoc":189,"header":"def __delitem__(self, key)","id":1475,"name":"__delitem__","nodeType":"Function","startLoc":188,"text":"def __delitem__(self, key):\n del self._data[key.lower()]"},{"col":4,"comment":"null","endLoc":192,"header":"def __len__(self)","id":1476,"name":"__len__","nodeType":"Function","startLoc":191,"text":"def __len__(self):\n return len(self._data)"},{"col":4,"comment":"null","endLoc":196,"header":"def __iter__(self)","id":1477,"name":"__iter__","nodeType":"Function","startLoc":194,"text":"def __iter__(self):\n for headers in itervalues(self._data):\n yield headers[0][0]"},{"col":4,"comment":"null","endLoc":199,"header":"def __repr__(self)","id":1478,"name":"__repr__","nodeType":"Function","startLoc":198,"text":"def __repr__(self):\n return '%s(%r)' % (self.__class__.__name__, dict(self.items()))"},{"attributeType":"TypedDict","col":8,"comment":"null","endLoc":146,"id":1479,"name":"_data","nodeType":"Attribute","startLoc":146,"text":"self._data"},{"attributeType":"null","col":0,"comment":"null","endLoc":20,"id":1480,"name":"__all__","nodeType":"Attribute","startLoc":20,"text":"__all__"},{"attributeType":"object","col":0,"comment":"null","endLoc":23,"id":1481,"name":"_Null","nodeType":"Attribute","startLoc":23,"text":"_Null"},{"col":0,"comment":"","endLoc":1,"header":"_collections.py#","id":1482,"name":"","nodeType":"Function","startLoc":1,"text":"try:\n from threading import RLock\nexcept ImportError: # Platform-specific: No threads available\n class RLock:\n def __enter__(self):\n pass\n\n def __exit__(self, exc_type, exc_value, traceback):\n pass\n\ntry: # Python 2.7+\n from collections import OrderedDict\nexcept ImportError:\n from .packages.ordered_dict import OrderedDict\n\n__all__ = ['RecentlyUsedContainer', 'HTTPHeaderDict']\n\n_Null = object()"},{"fileName":"mbcssm.py","filePath":"requests/packages/chardet","id":1483,"nodeType":"File","text":"######################## BEGIN LICENSE BLOCK ########################\n# The Original Code is mozilla.org code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 1998\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n# Mark Pilgrim - port to Python\n#\n# This library is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public\n# License as published by the Free Software Foundation; either\n# version 2.1 of the License, or (at your option) any later version.\n#\n# This library is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n# Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this library; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n# 02110-1301 USA\n######################### END LICENSE BLOCK #########################\n\nfrom .constants import eStart, eError, eItsMe\n\n# BIG5\n\nBIG5_cls = (\n 1,1,1,1,1,1,1,1, # 00 - 07 #allow 0x00 as legal value\n 1,1,1,1,1,1,0,0, # 08 - 0f\n 1,1,1,1,1,1,1,1, # 10 - 17\n 1,1,1,0,1,1,1,1, # 18 - 1f\n 1,1,1,1,1,1,1,1, # 20 - 27\n 1,1,1,1,1,1,1,1, # 28 - 2f\n 1,1,1,1,1,1,1,1, # 30 - 37\n 1,1,1,1,1,1,1,1, # 38 - 3f\n 2,2,2,2,2,2,2,2, # 40 - 47\n 2,2,2,2,2,2,2,2, # 48 - 4f\n 2,2,2,2,2,2,2,2, # 50 - 57\n 2,2,2,2,2,2,2,2, # 58 - 5f\n 2,2,2,2,2,2,2,2, # 60 - 67\n 2,2,2,2,2,2,2,2, # 68 - 6f\n 2,2,2,2,2,2,2,2, # 70 - 77\n 2,2,2,2,2,2,2,1, # 78 - 7f\n 4,4,4,4,4,4,4,4, # 80 - 87\n 4,4,4,4,4,4,4,4, # 88 - 8f\n 4,4,4,4,4,4,4,4, # 90 - 97\n 4,4,4,4,4,4,4,4, # 98 - 9f\n 4,3,3,3,3,3,3,3, # a0 - a7\n 3,3,3,3,3,3,3,3, # a8 - af\n 3,3,3,3,3,3,3,3, # b0 - b7\n 3,3,3,3,3,3,3,3, # b8 - bf\n 3,3,3,3,3,3,3,3, # c0 - c7\n 3,3,3,3,3,3,3,3, # c8 - cf\n 3,3,3,3,3,3,3,3, # d0 - d7\n 3,3,3,3,3,3,3,3, # d8 - df\n 3,3,3,3,3,3,3,3, # e0 - e7\n 3,3,3,3,3,3,3,3, # e8 - ef\n 3,3,3,3,3,3,3,3, # f0 - f7\n 3,3,3,3,3,3,3,0 # f8 - ff\n)\n\nBIG5_st = (\n eError,eStart,eStart, 3,eError,eError,eError,eError,#00-07\n eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eError,#08-0f\n eError,eStart,eStart,eStart,eStart,eStart,eStart,eStart#10-17\n)\n\nBig5CharLenTable = (0, 1, 1, 2, 0)\n\nBig5SMModel = {'classTable': BIG5_cls,\n 'classFactor': 5,\n 'stateTable': BIG5_st,\n 'charLenTable': Big5CharLenTable,\n 'name': 'Big5'}\n\n# CP949\n\nCP949_cls = (\n 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,0,0, # 00 - 0f\n 1,1,1,1,1,1,1,1, 1,1,1,0,1,1,1,1, # 10 - 1f\n 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, # 20 - 2f\n 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, # 30 - 3f\n 1,4,4,4,4,4,4,4, 4,4,4,4,4,4,4,4, # 40 - 4f\n 4,4,5,5,5,5,5,5, 5,5,5,1,1,1,1,1, # 50 - 5f\n 1,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5, # 60 - 6f\n 5,5,5,5,5,5,5,5, 5,5,5,1,1,1,1,1, # 70 - 7f\n 0,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, # 80 - 8f\n 6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, # 90 - 9f\n 6,7,7,7,7,7,7,7, 7,7,7,7,7,8,8,8, # a0 - af\n 7,7,7,7,7,7,7,7, 7,7,7,7,7,7,7,7, # b0 - bf\n 7,7,7,7,7,7,9,2, 2,3,2,2,2,2,2,2, # c0 - cf\n 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, # d0 - df\n 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, # e0 - ef\n 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,0, # f0 - ff\n)\n\nCP949_st = (\n#cls= 0 1 2 3 4 5 6 7 8 9 # previous state =\n eError,eStart, 3,eError,eStart,eStart, 4, 5,eError, 6, # eStart\n eError,eError,eError,eError,eError,eError,eError,eError,eError,eError, # eError\n eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe, # eItsMe\n eError,eError,eStart,eStart,eError,eError,eError,eStart,eStart,eStart, # 3\n eError,eError,eStart,eStart,eStart,eStart,eStart,eStart,eStart,eStart, # 4\n eError,eStart,eStart,eStart,eStart,eStart,eStart,eStart,eStart,eStart, # 5\n eError,eStart,eStart,eStart,eStart,eError,eError,eStart,eStart,eStart, # 6\n)\n\nCP949CharLenTable = (0, 1, 2, 0, 1, 1, 2, 2, 0, 2)\n\nCP949SMModel = {'classTable': CP949_cls,\n 'classFactor': 10,\n 'stateTable': CP949_st,\n 'charLenTable': CP949CharLenTable,\n 'name': 'CP949'}\n\n# EUC-JP\n\nEUCJP_cls = (\n 4,4,4,4,4,4,4,4, # 00 - 07\n 4,4,4,4,4,4,5,5, # 08 - 0f\n 4,4,4,4,4,4,4,4, # 10 - 17\n 4,4,4,5,4,4,4,4, # 18 - 1f\n 4,4,4,4,4,4,4,4, # 20 - 27\n 4,4,4,4,4,4,4,4, # 28 - 2f\n 4,4,4,4,4,4,4,4, # 30 - 37\n 4,4,4,4,4,4,4,4, # 38 - 3f\n 4,4,4,4,4,4,4,4, # 40 - 47\n 4,4,4,4,4,4,4,4, # 48 - 4f\n 4,4,4,4,4,4,4,4, # 50 - 57\n 4,4,4,4,4,4,4,4, # 58 - 5f\n 4,4,4,4,4,4,4,4, # 60 - 67\n 4,4,4,4,4,4,4,4, # 68 - 6f\n 4,4,4,4,4,4,4,4, # 70 - 77\n 4,4,4,4,4,4,4,4, # 78 - 7f\n 5,5,5,5,5,5,5,5, # 80 - 87\n 5,5,5,5,5,5,1,3, # 88 - 8f\n 5,5,5,5,5,5,5,5, # 90 - 97\n 5,5,5,5,5,5,5,5, # 98 - 9f\n 5,2,2,2,2,2,2,2, # a0 - a7\n 2,2,2,2,2,2,2,2, # a8 - af\n 2,2,2,2,2,2,2,2, # b0 - b7\n 2,2,2,2,2,2,2,2, # b8 - bf\n 2,2,2,2,2,2,2,2, # c0 - c7\n 2,2,2,2,2,2,2,2, # c8 - cf\n 2,2,2,2,2,2,2,2, # d0 - d7\n 2,2,2,2,2,2,2,2, # d8 - df\n 0,0,0,0,0,0,0,0, # e0 - e7\n 0,0,0,0,0,0,0,0, # e8 - ef\n 0,0,0,0,0,0,0,0, # f0 - f7\n 0,0,0,0,0,0,0,5 # f8 - ff\n)\n\nEUCJP_st = (\n 3, 4, 3, 5,eStart,eError,eError,eError,#00-07\n eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,#08-0f\n eItsMe,eItsMe,eStart,eError,eStart,eError,eError,eError,#10-17\n eError,eError,eStart,eError,eError,eError, 3,eError,#18-1f\n 3,eError,eError,eError,eStart,eStart,eStart,eStart#20-27\n)\n\nEUCJPCharLenTable = (2, 2, 2, 3, 1, 0)\n\nEUCJPSMModel = {'classTable': EUCJP_cls,\n 'classFactor': 6,\n 'stateTable': EUCJP_st,\n 'charLenTable': EUCJPCharLenTable,\n 'name': 'EUC-JP'}\n\n# EUC-KR\n\nEUCKR_cls = (\n 1,1,1,1,1,1,1,1, # 00 - 07\n 1,1,1,1,1,1,0,0, # 08 - 0f\n 1,1,1,1,1,1,1,1, # 10 - 17\n 1,1,1,0,1,1,1,1, # 18 - 1f\n 1,1,1,1,1,1,1,1, # 20 - 27\n 1,1,1,1,1,1,1,1, # 28 - 2f\n 1,1,1,1,1,1,1,1, # 30 - 37\n 1,1,1,1,1,1,1,1, # 38 - 3f\n 1,1,1,1,1,1,1,1, # 40 - 47\n 1,1,1,1,1,1,1,1, # 48 - 4f\n 1,1,1,1,1,1,1,1, # 50 - 57\n 1,1,1,1,1,1,1,1, # 58 - 5f\n 1,1,1,1,1,1,1,1, # 60 - 67\n 1,1,1,1,1,1,1,1, # 68 - 6f\n 1,1,1,1,1,1,1,1, # 70 - 77\n 1,1,1,1,1,1,1,1, # 78 - 7f\n 0,0,0,0,0,0,0,0, # 80 - 87\n 0,0,0,0,0,0,0,0, # 88 - 8f\n 0,0,0,0,0,0,0,0, # 90 - 97\n 0,0,0,0,0,0,0,0, # 98 - 9f\n 0,2,2,2,2,2,2,2, # a0 - a7\n 2,2,2,2,2,3,3,3, # a8 - af\n 2,2,2,2,2,2,2,2, # b0 - b7\n 2,2,2,2,2,2,2,2, # b8 - bf\n 2,2,2,2,2,2,2,2, # c0 - c7\n 2,3,2,2,2,2,2,2, # c8 - cf\n 2,2,2,2,2,2,2,2, # d0 - d7\n 2,2,2,2,2,2,2,2, # d8 - df\n 2,2,2,2,2,2,2,2, # e0 - e7\n 2,2,2,2,2,2,2,2, # e8 - ef\n 2,2,2,2,2,2,2,2, # f0 - f7\n 2,2,2,2,2,2,2,0 # f8 - ff\n)\n\nEUCKR_st = (\n eError,eStart, 3,eError,eError,eError,eError,eError,#00-07\n eItsMe,eItsMe,eItsMe,eItsMe,eError,eError,eStart,eStart #08-0f\n)\n\nEUCKRCharLenTable = (0, 1, 2, 0)\n\nEUCKRSMModel = {'classTable': EUCKR_cls,\n 'classFactor': 4,\n 'stateTable': EUCKR_st,\n 'charLenTable': EUCKRCharLenTable,\n 'name': 'EUC-KR'}\n\n# EUC-TW\n\nEUCTW_cls = (\n 2,2,2,2,2,2,2,2, # 00 - 07\n 2,2,2,2,2,2,0,0, # 08 - 0f\n 2,2,2,2,2,2,2,2, # 10 - 17\n 2,2,2,0,2,2,2,2, # 18 - 1f\n 2,2,2,2,2,2,2,2, # 20 - 27\n 2,2,2,2,2,2,2,2, # 28 - 2f\n 2,2,2,2,2,2,2,2, # 30 - 37\n 2,2,2,2,2,2,2,2, # 38 - 3f\n 2,2,2,2,2,2,2,2, # 40 - 47\n 2,2,2,2,2,2,2,2, # 48 - 4f\n 2,2,2,2,2,2,2,2, # 50 - 57\n 2,2,2,2,2,2,2,2, # 58 - 5f\n 2,2,2,2,2,2,2,2, # 60 - 67\n 2,2,2,2,2,2,2,2, # 68 - 6f\n 2,2,2,2,2,2,2,2, # 70 - 77\n 2,2,2,2,2,2,2,2, # 78 - 7f\n 0,0,0,0,0,0,0,0, # 80 - 87\n 0,0,0,0,0,0,6,0, # 88 - 8f\n 0,0,0,0,0,0,0,0, # 90 - 97\n 0,0,0,0,0,0,0,0, # 98 - 9f\n 0,3,4,4,4,4,4,4, # a0 - a7\n 5,5,1,1,1,1,1,1, # a8 - af\n 1,1,1,1,1,1,1,1, # b0 - b7\n 1,1,1,1,1,1,1,1, # b8 - bf\n 1,1,3,1,3,3,3,3, # c0 - c7\n 3,3,3,3,3,3,3,3, # c8 - cf\n 3,3,3,3,3,3,3,3, # d0 - d7\n 3,3,3,3,3,3,3,3, # d8 - df\n 3,3,3,3,3,3,3,3, # e0 - e7\n 3,3,3,3,3,3,3,3, # e8 - ef\n 3,3,3,3,3,3,3,3, # f0 - f7\n 3,3,3,3,3,3,3,0 # f8 - ff\n)\n\nEUCTW_st = (\n eError,eError,eStart, 3, 3, 3, 4,eError,#00-07\n eError,eError,eError,eError,eError,eError,eItsMe,eItsMe,#08-0f\n eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eError,eStart,eError,#10-17\n eStart,eStart,eStart,eError,eError,eError,eError,eError,#18-1f\n 5,eError,eError,eError,eStart,eError,eStart,eStart,#20-27\n eStart,eError,eStart,eStart,eStart,eStart,eStart,eStart #28-2f\n)\n\nEUCTWCharLenTable = (0, 0, 1, 2, 2, 2, 3)\n\nEUCTWSMModel = {'classTable': EUCTW_cls,\n 'classFactor': 7,\n 'stateTable': EUCTW_st,\n 'charLenTable': EUCTWCharLenTable,\n 'name': 'x-euc-tw'}\n\n# GB2312\n\nGB2312_cls = (\n 1,1,1,1,1,1,1,1, # 00 - 07\n 1,1,1,1,1,1,0,0, # 08 - 0f\n 1,1,1,1,1,1,1,1, # 10 - 17\n 1,1,1,0,1,1,1,1, # 18 - 1f\n 1,1,1,1,1,1,1,1, # 20 - 27\n 1,1,1,1,1,1,1,1, # 28 - 2f\n 3,3,3,3,3,3,3,3, # 30 - 37\n 3,3,1,1,1,1,1,1, # 38 - 3f\n 2,2,2,2,2,2,2,2, # 40 - 47\n 2,2,2,2,2,2,2,2, # 48 - 4f\n 2,2,2,2,2,2,2,2, # 50 - 57\n 2,2,2,2,2,2,2,2, # 58 - 5f\n 2,2,2,2,2,2,2,2, # 60 - 67\n 2,2,2,2,2,2,2,2, # 68 - 6f\n 2,2,2,2,2,2,2,2, # 70 - 77\n 2,2,2,2,2,2,2,4, # 78 - 7f\n 5,6,6,6,6,6,6,6, # 80 - 87\n 6,6,6,6,6,6,6,6, # 88 - 8f\n 6,6,6,6,6,6,6,6, # 90 - 97\n 6,6,6,6,6,6,6,6, # 98 - 9f\n 6,6,6,6,6,6,6,6, # a0 - a7\n 6,6,6,6,6,6,6,6, # a8 - af\n 6,6,6,6,6,6,6,6, # b0 - b7\n 6,6,6,6,6,6,6,6, # b8 - bf\n 6,6,6,6,6,6,6,6, # c0 - c7\n 6,6,6,6,6,6,6,6, # c8 - cf\n 6,6,6,6,6,6,6,6, # d0 - d7\n 6,6,6,6,6,6,6,6, # d8 - df\n 6,6,6,6,6,6,6,6, # e0 - e7\n 6,6,6,6,6,6,6,6, # e8 - ef\n 6,6,6,6,6,6,6,6, # f0 - f7\n 6,6,6,6,6,6,6,0 # f8 - ff\n)\n\nGB2312_st = (\n eError,eStart,eStart,eStart,eStart,eStart, 3,eError,#00-07\n eError,eError,eError,eError,eError,eError,eItsMe,eItsMe,#08-0f\n eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eError,eError,eStart,#10-17\n 4,eError,eStart,eStart,eError,eError,eError,eError,#18-1f\n eError,eError, 5,eError,eError,eError,eItsMe,eError,#20-27\n eError,eError,eStart,eStart,eStart,eStart,eStart,eStart #28-2f\n)\n\n# To be accurate, the length of class 6 can be either 2 or 4.\n# But it is not necessary to discriminate between the two since\n# it is used for frequency analysis only, and we are validing\n# each code range there as well. So it is safe to set it to be\n# 2 here.\nGB2312CharLenTable = (0, 1, 1, 1, 1, 1, 2)\n\nGB2312SMModel = {'classTable': GB2312_cls,\n 'classFactor': 7,\n 'stateTable': GB2312_st,\n 'charLenTable': GB2312CharLenTable,\n 'name': 'GB2312'}\n\n# Shift_JIS\n\nSJIS_cls = (\n 1,1,1,1,1,1,1,1, # 00 - 07\n 1,1,1,1,1,1,0,0, # 08 - 0f\n 1,1,1,1,1,1,1,1, # 10 - 17\n 1,1,1,0,1,1,1,1, # 18 - 1f\n 1,1,1,1,1,1,1,1, # 20 - 27\n 1,1,1,1,1,1,1,1, # 28 - 2f\n 1,1,1,1,1,1,1,1, # 30 - 37\n 1,1,1,1,1,1,1,1, # 38 - 3f\n 2,2,2,2,2,2,2,2, # 40 - 47\n 2,2,2,2,2,2,2,2, # 48 - 4f\n 2,2,2,2,2,2,2,2, # 50 - 57\n 2,2,2,2,2,2,2,2, # 58 - 5f\n 2,2,2,2,2,2,2,2, # 60 - 67\n 2,2,2,2,2,2,2,2, # 68 - 6f\n 2,2,2,2,2,2,2,2, # 70 - 77\n 2,2,2,2,2,2,2,1, # 78 - 7f\n 3,3,3,3,3,3,3,3, # 80 - 87\n 3,3,3,3,3,3,3,3, # 88 - 8f\n 3,3,3,3,3,3,3,3, # 90 - 97\n 3,3,3,3,3,3,3,3, # 98 - 9f\n #0xa0 is illegal in sjis encoding, but some pages does\n #contain such byte. We need to be more error forgiven.\n 2,2,2,2,2,2,2,2, # a0 - a7\n 2,2,2,2,2,2,2,2, # a8 - af\n 2,2,2,2,2,2,2,2, # b0 - b7\n 2,2,2,2,2,2,2,2, # b8 - bf\n 2,2,2,2,2,2,2,2, # c0 - c7\n 2,2,2,2,2,2,2,2, # c8 - cf\n 2,2,2,2,2,2,2,2, # d0 - d7\n 2,2,2,2,2,2,2,2, # d8 - df\n 3,3,3,3,3,3,3,3, # e0 - e7\n 3,3,3,3,3,4,4,4, # e8 - ef\n 4,4,4,4,4,4,4,4, # f0 - f7\n 4,4,4,4,4,0,0,0 # f8 - ff\n)\n\n\nSJIS_st = (\n eError,eStart,eStart, 3,eError,eError,eError,eError,#00-07\n eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,#08-0f\n eItsMe,eItsMe,eError,eError,eStart,eStart,eStart,eStart #10-17\n)\n\nSJISCharLenTable = (0, 1, 1, 2, 0, 0)\n\nSJISSMModel = {'classTable': SJIS_cls,\n 'classFactor': 6,\n 'stateTable': SJIS_st,\n 'charLenTable': SJISCharLenTable,\n 'name': 'Shift_JIS'}\n\n# UCS2-BE\n\nUCS2BE_cls = (\n 0,0,0,0,0,0,0,0, # 00 - 07\n 0,0,1,0,0,2,0,0, # 08 - 0f\n 0,0,0,0,0,0,0,0, # 10 - 17\n 0,0,0,3,0,0,0,0, # 18 - 1f\n 0,0,0,0,0,0,0,0, # 20 - 27\n 0,3,3,3,3,3,0,0, # 28 - 2f\n 0,0,0,0,0,0,0,0, # 30 - 37\n 0,0,0,0,0,0,0,0, # 38 - 3f\n 0,0,0,0,0,0,0,0, # 40 - 47\n 0,0,0,0,0,0,0,0, # 48 - 4f\n 0,0,0,0,0,0,0,0, # 50 - 57\n 0,0,0,0,0,0,0,0, # 58 - 5f\n 0,0,0,0,0,0,0,0, # 60 - 67\n 0,0,0,0,0,0,0,0, # 68 - 6f\n 0,0,0,0,0,0,0,0, # 70 - 77\n 0,0,0,0,0,0,0,0, # 78 - 7f\n 0,0,0,0,0,0,0,0, # 80 - 87\n 0,0,0,0,0,0,0,0, # 88 - 8f\n 0,0,0,0,0,0,0,0, # 90 - 97\n 0,0,0,0,0,0,0,0, # 98 - 9f\n 0,0,0,0,0,0,0,0, # a0 - a7\n 0,0,0,0,0,0,0,0, # a8 - af\n 0,0,0,0,0,0,0,0, # b0 - b7\n 0,0,0,0,0,0,0,0, # b8 - bf\n 0,0,0,0,0,0,0,0, # c0 - c7\n 0,0,0,0,0,0,0,0, # c8 - cf\n 0,0,0,0,0,0,0,0, # d0 - d7\n 0,0,0,0,0,0,0,0, # d8 - df\n 0,0,0,0,0,0,0,0, # e0 - e7\n 0,0,0,0,0,0,0,0, # e8 - ef\n 0,0,0,0,0,0,0,0, # f0 - f7\n 0,0,0,0,0,0,4,5 # f8 - ff\n)\n\nUCS2BE_st = (\n 5, 7, 7,eError, 4, 3,eError,eError,#00-07\n eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,#08-0f\n eItsMe,eItsMe, 6, 6, 6, 6,eError,eError,#10-17\n 6, 6, 6, 6, 6,eItsMe, 6, 6,#18-1f\n 6, 6, 6, 6, 5, 7, 7,eError,#20-27\n 5, 8, 6, 6,eError, 6, 6, 6,#28-2f\n 6, 6, 6, 6,eError,eError,eStart,eStart #30-37\n)\n\nUCS2BECharLenTable = (2, 2, 2, 0, 2, 2)\n\nUCS2BESMModel = {'classTable': UCS2BE_cls,\n 'classFactor': 6,\n 'stateTable': UCS2BE_st,\n 'charLenTable': UCS2BECharLenTable,\n 'name': 'UTF-16BE'}\n\n# UCS2-LE\n\nUCS2LE_cls = (\n 0,0,0,0,0,0,0,0, # 00 - 07\n 0,0,1,0,0,2,0,0, # 08 - 0f\n 0,0,0,0,0,0,0,0, # 10 - 17\n 0,0,0,3,0,0,0,0, # 18 - 1f\n 0,0,0,0,0,0,0,0, # 20 - 27\n 0,3,3,3,3,3,0,0, # 28 - 2f\n 0,0,0,0,0,0,0,0, # 30 - 37\n 0,0,0,0,0,0,0,0, # 38 - 3f\n 0,0,0,0,0,0,0,0, # 40 - 47\n 0,0,0,0,0,0,0,0, # 48 - 4f\n 0,0,0,0,0,0,0,0, # 50 - 57\n 0,0,0,0,0,0,0,0, # 58 - 5f\n 0,0,0,0,0,0,0,0, # 60 - 67\n 0,0,0,0,0,0,0,0, # 68 - 6f\n 0,0,0,0,0,0,0,0, # 70 - 77\n 0,0,0,0,0,0,0,0, # 78 - 7f\n 0,0,0,0,0,0,0,0, # 80 - 87\n 0,0,0,0,0,0,0,0, # 88 - 8f\n 0,0,0,0,0,0,0,0, # 90 - 97\n 0,0,0,0,0,0,0,0, # 98 - 9f\n 0,0,0,0,0,0,0,0, # a0 - a7\n 0,0,0,0,0,0,0,0, # a8 - af\n 0,0,0,0,0,0,0,0, # b0 - b7\n 0,0,0,0,0,0,0,0, # b8 - bf\n 0,0,0,0,0,0,0,0, # c0 - c7\n 0,0,0,0,0,0,0,0, # c8 - cf\n 0,0,0,0,0,0,0,0, # d0 - d7\n 0,0,0,0,0,0,0,0, # d8 - df\n 0,0,0,0,0,0,0,0, # e0 - e7\n 0,0,0,0,0,0,0,0, # e8 - ef\n 0,0,0,0,0,0,0,0, # f0 - f7\n 0,0,0,0,0,0,4,5 # f8 - ff\n)\n\nUCS2LE_st = (\n 6, 6, 7, 6, 4, 3,eError,eError,#00-07\n eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,#08-0f\n eItsMe,eItsMe, 5, 5, 5,eError,eItsMe,eError,#10-17\n 5, 5, 5,eError, 5,eError, 6, 6,#18-1f\n 7, 6, 8, 8, 5, 5, 5,eError,#20-27\n 5, 5, 5,eError,eError,eError, 5, 5,#28-2f\n 5, 5, 5,eError, 5,eError,eStart,eStart #30-37\n)\n\nUCS2LECharLenTable = (2, 2, 2, 2, 2, 2)\n\nUCS2LESMModel = {'classTable': UCS2LE_cls,\n 'classFactor': 6,\n 'stateTable': UCS2LE_st,\n 'charLenTable': UCS2LECharLenTable,\n 'name': 'UTF-16LE'}\n\n# UTF-8\n\nUTF8_cls = (\n 1,1,1,1,1,1,1,1, # 00 - 07 #allow 0x00 as a legal value\n 1,1,1,1,1,1,0,0, # 08 - 0f\n 1,1,1,1,1,1,1,1, # 10 - 17\n 1,1,1,0,1,1,1,1, # 18 - 1f\n 1,1,1,1,1,1,1,1, # 20 - 27\n 1,1,1,1,1,1,1,1, # 28 - 2f\n 1,1,1,1,1,1,1,1, # 30 - 37\n 1,1,1,1,1,1,1,1, # 38 - 3f\n 1,1,1,1,1,1,1,1, # 40 - 47\n 1,1,1,1,1,1,1,1, # 48 - 4f\n 1,1,1,1,1,1,1,1, # 50 - 57\n 1,1,1,1,1,1,1,1, # 58 - 5f\n 1,1,1,1,1,1,1,1, # 60 - 67\n 1,1,1,1,1,1,1,1, # 68 - 6f\n 1,1,1,1,1,1,1,1, # 70 - 77\n 1,1,1,1,1,1,1,1, # 78 - 7f\n 2,2,2,2,3,3,3,3, # 80 - 87\n 4,4,4,4,4,4,4,4, # 88 - 8f\n 4,4,4,4,4,4,4,4, # 90 - 97\n 4,4,4,4,4,4,4,4, # 98 - 9f\n 5,5,5,5,5,5,5,5, # a0 - a7\n 5,5,5,5,5,5,5,5, # a8 - af\n 5,5,5,5,5,5,5,5, # b0 - b7\n 5,5,5,5,5,5,5,5, # b8 - bf\n 0,0,6,6,6,6,6,6, # c0 - c7\n 6,6,6,6,6,6,6,6, # c8 - cf\n 6,6,6,6,6,6,6,6, # d0 - d7\n 6,6,6,6,6,6,6,6, # d8 - df\n 7,8,8,8,8,8,8,8, # e0 - e7\n 8,8,8,8,8,9,8,8, # e8 - ef\n 10,11,11,11,11,11,11,11, # f0 - f7\n 12,13,13,13,14,15,0,0 # f8 - ff\n)\n\nUTF8_st = (\n eError,eStart,eError,eError,eError,eError, 12, 10,#00-07\n 9, 11, 8, 7, 6, 5, 4, 3,#08-0f\n eError,eError,eError,eError,eError,eError,eError,eError,#10-17\n eError,eError,eError,eError,eError,eError,eError,eError,#18-1f\n eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,#20-27\n eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,#28-2f\n eError,eError, 5, 5, 5, 5,eError,eError,#30-37\n eError,eError,eError,eError,eError,eError,eError,eError,#38-3f\n eError,eError,eError, 5, 5, 5,eError,eError,#40-47\n eError,eError,eError,eError,eError,eError,eError,eError,#48-4f\n eError,eError, 7, 7, 7, 7,eError,eError,#50-57\n eError,eError,eError,eError,eError,eError,eError,eError,#58-5f\n eError,eError,eError,eError, 7, 7,eError,eError,#60-67\n eError,eError,eError,eError,eError,eError,eError,eError,#68-6f\n eError,eError, 9, 9, 9, 9,eError,eError,#70-77\n eError,eError,eError,eError,eError,eError,eError,eError,#78-7f\n eError,eError,eError,eError,eError, 9,eError,eError,#80-87\n eError,eError,eError,eError,eError,eError,eError,eError,#88-8f\n eError,eError, 12, 12, 12, 12,eError,eError,#90-97\n eError,eError,eError,eError,eError,eError,eError,eError,#98-9f\n eError,eError,eError,eError,eError, 12,eError,eError,#a0-a7\n eError,eError,eError,eError,eError,eError,eError,eError,#a8-af\n eError,eError, 12, 12, 12,eError,eError,eError,#b0-b7\n eError,eError,eError,eError,eError,eError,eError,eError,#b8-bf\n eError,eError,eStart,eStart,eStart,eStart,eError,eError,#c0-c7\n eError,eError,eError,eError,eError,eError,eError,eError #c8-cf\n)\n\nUTF8CharLenTable = (0, 1, 0, 0, 0, 0, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6)\n\nUTF8SMModel = {'classTable': UTF8_cls,\n 'classFactor': 16,\n 'stateTable': UTF8_st,\n 'charLenTable': UTF8CharLenTable,\n 'name': 'UTF-8'}\n\n# flake8: noqa\n"},{"attributeType":"null","col":0,"comment":"null","endLoc":35,"id":1484,"name":"eStart","nodeType":"Attribute","startLoc":35,"text":"eStart"},{"attributeType":"null","col":0,"comment":"null","endLoc":36,"id":1485,"name":"eError","nodeType":"Attribute","startLoc":36,"text":"eError"},{"attributeType":"null","col":0,"comment":"null","endLoc":37,"id":1486,"name":"eItsMe","nodeType":"Attribute","startLoc":37,"text":"eItsMe"},{"attributeType":"(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int)","col":0,"comment":"null","endLoc":32,"id":1487,"name":"BIG5_cls","nodeType":"Attribute","startLoc":32,"text":"BIG5_cls"},{"attributeType":"(Any, Any, Any, int, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any)","col":0,"comment":"null","endLoc":67,"id":1488,"name":"BIG5_st","nodeType":"Attribute","startLoc":67,"text":"BIG5_st"},{"attributeType":"(int, int, int, int, int)","col":0,"comment":"null","endLoc":73,"id":1489,"name":"Big5CharLenTable","nodeType":"Attribute","startLoc":73,"text":"Big5CharLenTable"},{"attributeType":"TypedDict","col":0,"comment":"null","endLoc":75,"id":1490,"name":"Big5SMModel","nodeType":"Attribute","startLoc":75,"text":"Big5SMModel"},{"attributeType":"(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int)","col":0,"comment":"null","endLoc":83,"id":1491,"name":"CP949_cls","nodeType":"Attribute","startLoc":83,"text":"CP949_cls"},{"attributeType":"(Any, Any, int, Any, Any, Any, int, int, Any, int, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any)","col":0,"comment":"null","endLoc":102,"id":1492,"name":"CP949_st","nodeType":"Attribute","startLoc":102,"text":"CP949_st"},{"attributeType":"(int, int, int, int, int, int, int, int, int, int)","col":0,"comment":"null","endLoc":113,"id":1493,"name":"CP949CharLenTable","nodeType":"Attribute","startLoc":113,"text":"CP949CharLenTable"},{"attributeType":"TypedDict","col":0,"comment":"null","endLoc":115,"id":1494,"name":"CP949SMModel","nodeType":"Attribute","startLoc":115,"text":"CP949SMModel"},{"attributeType":"(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int)","col":0,"comment":"null","endLoc":123,"id":1495,"name":"EUCJP_cls","nodeType":"Attribute","startLoc":123,"text":"EUCJP_cls"},{"attributeType":"(int, int, int, int, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, int, Any, int, Any, Any, Any, Any, Any, Any, Any)","col":0,"comment":"null","endLoc":158,"id":1496,"name":"EUCJP_st","nodeType":"Attribute","startLoc":158,"text":"EUCJP_st"},{"fileName":"sbcharsetprober.py","filePath":"requests/packages/chardet","id":1497,"nodeType":"File","text":"######################## BEGIN LICENSE BLOCK ########################\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n# Mark Pilgrim - port to Python\n# Shy Shalom - original C code\n#\n# This library is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public\n# License as published by the Free Software Foundation; either\n# version 2.1 of the License, or (at your option) any later version.\n#\n# This library is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n# Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this library; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n# 02110-1301 USA\n######################### END LICENSE BLOCK #########################\n\nimport sys\nfrom . import constants\nfrom .charsetprober import CharSetProber\nfrom .compat import wrap_ord\n\nSAMPLE_SIZE = 64\nSB_ENOUGH_REL_THRESHOLD = 1024\nPOSITIVE_SHORTCUT_THRESHOLD = 0.95\nNEGATIVE_SHORTCUT_THRESHOLD = 0.05\nSYMBOL_CAT_ORDER = 250\nNUMBER_OF_SEQ_CAT = 4\nPOSITIVE_CAT = NUMBER_OF_SEQ_CAT - 1\n#NEGATIVE_CAT = 0\n\n\nclass SingleByteCharSetProber(CharSetProber):\n def __init__(self, model, reversed=False, nameProber=None):\n CharSetProber.__init__(self)\n self._mModel = model\n # TRUE if we need to reverse every pair in the model lookup\n self._mReversed = reversed\n # Optional auxiliary prober for name decision\n self._mNameProber = nameProber\n self.reset()\n\n def reset(self):\n CharSetProber.reset(self)\n # char order of last character\n self._mLastOrder = 255\n self._mSeqCounters = [0] * NUMBER_OF_SEQ_CAT\n self._mTotalSeqs = 0\n self._mTotalChar = 0\n # characters that fall in our sampling range\n self._mFreqChar = 0\n\n def get_charset_name(self):\n if self._mNameProber:\n return self._mNameProber.get_charset_name()\n else:\n return self._mModel['charsetName']\n\n def feed(self, aBuf):\n if not self._mModel['keepEnglishLetter']:\n aBuf = self.filter_without_english_letters(aBuf)\n aLen = len(aBuf)\n if not aLen:\n return self.get_state()\n for c in aBuf:\n order = self._mModel['charToOrderMap'][wrap_ord(c)]\n if order < SYMBOL_CAT_ORDER:\n self._mTotalChar += 1\n if order < SAMPLE_SIZE:\n self._mFreqChar += 1\n if self._mLastOrder < SAMPLE_SIZE:\n self._mTotalSeqs += 1\n if not self._mReversed:\n i = (self._mLastOrder * SAMPLE_SIZE) + order\n model = self._mModel['precedenceMatrix'][i]\n else: # reverse the order of the letters in the lookup\n i = (order * SAMPLE_SIZE) + self._mLastOrder\n model = self._mModel['precedenceMatrix'][i]\n self._mSeqCounters[model] += 1\n self._mLastOrder = order\n\n if self.get_state() == constants.eDetecting:\n if self._mTotalSeqs > SB_ENOUGH_REL_THRESHOLD:\n cf = self.get_confidence()\n if cf > POSITIVE_SHORTCUT_THRESHOLD:\n if constants._debug:\n sys.stderr.write('%s confidence = %s, we have a'\n 'winner\\n' %\n (self._mModel['charsetName'], cf))\n self._mState = constants.eFoundIt\n elif cf < NEGATIVE_SHORTCUT_THRESHOLD:\n if constants._debug:\n sys.stderr.write('%s confidence = %s, below negative'\n 'shortcut threshhold %s\\n' %\n (self._mModel['charsetName'], cf,\n NEGATIVE_SHORTCUT_THRESHOLD))\n self._mState = constants.eNotMe\n\n return self.get_state()\n\n def get_confidence(self):\n r = 0.01\n if self._mTotalSeqs > 0:\n r = ((1.0 * self._mSeqCounters[POSITIVE_CAT]) / self._mTotalSeqs\n / self._mModel['mTypicalPositiveRatio'])\n r = r * self._mFreqChar / self._mTotalChar\n if r >= 1.0:\n r = 0.99\n return r\n"},{"attributeType":"(int, int, int, int, int, int)","col":0,"comment":"null","endLoc":166,"id":1498,"name":"EUCJPCharLenTable","nodeType":"Attribute","startLoc":166,"text":"EUCJPCharLenTable"},{"attributeType":"int","col":0,"comment":"null","endLoc":34,"id":1499,"name":"SAMPLE_SIZE","nodeType":"Attribute","startLoc":34,"text":"SAMPLE_SIZE"},{"attributeType":"int","col":0,"comment":"null","endLoc":35,"id":1500,"name":"SB_ENOUGH_REL_THRESHOLD","nodeType":"Attribute","startLoc":35,"text":"SB_ENOUGH_REL_THRESHOLD"},{"attributeType":"float","col":0,"comment":"null","endLoc":36,"id":1501,"name":"POSITIVE_SHORTCUT_THRESHOLD","nodeType":"Attribute","startLoc":36,"text":"POSITIVE_SHORTCUT_THRESHOLD"},{"attributeType":"float","col":0,"comment":"null","endLoc":37,"id":1502,"name":"NEGATIVE_SHORTCUT_THRESHOLD","nodeType":"Attribute","startLoc":37,"text":"NEGATIVE_SHORTCUT_THRESHOLD"},{"attributeType":"int","col":0,"comment":"null","endLoc":38,"id":1503,"name":"SYMBOL_CAT_ORDER","nodeType":"Attribute","startLoc":38,"text":"SYMBOL_CAT_ORDER"},{"attributeType":"int","col":0,"comment":"null","endLoc":39,"id":1504,"name":"NUMBER_OF_SEQ_CAT","nodeType":"Attribute","startLoc":39,"text":"NUMBER_OF_SEQ_CAT"},{"attributeType":"int","col":0,"comment":"null","endLoc":40,"id":1505,"name":"POSITIVE_CAT","nodeType":"Attribute","startLoc":40,"text":"POSITIVE_CAT"},{"col":0,"comment":"","endLoc":29,"header":"sbcharsetprober.py#","id":1506,"name":"","nodeType":"Function","startLoc":29,"text":"SAMPLE_SIZE = 64\n\nSB_ENOUGH_REL_THRESHOLD = 1024\n\nPOSITIVE_SHORTCUT_THRESHOLD = 0.95\n\nNEGATIVE_SHORTCUT_THRESHOLD = 0.05\n\nSYMBOL_CAT_ORDER = 250\n\nNUMBER_OF_SEQ_CAT = 4\n\nPOSITIVE_CAT = NUMBER_OF_SEQ_CAT - 1"},{"attributeType":"TypedDict","col":0,"comment":"null","endLoc":168,"id":1507,"name":"EUCJPSMModel","nodeType":"Attribute","startLoc":168,"text":"EUCJPSMModel"},{"attributeType":"(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int)","col":0,"comment":"null","endLoc":176,"id":1508,"name":"EUCKR_cls","nodeType":"Attribute","startLoc":176,"text":"EUCKR_cls"},{"attributeType":"(Any, Any, int, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any)","col":0,"comment":"null","endLoc":211,"id":1509,"name":"EUCKR_st","nodeType":"Attribute","startLoc":211,"text":"EUCKR_st"},{"fileName":"langthaimodel.py","filePath":"requests/packages/chardet","id":1510,"nodeType":"File","text":"######################## BEGIN LICENSE BLOCK ########################\n# The Original Code is Mozilla Communicator client code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 1998\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n# Mark Pilgrim - port to Python\n#\n# This library is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public\n# License as published by the Free Software Foundation; either\n# version 2.1 of the License, or (at your option) any later version.\n#\n# This library is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n# Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this library; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n# 02110-1301 USA\n######################### END LICENSE BLOCK #########################\n\n# 255: Control characters that usually does not exist in any text\n# 254: Carriage/Return\n# 253: symbol (punctuation) that does not belong to word\n# 252: 0 - 9\n\n# The following result for thai was collected from a limited sample (1M).\n\n# Character Mapping Table:\nTIS620CharToOrderMap = (\n255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00\n255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10\n253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20\n252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30\n253,182,106,107,100,183,184,185,101, 94,186,187,108,109,110,111, # 40\n188,189,190, 89, 95,112,113,191,192,193,194,253,253,253,253,253, # 50\n253, 64, 72, 73,114, 74,115,116,102, 81,201,117, 90,103, 78, 82, # 60\n 96,202, 91, 79, 84,104,105, 97, 98, 92,203,253,253,253,253,253, # 70\n209,210,211,212,213, 88,214,215,216,217,218,219,220,118,221,222,\n223,224, 99, 85, 83,225,226,227,228,229,230,231,232,233,234,235,\n236, 5, 30,237, 24,238, 75, 8, 26, 52, 34, 51,119, 47, 58, 57,\n 49, 53, 55, 43, 20, 19, 44, 14, 48, 3, 17, 25, 39, 62, 31, 54,\n 45, 9, 16, 2, 61, 15,239, 12, 42, 46, 18, 21, 76, 4, 66, 63,\n 22, 10, 1, 36, 23, 13, 40, 27, 32, 35, 86,240,241,242,243,244,\n 11, 28, 41, 29, 33,245, 50, 37, 6, 7, 67, 77, 38, 93,246,247,\n 68, 56, 59, 65, 69, 60, 70, 80, 71, 87,248,249,250,251,252,253,\n)\n\n# Model Table:\n# total sequences: 100%\n# first 512 sequences: 92.6386%\n# first 1024 sequences:7.3177%\n# rest sequences: 1.0230%\n# negative sequences: 0.0436%\nThaiLangModel = (\n0,1,3,3,3,3,0,0,3,3,0,3,3,0,3,3,3,3,3,3,3,3,0,0,3,3,3,0,3,3,3,3,\n0,3,3,0,0,0,1,3,0,3,3,2,3,3,0,1,2,3,3,3,3,0,2,0,2,0,0,3,2,1,2,2,\n3,0,3,3,2,3,0,0,3,3,0,3,3,0,3,3,3,3,3,3,3,3,3,0,3,2,3,0,2,2,2,3,\n0,2,3,0,0,0,0,1,0,1,2,3,1,1,3,2,2,0,1,1,0,0,1,0,0,0,0,0,0,0,1,1,\n3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,3,3,2,3,2,3,3,2,2,2,\n3,1,2,3,0,3,3,2,2,1,2,3,3,1,2,0,1,3,0,1,0,0,1,0,0,0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n\n# flake8: noqa\n"},{"attributeType":"(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int)","col":0,"comment":"null","endLoc":36,"id":1511,"name":"TIS620CharToOrderMap","nodeType":"Attribute","startLoc":36,"text":"TIS620CharToOrderMap"},{"attributeType":"(int, int, int, int)","col":0,"comment":"null","endLoc":216,"id":1512,"name":"EUCKRCharLenTable","nodeType":"Attribute","startLoc":216,"text":"EUCKRCharLenTable"},{"attributeType":"TypedDict","col":0,"comment":"null","endLoc":218,"id":1513,"name":"EUCKRSMModel","nodeType":"Attribute","startLoc":218,"text":"EUCKRSMModel"},{"attributeType":"(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int)","col":0,"comment":"null","endLoc":226,"id":1514,"name":"EUCTW_cls","nodeType":"Attribute","startLoc":226,"text":"EUCTW_cls"},{"attributeType":"(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int)","col":0,"comment":"null","endLoc":61,"id":1515,"name":"ThaiLangModel","nodeType":"Attribute","startLoc":61,"text":"ThaiLangModel"},{"attributeType":"(Any, Any, Any, int, int, int, int, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, int, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any)","col":0,"comment":"null","endLoc":261,"id":1516,"name":"EUCTW_st","nodeType":"Attribute","startLoc":261,"text":"EUCTW_st"},{"attributeType":"(int, int, int, int, int, int, int)","col":0,"comment":"null","endLoc":270,"id":1517,"name":"EUCTWCharLenTable","nodeType":"Attribute","startLoc":270,"text":"EUCTWCharLenTable"},{"attributeType":"TypedDict","col":0,"comment":"null","endLoc":272,"id":1518,"name":"EUCTWSMModel","nodeType":"Attribute","startLoc":272,"text":"EUCTWSMModel"},{"attributeType":"(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int)","col":0,"comment":"null","endLoc":280,"id":1519,"name":"GB2312_cls","nodeType":"Attribute","startLoc":280,"text":"GB2312_cls"},{"attributeType":"(Any, Any, Any, Any, Any, Any, int, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, int, Any, Any, Any, Any, Any, Any, Any, Any, Any, int, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any)","col":0,"comment":"null","endLoc":315,"id":1520,"name":"GB2312_st","nodeType":"Attribute","startLoc":315,"text":"GB2312_st"},{"attributeType":"(int, int, int, int, int, int, int)","col":0,"comment":"null","endLoc":329,"id":1521,"name":"GB2312CharLenTable","nodeType":"Attribute","startLoc":329,"text":"GB2312CharLenTable"},{"attributeType":"(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int)","col":0,"comment":"null","endLoc":339,"id":1522,"name":"SJIS_cls","nodeType":"Attribute","startLoc":339,"text":"SJIS_cls"},{"attributeType":"(Any, Any, Any, int, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any)","col":0,"comment":"null","endLoc":377,"id":1523,"name":"SJIS_st","nodeType":"Attribute","startLoc":377,"text":"SJIS_st"},{"attributeType":"(int, int, int, int, int, int)","col":0,"comment":"null","endLoc":383,"id":1524,"name":"SJISCharLenTable","nodeType":"Attribute","startLoc":383,"text":"SJISCharLenTable"},{"attributeType":"TypedDict","col":0,"comment":"null","endLoc":385,"id":1525,"name":"SJISSMModel","nodeType":"Attribute","startLoc":385,"text":"SJISSMModel"},{"attributeType":"(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int)","col":0,"comment":"null","endLoc":393,"id":1526,"name":"UCS2BE_cls","nodeType":"Attribute","startLoc":393,"text":"UCS2BE_cls"},{"col":0,"comment":"","endLoc":53,"header":"langthaimodel.py#","id":1527,"name":"","nodeType":"Function","startLoc":36,"text":"TIS620CharToOrderMap = (\n255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00\n255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10\n253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20\n252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30\n253,182,106,107,100,183,184,185,101, 94,186,187,108,109,110,111, # 40\n188,189,190, 89, 95,112,113,191,192,193,194,253,253,253,253,253, # 50\n253, 64, 72, 73,114, 74,115,116,102, 81,201,117, 90,103, 78, 82, # 60\n 96,202, 91, 79, 84,104,105, 97, 98, 92,203,253,253,253,253,253, # 70\n209,210,211,212,213, 88,214,215,216,217,218,219,220,118,221,222,\n223,224, 99, 85, 83,225,226,227,228,229,230,231,232,233,234,235,\n236, 5, 30,237, 24,238, 75, 8, 26, 52, 34, 51,119, 47, 58, 57,\n 49, 53, 55, 43, 20, 19, 44, 14, 48, 3, 17, 25, 39, 62, 31, 54,\n 45, 9, 16, 2, 61, 15,239, 12, 42, 46, 18, 21, 76, 4, 66, 63,\n 22, 10, 1, 36, 23, 13, 40, 27, 32, 35, 86,240,241,242,243,244,\n 11, 28, 41, 29, 33,245, 50, 37, 6, 7, 67, 77, 38, 93,246,247,\n 68, 56, 59, 65, 69, 60, 70, 80, 71, 87,248,249,250,251,252,253,\n)\n\nThaiLangModel = (\n0,1,3,3,3,3,0,0,3,3,0,3,3,0,3,3,3,3,3,3,3,3,0,0,3,3,3,0,3,3,3,3,\n0,3,3,0,0,0,1,3,0,3,3,2,3,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n)\n\nTIS620ThaiModel = {\n 'charToOrderMap': TIS620CharToOrderMap,\n 'precedenceMatrix': ThaiLangModel,\n 'mTypicalPositiveRatio': 0.926386,\n 'keepEnglishLetter': False,\n 'charsetName': \"TIS-620\"\n}"},{"attributeType":"(int, int, int, Any, int, int, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, int, int, int, int, Any, Any, int, int, int, int, int, Any, int, int, int, int, int, int, int, int, int, Any, int, int, int, int, Any, int, int, int, int, int, int, int, Any, Any, Any, Any)","col":0,"comment":"null","endLoc":428,"id":1528,"name":"UCS2BE_st","nodeType":"Attribute","startLoc":428,"text":"UCS2BE_st"},{"attributeType":"(int, int, int, int, int, int)","col":0,"comment":"null","endLoc":438,"id":1529,"name":"UCS2BECharLenTable","nodeType":"Attribute","startLoc":438,"text":"UCS2BECharLenTable"},{"attributeType":"TypedDict","col":0,"comment":"null","endLoc":440,"id":1530,"name":"UCS2BESMModel","nodeType":"Attribute","startLoc":440,"text":"UCS2BESMModel"},{"attributeType":"(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int)","col":0,"comment":"null","endLoc":448,"id":1531,"name":"UCS2LE_cls","nodeType":"Attribute","startLoc":448,"text":"UCS2LE_cls"},{"id":1532,"name":"docs/_themes","nodeType":"Package"},{"fileName":"flask_theme_support.py","filePath":"docs/_themes","id":1533,"nodeType":"File","text":"# flasky extensions. flasky pygments style based on tango style\nfrom pygments.style import Style\nfrom pygments.token import Keyword, Name, Comment, String, Error, \\\n Number, Operator, Generic, Whitespace, Punctuation, Other, Literal\n\n\nclass FlaskyStyle(Style):\n background_color = \"#f8f8f8\"\n default_style = \"\"\n\n styles = {\n # No corresponding class for the following:\n #Text: \"\", # class: ''\n Whitespace: \"underline #f8f8f8\", # class: 'w'\n Error: \"#a40000 border:#ef2929\", # class: 'err'\n Other: \"#000000\", # class 'x'\n\n Comment: \"italic #8f5902\", # class: 'c'\n Comment.Preproc: \"noitalic\", # class: 'cp'\n\n Keyword: \"bold #004461\", # class: 'k'\n Keyword.Constant: \"bold #004461\", # class: 'kc'\n Keyword.Declaration: \"bold #004461\", # class: 'kd'\n Keyword.Namespace: \"bold #004461\", # class: 'kn'\n Keyword.Pseudo: \"bold #004461\", # class: 'kp'\n Keyword.Reserved: \"bold #004461\", # class: 'kr'\n Keyword.Type: \"bold #004461\", # class: 'kt'\n\n Operator: \"#582800\", # class: 'o'\n Operator.Word: \"bold #004461\", # class: 'ow' - like keywords\n\n Punctuation: \"bold #000000\", # class: 'p'\n\n # because special names such as Name.Class, Name.Function, etc.\n # are not recognized as such later in the parsing, we choose them\n # to look the same as ordinary variables.\n Name: \"#000000\", # class: 'n'\n Name.Attribute: \"#c4a000\", # class: 'na' - to be revised\n Name.Builtin: \"#004461\", # class: 'nb'\n Name.Builtin.Pseudo: \"#3465a4\", # class: 'bp'\n Name.Class: \"#000000\", # class: 'nc' - to be revised\n Name.Constant: \"#000000\", # class: 'no' - to be revised\n Name.Decorator: \"#888\", # class: 'nd' - to be revised\n Name.Entity: \"#ce5c00\", # class: 'ni'\n Name.Exception: \"bold #cc0000\", # class: 'ne'\n Name.Function: \"#000000\", # class: 'nf'\n Name.Property: \"#000000\", # class: 'py'\n Name.Label: \"#f57900\", # class: 'nl'\n Name.Namespace: \"#000000\", # class: 'nn' - to be revised\n Name.Other: \"#000000\", # class: 'nx'\n Name.Tag: \"bold #004461\", # class: 'nt' - like a keyword\n Name.Variable: \"#000000\", # class: 'nv' - to be revised\n Name.Variable.Class: \"#000000\", # class: 'vc' - to be revised\n Name.Variable.Global: \"#000000\", # class: 'vg' - to be revised\n Name.Variable.Instance: \"#000000\", # class: 'vi' - to be revised\n\n Number: \"#990000\", # class: 'm'\n\n Literal: \"#000000\", # class: 'l'\n Literal.Date: \"#000000\", # class: 'ld'\n\n String: \"#4e9a06\", # class: 's'\n String.Backtick: \"#4e9a06\", # class: 'sb'\n String.Char: \"#4e9a06\", # class: 'sc'\n String.Doc: \"italic #8f5902\", # class: 'sd' - like a comment\n String.Double: \"#4e9a06\", # class: 's2'\n String.Escape: \"#4e9a06\", # class: 'se'\n String.Heredoc: \"#4e9a06\", # class: 'sh'\n String.Interpol: \"#4e9a06\", # class: 'si'\n String.Other: \"#4e9a06\", # class: 'sx'\n String.Regex: \"#4e9a06\", # class: 'sr'\n String.Single: \"#4e9a06\", # class: 's1'\n String.Symbol: \"#4e9a06\", # class: 'ss'\n\n Generic: \"#000000\", # class: 'g'\n Generic.Deleted: \"#a40000\", # class: 'gd'\n Generic.Emph: \"italic #000000\", # class: 'ge'\n Generic.Error: \"#ef2929\", # class: 'gr'\n Generic.Heading: \"bold #000080\", # class: 'gh'\n Generic.Inserted: \"#00A000\", # class: 'gi'\n Generic.Output: \"#888\", # class: 'go'\n Generic.Prompt: \"#745334\", # class: 'gp'\n Generic.Strong: \"bold #000000\", # class: 'gs'\n Generic.Subheading: \"bold #800080\", # class: 'gu'\n Generic.Traceback: \"bold #a40000\", # class: 'gt'\n }\n"},{"attributeType":"(int, int, int, int, int, int, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, int, int, int, Any, Any, Any, int, int, int, Any, int, Any, int, int, int, int, int, int, int, int, int, Any, int, int, int, Any, Any, Any, int, int, int, int, int, Any, int, Any, Any, Any)","col":0,"comment":"null","endLoc":483,"id":1534,"name":"UCS2LE_st","nodeType":"Attribute","startLoc":483,"text":"UCS2LE_st"},{"className":"Style","col":0,"comment":"null","endLoc":40,"id":1535,"nodeType":"Class","startLoc":40,"text":"class Style(metaclass=StyleMeta): ..."},{"attributeType":"(int, int, int, int, int, int)","col":0,"comment":"null","endLoc":493,"id":1536,"name":"UCS2LECharLenTable","nodeType":"Attribute","startLoc":493,"text":"UCS2LECharLenTable"},{"attributeType":"TypedDict","col":0,"comment":"null","endLoc":495,"id":1537,"name":"UCS2LESMModel","nodeType":"Attribute","startLoc":495,"text":"UCS2LESMModel"},{"attributeType":"(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int)","col":0,"comment":"null","endLoc":503,"id":1538,"name":"UTF8_cls","nodeType":"Attribute","startLoc":503,"text":"UTF8_cls"},{"attributeType":"_TokenType","col":0,"comment":"null","endLoc":20,"id":1539,"name":"Keyword","nodeType":"Attribute","startLoc":20,"text":"Keyword"},{"attributeType":"(Any, Any, Any, Any, Any, Any, int, int, int, int, int, int, int, int, int, int, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, int, int, int, int, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, int, int, int, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, int, int, int, int, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, int, int, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, int, int, int, int, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, int, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, int, int, int, int, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, int, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, int, int, int, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any)","col":0,"comment":"null","endLoc":538,"id":1540,"name":"UTF8_st","nodeType":"Attribute","startLoc":538,"text":"UTF8_st"},{"attributeType":"_TokenType","col":0,"comment":"null","endLoc":21,"id":1541,"name":"Name","nodeType":"Attribute","startLoc":21,"text":"Name"},{"attributeType":"_TokenType","col":0,"comment":"null","endLoc":27,"id":1542,"name":"Comment","nodeType":"Attribute","startLoc":27,"text":"Comment"},{"attributeType":"_TokenType","col":0,"comment":"null","endLoc":23,"id":1543,"name":"String","nodeType":"Attribute","startLoc":23,"text":"String"},{"attributeType":"_TokenType","col":0,"comment":"null","endLoc":18,"id":1544,"name":"Error","nodeType":"Attribute","startLoc":18,"text":"Error"},{"attributeType":"_TokenType","col":0,"comment":"null","endLoc":24,"id":1545,"name":"Number","nodeType":"Attribute","startLoc":24,"text":"Number"},{"attributeType":"_TokenType","col":0,"comment":"null","endLoc":26,"id":1546,"name":"Operator","nodeType":"Attribute","startLoc":26,"text":"Operator"},{"attributeType":"_TokenType","col":0,"comment":"null","endLoc":28,"id":1547,"name":"Generic","nodeType":"Attribute","startLoc":28,"text":"Generic"},{"attributeType":"_TokenType","col":0,"comment":"null","endLoc":16,"id":1548,"name":"Whitespace","nodeType":"Attribute","startLoc":16,"text":"Whitespace"},{"attributeType":"_TokenType","col":0,"comment":"null","endLoc":25,"id":1549,"name":"Punctuation","nodeType":"Attribute","startLoc":25,"text":"Punctuation"},{"attributeType":"_TokenType","col":0,"comment":"null","endLoc":19,"id":1550,"name":"Other","nodeType":"Attribute","startLoc":19,"text":"Other"},{"attributeType":"_TokenType","col":0,"comment":"null","endLoc":22,"id":1551,"name":"Literal","nodeType":"Attribute","startLoc":22,"text":"Literal"},{"className":"FlaskyStyle","col":0,"comment":"null","endLoc":86,"id":1552,"nodeType":"Class","startLoc":7,"text":"class FlaskyStyle(Style):\n background_color = \"#f8f8f8\"\n default_style = \"\"\n\n styles = {\n # No corresponding class for the following:\n #Text: \"\", # class: ''\n Whitespace: \"underline #f8f8f8\", # class: 'w'\n Error: \"#a40000 border:#ef2929\", # class: 'err'\n Other: \"#000000\", # class 'x'\n\n Comment: \"italic #8f5902\", # class: 'c'\n Comment.Preproc: \"noitalic\", # class: 'cp'\n\n Keyword: \"bold #004461\", # class: 'k'\n Keyword.Constant: \"bold #004461\", # class: 'kc'\n Keyword.Declaration: \"bold #004461\", # class: 'kd'\n Keyword.Namespace: \"bold #004461\", # class: 'kn'\n Keyword.Pseudo: \"bold #004461\", # class: 'kp'\n Keyword.Reserved: \"bold #004461\", # class: 'kr'\n Keyword.Type: \"bold #004461\", # class: 'kt'\n\n Operator: \"#582800\", # class: 'o'\n Operator.Word: \"bold #004461\", # class: 'ow' - like keywords\n\n Punctuation: \"bold #000000\", # class: 'p'\n\n # because special names such as Name.Class, Name.Function, etc.\n # are not recognized as such later in the parsing, we choose them\n # to look the same as ordinary variables.\n Name: \"#000000\", # class: 'n'\n Name.Attribute: \"#c4a000\", # class: 'na' - to be revised\n Name.Builtin: \"#004461\", # class: 'nb'\n Name.Builtin.Pseudo: \"#3465a4\", # class: 'bp'\n Name.Class: \"#000000\", # class: 'nc' - to be revised\n Name.Constant: \"#000000\", # class: 'no' - to be revised\n Name.Decorator: \"#888\", # class: 'nd' - to be revised\n Name.Entity: \"#ce5c00\", # class: 'ni'\n Name.Exception: \"bold #cc0000\", # class: 'ne'\n Name.Function: \"#000000\", # class: 'nf'\n Name.Property: \"#000000\", # class: 'py'\n Name.Label: \"#f57900\", # class: 'nl'\n Name.Namespace: \"#000000\", # class: 'nn' - to be revised\n Name.Other: \"#000000\", # class: 'nx'\n Name.Tag: \"bold #004461\", # class: 'nt' - like a keyword\n Name.Variable: \"#000000\", # class: 'nv' - to be revised\n Name.Variable.Class: \"#000000\", # class: 'vc' - to be revised\n Name.Variable.Global: \"#000000\", # class: 'vg' - to be revised\n Name.Variable.Instance: \"#000000\", # class: 'vi' - to be revised\n\n Number: \"#990000\", # class: 'm'\n\n Literal: \"#000000\", # class: 'l'\n Literal.Date: \"#000000\", # class: 'ld'\n\n String: \"#4e9a06\", # class: 's'\n String.Backtick: \"#4e9a06\", # class: 'sb'\n String.Char: \"#4e9a06\", # class: 'sc'\n String.Doc: \"italic #8f5902\", # class: 'sd' - like a comment\n String.Double: \"#4e9a06\", # class: 's2'\n String.Escape: \"#4e9a06\", # class: 'se'\n String.Heredoc: \"#4e9a06\", # class: 'sh'\n String.Interpol: \"#4e9a06\", # class: 'si'\n String.Other: \"#4e9a06\", # class: 'sx'\n String.Regex: \"#4e9a06\", # class: 'sr'\n String.Single: \"#4e9a06\", # class: 's1'\n String.Symbol: \"#4e9a06\", # class: 'ss'\n\n Generic: \"#000000\", # class: 'g'\n Generic.Deleted: \"#a40000\", # class: 'gd'\n Generic.Emph: \"italic #000000\", # class: 'ge'\n Generic.Error: \"#ef2929\", # class: 'gr'\n Generic.Heading: \"bold #000080\", # class: 'gh'\n Generic.Inserted: \"#00A000\", # class: 'gi'\n Generic.Output: \"#888\", # class: 'go'\n Generic.Prompt: \"#745334\", # class: 'gp'\n Generic.Strong: \"bold #000000\", # class: 'gs'\n Generic.Subheading: \"bold #800080\", # class: 'gu'\n Generic.Traceback: \"bold #a40000\", # class: 'gt'\n }"},{"attributeType":"str","col":4,"comment":"null","endLoc":8,"id":1553,"name":"background_color","nodeType":"Attribute","startLoc":8,"text":"background_color"},{"attributeType":"str","col":4,"comment":"null","endLoc":9,"id":1554,"name":"default_style","nodeType":"Attribute","startLoc":9,"text":"default_style"},{"attributeType":"dict","col":4,"comment":"null","endLoc":11,"id":1555,"name":"styles","nodeType":"Attribute","startLoc":11,"text":"styles"},{"attributeType":"(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int)","col":0,"comment":"null","endLoc":567,"id":1556,"name":"UTF8CharLenTable","nodeType":"Attribute","startLoc":567,"text":"UTF8CharLenTable"},{"col":0,"comment":"","endLoc":28,"header":"mbcssm.py#","id":1557,"name":"","nodeType":"Function","startLoc":28,"text":"BIG5_cls = (\n 1,1,1,1,1,1,1,1, # 00 - 07 #allow 0x00 as legal value\n 1,1,1,1,1,1,0,0, # 08 - 0f\n 1,1,1,1,1,1,1,1, # 10 - 17\n 1,1,1,0,1,1,1,1, # 18 - 1f\n 1,1,1,1,1,1,1,1, # 20 - 27\n 1,1,1,1,1,1,1,1, # 28 - 2f\n 1,1,1,1,1,1,1,1, # 30 - 37\n 1,1,1,1,1,1,1,1, # 38 - 3f\n 2,2,2,2,2,2,2,2, # 40 - 47\n 2,2,2,2,2,2,2,2, # 48 - 4f\n 2,2,2,2,2,2,2,2, # 50 - 57\n 2,2,2,2,2,2,2,2, # 58 - 5f\n 2,2,2,2,2,2,2,2, # 60 - 67\n 2,2,2,2,2,2,2,2, # 68 - 6f\n 2,2,2,2,2,2,2,2, # 70 - 77\n 2,2,2,2,2,2,2,1, # 78 - 7f\n 4,4,4,4,4,4,4,4, # 80 - 87\n 4,4,4,4,4,4,4,4, # 88 - 8f\n 4,4,4,4,4,4,4,4, # 90 - 97\n 4,4,4,4,4,4,4,4, # 98 - 9f\n 4,3,3,3,3,3,3,3, # a0 - a7\n 3,3,3,3,3,3,3,3, # a8 - af\n 3,3,3,3,3,3,3,3, # b0 - b7\n 3,3,3,3,3,3,3,3, # b8 - bf\n 3,3,3,3,3,3,3,3, # c0 - c7\n 3,3,3,3,3,3,3,3, # c8 - cf\n 3,3,3,3,3,3,3,3, # d0 - d7\n 3,3,3,3,3,3,3,3, # d8 - df\n 3,3,3,3,3,3,3,3, # e0 - e7\n 3,3,3,3,3,3,3,3, # e8 - ef\n 3,3,3,3,3,3,3,3, # f0 - f7\n 3,3,3,3,3,3,3,0 # f8 - ff\n)\n\nBIG5_st = (\n eError,eStart,eStart, 3,eError,eError,eError,eError,#00-07\n eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eError,#08-0f\n eError,eStart,eStart,eStart,eStart,eStart,eStart,eStart#10-17\n)\n\nBig5CharLenTable = (0, 1, 1, 2, 0)\n\nBig5SMModel = {'classTable': BIG5_cls,\n 'classFactor': 5,\n 'stateTable': BIG5_st,\n 'charLenTable': Big5CharLenTable,\n 'name': 'Big5'}\n\nCP949_cls = (\n 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,0,0, # 00 - 0f\n 1,1,1,1,1,1,1,1, 1,1,1,0,1,1,1,1, # 10 - 1f\n 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, # 20 - 2f\n 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, # 30 - 3f\n 1,4,4,4,4,4,4,4, 4,4,4,4,4,4,4,4, # 40 - 4f\n 4,4,5,5,5,5,5,5, 5,5,5,1,1,1,1,1, # 50 - 5f\n 1,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5, # 60 - 6f\n 5,5,5,5,5,5,5,5, 5,5,5,1,1,1,1,1, # 70 - 7f\n 0,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, # 80 - 8f\n 6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, # 90 - 9f\n 6,7,7,7,7,7,7,7, 7,7,7,7,7,8,8,8, # a0 - af\n 7,7,7,7,7,7,7,7, 7,7,7,7,7,7,7,7, # b0 - bf\n 7,7,7,7,7,7,9,2, 2,3,2,2,2,2,2,2, # c0 - cf\n 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, # d0 - df\n 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, # e0 - ef\n 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,0, # f0 - ff\n)\n\nCP949_st = (\n#cls= 0 1 2 3 4 5 6 7 8 9 # previous state =\n eError,eStart, 3,eError,eStart,eStart, 4, 5,eError, 6, # eStart\n eError,eError,eError,eError,eError,eError,eError,eError,eError,eError, # eError\n eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe, # eItsMe\n eError,eError,eStart,eStart,eError,eError,eError,eStart,eStart,eStart, # 3\n eError,eError,eStart,eStart,eStart,eStart,eStart,eStart,eStart,eStart, # 4\n eError,eStart,eStart,eStart,eStart,eStart,eStart,eStart,eStart,eStart, # 5\n eError,eStart,eStart,eStart,eStart,eError,eError,eStart,eStart,eStart, # 6\n)\n\nCP949CharLenTable = (0, 1, 2, 0, 1, 1, 2, 2, 0, 2)\n\nCP949SMModel = {'classTable': CP949_cls,\n 'classFactor': 10,\n 'stateTable': CP949_st,\n 'charLenTable': CP949CharLenTable,\n 'name': 'CP949'}\n\nEUCJP_cls = (\n 4,4,4,4,4,4,4,4, # 00 - 07\n 4,4,4,4,4,4,5,5, # 08 - 0f\n 4,4,4,4,4,4,4,4, # 10 - 17\n 4,4,4,5,4,4,4,4, # 18 - 1f\n 4,4,4,4,4,4,4,4, # 20 - 27\n 4,4,4,4,4,4,4,4, # 28 - 2f\n 4,4,4,4,4,4,4,4, # 30 - 37\n 4,4,4,4,4,4,4,4, # 38 - 3f\n 4,4,4,4,4,4,4,4, # 40 - 47\n 4,4,4,4,4,4,4,4, # 48 - 4f\n 4,4,4,4,4,4,4,4, # 50 - 57\n 4,4,4,4,4,4,4,4, # 58 - 5f\n 4,4,4,4,4,4,4,4, # 60 - 67\n 4,4,4,4,4,4,4,4, # 68 - 6f\n 4,4,4,4,4,4,4,4, # 70 - 77\n 4,4,4,4,4,4,4,4, # 78 - 7f\n 5,5,5,5,5,5,5,5, # 80 - 87\n 5,5,5,5,5,5,1,3, # 88 - 8f\n 5,5,5,5,5,5,5,5, # 90 - 97\n 5,5,5,5,5,5,5,5, # 98 - 9f\n 5,2,2,2,2,2,2,2, # a0 - a7\n 2,2,2,2,2,2,2,2, # a8 - af\n 2,2,2,2,2,2,2,2, # b0 - b7\n 2,2,2,2,2,2,2,2, # b8 - bf\n 2,2,2,2,2,2,2,2, # c0 - c7\n 2,2,2,2,2,2,2,2, # c8 - cf\n 2,2,2,2,2,2,2,2, # d0 - d7\n 2,2,2,2,2,2,2,2, # d8 - df\n 0,0,0,0,0,0,0,0, # e0 - e7\n 0,0,0,0,0,0,0,0, # e8 - ef\n 0,0,0,0,0,0,0,0, # f0 - f7\n 0,0,0,0,0,0,0,5 # f8 - ff\n)\n\nEUCJP_st = (\n 3, 4, 3, 5,eStart,eError,eError,eError,#00-07\n eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,#08-0f\n eItsMe,eItsMe,eStart,eError,eStart,eError,eError,eError,#10-17\n eError,eError,eStart,eError,eError,eError, 3,eError,#18-1f\n 3,eError,eError,eError,eStart,eStart,eStart,eStart#20-27\n)\n\nEUCJPCharLenTable = (2, 2, 2, 3, 1, 0)\n\nEUCJPSMModel = {'classTable': EUCJP_cls,\n 'classFactor': 6,\n 'stateTable': EUCJP_st,\n 'charLenTable': EUCJPCharLenTable,\n 'name': 'EUC-JP'}\n\nEUCKR_cls = (\n 1,1,1,1,1,1,1,1, # 00 - 07\n 1,1,1,1,1,1,0,0, # 08 - 0f\n 1,1,1,1,1,1,1,1, # 10 - 17\n 1,1,1,0,1,1,1,1, # 18 - 1f\n 1,1,1,1,1,1,1,1, # 20 - 27\n 1,1,1,1,1,1,1,1, # 28 - 2f\n 1,1,1,1,1,1,1,1, # 30 - 37\n 1,1,1,1,1,1,1,1, # 38 - 3f\n 1,1,1,1,1,1,1,1, # 40 - 47\n 1,1,1,1,1,1,1,1, # 48 - 4f\n 1,1,1,1,1,1,1,1, # 50 - 57\n 1,1,1,1,1,1,1,1, # 58 - 5f\n 1,1,1,1,1,1,1,1, # 60 - 67\n 1,1,1,1,1,1,1,1, # 68 - 6f\n 1,1,1,1,1,1,1,1, # 70 - 77\n 1,1,1,1,1,1,1,1, # 78 - 7f\n 0,0,0,0,0,0,0,0, # 80 - 87\n 0,0,0,0,0,0,0,0, # 88 - 8f\n 0,0,0,0,0,0,0,0, # 90 - 97\n 0,0,0,0,0,0,0,0, # 98 - 9f\n 0,2,2,2,2,2,2,2, # a0 - a7\n 2,2,2,2,2,3,3,3, # a8 - af\n 2,2,2,2,2,2,2,2, # b0 - b7\n 2,2,2,2,2,2,2,2, # b8 - bf\n 2,2,2,2,2,2,2,2, # c0 - c7\n 2,3,2,2,2,2,2,2, # c8 - cf\n 2,2,2,2,2,2,2,2, # d0 - d7\n 2,2,2,2,2,2,2,2, # d8 - df\n 2,2,2,2,2,2,2,2, # e0 - e7\n 2,2,2,2,2,2,2,2, # e8 - ef\n 2,2,2,2,2,2,2,2, # f0 - f7\n 2,2,2,2,2,2,2,0 # f8 - ff\n)\n\nEUCKR_st = (\n eError,eStart, 3,eError,eError,eError,eError,eError,#00-07\n eItsMe,eItsMe,eItsMe,eItsMe,eError,eError,eStart,eStart #08-0f\n)\n\nEUCKRCharLenTable = (0, 1, 2, 0)\n\nEUCKRSMModel = {'classTable': EUCKR_cls,\n 'classFactor': 4,\n 'stateTable': EUCKR_st,\n 'charLenTable': EUCKRCharLenTable,\n 'name': 'EUC-KR'}\n\nEUCTW_cls = (\n 2,2,2,2,2,2,2,2, # 00 - 07\n 2,2,2,2,2,2,0,0, # 08 - 0f\n 2,2,2,2,2,2,2,2, # 10 - 17\n 2,2,2,0,2,2,2,2, # 18 - 1f\n 2,2,2,2,2,2,2,2, # 20 - 27\n 2,2,2,2,2,2,2,2, # 28 - 2f\n 2,2,2,2,2,2,2,2, # 30 - 37\n 2,2,2,2,2,2,2,2, # 38 - 3f\n 2,2,2,2,2,2,2,2, # 40 - 47\n 2,2,2,2,2,2,2,2, # 48 - 4f\n 2,2,2,2,2,2,2,2, # 50 - 57\n 2,2,2,2,2,2,2,2, # 58 - 5f\n 2,2,2,2,2,2,2,2, # 60 - 67\n 2,2,2,2,2,2,2,2, # 68 - 6f\n 2,2,2,2,2,2,2,2, # 70 - 77\n 2,2,2,2,2,2,2,2, # 78 - 7f\n 0,0,0,0,0,0,0,0, # 80 - 87\n 0,0,0,0,0,0,6,0, # 88 - 8f\n 0,0,0,0,0,0,0,0, # 90 - 97\n 0,0,0,0,0,0,0,0, # 98 - 9f\n 0,3,4,4,4,4,4,4, # a0 - a7\n 5,5,1,1,1,1,1,1, # a8 - af\n 1,1,1,1,1,1,1,1, # b0 - b7\n 1,1,1,1,1,1,1,1, # b8 - bf\n 1,1,3,1,3,3,3,3, # c0 - c7\n 3,3,3,3,3,3,3,3, # c8 - cf\n 3,3,3,3,3,3,3,3, # d0 - d7\n 3,3,3,3,3,3,3,3, # d8 - df\n 3,3,3,3,3,3,3,3, # e0 - e7\n 3,3,3,3,3,3,3,3, # e8 - ef\n 3,3,3,3,3,3,3,3, # f0 - f7\n 3,3,3,3,3,3,3,0 # f8 - ff\n)\n\nEUCTW_st = (\n eError,eError,eStart, 3, 3, 3, 4,eError,#00-07\n eError,eError,eError,eError,eError,eError,eItsMe,eItsMe,#08-0f\n eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eError,eStart,eError,#10-17\n eStart,eStart,eStart,eError,eError,eError,eError,eError,#18-1f\n 5,eError,eError,eError,eStart,eError,eStart,eStart,#20-27\n eStart,eError,eStart,eStart,eStart,eStart,eStart,eStart #28-2f\n)\n\nEUCTWCharLenTable = (0, 0, 1, 2, 2, 2, 3)\n\nEUCTWSMModel = {'classTable': EUCTW_cls,\n 'classFactor': 7,\n 'stateTable': EUCTW_st,\n 'charLenTable': EUCTWCharLenTable,\n 'name': 'x-euc-tw'}\n\nGB2312_cls = (\n 1,1,1,1,1,1,1,1, # 00 - 07\n 1,1,1,1,1,1,0,0, # 08 - 0f\n 1,1,1,1,1,1,1,1, # 10 - 17\n 1,1,1,0,1,1,1,1, # 18 - 1f\n 1,1,1,1,1,1,1,1, # 20 - 27\n 1,1,1,1,1,1,1,1, # 28 - 2f\n 3,3,3,3,3,3,3,3, # 30 - 37\n 3,3,1,1,1,1,1,1, # 38 - 3f\n 2,2,2,2,2,2,2,2, # 40 - 47\n 2,2,2,2,2,2,2,2, # 48 - 4f\n 2,2,2,2,2,2,2,2, # 50 - 57\n 2,2,2,2,2,2,2,2, # 58 - 5f\n 2,2,2,2,2,2,2,2, # 60 - 67\n 2,2,2,2,2,2,2,2, # 68 - 6f\n 2,2,2,2,2,2,2,2, # 70 - 77\n 2,2,2,2,2,2,2,4, # 78 - 7f\n 5,6,6,6,6,6,6,6, # 80 - 87\n 6,6,6,6,6,6,6,6, # 88 - 8f\n 6,6,6,6,6,6,6,6, # 90 - 97\n 6,6,6,6,6,6,6,6, # 98 - 9f\n 6,6,6,6,6,6,6,6, # a0 - a7\n 6,6,6,6,6,6,6,6, # a8 - af\n 6,6,6,6,6,6,6,6, # b0 - b7\n 6,6,6,6,6,6,6,6, # b8 - bf\n 6,6,6,6,6,6,6,6, # c0 - c7\n 6,6,6,6,6,6,6,6, # c8 - cf\n 6,6,6,6,6,6,6,6, # d0 - d7\n 6,6,6,6,6,6,6,6, # d8 - df\n 6,6,6,6,6,6,6,6, # e0 - e7\n 6,6,6,6,6,6,6,6, # e8 - ef\n 6,6,6,6,6,6,6,6, # f0 - f7\n 6,6,6,6,6,6,6,0 # f8 - ff\n)\n\nGB2312_st = (\n eError,eStart,eStart,eStart,eStart,eStart, 3,eError,#00-07\n eError,eError,eError,eError,eError,eError,eItsMe,eItsMe,#08-0f\n eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eError,eError,eStart,#10-17\n 4,eError,eStart,eStart,eError,eError,eError,eError,#18-1f\n eError,eError, 5,eError,eError,eError,eItsMe,eError,#20-27\n eError,eError,eStart,eStart,eStart,eStart,eStart,eStart #28-2f\n)\n\nGB2312CharLenTable = (0, 1, 1, 1, 1, 1, 2)\n\nGB2312SMModel = {'classTable': GB2312_cls,\n 'classFactor': 7,\n 'stateTable': GB2312_st,\n 'charLenTable': GB2312CharLenTable,\n 'name': 'GB2312'}\n\nSJIS_cls = (\n 1,1,1,1,1,1,1,1, # 00 - 07\n 1,1,1,1,1,1,0,0, # 08 - 0f\n 1,1,1,1,1,1,1,1, # 10 - 17\n 1,1,1,0,1,1,1,1, # 18 - 1f\n 1,1,1,1,1,1,1,1, # 20 - 27\n 1,1,1,1,1,1,1,1, # 28 - 2f\n 1,1,1,1,1,1,1,1, # 30 - 37\n 1,1,1,1,1,1,1,1, # 38 - 3f\n 2,2,2,2,2,2,2,2, # 40 - 47\n 2,2,2,2,2,2,2,2, # 48 - 4f\n 2,2,2,2,2,2,2,2, # 50 - 57\n 2,2,2,2,2,2,2,2, # 58 - 5f\n 2,2,2,2,2,2,2,2, # 60 - 67\n 2,2,2,2,2,2,2,2, # 68 - 6f\n 2,2,2,2,2,2,2,2, # 70 - 77\n 2,2,2,2,2,2,2,1, # 78 - 7f\n 3,3,3,3,3,3,3,3, # 80 - 87\n 3,3,3,3,3,3,3,3, # 88 - 8f\n 3,3,3,3,3,3,3,3, # 90 - 97\n 3,3,3,3,3,3,3,3, # 98 - 9f\n #0xa0 is illegal in sjis encoding, but some pages does\n #contain such byte. We need to be more error forgiven.\n 2,2,2,2,2,2,2,2, # a0 - a7\n 2,2,2,2,2,2,2,2, # a8 - af\n 2,2,2,2,2,2,2,2, # b0 - b7\n 2,2,2,2,2,2,2,2, # b8 - bf\n 2,2,2,2,2,2,2,2, # c0 - c7\n 2,2,2,2,2,2,2,2, # c8 - cf\n 2,2,2,2,2,2,2,2, # d0 - d7\n 2,2,2,2,2,2,2,2, # d8 - df\n 3,3,3,3,3,3,3,3, # e0 - e7\n 3,3,3,3,3,4,4,4, # e8 - ef\n 4,4,4,4,4,4,4,4, # f0 - f7\n 4,4,4,4,4,0,0,0 # f8 - ff\n)\n\nSJIS_st = (\n eError,eStart,eStart, 3,eError,eError,eError,eError,#00-07\n eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,#08-0f\n eItsMe,eItsMe,eError,eError,eStart,eStart,eStart,eStart #10-17\n)\n\nSJISCharLenTable = (0, 1, 1, 2, 0, 0)\n\nSJISSMModel = {'classTable': SJIS_cls,\n 'classFactor': 6,\n 'stateTable': SJIS_st,\n 'charLenTable': SJISCharLenTable,\n 'name': 'Shift_JIS'}\n\nUCS2BE_cls = (\n 0,0,0,0,0,0,0,0, # 00 - 07\n 0,0,1,0,0,2,0,0, # 08 - 0f\n 0,0,0,0,0,0,0,0, # 10 - 17\n 0,0,0,3,0,0,0,0, # 18 - 1f\n 0,0,0,0,0,0,0,0, # 20 - 27\n 0,3,3,3,3,3,0,0, # 28 - 2f\n 0,0,0,0,0,0,0,0, # 30 - 37\n 0,0,0,0,0,0,0,0, # 38 - 3f\n 0,0,0,0,0,0,0,0, # 40 - 47\n 0,0,0,0,0,0,0,0, # 48 - 4f\n 0,0,0,0,0,0,0,0, # 50 - 57\n 0,0,0,0,0,0,0,0, # 58 - 5f\n 0,0,0,0,0,0,0,0, # 60 - 67\n 0,0,0,0,0,0,0,0, # 68 - 6f\n 0,0,0,0,0,0,0,0, # 70 - 77\n 0,0,0,0,0,0,0,0, # 78 - 7f\n 0,0,0,0,0,0,0,0, # 80 - 87\n 0,0,0,0,0,0,0,0, # 88 - 8f\n 0,0,0,0,0,0,0,0, # 90 - 97\n 0,0,0,0,0,0,0,0, # 98 - 9f\n 0,0,0,0,0,0,0,0, # a0 - a7\n 0,0,0,0,0,0,0,0, # a8 - af\n 0,0,0,0,0,0,0,0, # b0 - b7\n 0,0,0,0,0,0,0,0, # b8 - bf\n 0,0,0,0,0,0,0,0, # c0 - c7\n 0,0,0,0,0,0,0,0, # c8 - cf\n 0,0,0,0,0,0,0,0, # d0 - d7\n 0,0,0,0,0,0,0,0, # d8 - df\n 0,0,0,0,0,0,0,0, # e0 - e7\n 0,0,0,0,0,0,0,0, # e8 - ef\n 0,0,0,0,0,0,0,0, # f0 - f7\n 0,0,0,0,0,0,4,5 # f8 - ff\n)\n\nUCS2BE_st = (\n 5, 7, 7,eError, 4, 3,eError,eError,#00-07\n eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,#08-0f\n eItsMe,eItsMe, 6, 6, 6, 6,eError,eError,#10-17\n 6, 6, 6, 6, 6,eItsMe, 6, 6,#18-1f\n 6, 6, 6, 6, 5, 7, 7,eError,#20-27\n 5, 8, 6, 6,eError, 6, 6, 6,#28-2f\n 6, 6, 6, 6,eError,eError,eStart,eStart #30-37\n)\n\nUCS2BECharLenTable = (2, 2, 2, 0, 2, 2)\n\nUCS2BESMModel = {'classTable': UCS2BE_cls,\n 'classFactor': 6,\n 'stateTable': UCS2BE_st,\n 'charLenTable': UCS2BECharLenTable,\n 'name': 'UTF-16BE'}\n\nUCS2LE_cls = (\n 0,0,0,0,0,0,0,0, # 00 - 07\n 0,0,1,0,0,2,0,0, # 08 - 0f\n 0,0,0,0,0,0,0,0, # 10 - 17\n 0,0,0,3,0,0,0,0, # 18 - 1f\n 0,0,0,0,0,0,0,0, # 20 - 27\n 0,3,3,3,3,3,0,0, # 28 - 2f\n 0,0,0,0,0,0,0,0, # 30 - 37\n 0,0,0,0,0,0,0,0, # 38 - 3f\n 0,0,0,0,0,0,0,0, # 40 - 47\n 0,0,0,0,0,0,0,0, # 48 - 4f\n 0,0,0,0,0,0,0,0, # 50 - 57\n 0,0,0,0,0,0,0,0, # 58 - 5f\n 0,0,0,0,0,0,0,0, # 60 - 67\n 0,0,0,0,0,0,0,0, # 68 - 6f\n 0,0,0,0,0,0,0,0, # 70 - 77\n 0,0,0,0,0,0,0,0, # 78 - 7f\n 0,0,0,0,0,0,0,0, # 80 - 87\n 0,0,0,0,0,0,0,0, # 88 - 8f\n 0,0,0,0,0,0,0,0, # 90 - 97\n 0,0,0,0,0,0,0,0, # 98 - 9f\n 0,0,0,0,0,0,0,0, # a0 - a7\n 0,0,0,0,0,0,0,0, # a8 - af\n 0,0,0,0,0,0,0,0, # b0 - b7\n 0,0,0,0,0,0,0,0, # b8 - bf\n 0,0,0,0,0,0,0,0, # c0 - c7\n 0,0,0,0,0,0,0,0, # c8 - cf\n 0,0,0,0,0,0,0,0, # d0 - d7\n 0,0,0,0,0,0,0,0, # d8 - df\n 0,0,0,0,0,0,0,0, # e0 - e7\n 0,0,0,0,0,0,0,0, # e8 - ef\n 0,0,0,0,0,0,0,0, # f0 - f7\n 0,0,0,0,0,0,4,5 # f8 - ff\n)\n\nUCS2LE_st = (\n 6, 6, 7, 6, 4, 3,eError,eError,#00-07\n eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,#08-0f\n eItsMe,eItsMe, 5, 5, 5,eError,eItsMe,eError,#10-17\n 5, 5, 5,eError, 5,eError, 6, 6,#18-1f\n 7, 6, 8, 8, 5, 5, 5,eError,#20-27\n 5, 5, 5,eError,eError,eError, 5, 5,#28-2f\n 5, 5, 5,eError, 5,eError,eStart,eStart #30-37\n)\n\nUCS2LECharLenTable = (2, 2, 2, 2, 2, 2)\n\nUCS2LESMModel = {'classTable': UCS2LE_cls,\n 'classFactor': 6,\n 'stateTable': UCS2LE_st,\n 'charLenTable': UCS2LECharLenTable,\n 'name': 'UTF-16LE'}\n\nUTF8_cls = (\n 1,1,1,1,1,1,1,1, # 00 - 07 #allow 0x00 as a legal value\n 1,1,1,1,1,1,0,0, # 08 - 0f\n 1,1,1,1,1,1,1,1, # 10 - 17\n 1,1,1,0,1,1,1,1, # 18 - 1f\n 1,1,1,1,1,1,1,1, # 20 - 27\n 1,1,1,1,1,1,1,1, # 28 - 2f\n 1,1,1,1,1,1,1,1, # 30 - 37\n 1,1,1,1,1,1,1,1, # 38 - 3f\n 1,1,1,1,1,1,1,1, # 40 - 47\n 1,1,1,1,1,1,1,1, # 48 - 4f\n 1,1,1,1,1,1,1,1, # 50 - 57\n 1,1,1,1,1,1,1,1, # 58 - 5f\n 1,1,1,1,1,1,1,1, # 60 - 67\n 1,1,1,1,1,1,1,1, # 68 - 6f\n 1,1,1,1,1,1,1,1, # 70 - 77\n 1,1,1,1,1,1,1,1, # 78 - 7f\n 2,2,2,2,3,3,3,3, # 80 - 87\n 4,4,4,4,4,4,4,4, # 88 - 8f\n 4,4,4,4,4,4,4,4, # 90 - 97\n 4,4,4,4,4,4,4,4, # 98 - 9f\n 5,5,5,5,5,5,5,5, # a0 - a7\n 5,5,5,5,5,5,5,5, # a8 - af\n 5,5,5,5,5,5,5,5, # b0 - b7\n 5,5,5,5,5,5,5,5, # b8 - bf\n 0,0,6,6,6,6,6,6, # c0 - c7\n 6,6,6,6,6,6,6,6, # c8 - cf\n 6,6,6,6,6,6,6,6, # d0 - d7\n 6,6,6,6,6,6,6,6, # d8 - df\n 7,8,8,8,8,8,8,8, # e0 - e7\n 8,8,8,8,8,9,8,8, # e8 - ef\n 10,11,11,11,11,11,11,11, # f0 - f7\n 12,13,13,13,14,15,0,0 # f8 - ff\n)\n\nUTF8_st = (\n eError,eStart,eError,eError,eError,eError, 12, 10,#00-07\n 9, 11, 8, 7, 6, 5, 4, 3,#08-0f\n eError,eError,eError,eError,eError,eError,eError,eError,#10-17\n eError,eError,eError,eError,eError,eError,eError,eError,#18-1f\n eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,#20-27\n eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,#28-2f\n eError,eError, 5, 5, 5, 5,eError,eError,#30-37\n eError,eError,eError,eError,eError,eError,eError,eError,#38-3f\n eError,eError,eError, 5, 5, 5,eError,eError,#40-47\n eError,eError,eError,eError,eError,eError,eError,eError,#48-4f\n eError,eError, 7, 7, 7, 7,eError,eError,#50-57\n eError,eError,eError,eError,eError,eError,eError,eError,#58-5f\n eError,eError,eError,eError, 7, 7,eError,eError,#60-67\n eError,eError,eError,eError,eError,eError,eError,eError,#68-6f\n eError,eError, 9, 9, 9, 9,eError,eError,#70-77\n eError,eError,eError,eError,eError,eError,eError,eError,#78-7f\n eError,eError,eError,eError,eError, 9,eError,eError,#80-87\n eError,eError,eError,eError,eError,eError,eError,eError,#88-8f\n eError,eError, 12, 12, 12, 12,eError,eError,#90-97\n eError,eError,eError,eError,eError,eError,eError,eError,#98-9f\n eError,eError,eError,eError,eError, 12,eError,eError,#a0-a7\n eError,eError,eError,eError,eError,eError,eError,eError,#a8-af\n eError,eError, 12, 12, 12,eError,eError,eError,#b0-b7\n eError,eError,eError,eError,eError,eError,eError,eError,#b8-bf\n eError,eError,eStart,eStart,eStart,eStart,eError,eError,#c0-c7\n eError,eError,eError,eError,eError,eError,eError,eError #c8-cf\n)\n\nUTF8CharLenTable = (0, 1, 0, 0, 0, 0, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6)\n\nUTF8SMModel = {'classTable': UTF8_cls,\n 'classFactor': 16,\n 'stateTable': UTF8_st,\n 'charLenTable': UTF8CharLenTable,\n 'name': 'UTF-8'}"},{"fileName":"url.py","filePath":"requests/packages/urllib3/util","id":1558,"nodeType":"File","text":"from collections import namedtuple\n\nfrom ..exceptions import LocationParseError\n\n\nurl_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment']\n\n\nclass Url(namedtuple('Url', url_attrs)):\n \"\"\"\n Datastructure for representing an HTTP URL. Used as a return value for\n :func:`parse_url`.\n \"\"\"\n slots = ()\n\n def __new__(cls, scheme=None, auth=None, host=None, port=None, path=None,\n query=None, fragment=None):\n return super(Url, cls).__new__(cls, scheme, auth, host, port, path,\n query, fragment)\n\n @property\n def hostname(self):\n \"\"\"For backwards-compatibility with urlparse. We're nice like that.\"\"\"\n return self.host\n\n @property\n def request_uri(self):\n \"\"\"Absolute path including the query string.\"\"\"\n uri = self.path or '/'\n\n if self.query is not None:\n uri += '?' + self.query\n\n return uri\n\n @property\n def netloc(self):\n \"\"\"Network location including host and port\"\"\"\n if self.port:\n return '%s:%d' % (self.host, self.port)\n return self.host\n\n\ndef split_first(s, delims):\n \"\"\"\n Given a string and an iterable of delimiters, split on the first found\n delimiter. Return two split parts and the matched delimiter.\n\n If not found, then the first part is the full input string.\n\n Example::\n\n >>> split_first('foo/bar?baz', '?/=')\n ('foo', 'bar?baz', '/')\n >>> split_first('foo/bar?baz', '123')\n ('foo/bar?baz', '', None)\n\n Scales linearly with number of delims. Not ideal for large number of delims.\n \"\"\"\n min_idx = None\n min_delim = None\n for d in delims:\n idx = s.find(d)\n if idx < 0:\n continue\n\n if min_idx is None or idx < min_idx:\n min_idx = idx\n min_delim = d\n\n if min_idx is None or min_idx < 0:\n return s, '', None\n\n return s[:min_idx], s[min_idx+1:], min_delim\n\n\ndef parse_url(url):\n \"\"\"\n Given a url, return a parsed :class:`.Url` namedtuple. Best-effort is\n performed to parse incomplete urls. Fields not provided will be None.\n\n Partly backwards-compatible with :mod:`urlparse`.\n\n Example::\n\n >>> parse_url('http://google.com/mail/')\n Url(scheme='http', host='google.com', port=None, path='/', ...)\n >>> parse_url('google.com:80')\n Url(scheme=None, host='google.com', port=80, path=None, ...)\n >>> parse_url('/foo?bar')\n Url(scheme=None, host=None, port=None, path='/foo', query='bar', ...)\n \"\"\"\n\n # While this code has overlap with stdlib's urlparse, it is much\n # simplified for our needs and less annoying.\n # Additionally, this implementations does silly things to be optimal\n # on CPython.\n\n if not url:\n # Empty\n return Url()\n\n scheme = None\n auth = None\n host = None\n port = None\n path = None\n fragment = None\n query = None\n\n # Scheme\n if '://' in url:\n scheme, url = url.split('://', 1)\n\n # Find the earliest Authority Terminator\n # (http://tools.ietf.org/html/rfc3986#section-3.2)\n url, path_, delim = split_first(url, ['/', '?', '#'])\n\n if delim:\n # Reassemble the path\n path = delim + path_\n\n # Auth\n if '@' in url:\n # Last '@' denotes end of auth part\n auth, url = url.rsplit('@', 1)\n\n # IPv6\n if url and url[0] == '[':\n host, url = url.split(']', 1)\n host += ']'\n\n # Port\n if ':' in url:\n _host, port = url.split(':', 1)\n\n if not host:\n host = _host\n\n if port:\n # If given, ports must be integers.\n if not port.isdigit():\n raise LocationParseError(url)\n port = int(port)\n else:\n # Blank ports are cool, too. (rfc3986#section-3.2.3)\n port = None\n\n elif not host and url:\n host = url\n\n if not path:\n return Url(scheme, auth, host, port, path, query, fragment)\n\n # Fragment\n if '#' in path:\n path, fragment = path.split('#', 1)\n\n # Query\n if '?' in path:\n path, query = path.split('?', 1)\n\n return Url(scheme, auth, host, port, path, query, fragment)\n\n\ndef get_host(url):\n \"\"\"\n Deprecated. Use :func:`.parse_url` instead.\n \"\"\"\n p = parse_url(url)\n return p.scheme or 'http', p.hostname, p.port\n"},{"col":0,"comment":"null","endLoc":46,"header":"def namedtuple(\n typename: str,\n field_names: str | Iterable[str],\n *,\n rename: bool = False,\n module: str | None = None,\n defaults: Iterable[Any] | None = None,\n) -> type[tuple[Any, ...]]","id":1559,"name":"namedtuple","nodeType":"Function","startLoc":39,"text":"def namedtuple(\n typename: str,\n field_names: str | Iterable[str],\n *,\n rename: bool = False,\n module: str | None = None,\n defaults: Iterable[Any] | None = None,\n) -> type[tuple[Any, ...]]: ..."},{"className":"LocationParseError","col":0,"comment":"Raised when get_host or similar fails to parse the URL input.","endLoc":134,"id":1560,"nodeType":"Class","startLoc":127,"text":"class LocationParseError(LocationValueError):\n \"Raised when get_host or similar fails to parse the URL input.\"\n\n def __init__(self, location):\n message = \"Failed to parse: %s\" % location\n HTTPError.__init__(self, message)\n\n self.location = location"},{"className":"LocationValueError","col":0,"comment":"Raised when there is something wrong with a given URL input.","endLoc":124,"id":1561,"nodeType":"Class","startLoc":122,"text":"class LocationValueError(ValueError, HTTPError):\n \"Raised when there is something wrong with a given URL input.\"\n pass"},{"attributeType":"null","col":8,"comment":"null","endLoc":134,"id":1562,"name":"location","nodeType":"Attribute","startLoc":134,"text":"self.location"},{"className":"Url","col":0,"comment":"\n Datastructure for representing an HTTP URL. Used as a return value for\n :func:`parse_url`.\n ","endLoc":41,"id":1563,"nodeType":"Class","startLoc":9,"text":"class Url(namedtuple('Url', url_attrs)):\n \"\"\"\n Datastructure for representing an HTTP URL. Used as a return value for\n :func:`parse_url`.\n \"\"\"\n slots = ()\n\n def __new__(cls, scheme=None, auth=None, host=None, port=None, path=None,\n query=None, fragment=None):\n return super(Url, cls).__new__(cls, scheme, auth, host, port, path,\n query, fragment)\n\n @property\n def hostname(self):\n \"\"\"For backwards-compatibility with urlparse. We're nice like that.\"\"\"\n return self.host\n\n @property\n def request_uri(self):\n \"\"\"Absolute path including the query string.\"\"\"\n uri = self.path or '/'\n\n if self.query is not None:\n uri += '?' + self.query\n\n return uri\n\n @property\n def netloc(self):\n \"\"\"Network location including host and port\"\"\"\n if self.port:\n return '%s:%d' % (self.host, self.port)\n return self.host"},{"col":4,"comment":"For backwards-compatibility with urlparse. We're nice like that.","endLoc":24,"header":"@property\n def hostname(self)","id":1564,"name":"hostname","nodeType":"Function","startLoc":21,"text":"@property\n def hostname(self):\n \"\"\"For backwards-compatibility with urlparse. We're nice like that.\"\"\"\n return self.host"},{"col":4,"comment":"Absolute path including the query string.","endLoc":34,"header":"@property\n def request_uri(self)","id":1565,"name":"request_uri","nodeType":"Function","startLoc":26,"text":"@property\n def request_uri(self):\n \"\"\"Absolute path including the query string.\"\"\"\n uri = self.path or '/'\n\n if self.query is not None:\n uri += '?' + self.query\n\n return uri"},{"col":4,"comment":"Network location including host and port","endLoc":41,"header":"@property\n def netloc(self)","id":1566,"name":"netloc","nodeType":"Function","startLoc":36,"text":"@property\n def netloc(self):\n \"\"\"Network location including host and port\"\"\"\n if self.port:\n return '%s:%d' % (self.host, self.port)\n return self.host"},{"attributeType":"()","col":4,"comment":"null","endLoc":14,"id":1567,"name":"slots","nodeType":"Attribute","startLoc":14,"text":"slots"},{"attributeType":"list","col":0,"comment":"null","endLoc":6,"id":1568,"name":"url_attrs","nodeType":"Attribute","startLoc":6,"text":"url_attrs"},{"col":0,"comment":"","endLoc":1,"header":"url.py#","id":1569,"name":"","nodeType":"Function","startLoc":1,"text":"url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment']"},{"id":1570,"name":"AUTHORS.rst","nodeType":"TextFile","path":"","text":"Requests is written and maintained by Kenneth Reitz and\nvarious contributors:\n\nDevelopment Lead\n````````````````\n\n- Kenneth Reitz `@kennethreitz `_\n\nCore Contributors\n`````````````````\n\n- Cory Benfield `@lukasa `_\n- Ian Cordasco `@sigmavirus24 `_\n\n\n\nUrllib3\n```````\n\n- Andrey Petrov \n\n\nPatches and Suggestions\n```````````````````````\n\n- Various Pocoo Members\n- Chris Adams\n- Flavio Percoco Premoli\n- Dj Gilcrease\n- Justin Murphy\n- Rob Madole\n- Aram Dulyan\n- Johannes Gorset\n- 村山めがね (Megane Murayama)\n- James Rowe\n- Daniel Schauenberg\n- Zbigniew Siciarz\n- Daniele Tricoli 'Eriol'\n- Richard Boulton\n- Miguel Olivares \n- Alberto Paro\n- Jérémy Bethmont\n- 潘旭 (Xu Pan)\n- Tamás Gulácsi\n- Rubén Abad\n- Peter Manser\n- Jeremy Selier\n- Jens Diemer\n- Alex (`@alopatin `_)\n- Tom Hogans \n- Armin Ronacher\n- Shrikant Sharat Kandula\n- Mikko Ohtamaa\n- Den Shabalin\n- Daniel Miller \n- Alejandro Giacometti\n- Rick Mak\n- Johan Bergström\n- Josselin Jacquard\n- Travis N. Vaught\n- Fredrik Möllerstrand\n- Daniel Hengeveld\n- Dan Head\n- Bruno Renié\n- David Fischer\n- Joseph McCullough\n- Juergen Brendel\n- Juan Riaza\n- Ryan Kelly\n- Rolando Espinoza La fuente\n- Robert Gieseke\n- Idan Gazit\n- Ed Summers\n- Chris Van Horne\n- Christopher Davis\n- Ori Livneh\n- Jason Emerick\n- Bryan Helmig\n- Jonas Obrist\n- Lucian Ursu\n- Tom Moertel\n- Frank Kumro Jr\n- Chase Sterling\n- Marty Alchin\n- takluyver\n- Ben Toews (`@mastahyeti `_)\n- David Kemp\n- Brendon Crawford\n- Denis (`@Telofy `_)\n- Matt Giuca\n- Adam Tauber\n- Honza Javorek\n- Brendan Maguire \n- Chris Dary\n- Danver Braganza \n- Max Countryman\n- Nick Chadwick\n- Jonathan Drosdeck\n- Jiri Machalek\n- Steve Pulec\n- Michael Kelly\n- Michael Newman \n- Jonty Wareing \n- Shivaram Lingamneni\n- Miguel Turner\n- Rohan Jain (`@crodjer `_)\n- Justin Barber \n- Roman Haritonov (`@reclosedev `_)\n- Josh Imhoff \n- Arup Malakar \n- Danilo Bargen (`@dbrgn `_)\n- Torsten Landschoff\n- Michael Holler (`@apotheos