def METHOD_NAME(objs_or_ids, model):
    if not objs_or_ids:
        return model.objects.none()
    if isinstance(objs_or_ids, QuerySet) and isinstance(objs_or_ids.first(), model):
        return objs_or_ids
    ids = [
        str(i.id) if isinstance(i, model) else i
        for i in objs_or_ids
    ]
    return model.objects.filter(id__in=ids)