code: def global_check_import(name=None, functionality=None):
      """check if the optional dependency is available"""
      if name:
          try:
              if name == "scikit-learn":
                  import_module("sklearn")
              else:
                  import_module(name)
  
              installed_version = pkg_resources.parse_version(
                  pkg_resources.get_distribution(name).version
              )
              needed_version = pkg_resources.parse_version(
                  OPTIONAL_DEPENDENCIES[name]
              )
              if installed_version < needed_version:
                  raise ImportWarning(
                      "Outdated version of optional dependency '"
                      + name
                      + "'. "
                      + (
                          "Update '"
                          + name
                          + "' for "
                          + functionality
                          + ". "
                      )
                      if functionality
                      else ""
                      + "Use pip or conda to update '"
                      + name
                      + "' to avoid potential errors."
                  )
          except ImportError:
              raise ImportError(
                  "Missing optional dependency '"
                  + name
                  + "'. "
                  + (
                      "Install '"
                      + name
                      + "' for "
                      + functionality
                      + ". "
                  )
                  if functionality
                  else ""
                  + "Use pip or conda to install '"
                  + name
                  + "'."
              )
  
file_path: DALEX/python/dalex/dalex/_global_checks.py
imports: import pkg_resources
  from importlib import import_module
  from re import search
  import numpy
  import pandas
label_desc: Use image node_id 1 for calling a global function with example usage: global_check_import(name, functionality) without return types