code: def _verify_package(
      name: str, operation: Optional[str], version: str
  ) -> None:
      try:
          module_dist = pkg_resources.get_distribution(name)
          installed_version = LooseVersion(module_dist.version)
      except pkg_resources.DistributionNotFound:
          try:
              module = importlib.import_module(name)  # type: ignore
              installed_version = LooseVersion(module.__version__)
          except ImportError:
              raise MissingPackageError(name)
  
      if not operation:
          return
  
      required_version = LooseVersion(version)
  
      if operation == "==":
          check = required_version == installed_version
      elif operation == ">":
          check = installed_version > required_version
      elif operation == "<":
          check = installed_version < required_version
      elif operation == ">=":
          check = (
              installed_version > required_version
              or installed_version == required_version
          )
      else:
          raise NotImplementedError(
              "operation '%s' is not supported" % operation
          )
      if not check:
          raise IncorrectPackageVersionError(
              name, installed_version, operation, required_version
          )
  
file_path: auto-sklearn/autosklearn/util/dependencies.py
imports: from typing import List, Optional, Union, no_type_check
  import importlib
  from distutils.version import LooseVersion
  import pkg_resources
  from autosklearn.util import RE_PATTERN
label_desc: Use image node_id 2 for calling a global function with example usage: _verify_package(name, operation, version) without return types