code: def get_module(name, should_load=True):
      """
      Return module or None. Absolute import is required.
  
      :param (str) name: Dot-separated module path. E.g., 'scipy.stats'.
      :raise: (ImportError) Only when exc_msg is defined.
      :return: (module|None) If import succeeds, the module will be returned.
  
      """
      if name in sys.modules:
          return sys.modules[name]
      if not should_load:
          return None
      if name not in _not_importable:
          try:
              return import_module(name)
          except ImportError:
              _not_importable.add(name)
          except Exception:
              _not_importable.add(name)
              msg = f"Error importing optional module {name}"
              logger.exception(msg)
  
imports: from importlib import import_module
  import logging
  import sys
label_desc: Use image node_id 1 for calling a global function with example usage: get_module(name, should_load) and returns: sys, None, import_module