How many items in the set?

        :param name: str     the name of the redis key
        :return: Future()
433978
def scard(self, name):
        
        with self.pipe as pipe:
            return pipe.scard(self.redis_key(name))
1159540
def find_item(self, fq_name):
        
        names = fq_name.split(self._separator)
        current = self._yapconf_items
        for name in names:
            if isinstance(current, (YapconfDictItem, YapconfListItem)):
                current = current.children

            if name not in current:
                return None
            current = current[name]
        return current
1310376
def get_by_name(self, name): # pylint: disable=invalid-name,redefined-builtin
        
        rs, _ = self.list(filter=field('name').eq(name), limit=1)
        if len(rs) is 0:
            raise CDRouterError('no such device')
        return rs[0]
1191435
def items(iterable):
    
    if hasattr(iterable, 'iteritems'):
        return (p for p in iterable.iteritems())
    elif hasattr(iterable, 'items'):
        return (p for p in iterable.items())
    else:
        return (p for p in enumerate(iterable))
830063
def iteritems(self, pipe=None):
        """"""
        pipe = self.redis if pipe is None else pipe
        for k, v in self._data(pipe).items():
            yield k, self.cache.get(k, v)
285622
def collection(self, name):
        

        return Collection(
            name=name,
            api_resource=self.api.collection(name),
            api=self.api,
        )
1145474
def items(self):
        
        cursor = '0'
        _loads = self._loads
        _mget = self._client.mget
        while cursor != 0:
            cursor, keys = self.scan(cursor=cursor)
            if keys:
                vals = _mget(*keys)
                for i, key in enumerate(keys):
                    yield (
                        key.replace(
                            self.key_prefix+":", "", 1),
                        _loads(vals[i])
                    )
12163
def getSet(self, name):
        
        return lock_and_call(
            lambda: Set(self._impl.getSet(name)),
            self._lock
        )
1040172
def _get_dicts_from_redis(self, name, index_name, redis_prefix, item):
        
        r = self._redis
        data_dict = {}
        data_index_dict = {}

        if redis_prefix is None:
            raise KeyError ("redis_prefix is missing")

        if r.scard(redis_prefix + index_name + str(item)) > 0:
            data_index_dict[str(item)] = r.smembers(redis_prefix + index_name + str(item))

            for i in data_index_dict[item]:
                json_data = r.get(redis_prefix + name + str(int(i)))
                data_dict[i] = self._deserialize_data(json_data)

            return (data_dict, data_index_dict)

        raise KeyError ("No Data found in Redis for "+ item)
528399
def zcard(self, name):
        
        with self.pipe as pipe:
            return pipe.zcard(self.redis_key(name))
272986
def get_items(self):
        
        uids = self.get_uids()
        if not uids:
            return [SuperModel(self.context)]
        items = map(lambda uid: SuperModel(uid), uids)
        return self._resolve_number_of_copies(items)
272782
def Items(self, key):
    
    with self._mutex:
      if key not in self._buckets:
        raise KeyError('Key %s was not found in Reservoir' % key)
      bucket = self._buckets[key]
    return bucket.Items()
718780
def get_by(self, name):
    """"""
    return next((item for item in self if item.name == name), None)
716031
def remove_from_set(set, item)
      Predictor.redis.multi do |redis|
        redis.srem(redis_key(:items, set), item)
        redis.srem(redis_key(:sets, item), set)
      end
    end
895242
def get_configurable_by_name(self, name):
        
        l = [c for c in self.configurables if c.name == name]
        if l:
            return l[0]
1115401
def calculate_size(name, items):
    
    data_size = 0
    data_size += calculate_size_str(name)
    data_size += INT_SIZE_IN_BYTES
    for items_item in items:
        data_size += calculate_size_data(items_item)
    return data_size
168905
def lpop(self, name):
        
        with self.pipe as pipe:
            f = Future()
            res = pipe.lpop(self.redis_key(name))

            def cb():
                f.set(self.valueparse.decode(res.result))

            pipe.on_execute(cb)
            return f