from typing import Any


def find_by_key(data: dict, target: str) -> Any:
    """
    Find a value by key in a dictionary.

    .. code-block:: python

        >>> dct = {
        >>>         "A": "T",
        >>>         "R": 3,
        >>>         "B": {
        >>>             "C": {
        >>>                 "D": "value"
        >>>                  }
        >>>              }
        >>>        }
        >>> find_by_key(dct, "D")
        "value"

    Args:
        data (dict): Dict to walk through
        target (str): target key

    Returns:
        Any: Value data[...][target]

    """
    val = None
    for key, value in data.items():
        if isinstance(value, dict):
            val = find_by_key(value, target)
            if val:
                break
        elif key == target:
            val = value
    return val