def remove_keys(d, to_remove):
    """ This function removes the given keys from the dictionary d. N.B.,
        "not in" is used to match the keys.

        Args:
            d (dict): a dictionary

            to_remove (list): a list of keys to remove from d

        Returns:
            dict: a copy of d, excluding keys in to_remove
    """
    ret = {
        k:v for k,v in d.items() if k not in to_remove
    }
    return ret