code: def spark_context():
      if not spark_found:
          return None
  
      current_path = Path(__file__).parent
  
      scala = "2.12" if int(pyspark_version[0]) >= 3 else "2.11"
      hist_spark_jar = (
          current_path
          / f"jars/histogrammar-sparksql_{scala}-1.0.11.jar"
      )
      hist_jar = current_path / f"jars/histogrammar_{scala}-1.0.11.jar"
  
      spark = (
          SparkSession.builder.master("local")
          .appName("popmon-pytest")
          .config("spark.jars", f"{hist_spark_jar},{hist_jar}")
          .config("spark.sql.session.timeZone", "GMT")
          .getOrCreate()
      )
      return spark
  
file_path: popmon/tests/popmon/spark/test_spark.py
imports: from copy import deepcopy
  from pathlib import Path
  import pandas
  import pytest
  from popmon.hist.filling import make_histograms
  from popmon.pipeline.metrics import df_stability_metrics
label_desc: Use image node_id 1 for calling a global function with example usage: spark_context() and returns: spark, None