code: def normalise_by_max(
      a: np.ndarray,
      normalise_axes: Optional[Sequence[int]] = None,
  ) -> np.ndarray:
      """
      Normalise attributions by the maximum absolute value of the explanation.
  
      Parameters
      ----------
      a: np.ndarray
           the array to normalise, e.g., an image or an explanation.
      normalise_axes: optional, sequence
          the axes to normalise over.
      kwargs: optional
          Keyword arguments.
  
      Returns
      -------
      a: np.ndarray
           a normalised array.
      """
  
      # No normalisation if a is only zeros.
      if np.all(a == 0.0):
          return a
  
      # Default normalise_axes.
      if normalise_axes is None:
          normalise_axes = list(range(np.ndim(a)))
  
      # Cast Sequence to tuple so numpy accepts it.
      normalise_axes = tuple(normalise_axes)
  
      a_max = np.max(np.abs(a), axis=normalise_axes, keepdims=True)
      a = np.divide(a, a_max)
      return a
  
imports: import warnings
  from typing import Optional, Sequence
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: normalise_by_max(a, normalise_axes) and returns: a, a