def add(self, sketch, x):
    """Add an element to the sketch.

    Args:
      sketch: sketch to add x to
      x: name or id in string
    """
    assert isinstance(x, str)
    assert self.depth, self.width == sketch.shape

    if x not in self.cache:
      self.cache[x] = [self._hash(x, i) for i in range(self.depth)]
    for i in range(self.depth):
      sketch[i, self.cache[x][i]] += 1.0
Add an element to the sketch.

    Args:
      sketch: sketch to add x to
      x: name or id in string
    
language/emql/cm_sketch.py