code: def _to_coords(
      lon: Optional[Union[float, Series, List[float]]],
      lat: Optional[Union[float, Series, List[float]]],
  ) -> List[GeoPoint]:
      if type(lon) != type(lat):
          raise ValueError("lon and lat have different types")
  
      if isinstance(lon, float):
          return [GeoPoint(lon, lat)]
  
      if isinstance(lon, Series):
          lon = lon.tolist()
          lat = lat.tolist()
  
      if isinstance(lon, list):
          assert_list_type(lon, float)
          assert_list_type(lat, float)
          return [GeoPoint(lo, la) for lo, la in zip(lon, lat)]
  
imports: from collections import namedtuple
  from collections.abc import Iterable
  from typing import Union, List, Optional, Dict
  from pandas import Series
  from .geocodes import _to_level_kind, request_types, Geocodes, _raise_exception, _ensure_is_list
  from .gis.geocoding_service import GeocodingService
  from .gis.geometry import GeoRect, GeoPoint
  from .gis.request import RequestBuilder, GeocodingRequest, RequestKind, MapRegion, AmbiguityResolver, RegionQuery, LevelKind, IgnoringStrategyKind, PayloadKind, ReverseGeocodingRequest
  from .gis.response import Response, SuccessResponse
  from .type_assertion import assert_list_type
label_desc: Use image node_id 8 for calling a global function with example usage: _to_coords(lon, lat) and returns: list, unknown