code: def extend_dataset_builder_for_streaming(builder: "DatasetBuilder"):
      """Extend the dataset builder module and the modules imported by it to support streaming.
  
      Args:
          builder (:class:`DatasetBuilder`): Dataset builder instance.
      """
      # this extends the open and os.path.join functions for data streaming
      download_config = DownloadConfig(
          storage_options=builder.storage_options, token=builder.token
      )
      extend_module_for_streaming(
          builder.__module__, download_config=download_config
      )
      # if needed, we also have to extend additional internal imports (like wmt14 -> wmt_utils)
      if not builder.__module__.startswith(
          "datasets."
      ):  # check that it's not a packaged builder like csv
          for imports in get_imports(
              inspect.getfile(builder.__class__)
          ):
              if imports[0] == "internal":
                  internal_import_name = imports[1]
                  internal_module_name = ".".join(
                      builder.__module__.split(".")[:-1]
                      + [internal_import_name]
                  )
                  extend_module_for_streaming(
                      internal_module_name,
                      download_config=download_config,
                  )
  
      # builders can inherit from other builders that might use streaming functionality
      # (for example, ImageFolder and AudioFolder inherit from FolderBuilder which implements examples generation)
      # but these parents builders are not patched automatically as they are not instantiated, so we patch them here
      from .builder import DatasetBuilder
  
      parent_builder_modules = [
          cls.__module__
          for cls in type(builder).__mro__[
              1:
          ]  # make sure it's not the same module we've already patched
          if issubclass(cls, DatasetBuilder)
          and cls.__module__ != DatasetBuilder.__module__
      ]  # check it's not a standard builder from datasets.builder
      for module in parent_builder_modules:
          extend_module_for_streaming(
              module, download_config=download_config
          )
  
file_path: datasets/src/datasets/streaming.py
imports: import importlib
  import inspect
  from functools import wraps
  from typing import TYPE_CHECKING, Optional
  from .download.download_config import DownloadConfig
  from .download.streaming_download_manager import xbasename, xdirname, xet_parse, xexists, xgetsize, xglob, xgzip_open, xisdir, xisfile, xjoin, xlistdir, xnumpy_load, xopen, xpandas_read_csv, xpandas_read_excel, xPath, xpyarrow_parquet_read_table, xrelpath, xsio_loadmat, xsplit, xsplitext, xwalk, xxml_dom_minidom_parse
  from .utils.logging import get_logger
  from .utils.patching import patch_submodule
  from .utils.py_utils import get_imports
label_desc: Use image node_id 2 for calling a global function with example usage: extend_dataset_builder_for_streaming(builder) without return types