code: def stop_spark_standalone():
      import subprocess
  
      env = SparkRunner.standalone_env
      if env is not None:
          stop_worker_pro = subprocess.Popen(
              "{}/sbin/stop-worker.sh".format(
                  env["ZOO_STANDALONE_HOME"]
              ),
              shell=True,
              env=env,
          )
          os.waitpid(stop_worker_pro.pid, 0)
          stop_master_pro = subprocess.Popen(
              "{}/sbin/stop-master.sh".format(
                  env["ZOO_STANDALONE_HOME"]
              ),
              shell=True,
              env=env,
          )
          os.waitpid(stop_master_pro.pid, 0)
      else:
          # if env is None, then the standalone cluster is not started by analytics zoo
          pass
  
file_path: analytics-zoo/pyzoo/zoo/util/spark.py
imports: import os
  import platform
  from pyspark import SparkContext
  from zoo import init_nncontext, init_spark_conf
  from zoo.util.utils import detect_python_location, pack_penv
  from zoo.util.utils import get_executor_conda_zoo_classpath, get_zoo_bigdl_classpath_on_driver
label_desc: Use image node_id 6 for calling the SparkRunner obj's underlying member method code with example usage: obj.stop_spark_standalone() without return types