Get a range of keys with a prefix.
16427
def get_prefix_response(self, key_prefix, sort_order=None,
                            sort_target='key', keys_only=False):
        """"""
        range_request = self._build_get_range_request(
            key=key_prefix,
            range_end=utils.increment_last_byte(utils.to_bytes(key_prefix)),
            sort_order=sort_order,
            sort_target=sort_target,
            keys_only=keys_only,
        )

        return self.kvstub.Range(
            range_request,
            self.timeout,
            credentials=self.call_credentials,
            metadata=self.metadata
        )
84144
def get_prefix(self):
        """"""
        prefix = self.bucket
        if self.prefix:
            prefix += self.separator + self.prefix
        return prefix
313973
protected Map<String, String> getPrefixedProperties(String prefix) {
        Map<String, String> rval = new HashMap<>();
        Iterator<String> keys = getConfig().getKeys();
        while (keys.hasNext()) {
            String key = keys.next();
            if (key.startsWith(prefix)) {
                String value = getConfig().getString(key);
                key = key.substring(prefix.length());
                rval.put(key, value);
            }
        }
        return rval;
    }
612204
def _parse_PREFIX(value):
        ""
        channel_modes, channel_chars = value.split(')')
        channel_modes = channel_modes[1:]
        return collections.OrderedDict(zip(channel_chars, channel_modes))
1096777
def prefix(rowPrefix):
        """"""
        fp = Range.followingPrefix(rowPrefix)
        return Range(srow=rowPrefix, sinclude=True, erow=fp, einclude=False)
334116
def prefixes(self, key):
        '''
        
        '''
        res = []
        index = self.dct.ROOT
        if not isinstance(key, bytes):
            key = key.encode('utf8')

        pos = 1

        for ch in key:
            index = self.dct.follow_char(int_from_byte(ch), index)
            if not index:
                break

            if self._has_value(index):
                res.append(key[:pos].decode('utf8'))
            pos += 1

        return res
455043
def keys(pattern = SCAN_PATTERN, count = DEFAULT_COUNT)
      return redis(&:keys) if pattern.nil?

      redis { |conn| conn.scan_each(match: prefix(pattern), count: count).to_a }
    end
1020966
public function getRange($key, $length) {
        $badKeys = [];

        for ($i = 0; $i < $key; $i++) {
            array_push($badKeys, $i);
        }

        for ($i = $key + $length; $i < count($this->_datas); $i++) {
            array_push($badKeys, $i);
        }

        return array_diff_key($this->_datas, array_flip($badKeys));
    }
879311
function lrange(key, start, stop, req) {
  var val = this.getKey(key, req);
  if(val === undefined) return null;
  return val.lrange(start, stop);
}
48842
def iteritems(self, prefix=None):
        """"""
        query = Setting.query
        if prefix:
            query = query.filter(Setting.key.startswith(prefix))

        for s in query.yield_per(1000):
            yield (s.key, s.value)
22571
def sorted_conkeys(self, prefix=None):
        """"""

        # Make for defined and sorted output:
        conkeys = []
        for cond in _COND_PREFIXES:
            conkeys += sorted([key for key in self.conditions
                               if key.startswith(cond)], key=self.cond_int)
        if not prefix:
            return conkeys
        return [key for key in conkeys if key.startswith(prefix)]
1069394
def check_range_key(query_on, key):
    """"""
    return (
        isinstance(key, BaseCondition) and
        key.operation in ("begins_with", "between", "<", ">", "<=", ">=", "==") and
        key.column is query_on.range_key
    )
1010701
def _getVals(self, prefix = ""):
        
        if not hasattr(self, "vals"):
            self.vals = {}
        dict = {}
        for key in list(self.vals.keys()):
            # if no prefix then lower the first letter
            if prefix == "":
                newkey = key[:1].lower() + key[1:] if key else ""
                dict[newkey] = self.vals[key]
            else:
                newkey = key[:1].upper() + key[1:] if key else ""
                dict[prefix + newkey] = self.vals[key]
        return dict
473033
def range(self, start='-', stop='+', count=None):
        
        return self.database.xrange(self.key, start, stop, count)
876167
def make_prefix(self, prefix, iterable):
        
        if not prefix:
            yield from iterable

        for key, value in iterable:
            yield f"{prefix}_{key}", value
601793
def _get_redis_keys_opts():
    '''
    
    '''
    return {
        'bank_prefix': __opts__.get('cache.redis.bank_prefix', _BANK_PREFIX),
        'bank_keys_prefix': __opts__.get('cache.redis.bank_keys_prefix', _BANK_KEYS_PREFIX),
        'key_prefix': __opts__.get('cache.redis.key_prefix', _KEY_PREFIX),
        'separator': __opts__.get('cache.redis.separator', _SEPARATOR)
    }
1261641
def fill_prefixes(key, value, prefix, prefixes)
      prefixes = {} if prefixes.nil?
      if prefix.size == 1
        pr = prefix.to_i
        prefixes[pr] ||= {}
        prefixes[pr][key] = value
      else
        pr = prefix[0].to_i
        prefixes[pr] = fill_prefixes(key, value, prefix[1..-1], prefixes[pr])
      end
      prefixes
    end