code: def get_type(annotation: Type) -> str:
      if get_origin(annotation) is Annotated:
          return get_type(get_args(annotation)[0])
      if get_origin(annotation) is Union:
          # Optional is Union with None.
          # We don't want to show Optional[A, None] but just Optional[A]
          if annotation.__name__ == "Optional":
              args = ",".join(
                  get_type(arg) for arg in get_args(annotation)[:-1]
              )
          else:
              args = ",".join(
                  get_type(arg) for arg in get_args(annotation)
              )
          return f"{annotation.__name__}[{args}]"
      if get_origin(annotation) is Literal:
          return str(annotation).split(".", maxsplit=1)[-1]
      if get_origin(annotation) is list:
          return f"List[{get_type(get_args(annotation)[0])}]"
      if get_origin(annotation) is dict:
          return f"Dict[{get_type(get_args(annotation)[0])}, {get_type(get_args(annotation)[1])}]"
      return annotation.__name__
  
file_path: dstack/scripts/docs/gen_schema_reference.py
imports: import importlib
  import logging
  import re
  from fnmatch import fnmatch
  from typing import Annotated, Any, Dict, Literal, Type, Union, get_args, get_origin
  import mkdocs_gen_files
  import yaml
  from mkdocs.structure.files import File
label_desc: Use image node_id 1 for calling a global function with example usage: get_type(annotation) and returns: annotation, get_type, annotation, str, args, str, str, str, get_type, str, str, get_type, str, get_type, str