def get_insert_idx(pos_dict, name):
    """Return the position to insert a given function doc in a notebook."""
    keys, i = list(pos_dict.keys()), 0
    while i < len(keys) and str.lower(keys[i]) < str.lower(name):
        i += 1
    if i == len(keys):
        return -1
    else:
        return pos_dict[keys[i]]
