def decide_which_users_to_annotate(centrality_vector,
                                   number_to_annotate,
                                   already_annotated,
                                   node_to_id):
    """
    Sorts a centrality vector and returns the Twitter user ids that are to be annotated.

    Inputs: - centrality_vector: A numpy array vector, that contains the centrality values for all users.
            - number_to_annotate: The number of users to annotate.
            - already_annotated: A python set of user twitter ids that have already been annotated.
            - node_to_id: A python dictionary that maps graph nodes to user twitter ids.

    Output: - user_id_list: A python list of Twitter user ids.
    """
    # Sort the centrality vector according to decreasing centrality.
    centrality_vector = np.asarray(centrality_vector)
    ind = np.argsort(np.squeeze(centrality_vector))
    if centrality_vector.size > 1:
        reversed_ind = ind[::-1]
    else:
        reversed_ind = list()
        reversed_ind = reversed_ind.append(ind)

    # Get the sublist of Twitter user ids to return.
    user_id_list = list()
    append_user_id = user_id_list.append

    counter = 0
    for node in reversed_ind:
        user_twitter_id = node_to_id[node]
        if user_twitter_id not in already_annotated:
            append_user_id(user_twitter_id)
            counter += 1

            if counter >= number_to_annotate:
                break

    return user_id_list
Sorts a centrality vector and returns the Twitter user ids that are to be annotated.

    Inputs: - centrality_vector: A numpy array vector, that contains the centrality values for all users.
            - number_to_annotate: The number of users to annotate.
            - already_annotated: A python set of user twitter ids that have already been annotated.
            - node_to_id: A python dictionary that maps graph nodes to user twitter ids.

    Output: - user_id_list: A python list of Twitter user ids.