code: def logsumexp(arr, axis=0):
      
      arr = np.rollaxis(arr, axis)
      # Use the max to normalize, as with the log this is what accumulates
      # the less errors
      vmax = arr.max(axis=0)
      out = np.log(np.sum(np.exp(arr - vmax), axis=0))
      out += vmax
      return out
docs: Computes the sum of arr assuming arr is in the log domain.
  
      Returns log(sum(exp(arr))) while minimizing the possibility of
      over/underflow.
  
      Examples
      --------
  
      >>> import numpy as np
      >>> from sklearn.utils.extmath import logsumexp
      >>> a = np.arange(10)
      >>> np.log(np.sum(np.exp(a)))
      9.4586297444267107
      >>> logsumexp(a)
      9.4586297444267107