code: def test_space_consistency():
      # Reals (uniform)
  
      s1 = Space([Real(0.0, 1.0)])
      s2 = Space([Real(0.0, 1.0)])
      s3 = Space([Real(0, 1)])
      s4 = Space([(0.0, 1.0)])
      s5 = Space([(0.0, 1.0, "uniform")])
      s6 = Space([(0, 1.0)])
      s7 = Space([(np.float64(0.0), 1.0)])
      s8 = Space([(0, np.float64(1.0))])
      a1 = s1.rvs(n_samples=10, random_state=0)
      a2 = s2.rvs(n_samples=10, random_state=0)
      a3 = s3.rvs(n_samples=10, random_state=0)
      a4 = s4.rvs(n_samples=10, random_state=0)
      a5 = s5.rvs(n_samples=10, random_state=0)
      assert_equal(s1, s2)
      assert_equal(s1, s3)
      assert_equal(s1, s4)
      assert_equal(s1, s5)
      assert_equal(s1, s6)
      assert_equal(s1, s7)
      assert_equal(s1, s8)
      assert_array_equal(a1, a2)
      assert_array_equal(a1, a3)
      assert_array_equal(a1, a4)
      assert_array_equal(a1, a5)
  
      # Reals (log-uniform)
      s1 = Space(
          [Real(10**-3.0, 10**3.0, prior="log-uniform", base=10)]
      )
      s2 = Space(
          [Real(10**-3.0, 10**3.0, prior="log-uniform", base=10)]
      )
      s3 = Space(
          [Real(10**-3, 10**3, prior="log-uniform", base=10)]
      )
      s4 = Space([(10**-3.0, 10**3.0, "log-uniform", 10)])
      s5 = Space(
          [(np.float64(10**-3.0), 10**3.0, "log-uniform", 10)]
      )
      a1 = s1.rvs(n_samples=10, random_state=0)
      a2 = s2.rvs(n_samples=10, random_state=0)
      a3 = s3.rvs(n_samples=10, random_state=0)
      a4 = s4.rvs(n_samples=10, random_state=0)
      assert_equal(s1, s2)
      assert_equal(s1, s3)
      assert_equal(s1, s4)
      assert_equal(s1, s5)
      assert_array_equal(a1, a2)
      assert_array_equal(a1, a3)
      assert_array_equal(a1, a4)
  
      # Integers
      s1 = Space([Integer(1, 5)])
      s2 = Space([Integer(1.0, 5.0)])
      s3 = Space([(1, 5)])
      s4 = Space([(np.int64(1.0), 5)])
      s5 = Space([(1, np.int64(5.0))])
      a1 = s1.rvs(n_samples=10, random_state=0)
      a2 = s2.rvs(n_samples=10, random_state=0)
      a3 = s3.rvs(n_samples=10, random_state=0)
      assert_equal(s1, s2)
      assert_equal(s1, s3)
      assert_equal(s1, s4)
      assert_equal(s1, s5)
      assert_array_equal(a1, a2)
      assert_array_equal(a1, a3)
  
      # Integers (log-uniform)
      s1 = Space([Integer(16, 512, prior="log-uniform", base=2)])
      s2 = Space([Integer(16.0, 512.0, prior="log-uniform", base=2)])
      s3 = Space([(16, 512, "log-uniform", 2)])
      s4 = Space([(np.int64(16.0), 512, "log-uniform", 2)])
      s5 = Space([(16, np.int64(512.0), "log-uniform", 2)])
      a1 = s1.rvs(n_samples=10, random_state=0)
      a2 = s2.rvs(n_samples=10, random_state=0)
      a3 = s3.rvs(n_samples=10, random_state=0)
      assert_equal(s1, s2)
      assert_equal(s1, s3)
      assert_equal(s1, s4)
      assert_equal(s1, s5)
      assert_array_equal(a1, a2)
      assert_array_equal(a1, a3)
  
      # Categoricals
      s1 = Space([Categorical(["a", "b", "c"])])
      s2 = Space([Categorical(["a", "b", "c"])])
      s3 = Space([["a", "b", "c"]])
      a1 = s1.rvs(n_samples=10, random_state=0)
      a2 = s2.rvs(n_samples=10, random_state=0)
      a3 = s3.rvs(n_samples=10, random_state=0)
      assert_equal(s1, s2)
      assert_array_equal(a1, a2)
      assert_equal(s1, s3)
      assert_array_equal(a1, a3)
  
      s1 = Space([(True, False)])
      s2 = Space([Categorical([True, False])])
      s3 = Space([np.array([True, False])])
      assert s1 == s2 == s3
  
      # Categoricals Integer
      s1 = Space([Categorical([1, 2, 3])])
      s2 = Space([Categorical([1, 2, 3])])
      s3 = Space([[1, 2, 3]])
      a1 = s1.rvs(n_samples=10, random_state=0)
      a2 = s2.rvs(n_samples=10, random_state=0)
      a3 = s3.rvs(n_samples=10, random_state=0)
      assert_equal(s1, s2)
      assert_array_equal(a1, a2)
      assert_equal(s1, s3)
      assert_array_equal(a1, a3)
  
      s1 = Space([(True, False)])
      s2 = Space([Categorical([True, False])])
      s3 = Space([np.array([True, False])])
      assert s1 == s2 == s3
  
imports: import pytest
  import numbers
  import numpy
  import os
  import yaml
  from tempfile import NamedTemporaryFile
  from numpy.testing import assert_array_almost_equal
  from numpy.testing import assert_array_equal
  from numpy.testing import assert_equal
  from numpy.testing import assert_raises_regex
  from skopt import Optimizer
  from skopt.space import Space
  from skopt.space import Real
  from skopt.space import Integer
  from skopt.space import Categorical
  from skopt.space import check_dimension
  from skopt.utils import normalize_dimensions
label_desc: Use image node_id 12 for calling a global function with example usage: test_space_consistency() without return types