def slice(self, begin, end):
        """Filter RDDs to between begin and end.

        :param datetime.datetime|int begin: datetiem or unix timestamp
        :param datetime.datetime|int end: datetiem or unix timestamp
        :rtype: DStream
        """
        return self.transform(lambda time_, rdd:
                              rdd if begin <= time_ <= end
                              else EmptyRDD(self._context._context))
Filter RDDs to between begin and end.

        :param datetime.datetime|int begin: datetiem or unix timestamp
        :param datetime.datetime|int end: datetiem or unix timestamp
        :rtype: DStream