code: def merge(self, rhs, lhs_filter=None, rhs_filter=None):
          
          if lhs_filter or rhs_filter:
              get_ = self.get___method
              set_ = self.set___method
              max_value = _madoka.Sketch_max_value(self)
              for table_id in range(self.depth):
                  for cell_id in range(self.width):
                      lhs_val = get_(self, table_id, cell_id)
                      rhs_val = get_(rhs, table_id, cell_id)
                      if lhs_filter:
                          lhs_val = lhs_filter(lhs_val)
                      if rhs_filter:
                          rhs_val = rhs_filter(rhs_val)
                      if (lhs_val >= max_value) or (rhs_val >= (max_value - lhs_val)):
                          lhs_val = self.max_value
                      else:
                          lhs_val += rhs_val
                      set_(self, table_id, cell_id, lhs_val)
          else:
              self.merge_method(self, rhs)
              if rhs.k:
                  for (key, val) in rhs.most_common(rhs.k):
                      self._update(key, val)
docs: Merge two sketches
          Params:
              <Sketch> sketch
              <lambda> | <function> lhs_filter
              <lambda> | <function> rhs_filter