code: def normalize_selection(selected: str, *, possible=None):
      if selected in (None, True, False):
          return selected
      elif isinstance(selected, str):
          selected = [selected]
      elif not selected:
          return ()
  
      unsupported = []
      _selected = set()
      for item in selected:
          if not item:
              continue
          for value in item.strip().replace(",", " ").split():
              if not value:
                  continue
              # XXX Handle subtraction (leading "-").
              if possible and value not in possible and value != "all":
                  unsupported.append(value)
              _selected.add(value)
      if unsupported:
          raise UnsupportedSelectionError(unsupported, tuple(possible))
      if "all" in _selected:
          return True
      return frozenset(selected)
  
imports: import argparse
  import contextlib
  import logging
  import os
  import os.path
  import shutil
  import sys
  from .None import fsutil, strutil, iterutil, logging
label_desc: Use image node_id 7 for calling a global function with example usage: normalize_selection(selected) and returns: frozenset, selected, True, 