def deep_merge(first: dict, second: dict) -> dict:
    """
    Dict deep merge function
    Merge recursive second dict in first and return it

    >>> deep_merge({},{})
    {}
    >>> deep_merge({'key': 'value'}, {'key': 'value'})
    {'key': 'value'}
    >>> deep_merge({'key': 'value'}, {'key': 'new_value', 'second_key': 'second_value'})
    {'key': 'new_value', 'second_key': 'second_value'}
    >>> deep_merge(
    ...     {'key': 'value', 'dict_key': {'nested_key': 'nested_value'}},
    ...     {
    ...         'key': 'value',
    ...         'dict_key': {'nested_key': 'new_nested_value', 'nested_dict_key': {}},
    ...         'flat_key': 'flat_value'
    ...     }
    ... )
    {'key': 'value', 'dict_key': {'nested_key': 'new_nested_value', 'nested_dict_key': {}}, 'flat_key': 'flat_value'}
    """
    for key in second:
        if key in first:
            if isinstance(first[key], dict) and isinstance(second[key], dict):
                deep_merge(first[key], second[key])
            else:
                first[key] = second[key]
        else:
            first[key] = second[key]
    return first