def __init__(self, width, depth, n = -1):
    """Initialize the count-min sketch context.

    Pre-compute the hashes of all elements if the number of elements is
    known (n>0).

    Args:
      width: width of the cm-sketch
      depth: depth of the cm-sketch
      n: number of elements, -1 if it's unknown
    """
    self.width = width
    self.depth = depth
    self.cache = dict()  # cache of hash value to a list of ids
    if n != -1:
      for e in tqdm(range(n)):
        e = str(e)
        self.cache[e] = [self._hash(e, i) for i in range(self.depth)]
Initialize the count-min sketch context.

    Pre-compute the hashes of all elements if the number of elements is
    known (n>0).

    Args:
      width: width of the cm-sketch
      depth: depth of the cm-sketch
      n: number of elements, -1 if it's unknown
    
language/emql/cm_sketch.py