code: def init_spark_on_local(
      cores=2,
      conf=None,
      python_location=None,
      spark_log_level="WARN",
      redirect_spark_log=True,
  ):
      """
      Create a SparkContext with Analytics Zoo configurations on the local machine.
  
      :param cores: The number of cores for Spark local. Default to be 2. You can also set it to "*"
             to use all the available cores. i.e `init_spark_on_local(cores="*")`
      :param conf: You can append extra conf for Spark in key-value format.
             i.e conf={"spark.executor.extraJavaOptions": "-XX:+PrintGCDetails"}.
             Default to be None.
      :param python_location: The path to your running Python executable. If not specified, the
             default Python interpreter in effect would be used.
      :param spark_log_level: The log level for Spark. Default to be 'WARN'.
      :param redirect_spark_log: Whether to redirect the Spark log to local file. Default to be True.
  
      :return: An instance of SparkContext.
      """
      from zoo.util.spark import SparkRunner
  
      runner = SparkRunner(
          spark_log_level=spark_log_level,
          redirect_spark_log=redirect_spark_log,
      )
      set_python_home()
      return runner.init_spark_on_local(
          cores=cores, conf=conf, python_location=python_location
      )
  
imports: from bigdl.util.common import *
  from zoo.common.utils import callZooFunc
  from zoo.util.utils import set_python_home
  import warnings
  import multiprocessing
  import os
  import threading
  import sys
label_desc: Use image node_id 1 for calling a global function with example usage: init_spark_on_local(cores, conf, python_location, spark_log_level, redirect_spark_log) and returns: runner