Resolves a function instance, given a contract name and function.
    :param contract_name: The name of the contract the function is declared in.
    :param function_name: The name of the function to resolve.
    :return: Returns the resolved function, raises an exception otherwise.

def resolve_function(slither, contract_name, function_name):
    """
    Resolves a function instance, given a contract name and function.
    :param contract_name: The name of the contract the function is declared in.
    :param function_name: The name of the function to resolve.
    :return: Returns the resolved function, raises an exception otherwise.
    """
    # Obtain the target contract
    contract = slither.get_contract_from_name(contract_name)

    # Verify the contract was resolved successfully
    if contract is None:
        raise ResolveFunctionException(f"Could not resolve target contract: {contract_name}")

    # Obtain the target function
    target_function = next((function for function in contract.functions if function.name == function_name), None)

    # Verify we have resolved the function specified.
    if target_function is None:
        raise ResolveFunctionException(f"Could not resolve target function: {contract_name}.{function_name}")

    # Add the resolved function to the new list.
    return target_function