def filter_data(data, filter_keys):
    """Applies a key filter to a dictionary in order to return a subset of
    the key-values. The insertion order of the filtered key-value pairs is
    determined by the filter key sequence.

    Parameters:
        data (dict): key-value pairs to be filtered.
        filter_keys (tuple): sequence of key names that are used to select
                             key-value pairs that match on the key name.

    Returns:
        dict: filtered collection of key-value pairs.
    """

    return {key: data[key] for key in filter_keys if key in data.keys()}

    # record = {}
    # for key in filter_keys:
    #     if key in data.keys():
    #         record[key] = data[key]

    # return record