code: def test_next_works_when_error_is_recoverable(self) -> None:
      def fn(d: int) -> bool:
          if d == 2 or d == 4:
              # Errors caused by the filter callable are always treated as
              # recoverable.
              raise ValueError("foo")
  
          return True
  
      seq = [1, 2, 3, 4, 5]
  
      pipeline = read_sequence(seq).filter(fn).and_return()
  
      output = []
  
      it = iter(pipeline)
  
      while True:
          try:
              output.append(next(it))
          except DataPipelineError:
              assert not pipeline.is_broken
          except StopIteration:
              break
  
      assert output == [1, 3, 5]
  
imports: import pytest
  from fairseq2.data import DataPipelineError, get_last_failed_example, read_sequence
label_desc: Use image node_id 2 for calling the TestDataPipeline obj's underlying member method code with example usage: obj.test_next_works_when_error_is_recoverable() and returns: True