code: def _dotsum(x, y):
      """
      Returns sum(x * y), where '*' is the pointwise product, computed
      efficiently for dense and sparse matrices.
      """
  
      if sparse.issparse(x):
          return x.multiply(y).sum()
      else:
          # This way usually avoids allocating a temporary.
          return np.dot(x.ravel(), y.ravel())
  
imports: import warnings
  import numpy
  import pandas
  import patsy
  from scipy import sparse
  from scipy.stats.distributions import norm
  from statsmodels.base._penalties import Penalty
  import statsmodels.base.model
  from statsmodels.tools import data
  from statsmodels.tools.decorators import cache_readonly
  from statsmodels.tools.sm_exceptions import ConvergenceWarning
label_desc: Use image node_id 3 for calling a global function with example usage: _dotsum(x, y) and returns: x, np