def ConvertHubStringListToIDList(hub_name_list, map_d):
    """hub_map_tools.ConvertHubStringListToIDList
    INPUTS:
    - hub_name_list -- list of hub or teacher names
    - map_d         -- dictionary that maps hub/teacher names to hub IDs
    OUTPUTS:
    - hub_id_list   -- list of hub IDs corresponding to the hub_name_list.
                       if a corrsponding ID is not in the map, the original
                       hub name is returned in that position.
    """
    hub_id_list = []

    for hub_name in hub_name_list:
        # strip off quotes
        if isinstance(hub_name, str):
            hub_name = hub_name.strip('"')
            if len(hub_name) == 0:
                continue

        # check if the hub name is among map keys
        if hub_name in map_d.keys():
            hub_id_list.append(map_d[hub_name])
        else:
            hub_id_list.append(hub_name)

    return hub_id_list