def METHOD_NAME(type_, magic):
    def is_type(fileobj):
        if not hasattr(fileobj, 'read'):
            fileobj = BytesIO(fileobj)
        return has_magic_bytes(fileobj, magic)
    return is_type