code: def __init__(
      self,
      *,
      metric: Callable[..., Union[float, int]],
      transform: str,
      sample_param_names: List[str],
  ):
      if not callable(metric):
          raise ValueError(_METRIC_CALLABLE_ERROR)
      sig = inspect.signature(metric)
  
      for param_name in parameters_for_transforms:
          if param_name in sig.parameters:
              raise ValueError(_METHOD_ARG_ERROR.format(param_name))
      self._metric_fn = metric
  
      if transform not in transform_options:
          raise ValueError(_INVALID_TRANSFORM)
      self._transform = transform
  
      self._sample_param_names = []
      if sample_param_names is not None:
          self._sample_param_names = sample_param_names
  
imports: import functools
  import inspect
  from typing import Callable, List, Union
  from ._metric_frame import MetricFrame
label_desc: Use image node_id 1 to create a new _DerivedMetric object  with example: obj = _DerivedMetric()