code: def logsumexp(x):
      """Log of sum of exponentials.
  
      Parameters
      ----------
      x : numpy.ndarray
          Input 2d matrix.
  
      Returns
      -------
      float
          log of sum of exponentials of elements in `x`.
  
      Warnings
      --------
      By performance reasons, doesn't support NaNs or 1d, 3d, etc arrays like :func:`scipy.special.logsumexp`.
  
      """
      x_max = np.max(x)
      x = np.log(np.sum(np.exp(x - x_max)))
      x += x_max
  
      return x
  
imports: import logging
  import unittest
  import numpy
  from numpy.testing import assert_array_equal
  from scipy import sparse
  from scipy.sparse import csc_matrix
  from scipy.special import psi
  import gensim.matutils
label_desc: Use image node_id 1 for calling a global function with example usage: logsumexp(x) and returns: x