class_docstr: Implement a consistent hashing ring.
class_docstr_tok: ["Implement","a","consistent","hashing","ring","."]
docstr: Get the index of the given key in the sorted key list.
  
  We return the position with the nearest hash based on
  the provided key unless we reach the end of the continuum/ring
  in which case we return the 0 (beginning) index position.
  
  :param key: the key to hash and look for.
docstr_tok: ["Get","the","index","of","the","given","key","in","the","sorted","key","list",".","We","return","the","position","with","the","nearest","hash","based","on","the","provided","key","unless","we","reach","the","end","of","the","continuum\/ring","in","which","case","we","return","the","0","(","beginning",")","index","position",".",":","param","key",":","the","key","to","hash","and","look","for","."]
code: def _get_pos(self, key):
      """Get the index of the given key in the sorted key list.
  
      We return the position with the nearest hash based on
      the provided key unless we reach the end of the continuum/ring
      in which case we return the 0 (beginning) index position.
  
      :param key: the key to hash and look for.
      """
      p = bisect(self.runtime._keys, self.hashi(key))
      if p == len(self.runtime._keys):
          return 0
      else:
          return p
  
imports: from bisect import bisect
  from .ring_ketama import KetamaRing
  from .ring_meta import MetaRing
label_desc: Use image node_id 6 for calling the HashRing obj's underlying member method code with example usage: obj._get_pos(key) and returns: int, p