class_docstr: Test case of valid data collection interface 
docstr: target: test time_window() API for pipeline
  method: Get the input data, apply it to a function over time_windows of given size,then output.
  expected: output successfully
docstr_tok: ["target",":","test","time_window","(",")","API","for","pipeline","method",":","Get","the","input","data",",","apply","it","to","a","function","over","time_windows","of","given","size",",","then","output",".","expected",":","output","successfully"]
code: def test_data_collection_time_window(self):
      """
      target: test time_window() API for pipeline
      method: Get the input data, apply it to a function over time_windows of given size,then output.
      expected: output successfully
      """
      p = (
          towhee.pipe.input("d")
          .flat_map(
              "d",
              ("n1", "n2", "t"),
              lambda x: ((a, b, c) for a, b, c in x),
          )
          .time_window(
              ("n1", "n2"),
              ("s1", "s2"),
              "t",
              3,
              3,
              lambda x, y: (sum(x), sum(y)),
          )
          .output("s1", "s2")
      )
      res = p(
          [(i, i + 1, i * 1000) for i in range(11) if i < 3 or i > 7]
      )
      assert res.get() == [3, 6]
      assert res.get() == [8, 9]
      assert res.get() == [19, 21]
  
      return True
  
imports: import sys
  import towhee
  import time
  import threading
  import numpy
  import random
  import operator
  from common import common_func
  from towhee import pipe, ops
label_desc: Use image node_id 7 for calling the TestDataCollectionAPIsValid obj's underlying member method code with example usage: obj.test_data_collection_time_window() and returns: True