code: def test_load_v2():
      file = tests.frontend.modules.get_test_resources_directory(
          "measureobjectneighbors/v2.pipeline"
      )
      with open(file, "r") as fd:
          data = fd.read()
  
      pipeline = cellprofiler_core.pipeline.Pipeline()
  
      def callback(caller, event):
          assert not isinstance(
              event, cellprofiler_core.pipeline.event.LoadException
          )
  
      pipeline.add_listener(callback)
      pipeline.load(six.moves.StringIO(data))
      assert len(pipeline.modules()) == 1
      module = pipeline.modules()[0]
      assert isinstance(
          module,
          cellprofiler.modules.measureobjectneighbors.MeasureObjectNeighbors,
      )
      assert module.object_name == "glia"
      assert module.neighbors_name == "neurites"
      assert (
          module.distance_method
          == cellprofiler.modules.measureobjectneighbors.D_EXPAND
      )
      assert module.distance == 2
      assert not module.wants_count_image
      assert module.count_image_name == "countimage"
      assert module.count_colormap == "pink"
      assert not module.wants_percent_touching_image
      assert module.touching_image_name == "touchingimage"
      assert module.touching_colormap == "purple"
  
imports: import numpy
  import six.moves
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  from cellprofiler_core.constants.measurement import COLTYPE_INTEGER, COLTYPE_FLOAT, NEIGHBORS, R_FIRST_OBJECT_NUMBER, R_SECOND_OBJECT_NUMBER
  from cellprofiler_core.measurement import RelationshipKey
  import cellprofiler.modules.measureobjectneighbors
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.workspace
  import tests.frontend.modules
label_desc: Use image node_id 2 for calling a global function with example usage: test_load_v2() without return types