def METHOD_NAME(
    qs, request, has_team=False, user_write_filter=None, scope=None, fk_path=None
):
    user = request.user
    if not user.is_authenticated:
        return qs.none()
    # OAuth token
    token = getattr(request, "auth", None)
    if token and (not scope or not token.is_valid([scope])):
        # API access, but no scope
        return qs.none()
    if user.is_superuser:
        return qs
    model = qs.model
    opts = model._meta
    codename = get_permission_codename("change", opts)
    if user.is_staff and user.has_perm("%s.%s" % (opts.app_label, codename)):
        return qs
    filters = None
    if user_write_filter is not None:
        filters = user_write_filter
    teams = None
    if has_team:
        teams = Team.objects.get_editor_owner_teams(user)
    user_filter = get_user_filter(request, teams=teams, fk_path=fk_path)
    if filters is None:
        filters = user_filter
    else:
        filters |= user_filter
    return qs.filter(filters)