code: def _test() -> None:
      import os
      import sys
      from pyspark.testing.utils import search_jar
  
      avro_jar = search_jar(
          "connector/avro", "spark-avro", "spark-avro"
      )
      if avro_jar is None:
          print(
              "Skipping all Avro Python tests as the optional Avro project was "
              "not compiled into a JAR. To run these tests, "
              "you need to build Spark with 'build/sbt -Pavro package' or "
              "'build/mvn -Pavro package' before running this test."
          )
          sys.exit(0)
      else:
          existing_args = os.environ.get(
              "PYSPARK_SUBMIT_ARGS", "pyspark-shell"
          )
          jars_args = "--jars %s" % avro_jar
          os.environ["PYSPARK_SUBMIT_ARGS"] = " ".join(
              [jars_args, existing_args]
          )
  
      import doctest
      from pyspark.sql import SparkSession
      import pyspark.sql.avro.functions
  
      globs = pyspark.sql.avro.functions.__dict__.copy()
      spark = (
          SparkSession.builder.master("local[4]")
          .appName("sql.avro.functions tests")
          .getOrCreate()
      )
      globs["spark"] = spark
      (failure_count, test_count) = doctest.testmod(
          pyspark.sql.avro.functions,
          globs=globs,
          optionflags=doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE,
      )
      spark.stop()
      if failure_count:
          sys.exit(-1)
  
file_path: spark/python/pyspark/sql/avro/functions.py
imports: from typing import Dict, Optional, TYPE_CHECKING, cast
  from py4j.java_gateway import JVMView
  from pyspark.sql.column import Column, _to_java_column
  from pyspark.sql.utils import get_active_spark_context, try_remote_avro_functions
  from pyspark.util import _print_missing_jar
label_desc: Use image node_id 3 for calling a global function with example usage: _test() without return types