code: def get_metric_attr(metric, attr):
      for line in getattr(metrics, metric).__doc__.split("\n"):
          line = line.strip()
  
          # string
          prefix = attr + ' = "'
          suffix = '"'
          if line.startswith(prefix) and line.endswith(suffix):
              return line[len(prefix) : -len(suffix)]
  
          # number
          prefix = attr + " = "
          if line.startswith(prefix):
              return float(line[len(prefix) :])
      return ""
  
file_path: shap/shap/benchmark/plots.py
imports: import base64
  import io
  import os
  import numpy
  import sklearn
  from matplotlib.colors import LinearSegmentedColormap
  from ..None import __version__
  from ..plots import colors
  from .None import methods, metrics, models
  from .experiments import run_experiments
label_desc: Use image node_id 3 for calling a global function with example usage: get_metric_attr(metric, attr) and returns: str, line, float