code: def test_check_array_min_samples_and_features_messages():
      # empty list is considered 2D by default:
      msg = "0 feature(s) (shape=(1, 0)) while a minimum of 1 is required."
      assert_raise_message(ValueError, msg, check_array, [[]])
  
      # If considered a 1D collection when ensure_2d=False, then the minimum
      # number of samples will break:
      msg = "0 sample(s) (shape=(0,)) while a minimum of 1 is required."
      assert_raise_message(
          ValueError, msg, check_array, [], ensure_2d=False
      )
  
      # Invalid edge case when checking the default minimum sample of a scalar
      msg = "Singleton array array(42) cannot be considered a valid collection."
      assert_raise_message(
          TypeError, msg, check_array, 42, ensure_2d=False
      )
  
imports: from itertools import product
  import numpy
  import pytest
  import scipy.sparse
  from sklearn.utils.estimator_checks import _NotAnArray
  from sklearn.utils._mocking import MockDataFrame
  from sklearn.utils._testing import assert_raise_message, assert_raises_regex
  from ....None import tensor
  from ....None import dataframe
  from ....tensor.core import Tensor
  from ..validation import check_array, check_consistent_length
label_desc: Use image node_id 7 for calling a global function with example usage: test_check_array_min_samples_and_features_messages() without return types