def _with_values(original: dict[T, V], val: V | dict[T, V]) -> dict[T, V]:
    """Returns a copy of `original` using values from `val`.

    If val is a single value, all keys are mapped to that value. If val is a
    dict, the union of original and val is returned, using values from val for
    any conflicting keys.
    """
    if isinstance(val, dict):
        return {**original, **val}
    return {k: val for k in original}
Returns a copy of `original` using values from `val`.

    If val is a single value, all keys are mapped to that value. If val is a
    dict, the union of original and val is returned, using values from val for
    any conflicting keys.
    
cirq-google/cirq_google/devices/google_noise_properties.py