code: def _test() -> None:
      import doctest
      import numpy
      from pyspark.sql import SparkSession
      import pyspark.mllib.evaluation
  
      try:
          # Numpy 1.14+ changed it's string format.
          numpy.set_printoptions(legacy="1.13")
      except TypeError:
          pass
      globs = pyspark.mllib.evaluation.__dict__.copy()
      spark = (
          SparkSession.builder.master("local[4]")
          .appName("mllib.evaluation tests")
          .getOrCreate()
      )
      globs["sc"] = spark.sparkContext
      (failure_count, test_count) = doctest.testmod(
          globs=globs, optionflags=doctest.ELLIPSIS
      )
      spark.stop()
      if failure_count:
          sys.exit(-1)
  
imports: from typing import Generic, List, Optional, Tuple, TypeVar, Union
  import sys
  from pyspark import since
  from pyspark.rdd import RDD
  from pyspark.mllib.common import JavaModelWrapper, callMLlibFunc
  from pyspark.mllib.linalg import Matrix
  from pyspark.sql import SQLContext
  from pyspark.sql.types import ArrayType, DoubleType, StructField, StructType
label_desc: Use image node_id 1 for calling a global function with example usage: _test() without return types