def binary_is_text(data):
    """ Returns ``True`` if the given ``data`` argument (a ``bytes`` object)
    does not contain unprintable control characters.
    """
    if not isinstance(data, bytes):
        raise TypeError("data must be bytes, got '%s'" % type(data).__name__)
    return all(c not in _BINARYCHARS for c in data)
 Returns ``True`` if the given ``data`` argument (a ``bytes`` object)
    does not contain unprintable control characters.
    
stackoverflow/venv/lib/python3.6/site-packages/scrapy/utils/python.py