class_docstr: Main entry point for Spark Streaming functionality. A StreamingContext
  represents the connection to a Spark cluster, and can be used to create
  :class:`DStream` various input sources. It can be from an existing :class:`SparkContext`.
  After creating and transforming DStreams, the streaming computation can
  be started and stopped using `context.start()` and `context.stop()`,
  respectively. `context.awaitTermination()` allows the current thread
  to wait for the termination of the context by `stop()` or by an exception.
  
  .. deprecated:: Spark 3.4.0
     This is deprecated as of Spark 3.4.0.
     There are no longer updates to DStream and it's a legacy project.
     There is a newer and easier to use streaming engine in Spark called Structured Streaming.
     You should use Spark Structured Streaming for your streaming applications.
  
  Parameters
  ----------
  sparkContext : :class:`SparkContext`
      SparkContext object.
  batchDuration : int, optional
      the time interval (in seconds) at which streaming
      data will be divided into batches
class_docstr_tok: ["Main","entry","point","for","Spark","Streaming","functionality",".","A","StreamingContext","represents","the","connection","to","a","Spark","cluster",",","and","can","be","used","to","create",":","class",":","`","DStream","`","various","input","sources",".","It","can","be","from","an","existing",":","class",":","`","SparkContext","`",".","After","creating","and","transforming","DStreams",",","the","streaming","computation","can","be","started","and","stopped","using","`","context.start","(",")","`","and","`","context.stop","(",")","`",",","respectively",".","`","context.awaitTermination","(",")","`","allows","the","current","thread","to","wait","for","the","termination","of","the","context","by","`","stop","(",")","`","or","by","an","exception",".","..","deprecated",":",":","Spark","3.4.0","This","is","deprecated","as","of","Spark","3.4.0",".","There","are","no","longer","updates","to","DStream","and","it","'s","a","legacy","project",".","There","is","a","newer","and","easier","to","use","streaming","engine","in","Spark","called","Structured","Streaming",".","You","should","use","Spark","Structured","Streaming","for","your","streaming","applications",".","Parameters","--","--","--","--","--","sparkContext",":",":","class",":","`","SparkContext","`","SparkContext","object",".","batchDuration",":","int",",","optional","the","time","interval","(","in","seconds",")","at","which","streaming","data","will","be","divided","into","batches"]
docstr: Either return the active StreamingContext (i.e. currently started but not stopped),
  or recreate a StreamingContext from checkpoint data or create a new StreamingContext
  using the provided setupFunc function. If the checkpointPath is None or does not contain
  valid checkpoint data, then setupFunc will be called to create a new context and setup
  DStreams.
  
  Parameters
  ----------
  checkpointPath : str
      Checkpoint directory used in an earlier streaming program. Can be
      None if the intention is to always create a new context when there
      is no active context.
  setupFunc : function
      Function to create a new JavaStreamingContext and setup DStreams
docstr_tok: ["Either","return","the","active","StreamingContext","(","i.e",".","currently","started","but","not","stopped",")",",","or","recreate","a","StreamingContext","from","checkpoint","data","or","create","a","new","StreamingContext","using","the","provided","setupFunc","function",".","If","the","checkpointPath","is","None","or","does","not","contain","valid","checkpoint","data",",","then","setupFunc","will","be","called","to","create","a","new","context","and","setup","DStreams",".","Parameters","--","--","--","--","--","checkpointPath",":","str","Checkpoint","directory","used","in","an","earlier","streaming","program",".","Can","be","None","if","the","intention","is","to","always","create","a","new","context","when","there","is","no","active","context",".","setupFunc",":","function","Function","to","create","a","new","JavaStreamingContext","and","setup","DStreams"]
code: def getActiveOrCreate(
      cls,
      checkpointPath: str,
      setupFunc: Callable[[], "StreamingContext"],
  ) -> "StreamingContext":
      """
      Either return the active StreamingContext (i.e. currently started but not stopped),
      or recreate a StreamingContext from checkpoint data or create a new StreamingContext
      using the provided setupFunc function. If the checkpointPath is None or does not contain
      valid checkpoint data, then setupFunc will be called to create a new context and setup
      DStreams.
  
      Parameters
      ----------
      checkpointPath : str
          Checkpoint directory used in an earlier streaming program. Can be
          None if the intention is to always create a new context when there
          is no active context.
      setupFunc : function
          Function to create a new JavaStreamingContext and setup DStreams
      """
  
      if not callable(setupFunc):
          raise TypeError("setupFunc should be callable.")
      activeContext = cls.getActive()
      if activeContext is not None:
          return activeContext
      elif checkpointPath is not None:
          return cls.getOrCreate(checkpointPath, setupFunc)
      else:
          return setupFunc()
  
imports: from typing import Any, Callable, List, Optional, TypeVar
  from py4j.java_gateway import java_import, is_instance_of, JavaObject
  from pyspark import RDD, SparkConf
  from pyspark.serializers import NoOpSerializer, UTF8Deserializer, CloudPickleSerializer
  from pyspark.context import SparkContext
  from pyspark.storagelevel import StorageLevel
  from pyspark.streaming.dstream import DStream
  from pyspark.streaming.listener import StreamingListener
  from pyspark.streaming.util import TransformFunction, TransformFunctionSerializer
  import warnings
label_desc: Use image node_id 7 for calling the StreamingContext obj's underlying member method code with example usage: obj.getActiveOrCreate(cls, checkpointPath, setupFunc) and returns: activeContext, cls, setupFunc