code: def _logcosh(x, fun_args=None):
      alpha = fun_args.get("alpha", 1.0)  # comment it out?
  
      x *= alpha
      gx = np.tanh(x, x)  # apply the tanh inplace
      g_x = np.empty(x.shape[0], dtype=x.dtype)
      # XXX compute in chunks to avoid extra allocation
      for i, gx_i in enumerate(gx):  # please don't vectorize.
          g_x[i] = (alpha * (1 - gx_i**2)).mean()
      return gx, g_x
  
imports: import warnings
  from numbers import Integral, Real
  import numpy
  from scipy import linalg
  from ..base import BaseEstimator, ClassNamePrefixFeaturesOutMixin, TransformerMixin, _fit_context
  from ..exceptions import ConvergenceWarning
  from ..utils import as_float_array, check_array, check_random_state
  from ..utils._param_validation import Interval, Options, StrOptions, validate_params
  from ..utils.validation import check_is_fitted
label_desc: Use image node_id 5 for calling a global function with example usage: _logcosh(x, fun_args) and returns: gx,  g_x