code: def spark(request):
      ray.init(num_cpus=2, include_dashboard=False)
      spark_session = raydp.init_spark("test", 1, 1, "500M")
  
      def stop_all():
          raydp.stop_spark()
          ray.shutdown()
  
      request.addfinalizer(stop_all)
      return spark_session
  
file_path: ray/python/ray/data/tests/test_raydp.py
imports: import pandas
  import pytest
  import raydp
  import torch
  import ray
  from ray.data.tests.conftest import *
  from ray.data.tests.test_execution_optimizer import _check_usage_record
label_desc: Use image node_id 1 for calling a global function with example usage: spark(request) and returns: spark_session