code: def shuffled_argmax(
      values: np.ndarray, n_instances: int = 1
  ) -> np.ndarray:
      """
      Shuffles the values and sorts them afterwards. This can be used to break
      the tie when the highest utility score is not unique. The shuffle randomizes
      order, which is preserved by the mergesort algorithm.
  
      Args:
          values: Contains the values to be selected from.
          n_instances: Specifies how many indices and values to return.
      Returns:
          The indices and values of the n_instances largest values.
      """
      assert (
          n_instances <= values.shape[0]
      ), "n_instances must be less or equal than the size of utility"
  
      # shuffling indices and corresponding values
      shuffled_idx = np.random.permutation(len(values))
      shuffled_values = values[shuffled_idx]
  
      # getting the n_instances best instance
      # since mergesort is used, the shuffled order is preserved
      sorted_query_idx = np.argsort(shuffled_values, kind="mergesort")[
          len(shuffled_values) - n_instances :
      ]
  
      # inverting the shuffle
      query_idx = shuffled_idx[sorted_query_idx]
  
      return query_idx, values[query_idx]
  
imports: import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: shuffled_argmax(values, n_instances) and returns: query_idx,  values