code: def init_spark_conf(conf=None):
      spark_conf = SparkConf()
      if conf:
          spark_conf.setAll(conf.items())
      init_env(spark_conf)
      zoo_conf = get_analytics_zoo_conf()
      # Set bigDL and TF conf
      if conf and "spark.driver.extraJavaOptions" in conf:
          extraJavaOptions = conf["spark.driver.extraJavaOptions"]
          spark_conf.setAll(zoo_conf.items())
          concatJavaOptions = (
              extraJavaOptions
              + " "
              + zoo_conf.get("spark.driver.extraJavaOptions")
          )
          spark_conf.set(
              "spark.driver.extraJavaOptions", concatJavaOptions
          )
      else:
          spark_conf.setAll(zoo_conf.items())
  
      if (
          os.environ.get("BIGDL_JARS", None)
          and not is_spark_below_2_2()
      ):
          if "PYSPARK_SUBMIT_ARGS" in os.environ:
              submit_args = os.environ["PYSPARK_SUBMIT_ARGS"]
              start = submit_args.find("pyspark-shell")
              submit_args = (
                  submit_args[:start]
                  + "--driver-class-path "
                  + os.environ["BIGDL_JARS"]
                  + submit_args[start:]
              )
          else:
              submit_args = f" --driver-class-path {os.environ['BIGDL_JARS']} pyspark-shell "
          print("pyspark_submit_args is:", submit_args)
          os.environ["PYSPARK_SUBMIT_ARGS"] = submit_args
  
      # add content in PYSPARK_FILES in spark.submit.pyFiles
      # This is a workaround for current Spark on k8s
      python_lib = os.environ.get("PYSPARK_FILES", None)
      if python_lib:
          existing_py_files = spark_conf.get("spark.submit.pyFiles")
          if existing_py_files:
              spark_conf.set(
                  key="spark.submit.pyFiles",
                  value="%s,%s" % (python_lib, existing_py_files),
              )
          else:
              spark_conf.set(
                  key="spark.submit.pyFiles", value=python_lib
              )
  
      return spark_conf
  
imports: from bigdl.dllib.utils.common import *
  from bigdl.dllib.utils.file_utils import callZooFunc
  from bigdl.dllib.utils.utils import set_python_home
  from bigdl.dllib.utils.log4Error import *
  import warnings
  import multiprocessing
  import os
  import threading
  import sys
label_desc: Use image node_id 14 for calling a global function with example usage: init_spark_conf(conf) and returns: spark_conf