def get_aggregate_metric(self, metric_path):
    if metric_path in self.cache:
      return self.cache[metric_path]

    match = self.regex.match(metric_path)
    result = None

    if match:
      extracted_fields = match.groupdict()
      try:
        result = self.output_template % extracted_fields
      except __HOLE__:
        log.err("Failed to interpolate template %s with fields %s" % (self.output_template, extracted_fields))

    if result:
      self.cache[metric_path] = result
    return result
dataset/ETHPy150Open graphite-project/carbon/lib/carbon/aggregator/rules.py/AggregationRule.get_aggregate_metric