code: def spark():
      spark = (
          SparkSession.builder.remote("local[2]")
          .config(
              # The jars for spark-connect are not bundled in the pyspark package
              "spark.jars.packages",
              f"org.apache.spark:spark-connect_2.12:{pyspark.__version__}",
          )
          .getOrCreate()
      )
      yield spark
      spark.stop()
  
file_path: mlflow/tests/pyfunc/test_spark_connect.py
imports: import numpy
  import pandas
  import pyspark
  import pytest
  from pyspark.sql import SparkSession
  from sklearn.datasets import load_iris
  from sklearn.linear_model import LogisticRegression
  import mlflow
label_desc: Use image node_id 1 for calling a global function with example usage: spark() without return types