code: def test_geodesic_inv(
      ellipsoid,
      true_az12,
      true_az21,
      expected_distance,
      return_back_azimuth,
      scalar_and_array,
  ):
      geod = Geod(ellps=ellipsoid)
      az12, az21, dist = geod.inv(
          scalar_and_array(_BOSTON_LON),
          scalar_and_array(_BOSTON_LAT),
          scalar_and_array(_PORTLAND_LON),
          scalar_and_array(_PORTLAND_LAT),
          return_back_azimuth=return_back_azimuth,
      )
      if not return_back_azimuth:
          az21 = reverse_azimuth(az21)
      assert_almost_equal(
          (az12, az21, dist),
          (
              scalar_and_array(true_az12),
              scalar_and_array(true_az21),
              scalar_and_array(expected_distance),
          ),
          decimal=3,
      )
  
imports: import math
  import pickle
  from contextlib import nullcontext
  from itertools import permutations
  import numpy
  import pytest
  from numpy.testing import assert_almost_equal, assert_array_equal
  from pyproj import Geod
  from pyproj.geod import GeodIntermediateFlag, reverse_azimuth
label_desc: Use image node_id 1 for calling a global function with example usage: test_geodesic_inv(ellipsoid, true_az12, true_az21, expected_distance, return_back_azimuth, scalar_and_array) without return types