def is_bytes_object(obj):
    """
    Returns True if the argument can be decoded (usually bytes string)
    Based on https://stackoverflow.com/a/34870210
    """
    try:
        obj.decode()
        return True
    except AttributeError:
        return False
