code: def softmax(X, copy=True):
      """
      Calculate the softmax function.
  
      The softmax function is calculated by
      np.exp(X) / np.sum(np.exp(X), axis=1)
  
      This will cause overflow when large values are exponentiated.
      Hence the largest value in each row is subtracted from each data
      point to prevent this.
  
      Parameters
      ----------
      X: array-like, shape (M, N)
          Argument to the logistic function
  
      copy: bool, optional
          Copy X or not.
  
      Returns
      -------
      out: array, shape (M, N)
          Softmax function evaluated at every point in x
      """
      if copy:
          X = np.copy(X)
      max_prob = np.max(X, axis=1).reshape((-1, 1))
      X -= max_prob
      np.exp(X, X)
      sum_prob = np.sum(X, axis=1).reshape((-1, 1))
      X /= sum_prob
      return X
  
imports: from __future__ import division
  from functools import partial
  import warnings
  import numpy
  from scipy import linalg
  from scipy.sparse import issparse, csr_matrix
  from .None import check_random_state
  from .fixes import np_version
  from ._logistic_sigmoid import _log_logistic_sigmoid
  from ..externals.six.moves import xrange
  from .sparsefuncs_fast import csr_row_norms
  from .validation import check_array
  from ..exceptions import NonBLASDotWarning
label_desc: Use image node_id 18 for calling a global function with example usage: softmax(X, copy) and returns: X