class_docstr: Class for creating and destroying SparkSession.
class_docstr_tok: ["Class","for","creating","and","destroying","SparkSession","."]
code: def set_up_spark(  # noqa: D102
      app_name: str,
      master: str = STANDALONE,
      conf: SparkConf = None,
      extra_dependencies: list[str] | None = None,
      extra_files: list[str] | None = None,
  ) -> SparkSession:
      conf = conf if conf else SparkConf()
  
      if extra_dependencies:
          spark_dependencies = ",".join(extra_dependencies)
          conf.set("spark.jars.packages", spark_dependencies)
  
      spark = (
          SparkSession.builder.appName(app_name)
          .master(master)
          .config(conf=conf)
          .getOrCreate()
      )
  
      extra_files = extra_files if extra_files else []
      for extra_file in extra_files:
          spark.sparkContext.addPyFile(extra_file)
  
      quiet_py4j()
      return spark
  
file_path: quinn/quinn/spark.py
imports: from __future__ import annotations
  import logging
  import os
  from pyspark import SparkConf
  from pyspark.sql import SparkSession
label_desc: Use image node_id 3 for calling the SparkProvider obj's underlying member method code with example usage: obj.set_up_spark(app_name, master, conf, extra_dependencies, extra_files) and returns: spark