code: def tear_down_env(cls):
      cls.session.stop()
      cls.session = None
      cls.sc.stop()
      cls.sc = None
  
imports: import contextlib
  import logging
  import shutil
  import sys
  import tempfile
  import unittest
  from io import StringIO
  import pytest
  from xgboost import testing
  from pyspark.sql import SparkSession
  from xgboost.spark.utils import _get_default_params_from_func
label_desc: Use image node_id 2 for calling the TestSparkContext obj's underlying member method code with example usage: obj.tear_down_env(cls) without return types