code: def spark_test_ctx():
      ctx = SparkTestContext()
      try:
          yield ctx
      finally:
          ctx.tear_down()
  
imports: import logging
  import os
  import pickle
  import tempfile
  from base64 import b64encode, b64decode
  from collections import namedtuple
  import pytest
  import six
  from petastorm.spark import spark_dataset_converter, SparkDatasetConverter
  from petastorm.tests.test_common import create_test_dataset, create_test_scalar_dataset, create_many_columns_non_petastorm_dataset
  from pyspark.sql import SparkSession
label_desc: Use image node_id 7 for calling a global function with example usage: spark_test_ctx() without return types