from typing import Callable
import requests
from typing import Any


def send_get_request(url: str,
                     filter_function: Callable[[requests.Response], Any] =
                     lambda result: result.json()) -> Any:
    """
    The function sends a get request to the given url and returns the result based on the filter
    function.

    NOTE: This function assumes a raw JSON object will be returned from the get call.

    url: The url of the address where the get request is to be made to.
    filter_function: A function that takes a requests.Response object and returns a result based on
    the function. This is an optional parameter, and if not supplied, a json response will be sent.

    return: resulting data passed through the filter function
    """
    res = requests.get(url)
    return filter_function(res)