code: def test_cartesian():
      # Check if cartesian product delivers the right results
  
      axes = (np.array([1, 2, 3]), np.array([4, 5]), np.array([6, 7]))
  
      true_out = np.array(
          [
              [1, 4, 6],
              [1, 4, 7],
              [1, 5, 6],
              [1, 5, 7],
              [2, 4, 6],
              [2, 4, 7],
              [2, 5, 6],
              [2, 5, 7],
              [3, 4, 6],
              [3, 4, 7],
              [3, 5, 6],
              [3, 5, 7],
          ]
      )
  
      out = cartesian(axes)
      assert_array_equal(true_out, out)
  
      # check single axis
      x = np.arange(3)
      assert_array_equal(x[:, np.newaxis], cartesian((x,)))
  
imports: import numpy
  import pytest
  from scipy import linalg, sparse
  from scipy.linalg import eigh
  from scipy.sparse.linalg import eigsh
  from scipy.special import expit
  from sklearn.datasets import make_low_rank_matrix, make_sparse_spd_matrix
  from sklearn.utils import gen_batches
  from sklearn.utils._arpack import _init_arpack_v0
  from sklearn.utils._testing import assert_allclose, assert_allclose_dense_sparse, assert_almost_equal, assert_array_almost_equal, assert_array_equal, skip_if_32bit
  from sklearn.utils.extmath import _deterministic_vector_sign_flip, _incremental_mean_and_var, _randomized_eigsh, _safe_accumulator_op, cartesian, density, log_logistic, randomized_svd, row_norms, safe_sparse_dot, softmax, stable_cumsum, svd_flip, weighted_mode
  from sklearn.utils.fixes import COO_CONTAINERS, CSC_CONTAINERS, CSR_CONTAINERS, DOK_CONTAINERS, LIL_CONTAINERS, _mode
label_desc: Use image node_id 19 for calling a global function with example usage: test_cartesian() without return types