code: def _prepare_units(units: Any) -> float:
      try:
          return UNITS_DICT[units]
      except KeyError:
          raise ValueError(
              "Wrong units: {}. The units can take the following values: "
              "mi (miles), km (kilometers).".format(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 9 for calling a global function with example usage: _prepare_units(units) and returns: UNITS_DICT