code: def _test_roundtrip(expected_cf, wkt_startswith):
      crs = CRS.from_cf(expected_cf)
      cf_dict = crs.to_cf()
      assert cf_dict.pop("crs_wkt").startswith(wkt_startswith)
      assert_almost_equal(
          cf_dict.pop("semi_minor_axis"),
          expected_cf.pop("semi_minor_axis"),
      )
      assert_almost_equal(
          cf_dict.pop("inverse_flattening"),
          expected_cf.pop("inverse_flattening"),
      )
      if "towgs84" in expected_cf:
          assert_almost_equal(
              cf_dict.pop("towgs84"), expected_cf.pop("towgs84")
          )
  
      assert cf_dict == expected_cf
  
imports: import numpy
  import pytest
  from numpy.testing import assert_almost_equal
  from packaging import version
  from pyproj import CRS
  from pyproj.crs import ProjectedCRS
  from pyproj.crs._cf1x8 import _try_list_if_string
  from pyproj.crs.coordinate_operation import LambertAzimuthalEqualAreaConversion, LambertCylindricalEqualAreaConversion, MercatorAConversion, OrthographicConversion, PolarStereographicAConversion, PolarStereographicBConversion, SinusoidalConversion, StereographicConversion, VerticalPerspectiveConversion
  from pyproj.exceptions import CRSError
  from test.conftest import PROJ_GTE_901, PROJ_LOOSE_VERSION
label_desc: Use image node_id 2 for calling a global function with example usage: _test_roundtrip(expected_cf, wkt_startswith) without return types