from typing import Dict


def graceful_update(a: Dict, b: Dict) -> Dict:
    """
    Update keys in dictionary `a` with new values from dictionary `b`.

    This method will not change the `type` of a value that already exists
    in dictionary `a`. If a value in dictionary `a` is a list, then the
    new values from dictionary `b` will be appended to the existing list.

    Parameters
    ----------
    a: dict
        Dictionary to update
    b: dict
        Dictionary with keys to update along with new values

    Returns
    -------
    dict
        The updated dictionary

    """
    for key, value in b.items():
        if key in a:
            if isinstance(a[key], list) and isinstance(value, list):
                for x in value:
                    if x not in a[key]:
                        a[key].append(x)
            elif isinstance(a[key], list) and not isinstance(value, list):
                if value not in a[key]:
                    a[key].append(value)
            elif a[key] is None:
                a[key] = value
            else:
                pass
        else:
            a[key] = value
    return a