code: def distance(
      eng, matmap3d: bool, lat1, lon1, lat2, lon2
  ) -> tuple[float, float]:
      """Using Matlab Engine to do same thing as Pymap3d"""
  
      if matmap3d:
          return eng.matmap3d.vdist(lat1, lon1, lat2, lon2, nargout=2)
  
      return eng.distance(
          lat1, lon1, lat2, lon2, eng.wgs84Ellipsoid(), nargout=2
      )
  
imports: from __future__ import annotations
  from math import nan
  import pytest
  from pytest import approx
  from pymap3d.vincenty import vdist
label_desc: Use image node_id 1 for calling a global function with example usage: distance(eng, matmap3d, lat1, lon1, lat2, lon2) and returns: eng, eng