code: def marked_up_type_name(arg_type):
      if getattr(arg_type, "__origin__", None) is typing.Union:
          if (
              len(arg_type.__args__) == 2
              and type(None) in arg_type.__args__
          ):
              optional_type = next(
                  t
                  for t in arg_type.__args__
                  if not isinstance(t, type(None))
              )
              return f"Optional[{marked_up_type_name(optional_type)}]"
          options = [marked_up_type_name(t) for t in arg_type.__args__]
          return f"Union[{', '.join(options)}]"
      elif hasattr(arg_type, "__args__"):
          options = [marked_up_type_name(t) for t in arg_type.__args__]
          type_name = (
              arg_type.__origin__.__name__
              if arg_type.__origin__
              else arg_type.__name__
          )
          return f"{type_name}[{', '.join(options)}]"
      elif arg_type is typing.Any:
          return f"Any"
      elif issubclass(arg_type, ConfigBase):
          path = canonical_path(arg_type)
          name = arg_type.__name__
          return f":doc:`{name} <{path}>`"
      else:
          return arg_type.__name__
  
imports: import collections
  import contextlib
  import itertools
  import json
  import os
  import typing
  from pytext.config import ConfigBase, ExportConfig, PyTextConfig
  from pytext.config.component import Registry
  from pytext.config.serialize import config_to_json
  from pytext.utils.file_io import PathManager
  from sphinx.ext.napoleon import GoogleDocstring
  from sphinx.pycode import ModuleAnalyzer
label_desc: Use image node_id 3 for calling a global function with example usage: marked_up_type_name(arg_type) and returns: str, str, str, str, marked_up_type_name, str, type_name, str, str, str, str, str, name, str, path, str, arg_type