code: def _get_target_formatter_type(target: Any) -> Type[TargetFormatter]:
      """Determine the ``TargetFormatter`` type for a given target.
  
      Multi-label targets can be:
          * Comma delimited string - ``CommaDelimitedMultiLabelTargetFormatter`` (e.g. ["blue,green", "red"])
          * Space delimited string - ``SpaceDelimitedMultiLabelTargetFormatter`` (e.g. ["blue green", "red"])
          * List of strings - ``MultiLabelTargetFormatter`` (e.g. [["blue", "green"], ["red"]])
          * List of numbers - ``MultiNumericTargetFormatter`` (e.g. [[0, 1], [2]])
          * Binary list - ``MultiBinaryTargetFormatter`` (e.g. [[1, 1, 0], [0, 0, 1]])
          * Soft target - ``MultiSoftTargetFormatter`` (e.g. [[0.1, 0, 0], [0.9, 0.7, 0]])
  
      Single-label targets can be:
          * Single string - ``SingleLabelTargetFormatter`` (e.g. ["blue", "green", "red"])
          * Single number - ``SingleNumericTargetFormatter`` (e.g. [0, 1, 2])
          * One-hot binary list - ``SingleBinaryTargetFormatter`` (e.g. [[1, 0, 0], [0, 1, 0], [0, 0, 1]])
  
      Args:
          target: A target that is one of: a single target, a list of targets, a comma delimited string.
  
      """
      if isinstance(target, str):
          target = _strip(target)
          # TODO: This could be a dangerous assumption if people happen to have a label that contains a comma or space
          if "," in target:
              return CommaDelimitedMultiLabelTargetFormatter
          if " " in target:
              return SpaceDelimitedTargetFormatter
          return SingleLabelTargetFormatter
      if _is_list_like(target):
          if isinstance(target[0], str):
              return MultiLabelTargetFormatter
          target = _as_list(target)
          if len(target) > 1:
              if all(t == 0 or t == 1 for t in target):
                  if sum(target) == 1:
                      return SingleBinaryTargetFormatter
                  return MultiBinaryTargetFormatter
              if any(isinstance(t, float) for t in target):
                  return MultiSoftTargetFormatter
              return MultiNumericTargetFormatter
      return SingleNumericTargetFormatter
  
imports: from dataclasses import dataclass
  from functools import reduce
  from typing import Any, ClassVar, Dict, List, Optional, Tuple, Type, Union, cast
  import numpy
  import torch
  from torch import Tensor
  from flash.core.data.utilities.sort import sorted_alphanumeric
  from flash.core.utilities.imports import _TOPIC_CORE_AVAILABLE
label_desc: Use image node_id 4 for calling a global function with example usage: _get_target_formatter_type(target) and returns: SingleNumericTargetFormatter, SingleLabelTargetFormatter, CommaDelimitedMultiLabelTargetFormatter, SpaceDelimitedTargetFormatter, MultiLabelTargetFormatter, MultiNumericTargetFormatter, MultiBinaryTargetFormatter, MultiSoftTargetFormatter, SingleBinaryTargetFormatter