U ��.e�@s8ddlmZmZddlmZddlmZmZdd�ZdS)�)�PY2�PY3)�UniversalDetector)� __version__�VERSIONcCsHt|t�s0t|t�s(td�t|����nt|�}t�}|�|�|��S)z� Detect the encoding of the given byte string. :param byte_str: The byte sequence to examine. :type byte_str: ``bytes`` or ``bytearray`` z4Expected object of type bytes or bytearray, got: {0}) � isinstance� bytearray�bytes� TypeError�format�typerZfeed�close)Zbyte_strZdetector�r�@/usr/lib/python3.8/site-packages/pip/_vendor/chardet/__init__.py�detects  � rN) �compatrrZuniversaldetectorr�versionrrrrrrr�s