code: def _dot(x, y):
      """
      Returns the dot product of the arrays, works for sparse and dense.
      """
  
      if isinstance(x, np.ndarray) and isinstance(y, np.ndarray):
          return np.dot(x, y)
      elif sparse.issparse(x):
          return x.dot(y)
      elif sparse.issparse(y):
          return y.T.dot(x.T).T
  
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 1 for calling a global function with example usage: _dot(x, y) and returns: np, x, y