code: def _create_metric_extractor(metric_name):
    
    def extractor_fn(session_or_group):
      metric_value = _find_metric_value(session_or_group,
                                        metric_name)
      return metric_value.value if metric_value else None
  
    return extractor_fn
docs: Returns function that extracts a metric from a session group or a session.
  
    Args:
      metric_name: tensorboard.hparams.MetricName protobuffer. Identifies the
      metric to extract from the session group.
    Returns:
      A function that takes a tensorboard.hparams.SessionGroup or
      tensorborad.hparams.Session protobuffer and returns the value of the metric
      identified by 'metric_name' or None if the value doesn't exist.