B7-8E9C-6111ADAAB357}
			Sign:99c3a44ff5d87e8c7b6c9efb3809486de920d4a0
		System, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089:
			Guid:{DCA91DB8-9BB2-45C0-8A5C-0E62D9939BCA}
			Sign:acb551c522668fbd3c3d9fd3334636c55900b6b3
			Hardbound Guid:{9B3B0A9E-459F-3372-A335-D7FBA8F95419}
		System.Xml, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089:
			Guid:{046CA903-F7DC-492A-A665-B2946AEAF79A}
			Sign:e60caeafd6d1cd9dee8a86d06b2b8bc983e47c1c
		System.Configuration, Version=2.0.0.0, PublicKeyToken=b03f5f7f11d50a3a:
			Guid:{3A8A27CD-D4D5-4DE6-9957-EA80148F9A0D}
			Sign:830e20c901a5e7204cad05864f6df35624fec3b0
		SMDiagnostics, Version=3.0.0.0, PublicKeyToken=b77a5c561934e089:
			Guid:{CFF89D26-0361-4C69-AB0F-C685C43B3842}
			Sign:0a536549de1b5871f3a28d753d9f1fea4c6d7fa5

04/27/2015 03:08:57.031 [3924]: Successfully compiled: System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
04/27/2015 03:08:57.073 [3924]: Began compiling: System.IdentityModel, Version######################## BEGIN LICENSE BLOCK ########################
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301  USA
######################### END LICENSE BLOCK #########################


from .compat import PY2, PY3
from .universaldetector import UniversalDetector
from .version import __version__, VERSION


def detect(byte_str):
    """
    Detect the encoding of the given byte string.

    :param byte_str:     The byte sequence to examine.
    :type byte_str:      ``bytes`` or ``bytearray``
    """
    if not isinstance(byte_str, bytearray):
        if not isinstance(byte_str, bytes):
            raise TypeError('Expected object of type bytes or bytearray, got: '
                            '{0}'.format(type(byte_str)))
        else:
            byte_str = bytearray(byte_str)
    detector = UniversalDetector()
    detector.feed(byte_str)
    return detector.close()
