class_docstr: Implement a tunable consistent hashing ring.
docstr: Create a new HashRing.
  
  :param hash_fn: use this callable function to hash keys.
docstr_tok: ["Create","a","new","HashRing",".",":","param","hash_fn",":","use","this","callable","function","to","hash","keys","."]
code: def __init__(self, hash_fn):
      """Create a new HashRing.
  
      :param hash_fn: use this callable function to hash keys.
      """
      self._distribution = Counter()
      self._keys = []
      self._nodes = {}
      self._ring = {}
  
      if hash_fn and not hasattr(hash_fn, "__call__"):
          raise TypeError("hash_fn should be a callable function")
      self._hash_fn = hash_fn or (
          lambda key: int(md5(str(key).encode("utf-8")).hexdigest(), 16)
      )
  
file_path: mars/mars/lib/uhashring/ring_meta.py
imports: from collections import Counter
  from hashlib import md5
label_desc: Use image node_id 1 to create a new MetaRing object from inherited base classes: object with example: obj = MetaRing(hash_fn)