code: def show_versions(
      optional: bool = True, logger: Optional[logging.Logger] = None
  ):
      """Print useful debugging information (e.g. versions).
  
      Parameters
      ----------
      optional : bool, optional
          Should optional dependencies be documented, by default True
      logger : Optional[logging.Logger], optional
          The logger to use. If None, then uses print() command to display results,
          by default None
      """
  
      if logger is None:
          print_func = print
          prefix = "\n"
      else:
          print_func = logger.info
          prefix = ""
  
      print_func(f"{prefix}System:")  # noqa: T001
      sys_info = _get_sys_info()
      for k, stat in sys_info.items():
          print_func(
              "{k:>10}: {stat}".format(k=k, stat=stat)
          )  # noqa: T001
  
      print_func(
          f"{prefix}PyCaret required dependencies:"
      )  # noqa: T001
      optional_deps_info = _get_deps_info(logger=logger)
      for k, stat in optional_deps_info.items():
          print_func(
              "{k:>20}: {stat}".format(k=k, stat=stat)
          )  # noqa: T001
  
      if optional:
          print_func(
              f"{prefix}PyCaret optional dependencies:"
          )  # noqa: T001
          optional_deps_info = _get_deps_info(
              logger=logger, optional=True
          )
          for k, stat in optional_deps_info.items():
              print_func("{k:>20}: {stat}".format(k=k, stat=stat))
  
imports: import logging
  import platform
  import sys
  from typing import Optional
  from pycaret.utils._dependencies import get_module_version
label_desc: Use image node_id 3 for calling a global function with example usage: show_versions(optional, logger) without return types