class_docstr: Test Pipeline
class_docstr_tok: ["Test","Pipeline"]
code: def test_window(self):
      pipe = (
          Pipeline.input("n1", "n2")
          .flat_map(
              ("n1", "n2"), ("n1", "n2"), lambda x, y: list(zip(x, y))
          )
          .window(("n1", "n2"), ("s1", "s2"), 2, 1, ops.local.sum2())
          .output("s1", "s2")
      )
      res = pipe([10, 20, 30, 40], [1, 2, 3, 4])
      self.assertEqual(res.get(), [30, 3])
      self.assertEqual(res.get(), [50, 5])
  
      pipe = (
          Pipeline.input("n1", "n2")
          .flat_map(
              ("n1", "n2"), ("n1", "n2"), lambda x, y: list(zip(x, y))
          )
          .window(("n1", "n2"), ("s1", "s2"), 2, 2, ops.local.sum2())
          .output("s1", "s2")
      )
      res = pipe([10, 20, 30, 40], [1, 2, 3, 4])
      self.assertEqual(res.get(), [30, 3])
      self.assertEqual(res.get(), [70, 7])
  
      p = (
          Pipeline.input("x")
          .map("x", "z", lambda x: [i + 1 for i in range(x)])
          .flat_map("z", "x", NOPNodeOperator())
          .window("x", "y", 2, 1, lambda x: sum(x))
          .map("y", "z", lambda x: x * 10)
          .output("z")
      )
      res = p(4)
      self.assertEqual(res.to_list(), [[30], [50], [70], [40]])
  
imports: import unittest
  from towhee.operator.nop import NOPNodeOperator
  from towhee.operator import PyOperator
  from towhee.runtime.pipeline import Pipeline
  from towhee.runtime.data_queue import Empty
  from towhee.runtime import ops, register
  from towhee.runtime.runtime_pipeline import RuntimePipeline
label_desc: Use image node_id 18 for calling the TestPipeline obj's underlying member method code with example usage: obj.test_window() without return types