def __init__(self, metric, source):
    self._metric = metric
    self._source = source
    if self.VARZ_TYPE == VarzType.Gauge:
      self._fn = VarzReceiver.SetVarz
    elif self.VARZ_TYPE in (VarzType.AverageTimer, VarzType.AverageRate):
      self._fn = VarzReceiver.RecordPercentileSample
    else:
      self._fn = VarzReceiver.IncrementVarz

    if source:
      self._fn = functools.partial(self._fn, self._source)
    else:
      self._fn = self._Adapt(self._fn)
Returns the patterns relevant for optimizations
dataset/ETHPy150Open steveniemitz/scales/scales/varz.py/VarzMetric.__init__--crossover with--dataset/ETHPy150Open armon/pypred/pypred/optimizer.py/optimization_patterns