def transform(self, func):
        """Return a new DStream where each RDD is transformed by ``f``.

        :param f: Function that transforms an RDD.
        :rtype: DStream
        """
        if func.__code__.co_argcount == 1:
            one_arg_func = func
            func = lambda _, rdd: one_arg_func(rdd)

        return TransformedDStream(self, func)