code: def project(
      X, output_range=(0, 1), absmax=None, input_is_positive_only=False
  ):
      """Projects a tensor into a value range.
  
      Projects the tensor values into the specified range.
  
      :param X: A tensor.
      :param output_range: The output value range.
      :param absmax: A tensor specifying the absmax used for normalizing.
        Default the absmax along the first axis.
      :param input_is_positive_only: Is the input value range only positive.
      :return: The tensor with the values project into output range.
      """
  
      if absmax is None:
          absmax = np.max(np.abs(X), axis=tuple(range(1, len(X.shape))))
      absmax = np.asarray(absmax)
  
      mask = absmax != 0
      if mask.sum() > 0:
          X[mask] /= absmax[mask]
  
      if input_is_positive_only is False:
          X = (X + 1) / 2  # [0, 1]
      X = X.clip(0, 1)
  
      X = output_range[0] + (X * (output_range[1] - output_range[0]))
      return X
  
file_path: innvestigate/src/innvestigate/utils/visualizations.py
imports: from __future__ import annotations
  import matplotlib
  import matplotlib.pyplot
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: project(X, output_range, absmax, input_is_positive_only) and returns: X