code: def run_module(image, mask=None, fn=None):
      """Run the FlipAndRotate module
  
      image - pixel data to be transformed
      mask  - optional mask on the pixel data
      fn    - function with signature, "fn(module)" that will be
              called with the FlipAndRotate module
      returns an Image object containing the flipped/rotated/masked/cropped
      image and the angle measurement.
      """
      img = cellprofiler_core.image.Image(image, mask)
      image_set_list = cellprofiler_core.image.ImageSetList()
      image_set = image_set_list.get_image_set(0)
      image_set.add(IMAGE_NAME, img)
      module = cellprofiler.modules.flipandrotate.FlipAndRotate()
      module.image_name.value = IMAGE_NAME
      module.output_name.value = OUTPUT_IMAGE
      module.set_module_num(1)
      if fn is not None:
          fn(module)
      pipeline = cellprofiler_core.pipeline.Pipeline()
      pipeline.add_module(module)
  
      def error_callback(caller, event):
          assert not isinstance(
              event, cellprofiler_core.pipeline.event.RunException
          )
  
      pipeline.add_listener(error_callback)
      measurements = cellprofiler_core.measurement.Measurements()
      workspace = cellprofiler_core.workspace.Workspace(
          pipeline,
          module,
          image_set,
          cellprofiler_core.object.ObjectSet(),
          measurements,
          image_set_list,
      )
      module.run(workspace)
      feature = (
          cellprofiler.modules.flipandrotate.M_ROTATION_F % OUTPUT_IMAGE
      )
      assert feature in measurements.get_feature_names("Image")
      angle = measurements.get_current_image_measurement(feature)
      output_image = image_set.get_image(OUTPUT_IMAGE)
      return output_image, angle
  
file_path: CellProfiler/tests/frontend/modules/test_flipandrotate.py
imports: import centrosome.cpmorphology
  import numpy
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT
  import cellprofiler.modules.flipandrotate
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.workspace
label_desc: Use image node_id 1 for calling a global function with example usage: run_module(image, mask, fn) and returns: output_image,  angle