Return chunk no and 1-based offset of key
        :param key:
        :return:
770057
def _get_key_location(self, key) -> (int, int):
        
        key = int(key)
        if key == 0:
            return 1, 0
        remainder = key % self.chunkSize
        addend = ChunkedFileStore.firstChunkIndex
        chunk_no = key - remainder + addend if remainder \
            else key - self.chunkSize + addend
        offset = remainder or self.chunkSize
        return chunk_no, offset
993498
def get_cache_key(self, offset=0, limit=0, order=None, post_slug=''):
        
        return hashlib.sha1(
            '.'.join([
                str(self._get_data_source_url()),
                str(offset),
                str(limit),
                str(order),
                str(post_slug),
                ])
        ).hexdigest()
429594
public int indexOfKey(Object key) {
        return key == null ? indexOfNull() : indexOf(key, key.hashCode());
    }
981547
async def bitcount(self, key, start=None, end=None):
        
        params = [key]
        if start is not None and end is not None:
            params.append(start)
            params.append(end)
        elif (start is not None and end is None) or \
                (end is not None and start is None):
            raise RedisError("Both start and end must be specified")
        return await self.execute_command('BITCOUNT', *params)
248128
def hincrby(self, name, key, amount=1):
        
        with self.pipe as pipe:
            return pipe.hincrby(self.redis_key(name),
                                self.memberparse.encode(key),
                                amount)
356792
def _split_keys_v1(joined):
    
    left, _, right = joined.partition('::')
    return _decode_v1(left), _decode_v1(right)
655037
private int findIndexByKey(Object key)
    {
        // Traverse the vector from the back. Given proper locking done at
        // a higher level, this will ensure that the cache gets to the same
        // element in the presence of duplicates.
        // Traversing the vector from the first element causes a problem since
        // elements are inserted at the end of the vector (for efficiency).
        // Consequently after inserting duplicate element 1.2, if another
        // operation is performed on the same key 1, we will get to 1.1 instead
        // of 1.2
        for (int i = (size() - 1); i >= 0; --i) {
            Element element = (Element) get(i);
            if (element.key.equals(key)) {
                return i;
            }
        }

        return -1;
    }
1074013
def get_hmac(self, key):
        
        h = HMAC.new(key, None, SHA256)
        h.update(str(self.index).encode())
        h.update(self.seed)
        h.update(str(self.n).encode())
        h.update(self.root)
        h.update(str(self.timestamp).encode())
        return h.digest()
302066
def parse_key(key):
    
    hkey, lkey = struct.unpack('<II',key[0:UBIFS_SK_LEN])
    ino_num = hkey & UBIFS_S_KEY_HASH_MASK
    key_type = lkey >> UBIFS_S_KEY_BLOCK_BITS
    khash = lkey

    #if key_type < UBIFS_KEY_TYPES_CNT:
    return {'type':key_type, 'ino_num':ino_num, 'khash': khash}
235972
def split_key(key, max = Float::INFINITY)
      parts = []
      pos   = 0
      return [key] if max == 1
      key_parts(key) do |part|
        parts << part
        pos += part.length + 1
        if parts.length + 1 >= max
          parts << key[pos..-1] unless pos == key.length
          break
        end
      end
      parts
    end
849840
def get_group_key_line(self, data, key):
        
        idx = -1
        for i, line in enumerate(data.splitlines()):
            if isin_start(self.groups[key], line):
                idx = i
        return idx
35393
def get_key(blob, field, code):
    
    try:
        line = blob[np.nonzero(blob[:, 1] == field)[0][0] + 1]
    except IndexError:
        return None
    if line[0] == code:
        try:
            return int(line[1])
        except ValueError:
            return line[1]
    else:
        return None
464214
def hash_key(self, key):
        
        for i, destination_key in enumerate(self._dict):
            if key < destination_key:
                return destination_key

        return key
1067428
def dchans(self, key=None):
        
        if self._dtreat['indch'] is None or np.all(self._dtreat['indch']):
            dch = dict(self._dchans) if key is None else self._dchans[key]
        else:
            dch = {}
            lk = self._dchans.keys() if key is None else [key]
            for kk in lk:
                if self._dchans[kk].ndim==1:
                    dch[kk] = self._dchans[kk][self._dtreat['indch']]
                elif self._dchans[kk].ndim==2:
                    dch[kk] = self._dchans[kk][:,self._dtreat['indch']]
                else:
                    msg = "Don't know how to treat self._dchans[%s]:"%kk
                    msg += "\n  shape = %s"%(kk,str(self._dchans[kk].shape))
                    warnings.warn(msg)
            if key is not None:
                dch = dch[key]
        return dch
1233572
def get(self, key):
        
        validate_is_bytes(key)

        return self._get(self.root_hash, encode_to_bin(key))
957874
def _get_node_pos(self, key):
        
        if not self._hashring:
            return None

        key = self._gen_key(key)

        nodes = self._sorted_keys
        pos = bisect(nodes, key)

        if pos == len(nodes):
            return 0
        return pos
1247700
def modify_key_parity(key):
    
    validated_key = b''
    for byte in key:
        if parityOf(int(byte)) == -1:
            byte_candidate = int(byte) + 1 
            while parityOf(byte_candidate) == -1:
                byte_candidate = divmod(byte_candidate + 1, 256)[1]
            validated_key += bytes([byte_candidate])

        else:
            validated_key += bytes([byte])
    return validated_key