code: def getOrCreateSparkContext(conf=None, appName=None):
      """
      Get the current active SparkContext or create a new SparkContext.
      :param conf: An instance of SparkConf. If not specified, a new SparkConf with
             Analytics Zoo and BigDL configurations would be created and used.
      :param appName: The name of the application if any.
  
      :return: An instance of SparkContext.
      """
      with SparkContext._lock:
          if SparkContext._active_spark_context is None:
              spark_conf = init_spark_conf() if conf is None else conf
              if appName:
                  spark_conf.setAppName(appName)
              return SparkContext.getOrCreate(spark_conf)
          else:
              return SparkContext.getOrCreate()
  
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 8 for calling a global function with example usage: getOrCreateSparkContext(conf, appName) and returns: SparkContext, SparkContext