def METHOD_NAME(field, geopoint, **kwargs):
    """Filters cases to those within a certain distance of the provided geopoint
        eg: geo_distance('gps_location', GeoPoint(-33.1, 151.8), kilometers=100)
    """
    if len(kwargs) != 1 or not all(k in DISTANCE_UNITS for k in kwargs):
        raise ValueError("'geo_distance' requires exactly one distance kwarg, "
                         f"options are {', '.join(DISTANCE_UNITS)}")
    unit, distance = kwargs.popitem()
    return {
        'geo_distance': {
            field: geopoint.lat_lon,
            'distance': f"{distance}{unit}",
        }
    }