import textwrap


def unicode_escape(string: bytes) -> str:
    """Conterprocess of :meth:`bytes.decode('unicode_escape')`.

    Args:
        string: The bytestring to be escaped.

    Returns:
        The escaped bytestring as an encoded string

    Example:

        >>> b'\\x09'.decode('unicode_escape')
        '\\\\t'
        >>> unicode_escape(b'\\t')
        '\\\\x09'

    """
    return ''.join(map(lambda s: '\\x%s' % s, textwrap.wrap(string.hex(), 2)))