code: def spark_session():
      # Creates more helpful debug messages if Spark tests fail for some Java-related reason
      try:
          import faulthandler
  
          faulthandler.enable()
          faulthandler.disable()
      except:
          pass
      # Set timeout & heartbeat interval to 10 minutes to ensure tests can run to completion
      conf = (
          SparkConf(False)
          .setMaster("local[2]")
          .setAppName("unit-tests")
      )
      conf = conf.set("spark.network.timeout", "600000").set(
          "spark.executor.heartbeatInterval", "600000"
      )
      return SparkSession.builder.config(conf=conf).getOrCreate()
  
imports: import pytest
  from pyspark import SparkConf
  from pyspark.sql import SparkSession
label_desc: Use image node_id 1 for calling a global function with example usage: spark_session() and returns: SparkSession