code: def _test() -> None:
      import doctest
      import os
      from pyspark.sql import SparkSession
      import pyspark.sql.streaming.readwriter
  
      os.chdir(os.environ["SPARK_HOME"])
  
      globs = pyspark.sql.streaming.readwriter.__dict__.copy()
      globs["spark"] = (
          SparkSession.builder.master("local[4]")
          .appName("sql.streaming.readwriter tests")
          .getOrCreate()
      )
  
      (failure_count, test_count) = doctest.testmod(
          pyspark.sql.streaming.readwriter,
          globs=globs,
          optionflags=doctest.ELLIPSIS
          | doctest.NORMALIZE_WHITESPACE
          | doctest.REPORT_NDIFF,
      )
      globs["spark"].stop()
  
      if failure_count:
          sys.exit(-1)
  
imports: import sys
  from collections.abc import Iterator
  from typing import cast, overload, Any, Callable, List, Optional, TYPE_CHECKING, Union
  from py4j.java_gateway import java_import, JavaObject
  from pyspark.sql.column import _to_seq
  from pyspark.sql.readwriter import OptionUtils, to_str
  from pyspark.sql.streaming.query import StreamingQuery
  from pyspark.sql.types import Row, StructType
  from pyspark.sql.utils import ForeachBatchFunction
  from pyspark.errors import PySparkTypeError, PySparkValueError, PySparkAttributeError, PySparkRuntimeError
label_desc: Use image node_id 1 for calling a global function with example usage: _test() without return types