code: def binarization(array: Union[List, np.ndarray]) -> np.ndarray:
      # Takes a binary-class datafile and turn the max value (positive class)
      # into 1 and the min into 0
      array = np.array(
          array, dtype=float
      )  # conversion needed to use np.inf
      if len(np.unique(array)) > 2:
          raise ValueError(
              "The argument must be a binary-class datafile. "
              "{} classes detected".format(len(np.unique(array)))
          )
  
      # manipulation which aims at avoid error in data
      # with for example classes '1' and '2'.
      array[array == np.amax(array)] = np.inf
      array[array == np.amin(array)] = 0
      array[array == np.inf] = 1
      return np.array(array, dtype=int)
  
imports: from typing import Any, Dict, Iterator, List, Mapping, Optional, Sequence, Tuple, Type, Union, cast
  import warnings
  import numpy
  import pandas
  from scipy.sparse import spmatrix
  from sklearn.model_selection import train_test_split
  from autosklearn.evaluation.splitter import CustomStratifiedShuffleSplit
label_desc: Use image node_id 2 for calling a global function with example usage: binarization(array) and returns: np