code: def import_dependency_safe(
      name,
      error="raise",
      pkg_name=None,
      min_version=None,
      custom_message=None,
  ):
      """
      ## import_dependency_safe
  
      Imports specified dependency safely. By default(`error = raise`), if a dependency is missing,
      an ImportError with a meaningful message will be raised. Otherwise if `error = log` a warning
      will be logged and on `error = silent` everything will be quit. But If a dependency is present,
      but older than specified, an error is raised if specified.
  
      Parameters:
          name (string): name of dependency to be imported.
          error (string): raise or Log or silence ImportError. Possible values are `"raise"`, `"log"` and `silent`. Default is `"raise"`.
          pkg_name (string): (Optional) package name of dependency(if different `pip` name). Otherwise `name` will be used.
          min_version (string): (Optional) required minimum version of the dependency to be imported.
          custom_message (string): (Optional) custom Import error message to be raised or logged.
  
      **Returns:** The imported module, when found and the version is correct(if specified). Otherwise `None`.
      """
      # check specified parameters
      sub_class = ""
      if not name or not isinstance(name, str):
          return None
      else:
          # extract name in case of relative import
          name = name.strip()
          if name.startswith("from"):
              name = name.split(" ")
              name, sub_class = (name[1].strip(), name[-1].strip())
  
      assert error in [
          "raise",
          "log",
          "silent",
      ], "[Vidgear:ERROR] :: Invalid value at `error` parameter."
  
      # specify package name of dependency(if defined). Otherwise use name
      install_name = pkg_name if not (pkg_name is None) else name
  
      # create message
      msg = (
          custom_message
          if not (custom_message is None)
          else "Failed to find required dependency '{}'. Install it with  `pip install {}` command.".format(
              name, install_name
          )
      )
      # try importing dependency
      try:
          module = importlib.import_module(name)
          if sub_class:
              module = getattr(module, sub_class)
      except Exception:
          # handle errors.
          if error == "raise":
              raise ImportError(msg) from None
          elif error == "log":
              logger.error(msg)
              return None
          else:
              return None
  
      # check if minimum required version
      if not (min_version) is None:
          # Handle submodules
          parent_module = name.split(".")[0]
          if parent_module != name:
              # grab parent module
              module_to_get = sys.modules[parent_module]
          else:
              module_to_get = module
          # extract version
          version = get_module_version(module_to_get)
          # verify
          if parse_version(version) < parse_version(min_version):
              # create message
              msg = """Unsupported version '{}' found. Vidgear requires '{}' dependency installed with version '{}' or greater. 
              Update it with  `pip install -U {}` command.""".format(
                  parent_module, min_version, version, install_name
              )
              # handle errors.
              if error == "silent":
                  return None
              else:
                  # raise
                  raise ImportError(msg)
  
      return module
  
imports: import os
  import re
  import sys
  import cv2
  import types
  import errno
  import stat
  import shutil
  import importlib
  import requests
  import numpy
  import logging
  import platform
  import socket
  from tqdm import tqdm
  from contextlib import closing
  from pathlib import Path
  from colorlog import ColoredFormatter
  from pkg_resources import parse_version
  from requests.adapters import HTTPAdapter, Retry
  from ..version import __version__
label_desc: Use image node_id 4 for calling a global function with example usage: import_dependency_safe(name, error, pkg_name, min_version, custom_message) and returns: module, None, None, None, None