code: def distance(lon0, lat0, lon1, lat1, units="km"):
      """
      Calculate the distance between two points. Return result in kilometers or miles.
  
      Parameters
      ----------
      lon0 : float
          Longitude coordinate of the first point.
      lat0 : float
          Latitude coordinate of the first point.
      lon1 : float
          Longitude coordinate of the second point.
      lat1 : float
          Latitude coordinate of the second point.
      units : {'mi', 'km'}, default='km'
          The units in which the result will be obtained.
          There are shorthands for values: 'mi' (miles), 'km' (kilometers).
  
      Returns
      -------
      float
          Distance between the points.
  
      Examples
      --------
      .. jupyter-execute::
          :linenos:
          :emphasize-lines: 3
  
          from lets_plot.geo_data import *
          cities = geocode_cities(['New York', 'Chicago']).get_centroids().geometry
          distance(cities[0].x, cities[0].y, cities[1].x, cities[1].y, units='mi')
  
      """
      return _calc_distance(lon0, lat0, lon1, lat1, units)
  
file_path: lets-plot/python-package/lets_plot/geo_data/core.py
imports: from typing import Any
  import numpy
  from .geocoder import Geocoder, ReverseGeocoder, NamesGeocoder
label_desc: Use image node_id 7 for calling a global function with example usage: distance(lon0, lat0, lon1, lat1, units) and returns: _calc_distance