code: def _validate_metric_input(metric):
      if isinstance(metric, str):
          if metric.upper() in ("CATEGORICAL_ACCURACY", "ACCURACY"):
              return CategoricalAccuracy()
          elif metric.upper() == "BINARY_ACCURACY":
              return BinaryAccuracy()
          else:
              raise ValueError(
                  "Invalid metric string input - must match pytorch function."
              )
      elif isinstance(metric, Metric):
          return metric
      else:
          raise ValueError("Invalid metric input")
  
file_path: pywick/pywick/modules/_utils.py
imports: import datetime
  import warnings
  import torch.nn.functional
  import torch.optim
  from ..metrics import Metric, CategoricalAccuracy, BinaryAccuracy
  from ..initializers import GeneralInitializer
label_desc: Use image node_id 5 for calling a global function with example usage: _validate_metric_input(metric) and returns: CategoricalAccuracy, metric, BinaryAccuracy