code: def test_transform_PlateCarree_shortcut():
      src = ccrs.PlateCarree(central_longitude=0)
      target = ccrs.PlateCarree(central_longitude=180)
  
      # of the 3 paths, 2 of them cannot be short-cutted.
      pth1 = mpath.Path([[0.5, 0], [10, 10]])
      pth2 = mpath.Path([[0.5, 91], [10, 10]])
      pth3 = mpath.Path([[-0.5, 0], [10, 10]])
  
      trans = InterProjectionTransform(src, target)
  
      with mock.patch.object(
          target, "project_geometry", wraps=target.project_geometry
      ) as counter:
          trans.transform_path(pth1)
          # pth1 should allow a short-cut.
          counter.assert_not_called()
  
      with mock.patch.object(
          target, "project_geometry", wraps=target.project_geometry
      ) as counter:
          trans.transform_path(pth2)
          counter.assert_called_once()
  
      with mock.patch.object(
          target, "project_geometry", wraps=target.project_geometry
      ) as counter:
          trans.transform_path(pth3)
          counter.assert_called_once()
  
imports: from unittest import mock
  import matplotlib.path
  import matplotlib.pyplot
  import numpy
  import pytest
  import cartopy.crs
  import cartopy.feature
  from cartopy.mpl.geoaxes import GeoAxes, GeoAxesSubplot, InterProjectionTransform
label_desc: Use image node_id 1 for calling a global function with example usage: test_transform_PlateCarree_shortcut() without return types