code: def _check_dl_dependencies(msg=None, severity="error"):
      """Check if deep learning dependencies are installed.
  
      Parameters
      ----------
      msg : str, optional, default= default message (msg below)
          error message to be returned in the `ModuleNotFoundError`, overrides default
      severity : str, "error" (default), "warning", "none"
          behaviour for raising errors or warnings
          "error" - raises a ModuleNotFoundError if one of packages is not installed
          "warning" - raises a warning if one of packages is not installed
              function returns False if one of packages is not installed, otherwise True
          "none" - does not raise exception or warning
              function returns False if one of packages is not installed, otherwise True
  
      Raises
      ------
      ModuleNotFoundError
          User friendly error with suggested action to install deep learning dependencies
  
      Returns
      -------
      boolean - whether all packages are installed, only if no exception is raised
      """
      if not isinstance(msg, str):
          msg = (
              "tensorflow is required for deep learning functionality in `sktime`. "
              "To install these dependencies, run: `pip install sktime[dl]`"
          )
      try:
          import_module("tensorflow")
          return True
      except ModuleNotFoundError as e:
          if severity == "error":
              raise ModuleNotFoundError(msg) from e
          elif severity == "warning":
              warnings.warn(msg, stacklevel=2)
              return False
          elif severity == "none":
              return False
          else:
              raise RuntimeError(
                  "Error in calling _check_dl_dependencies, severity "
                  f'argument must be "error", "warning", or "none", found "{severity}".'
              )
  
file_path: sktime/sktime/utils/validation/_dependencies.py
imports: import io
  import sys
  import warnings
  from importlib import import_module
  from inspect import isclass
  from packaging.requirements import InvalidRequirement, Requirement
  from packaging.specifiers import InvalidSpecifier, SpecifierSet
label_desc: Use image node_id 2 for calling a global function with example usage: _check_dl_dependencies(msg, severity) and returns: True, False, False