code: def test_rotate_coordinates():
      """Test rotating a line to the horizontal and vertical"""
  
      img = numpy.zeros((20, 20))
      pt0 = (2, 2)
      pt1 = (6, 18)
      centrosome.cpmorphology.draw_line(img, pt0, pt1, 1)
      i, j = numpy.mgrid[0:20, 0:20]
      for option in (
          cellprofiler.modules.flipandrotate.C_HORIZONTALLY,
          cellprofiler.modules.flipandrotate.C_VERTICALLY,
      ):
  
          def fn(module):
              assert isinstance(
                  module,
                  cellprofiler.modules.flipandrotate.FlipAndRotate,
              )
              module.flip_choice.value = (
                  cellprofiler.modules.flipandrotate.FLIP_NONE
              )
              module.rotate_choice.value = (
                  cellprofiler.modules.flipandrotate.ROTATE_COORDINATES
              )
              module.horiz_or_vert.value = option
              module.wants_crop.value = False
              module.first_pixel.value = pt0
              module.second_pixel.value = pt1
  
          output_image, angle = run_module(img, fn=fn)
          pixels = output_image.pixel_data
  
          if (
              option
              == cellprofiler.modules.flipandrotate.C_HORIZONTALLY
          ):
              assert (
                  round(
                      abs(
                          angle
                          - numpy.arctan2(
                              pt1[0] - pt0[0], pt1[1] - pt0[1]
                          )
                          * 180.0
                          / numpy.pi
                      ),
                      3,
                  )
                  == 0
              )
              #
              # Account for extra pixels due to twisting
              #
              line_i = 4 + (pixels.shape[0] - 20) / 2
              line_j = 4 + (pixels.shape[1] - 20) / 2
              assert numpy.all(
                  pixels[int(line_i), int(line_j) : int(line_j) + 12]
                  > 0.2
              )
              assert numpy.all(
                  pixels[:20, :20][numpy.abs(i - line_i) > 1] < 0.1
              )
          else:
              assert (
                  round(
                      abs(
                          angle
                          - -numpy.arctan2(
                              pt1[1] - pt0[1], pt1[0] - pt0[0]
                          )
                          * 180.0
                          / numpy.pi
                      ),
                      3,
                  )
                  == 0
              )
              line_i = 4 + (pixels.shape[0] - 20) / 2
              line_j = 15 + (pixels.shape[1] - 20) / 2
              assert numpy.all(
                  pixels[int(line_i) : int(line_i) + 12, int(line_j)]
                  > 0.2
              )
              assert numpy.all(
                  pixels[:20, :20][numpy.abs(j - line_j) > 1] < 0.1
              )
  
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 6 for calling a global function with example usage: test_rotate_coordinates() without return types