code: def _check_import(obj, *, module: str, package: str) -> None:
      """Check if a required dependency is installed.
  
      If `module` can't be imported, this function raises an `ImportError` instructing
      the user to install `package` from PyPI.
  
      Args:
          obj: The object that has a dependency.
          module: The name of the module to import.
          package: The name of the package on PyPI.
      """
      try:
          importlib.import_module(module)
      except ImportError:
          raise ImportError(
              f"`{obj.__class__.__name__}` depends on '{package}', but '{package}' "
              f"couldn't be imported. You can install '{package}' by running `pip "
              f"install {package}`."
          )
  
imports: import importlib
  import logging
  import os
  import pathlib
  import random
  import sys
  import threading
  import time
  import urllib.parse
  from collections import deque
  from types import ModuleType
  from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, Iterator, List, Optional, Tuple, TypeVar, Union
  import numpy
  import ray
  from ray._private.utils import _get_pyarrow_version
  from ray.data._internal.arrow_ops.transform_pyarrow import unify_schemas
  from ray.data.context import WARN_PREFIX, DataContext
label_desc: Use image node_id 8 for calling a global function with example usage: _check_import(obj) without return types