nodes: 0, module; 1, function_definition; 2, function_name:decide_which_users_to_annotate; 3, parameters; 4, block; 5, identifier:centrality_vector; 6, identifier:number_to_annotate; 7, identifier:already_annotated; 8, identifier:node_to_id; 9, expression_statement; 10, comment:# Sort the centrality vector according to decreasing centrality.; 11, expression_statement; 12, expression_statement; 13, if_statement; 14, comment:# Get the sublist of Twitter user ids to return.; 15, expression_statement; 16, expression_statement; 17, expression_statement; 18, for_statement; 19, return_statement; 20, comment:"""
      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.
      """; 21, assignment; 22, assignment; 23, comparison_operator:centrality_vector.size > 1; 24, block; 25, else_clause; 26, assignment; 27, assignment; 28, assignment; 29, identifier:node; 30, identifier:reversed_ind; 31, block; 32, identifier:user_id_list; 33, identifier:centrality_vector; 34, call; 35, identifier:ind; 36, call; 37, attribute; 38, integer:1; 39, expression_statement; 40, block; 41, identifier:user_id_list; 42, call; 43, identifier:append_user_id; 44, attribute; 45, identifier:counter; 46, integer:0; 47, expression_statement; 48, if_statement; 49, attribute; 50, argument_list; 51, attribute; 52, argument_list; 53, identifier:centrality_vector; 54, identifier:size; 55, assignment; 56, expression_statement; 57, expression_statement; 58, identifier:list; 59, argument_list; 60, identifier:user_id_list; 61, identifier:append; 62, assignment; 63, comparison_operator:user_twitter_id not in already_annotated; 64, block; 65, identifier:np; 66, identifier:asarray; 67, identifier:centrality_vector; 68, identifier:np; 69, identifier:argsort; 70, call; 71, identifier:reversed_ind; 72, subscript; 73, assignment; 74, assignment; 75, identifier:user_twitter_id; 76, subscript; 77, identifier:user_twitter_id; 78, identifier:already_annotated; 79, expression_statement; 80, expression_statement; 81, if_statement; 82, attribute; 83, argument_list; 84, identifier:ind; 85, slice; 86, identifier:reversed_ind; 87, call; 88, identifier:reversed_ind; 89, call; 90, identifier:node_to_id; 91, identifier:node; 92, call; 93, augmented_assignment; 94, comparison_operator:counter >= number_to_annotate; 95, block; 96, identifier:np; 97, identifier:squeeze; 98, identifier:centrality_vector; 99, unary_operator; 100, identifier:list; 101, argument_list; 102, attribute; 103, argument_list; 104, identifier:append_user_id; 105, argument_list; 106, identifier:counter; 107, integer:1; 108, identifier:counter; 109, identifier:number_to_annotate; 110, break_statement; 111, integer:1; 112, identifier:reversed_ind; 113, identifier:append; 114, identifier:ind; 115, identifier:user_twitter_id
code: 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