code: def _metric_unit_from_name(metric_name):
      
      for item in _PATTERN_UNIT_LIST:
          pattern, unit = item
          if pattern.match(metric_name):
              return unit
      return None
docs: Return a metric unit string for human consumption, that is inferred from
      the metric name.
  
      If a unit cannot be inferred, `None` is returned.