def replace_staff_placeholder(user_list, staff):
    """
    Replace the staff placeholder with the actual list
    of staff members in the user_list.
    """
    if isinstance(user_list, str):
        user_list = [user_list]

    # We might end up in this case when one hub references the config of another deployed hub as an yaml alias
    if all(elem in user_list for elem in staff['github_ids']) or all(elem in user_list for elem in staff['google_ids']):
        return user_list

    custom_users = user_list[:]
    for staff_list_type, staff_ids in staff.items():
        staff_placeholder = "<staff_" + staff_list_type + ">"
        if staff_placeholder in user_list:
            custom_users.remove(staff_placeholder)

            custom_users = custom_users + staff_ids

    # If no staff placeholder was provided, then return the original list of users
    return custom_users