Set whether to filter by a user's faves list. Options available are
    user.ONLY, user.NOT, and None; default is None.
974414
def faves(self, option):
    
    params = join_params(self.parameters, {"faves": option})

    return self.__class__(**params)
404853
public void setSafariBuiltinFavorites() {
    File[] files = app.listFiles(new FilenameFilter() {
      @Override
      public boolean accept(File dir, String name) {
        return name.startsWith("BuiltinFavorites") && name.endsWith(".plist");
      }
    });
    for (File plist : files) {
      setSafariBuiltinFavories(plist);
    }
  }
520494
function isSelectionInList(
    opts: Options,
    value: Value,
    type?: string
): boolean {
    const items = getItemsAtRange(opts, value);
    return (
        !items.isEmpty() &&
        // Check the type of the list if needed
        (!type ||
            getListForItem(opts, value, items.first()).get('type') === type)
    );
}
285382
public boolean saveFavorite(boolean favorite) {
		if (PkRSS.getInstance() == null) return false;

		return PkRSS.getInstance().saveFavorite(this, favorite);
	}
646999
def has_friends(self, flt=FriendFilter.ALL):
        
        return self._iface.get_has_friend(self.user_id, flt)
400818
def setdefault(self, key, default=None):
        
        if key in self:
            return self[key]
        else:
            self._setitem(key, default)
            self._list_add(key)
            return default
789597
def exclude(self, *args, **kwargs) -> "QuerySet":
        
        return self._filter_or_exclude(negate=True, *args, **kwargs)
555893
def _filter_queryset(self, perms, queryset):
        """"""
        user = self.request.user if self.request else AnonymousUser()
        return get_objects_for_user(user, perms, queryset)
950882
def filtered_list(cls, name=None, obj=None):
        """"""
        options = {}
        if name:
            options['id'] = cls.usable_id(name)

        def obj_ok(dc, obj):
            if not obj or obj['datacenter_id'] == dc['id']:
                return True
            return False

        return [x for x in cls.list(options) if obj_ok(x, obj)]
1131705
def is_flagged(self, user=None, status=None):
        
        filter_kwargs = {
            'content_type': ContentType.objects.get_for_model(self),
            'object_id': self.id,
        }
        update_filter_dict(filter_kwargs, user, status)
        return self.flags.filter(**filter_kwargs).count()
176054
def toggle_favorite(request):
    
    if not request.is_ajax():
        return HttpResponseForbidden()

    try:
        app, model, pk = request.POST['app'], request.POST['model'], int(request.POST['pk'])

    except ValueError:
        return HttpResponseBadRequest()

    try:
        ctype = ContentType.objects.get(app_label=app, model=model)
        obj = ctype.get_object_for_this_type(id=pk)

    except Favorite.DoesNotExist:
        return HttpResponseNotFound()

    try:
        fave = Favorite.objects.get(content_type=ctype, object_id=obj.id, user=request.user)

    except Favorite.DoesNotExist:
        # Does not exist, so create it
        fave = Favorite(content_object=obj, user=request.user)
        fave.save()
        is_favorite = True

    else:
        # Exists, so delete it
        fave.delete()
        is_favorite = False

    # Return the current total number for UI updates
    favorites_count = Favorite.objects.filter(content_type=ctype, user=request.user).count()

    return JsonResponse({
        'app': app,
        'model': model,
        'pk': pk,
        'is_favorite': is_favorite,
        'count': favorites_count,
    })
56073
def _where(self, filter_fn):
        '''  '''
        assert callable(filter_fn), 'filter_fn needs to be callable'
        return VList(i for i in self if filter_fn(i()))
1294969
def filter(self, criteria: Q, offset: int = 0, limit: int = 10,
               order_by: list = ()) -> ResultSet:
        
715791
def users_favorites(*args)
      options = args.extract_options!.merge(:client_id => api_key)
      args[1].nil? ? (response = conn.get("/users/#{args[0]}/favorites.json") { |req| req.params = options }) : (response = conn.get("/users/#{args[0]}/favorites/#{args[1]}.json") { |req| req.params = options })
      args.nil? ? response.body.send(sym) : response.body
    end
1153883
def list_favorite_queries():
    """"""

    headers = ["Name", "Query"]
    rows = [(r, favoritequeries.get(r)) for r in favoritequeries.list()]

    if not rows:
        status = '\nNo favorite queries found.' + favoritequeries.usage
    else:
        status = ''
    return [('', rows, headers, status)]
1293481
def do_rmfilter(self, arg):
        
        if arg in self.curargs["tfilter"]:
            if arg == "*":
                msg.warn("The default filter cannot be removed.")
            else:
                self.curargs["tfilter"].remove(arg)
                self.do_filter("list")
488188
def show_feature(self, user, feature):
        
        user_filter = {
            self.model.USER_FEATURE_FIELD: user,
        }
        return self.get_feature(feature).filter(
            models.Q(**user_filter) | models.Q(everyone=True)).exists()