code: def test_out_of_bounds(self):
      # Check that a ring that is completely out of the map boundary
      # produces an empty result.
      # XXX Check efficiency?
      projection = ccrs.TransverseMercator(
          central_longitude=0, approx=True
      )
  
      rings = [
          # All valid
          ([(86, 1), (86, -1), (88, -1), (88, 1)], -1),
          # One NaN
          ([(86, 1), (86, -1), (130, -1), (88, 1)], 1),
          # A NaN segment
          ([(86, 1), (86, -1), (130, -1), (130, 1)], 1),
          # All NaN
          ([(120, 1), (120, -1), (130, -1), (130, 1)], 0),
      ]
  
      # Try all four combinations of valid/NaN vs valid/NaN.
      for coords, expected_n_lines in rings:
          linear_ring = sgeom.LinearRing(coords)
          rings, mlinestr = projection.project_geometry(linear_ring)
          if expected_n_lines == -1:
              assert rings
              assert not mlinestr
          else:
              assert len(mlinestr.geoms) == expected_n_lines
              if expected_n_lines == 0:
                  assert mlinestr.is_empty
  
file_path: cartopy/lib/cartopy/tests/test_linear_ring.py
imports: import numpy
  import pytest
  import shapely.geometry
  import cartopy.crs
label_desc: Use image node_id 2 for calling the TestBoundary obj's underlying member method code with example usage: obj.test_out_of_bounds() without return types