code: def _parse_config(
      pred_field, gt_field, method, is_temporal, **kwargs
  ):
      if method is None:
          if is_temporal:
              # @todo expose this in `fo.evaluation_config`?
              method = "activitynet"
          else:
              method = fo.evaluation_config.default_detection_backend
  
      if inspect.isclass(method):
          return method(pred_field, gt_field, **kwargs)
  
      backends = fo.evaluation_config.detection_backends
  
      if method not in backends:
          raise ValueError(
              "Unsupported detection evaluation method '%s'. The available "
              "methods are %s" % (method, sorted(backends.keys()))
          )
  
      params = deepcopy(backends[method])
  
      config_cls = kwargs.pop("config_cls", None)
  
      if config_cls is None:
          config_cls = params.pop("config_cls", None)
  
      if config_cls is None:
          raise ValueError(
              "Detection evaluation method '%s' has no `config_cls`"
              % method
          )
  
      if etau.is_str(config_cls):
          config_cls = etau.get_class(config_cls)
  
      params.update(**kwargs)
      return config_cls(pred_field, gt_field, **params)
  
imports: from copy import deepcopy
  import inspect
  import itertools
  import logging
  import numpy
  import eta.core.utils
  import fiftyone
  import fiftyone.core.evaluation
  import fiftyone.core.fields
  import fiftyone.core.labels
  import fiftyone.core.utils
  import fiftyone.core.validation
  from .base import BaseEvaluationResults
label_desc: Use image node_id 2 for calling a global function with example usage: _parse_config(pred_field, gt_field, method, is_temporal) and returns: config_cls, method