def get_heroesplayed_maps(map_list, maps, picks, results, bans={}):
    """Returns a dict linking each map to
    - the heroes played on this map
    - if it was a win (1) or a loss (0)
    Optional: returns dict of the team's bans for each map
    """
    heroes_map = {item: [[], []] for item in maps}
    bans_map = {item: [] for item in maps}
    for mp in maps:
        i = 0
        for rd in range(0, len(map_list)):
            if mp in map_list[rd]:
                heroes_map[mp][0] += list(picks[rd].values())
                if results[i] == 1:
                    heroes_map[mp][1] += [1, 1, 1, 1, 1]
                else:
                    heroes_map[mp][1] += [0, 0, 0, 0, 0]
                if bans:
                    bans_map[mp] += list(bans[rd])
            i += 1
    return heroes_map, bans_map