code: def get_labels_np_array(preds: np.ndarray) -> np.ndarray:
      """
      Returns the label of the most probable class given a array of class confidences.
  
      :param preds: Array of class confidences, nb of instances as first dimension.
      :return: Labels.
      """
      if len(preds.shape) >= 2:
          preds_max = np.amax(preds, axis=1, keepdims=True)
      else:
          preds_max = np.round(preds)
      y = preds == preds_max
      y = y.astype(np.uint8)
      return y
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import math
  import os
  import shutil
  import sys
  import tarfile
  import warnings
  import zipfile
  from functools import wraps
  from inspect import signature
  from typing import TYPE_CHECKING, Callable, List, Dict, Optional, Tuple, Union
  import numpy
  import six
  from scipy.special import gammainc
  from tqdm.auto import tqdm
  from art import config
label_desc: Use image node_id 18 for calling a global function with example usage: get_labels_np_array(preds) and returns: y