code: def test_infinite_loop_bounds(self, proj):
      # test a polygon which used to get stuck in an infinite loop but is now
      # erroneously clipped.
      # see https://github.com/SciTools/cartopy/issues/1131
  
      # These names are for IGH; effectively the same for Mollweide.
      bottom = [0.0, 70.0]
      right = [0.0, 90.0]
      top = [-180.0, 90.0]
      left = [-180.0, 70.0]
      verts = np.array(
          [
              bottom,
              right,
              top,
              left,
              bottom,
          ]
      )
      bad_path = sgeom.Polygon(verts)
  
      target = proj()
      source = ccrs.PlateCarree()
  
      projected = target.project_geometry(bad_path, source)
  
      # When transforming segments was broken, the resulting path did not
      # close, and either filled most of the domain, or a smaller portion
      # than it should. Check that the bounds match the individual points at
      # the expected edges.
      projected_left = target.transform_point(left[0], left[1], source)
      assert projected.bounds[0] == pytest.approx(
          projected_left[0], rel=target.threshold
      )
      projected_bottom = target.transform_point(
          bottom[0], bottom[1], source
      )
      assert projected.bounds[1] == pytest.approx(
          projected_bottom[1], rel=target.threshold
      )
      projected_right = target.transform_point(
          right[0], right[1], source
      )
      assert projected.bounds[2] == pytest.approx(
          projected_right[0], rel=target.threshold, abs=1e-8
      )
      projected_top = target.transform_point(top[0], top[1], source)
      assert projected.bounds[3] == pytest.approx(
          projected_top[1], rel=target.threshold
      )
  
imports: import numpy
  import pytest
  import shapely.geometry
  import shapely.wkt
  import cartopy.crs
label_desc: Use image node_id 5 for calling the TestMisc obj's underlying member method code with example usage: obj.test_infinite_loop_bounds(proj) without return types