import typing


def _remove_keys(
    parameters: typing.Dict[str, typing.Any], exclude_labels: typing.List[str]
) -> dict:
    """
    Remove keys from a dictionary without changing the original.

    Attempts to remove keys that don't exist in the dictinary are silently
    ignored.

    Args:
        parameters: Dictionary to be adjusted.

    Returns:
        Modified dictionary.
    """
    this_copy = parameters.copy()
    for k in exclude_labels:
        try:
            del this_copy[k]
        except KeyError:
            # silently ignore missing keys by suppressing this exception
            pass

    return this_copy