def test_pardo_with_undeclared_side_outputs(self):
    numbers = [1, 2, 3, 4, 5, 10, 20]
    # [START model_pardo_with_side_outputs_undeclared]
    def even_odd(x):
      yield pvalue.SideOutputValue('odd' if x % 2 else 'even', x)
      if x % 10 == 0:
        yield x

    results = numbers | df.FlatMap(even_odd).with_outputs()

    evens = results.even
    odds = results.odd
    tens = results[None]  # the undeclared main output
    # [END model_pardo_with_side_outputs_undeclared]

    self.assertEqual({2, 4, 10, 20}, set(evens))
    self.assertEqual({1, 3, 5}, set(odds))
    self.assertEqual({10, 20}, set(tens))
dataset/ETHPy150Open GoogleCloudPlatform/DataflowPythonSDK/google/cloud/dataflow/examples/snippets/snippets_test.py/ParDoTest.test_pardo_with_undeclared_side_outputs/original