code: def test_orion_configspace():
      space = Space()
  
      # NB: scipy uniform [loc, scale], configspace [min, max] with max = loc + scale, loc = min
      def uniform(type, name, low, high, **kwargs):
          return type(name, "uniform", low, high - low, **kwargs)
  
      space.register(Integer("r1i", "reciprocal", 1, 6))
      space.register(uniform(Integer, "u1i", -3, 6))
      space.register(uniform(Integer, "u2i", -3, 6))
      space.register(uniform(Integer, "u4i", -4, 0, default_value=-1))
      space.register(uniform(Integer, "u3i", -3, 6, default_value=2))
  
      space.register(Real("r1f", "reciprocal", 1, 6))
      space.register(uniform(Real, "u1f", -3, 6))
      space.register(uniform(Real, "u2f", -3, 6))
      space.register(uniform(Real, "u4f", -4, 0, default_value=-0.2))
      space.register(uniform(Real, "name.u2f", -3, 6))
  
      space.register(Categorical("c1", ("asdfa", 2)))
      space.register(Categorical("c2", dict(a=0.2, b=0.8)))
      space.register(Fidelity("f1", 1, 9, 3))
  
      space.register(Real("n1", "norm", 0.9, 0.1, precision=6))
      space.register(Real("n2", "norm", 0.9, 0.1, precision=None))
      space.register(Real("n3", "norm", 0.9, 0.1))
      space.register(Integer("n4", "norm", 1, 2))
  
      newspace = to_configspace(space)
      roundtrip = to_orionspace(newspace)
  
      compare_spaces(space, roundtrip)
  
file_path: orion/tests/unittests/algo/test_configspace.py
imports: import pytest
  from orion.algo.space import Categorical, Fidelity, Integer, Real, Space, to_orionspace
  from orion.algo.space.configspace import IMPORT_ERROR, UnsupportedPrior, to_configspace
label_desc: Use image node_id 2 for calling a global function with example usage: test_orion_configspace() and returns: type