code: def __prepare_spark_env():
      spark_home = os.environ.get("SPARK_HOME", None)
      if exist_pyspark():
          # use pyspark as the spark source
          import pyspark
  
          check_spark_source_conflict(spark_home, pyspark.__file__)
      else:
          # use SPARK_HOME as the spark source
          if not spark_home:
              invalidInputError(
                  False,
                  """Could not find Spark. Please make sure SPARK_HOME env is set:
                                export SPARK_HOME=path to your spark home directory.""",
              )
          log.info(f"Using {spark_home}")
          py4j = glob.glob(
              os.path.join(spark_home, "python/lib", "py4j-*.zip")
          )[0]
          pyspark = glob.glob(
              os.path.join(spark_home, "python/lib", "pyspark*.zip")
          )[0]
          __sys_path_insert(py4j)
          __sys_path_insert(pyspark)
  
file_path: BigDL/python/dllib/src/bigdl/dllib/utils/engine.py
imports: import sys
  import os
  import glob
  import warnings
  import logging
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 4 for calling a global function with example usage: __prepare_spark_env() without return types