code: def _format_marker(marker, first=True):
      # type: (Union[List[str], Tuple[Node, ...], str], Optional[bool]) -> str
  
      assert isinstance(marker, (list, tuple, string_types))
  
      # Sometimes we have a structure like [[...]] which is a single item list
      # where the single item is itself it's own list. In that case we want skip
      # the rest of this function so that we don't get extraneous () on the
      # outside.
      if (
          isinstance(marker, list)
          and len(marker) == 1
          and isinstance(marker[0], (list, tuple))
      ):
          return _format_marker(marker[0])
  
      if isinstance(marker, list):
          inner = (_format_marker(m, first=False) for m in marker)
          if first:
              return " ".join(inner)
          else:
              return "(" + " ".join(inner) + ")"
      elif isinstance(marker, tuple):
          return " ".join([m.serialize() for m in marker])
      else:
          return marker
  
imports: from __future__ import absolute_import, division, print_function
  import operator
  import os
  import platform
  import sys
  from pyparsing import Forward, Group, Literal, ParseException, ParseResults, QuotedString, ZeroOrMore, stringEnd, stringStart
  from ._compat import string_types
  from ._typing import TYPE_CHECKING
  from .specifiers import InvalidSpecifier, Specifier
label_desc: Use image node_id 2 for calling a global function with example usage: _format_marker(marker, first) and returns: _format_marker, str, unknown, str, marker