from typing import Iterable
from typing import Dict


def sanitize_data(fields: Iterable[str], data: Dict) -> Dict:
    """This function is used to remove any key value pairs in the dictionary
    used to create or update entities in the system

    Arg(s)
    ------
    fields -> The fields that are expected to be present in the dictionary
    data (dict) -> The dictionary whose value pairs will be removed if their key
        is not part of the list of fields to be returned

    Return(s)
    ---------
    tmp (dict) -> The new dictionary with the new key value pairs that match
        the models column
    """
    tmp = {}
    if 'token' in data:
        del data['token']

    for column in fields:
        if column in data:
            tmp[column] = data[column]
    return tmp