code: def test_get_active(self):
      self.assertEqual(StreamingContext.getActive(), None)
  
      # Verify that getActive() returns the active context
      self.ssc.queueStream([[1]]).foreachRDD(lambda rdd: rdd.count())
      self.ssc.start()
      self.assertEqual(StreamingContext.getActive(), self.ssc)
  
      # Verify that getActive() returns None
      self.ssc.stop(False)
      self.assertEqual(StreamingContext.getActive(), None)
  
      # Verify that if the Java context is stopped, then getActive() returns None
      self.ssc = StreamingContext(self.sc, self.duration)
      self.ssc.queueStream([[1]]).foreachRDD(lambda rdd: rdd.count())
      self.ssc.start()
      self.assertEqual(StreamingContext.getActive(), self.ssc)
      self.ssc._jssc.stop(False)
      self.assertEqual(StreamingContext.getActive(), None)
  
file_path: spark/python/pyspark/streaming/tests/test_context.py
imports: import os
  import struct
  import tempfile
  import time
  from pyspark.streaming import StreamingContext
  from pyspark.testing.streamingutils import PySparkStreamingTestCase
label_desc: Use image node_id 10 for calling the StreamingContextTests obj's underlying member method code with example usage: obj.test_get_active() without return types