def convert_items(data, mapping):
    """
    Input: list of dicts (each dict a record for one item),
    mapping with column names to swap into the records.
    Output: updated list of dicts.
    """
    new_recs = []
    for rec in data:
        new_rec = map_magic.mapping(rec, mapping)
        new_recs.append(new_rec)
    return new_recs
def convert_items ( data , mapping ) : new_recs = [ ] for rec in data : new_rec = map_magic . mapping ( rec , mapping ) new_recs . append ( new_rec ) return new_recs
Input: list of dicts (each dict a record for one item),
    mapping with column names to swap into the records.
    Output: updated list of dicts.