def get_orders_by_loc(phase_proto, orderable_locations, powers):
    """ Returns a dictionary with loc as key and its corresponding order as value
        Note: only the locs in orderable_locations are included in the dictionary

        :param phase_proto: A `.proto.game.SavedGame.Phase` object from the dataset.
        :param orderable_locations: A list of locs from which we want the orders
        :param powers: A list of powers for which to retrieve orders
        :return: A dictionary with locs as key, and their corresponding order as value
               (e.g. {'PAR': 'A PAR - MAR'})
    """
    orders_by_loc = {}
    for power_name in phase_proto.orders:
        if power_name not in powers:
            continue
        for order in phase_proto.orders[power_name].value:
            order_loc = order.split()[1]
            if order_loc not in orderable_locations and order_loc[:3
                ] not in orderable_locations:
                continue
            orders_by_loc[order_loc[:3]] = order
    return orders_by_loc
