code: def foreachRDD(self, func):
          
          if func.__code__.co_argcount == 1:
              old_func = func
              func = lambda t, rdd: old_func(rdd)
          jfunc = TransformFunction(self._sc, func, self._jrdd_deserializer)
          api = self._ssc._jvm.PythonDStream
          api.callForeachRDD(self._jdstream, jfunc)
docs: Apply a function to each RDD in this DStream.