from typing import Dict
from typing import Any


def build_headers_from(
    kwarg_headers: Dict[str, Any], additional_headers: Dict[str, Any]
):
    """
    Build correct headers for `AlgodClient.algod_request`.

    Args:
        kwarg_headers (Dict[str, Any]): headers passed through kwargs.
        additional_headers (Dict[str, Any]): additional headers to pass to `AlgodClient.algod_request`

    Returns:
        Dict[str, any]: final version of headers dictionary to be used for `AlgodClient.algod_request`
    """
    if kwarg_headers:
        kwarg_headers.update(additional_headers)
    else:
        kwarg_headers = additional_headers

    return kwarg_headers