Return an iterable object containing all entries stored in the specified bank.
481544
def list_(bank):
    '''
    
    '''
    try:
        _, keys = api.kv.get(bank + '/', keys=True, separator='/')
    except Exception as exc:
        raise SaltCacheError(
            'There was an error getting the key "{0}": {1}'.format(
                bank, exc
            )
        )
    if keys is None:
        keys = []
    else:
        # Any key could be a branch and a leaf at the same time in Consul
        # so we have to return a list of unique names only.
        out = set()
        for key in keys:
            out.add(key[len(bank) + 1:].rstrip('/'))
        keys = list(out)
    return keys
572196
def find_all(self, collection):
        
        obj = getattr(self.db, collection)
        result = obj.find()
        return result
981735
def contains(bank, key):
    '''
    
    '''
    _init_client()
    query = "SELECT COUNT(data) FROM {0} WHERE bank='{1}' " \
        "AND etcd_key='{2}'".format(_table_name, bank, key)
    cur, _ = run_query(client, query)
    r = cur.fetchone()
    cur.close()
    return r[0] == 1
452768
public Iterable<Map.Entry<Integer, Record>> entries() {
        return () -> new Iterator<Map.Entry<Integer, Record>>() {
            private final Iterator<Map.Entry<Integer, Record>> it = data.records.entrySet().iterator();

            /** {@inheritDoc} */
            @Override
            public boolean hasNext() {
                return it.hasNext();
            }

            /** {@inheritDoc} */
            @Override
            public Map.Entry<Integer, Record> next() {
                return it.next();
            }

            /** {@inheritDoc} */
            @Override
            public void remove() {
                throw new UnsupportedOperationException("This is a read-only iterator, remove operation is not supported.");
            }
        };
    }
1078465
def fetch(bank, key):
    '''
    
    '''
    _init_client()
    etcd_key = '{0}/{1}/{2}'.format(path_prefix, bank, key)
    try:
        value = client.read(etcd_key).value
        return __context__['serial'].loads(base64.b64decode(value))
    except etcd.EtcdKeyNotFound:
        return {}
    except Exception as exc:
        raise SaltCacheError(
            'There was an error reading the key, {0}: {1}'.format(
                etcd_key, exc
            )
        )
1058412
function all(){
  var len = storage.length;
  var ret = {};
  var key;

  while (0 <= --len) {
    key = storage.key(len);
    ret[key] = get(key);
  }

  return ret;
}
1124912
def get_all(cls, include_disabled=True):
        
        if cls == BaseAccount:
            raise InquisitorError('get_all on BaseAccount is not supported')

        account_type_id = db.AccountType.find_one(account_type=cls.account_type).account_type_id
        qry = db.Account.order_by(desc(Account.enabled), Account.account_type_id, Account.account_name)

        if not include_disabled:
            qry = qry.filter(Account.enabled == 1)

        accounts = qry.find(Account.account_type_id == account_type_id)

        return {res.account_id: cls(res) for res in accounts}
486656
def collections(record, key, value):
    """"""
    return {
        'primary': value.get('a'),
        'secondary': value.get('b'),
        'deleted': value.get('c'),
    }
190270
def index(self):
        
        if self.manager is None:
            raise IndexError('Bank not contains a manager')

        return self.manager.banks.index(self)
273902
def get_all_accounts(self):
        """"""
        for address_hash, rlpdata in self.secure_trie.trie.iter_branch():
            if rlpdata != trie.BLANK_NODE:
                yield rlp.decode(rlpdata, Account, db=self.db, addr=address_hash)
1056392
def store(bank, key, data, cachedir=None):
    '''
    
    '''
    if cachedir is None:
        cachedir = __opts__['cachedir']

    try:
        cache = salt.cache.Cache(__opts__, cachedir=cachedir)
    except TypeError:
        cache = salt.cache.Cache(__opts__)
    return cache.store(bank, key, data)
90781
public static <E> List<E> all(Iterable<E> iterable) {
        dbc.precondition(iterable != null, "cannot call all with a null iterable");
        final Function<Iterator<E>, ArrayList<E>> consumer = new ConsumeIntoCollection<>(new ArrayListFactory<E>());
        return consumer.apply(iterable.iterator());
    }
1277679
def from_iterable(cls, iterable: Iterable) -> 'List':
        """"""

        iterator = iter(iterable)

        def recurse() -> List:
            try:
                value = next(iterator)
            except StopIteration:

                return List.empty()
            return List.unit(value).append(recurse())
        return List.empty().append(recurse())
681072
public Iterable<String> getAll(String index, String key) {
        return getAllIncluding(index, get(index, key), new IterableChain<String>());
    }
63918
def all_query(expression):
    """"""
    def _all(index, expression=expression):
        """Return store key for documents that satisfy expression."""
        ev = expression() if callable(expression) else expression
        try:
            iter(ev)
        except TypeError:
            raise AttributeError('$all argument must be an iterable!')

        hashed_ev = [index.get_hash_for(v) for v in ev]
        store_keys = set()

        if len(hashed_ev) == 0:
            return []
        store_keys = set(index.get_keys_for(hashed_ev[0]))
        for value in hashed_ev[1:]:
            store_keys &= set(index.get_keys_for(value))
        return list(store_keys)

    return _all
1351807
def fetch(bank, key):
    '''
    
    '''
    c_key = '{0}/{1}'.format(bank, key)
    try:
        _, value = api.kv.get(c_key)
        if value is None:
            return {}
        return __context__['serial'].loads(value['Value'])
    except Exception as exc:
        raise SaltCacheError(
            'There was an error reading the key, {0}: {1}'.format(
                c_key, exc
            )
        )
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))