def _get_first_polygon(results: list[dict[str, Any]]) -> dict[str, Any]:
    """
    Choose first result of geometry type (Multi)Polygon from list of results.

    Parameters
    ----------
    results
        Results from the Nominatim API.

    Returns
    -------
    result
        The chosen result.
    """
    polygon_types = {"Polygon", "MultiPolygon"}

    for result in results:
        if "geojson" in result and result["geojson"]["type"] in polygon_types:
            return result

    # if we never found a polygon, raise an error
    raise TypeError

    Choose first result of geometry type (Multi)Polygon from list of results.

    Parameters
    ----------
    results
        Results from the Nominatim API.

    Returns
    -------
    result
        The chosen result.
    
osmnx/geocoder.py