class_docstr: Implement a consistent hashing ring.
class_docstr_tok: ["Implement","a","consistent","hashing","ring","."]
docstr: Returns a generator of nodes' configuration available
  in the continuum/ring.
  
  :param key: the key to look for.
  :param size: limit the list to at most this number of nodes.
  :param unique: a node may only appear once in the list (default True).
docstr_tok: ["Returns","a","generator","of","nodes","'","configuration","available","in","the","continuum\/ring",".",":","param","key",":","the","key","to","look","for",".",":","param","size",":","limit","the","list","to","at","most","this","number","of","nodes",".",":","param","unique",":","a","node","may","only","appear","once","in","the","list","(","default","True",")","."]
code: def range(self, key, size=None, unique=True):
      """Returns a generator of nodes' configuration available
      in the continuum/ring.
  
      :param key: the key to look for.
      :param size: limit the list to at most this number of nodes.
      :param unique: a node may only appear once in the list (default True).
      """
      all_nodes = set()
      if unique:
          size = size or len(self.runtime._nodes)
      else:
          all_nodes = []
  
      pos = self._get_pos(key)
      for key in self.runtime._keys[pos:]:
          nodename = self.runtime._ring[key]
          if unique:
              if nodename in all_nodes:
                  continue
              all_nodes.add(nodename)
          else:
              all_nodes.append(nodename)
          yield self.runtime._nodes[nodename]
          if len(all_nodes) == size:
              break
      else:
          for i, key in enumerate(self.runtime._keys):
              if i < pos:
                  nodename = self.runtime._ring[key]
                  if unique:
                      if nodename in all_nodes:
                          continue
                      all_nodes.add(nodename)
                  else:
                      all_nodes.append(nodename)
                  yield self.runtime._nodes[nodename]
                  if len(all_nodes) == size:
                      break
  
imports: from bisect import bisect
  from .ring_ketama import KetamaRing
  from .ring_meta import MetaRing
label_desc: Use image node_id 21 for calling the HashRing obj's underlying member method code with example usage: obj.range(key, size, unique) without return types