def process_singleton_ids(ids, entity):
    """Returns a single id if len(ids)==1. If len(ids)>1, returns ids (assumed to be a list), or raises
    a ValueError if the shared functions expect a single id rather than a list for the specified entity.
    """
    if len(ids)==1:
        ids = ids[0]
    elif entity=='gbd_round': # Also version id's?
        # It might be better to just let the shared functions raise an exception
        # rather than me doing it for them. In which case this function would be almost pointless...
        raise ValueError(f"Only single {entity} id's are allowed in shared functions.")
    return ids