def _dot(x, y):
 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

def _dot ( x , y ) : 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
returns the dot product of the arrays .