code: def test_load_v2(self):
      pipeline_file = os.path.join(
          get_data_directory(), "modules/images/v2.pipeline"
      )
      with open(pipeline_file, "r") as fd:
          data = fd.read()
  
      for fc, fctext in (
          (
              cellprofiler_core.constants.modules.images.FILTER_CHOICE_CUSTOM,
              "Custom",
          ),
          (
              cellprofiler_core.constants.modules.images.FILTER_CHOICE_IMAGES,
              "Images only",
          ),
          (
              cellprofiler_core.constants.modules.images.FILTER_CHOICE_NONE,
              "No filtering",
          ),
      ):
          pipeline = cellprofiler_core.pipeline.Pipeline()
  
          def callback(caller, event):
              assert not isinstance(
                  event,
                  cellprofiler_core.pipeline.event._load_exception.LoadException,
              )
  
          pipeline.add_listener(callback)
          pipeline.load(io.StringIO(data % fctext))
          assert len(pipeline.modules()) == 1
          module = pipeline.modules()[0]
          assert isinstance(
              module, cellprofiler_core.modules.images.Images
          )
          assert module.filter_choice == fc
          assert (
              module.filter.value
              == 'or (directory does startwith "foo") (file does contain "bar")'
          )
  
imports: import io
  import os
  import tempfile
  import cellprofiler_core.constants.modules.images
  import cellprofiler_core.measurement
  import cellprofiler_core.pipeline
  import cellprofiler_core.pipeline.event._load_exception
  import cellprofiler_core.workspace
  import cellprofiler_core.modules.images
  import cellprofiler_core.modules.metadata
  from cellprofiler_core.utilities.pathname import url2pathname, pathname2url
  import tests.core
label_desc: Use image node_id 4 for calling the TestImages obj's underlying member method code with example usage: obj.test_load_v2() without return types