code: def orion_space_to_hebo_space(space: Space) -> DesignSpace:
      """Get the HEBO-equivalent space for the `Space` `space`.
  
      Parameters
      ----------
      :param space: `Space` instance.
  
      Returns
      -------
      a `DesignSpace` from the `hebo` package.
  
      Raises
      ------
      NotImplementedError
          If there is an unsupported dimension or prior type in `space`.
      """
      specs = []
  
      ds = DesignSpace()
      name: str
      dimension: Dimension
      for name, dimension in space.items():
          spec: dict[str, Any] = {"name": name}
          prior_name = dimension.prior_name
          bounds = dimension.interval()
          if dimension.shape:
              raise NotImplementedError(
                  f"HEBO algorithm doesn't support dimension {dimension} since it has a shape."
              )
          if dimension.type == "fidelity":
              # Ignore that dimension: Don't include it in the space for Hebo to optimize.
              continue
  
          # BUG: https://github.com/Epistimio/orion/issues/800
          bounds = tuple(
              b.item() if isinstance(b, np.ndarray) else b
              for b in bounds
          )
  
          if prior_name == "choices":
              categories = [str(b) for b in bounds]
              spec.update(type="cat", categories=categories)
          elif prior_name == "uniform":
              spec.update(type="num", lb=bounds[0], ub=bounds[1])
          elif prior_name == "reciprocal":
              spec.update(type="pow", lb=bounds[0], ub=bounds[1])
          elif prior_name == "int_uniform":
              spec.update(type="int", lb=bounds[0], ub=bounds[1])
          elif prior_name == "int_reciprocal":
              spec.update(type="pow_int", lb=bounds[0], ub=bounds[1])
          else:
              raise NotImplementedError(prior_name, dimension)
          specs.append(spec)
      ds.parse(specs)
      return ds
  
imports: from __future__ import annotations
  import copy
  import typing
  import warnings
  from dataclasses import dataclass
  from logging import getLogger
  from typing import Any, ClassVar, Literal
  import numpy
  import pandas
  from typing_extensions import TypedDict
  from orion.algo.base import BaseAlgorithm
  from orion.algo.space import Dimension, Fidelity, Space
  from orion.core.utils.format_trials import dict_to_trial
  from orion.core.utils.module_import import ImportOptional
  from orion.core.utils.random_state import RandomState, control_randomness
  from orion.core.worker.transformer import TransformedDimension
  from orion.core.worker.trial import Trial
label_desc: Use image node_id 1 for calling a global function with example usage: orion_space_to_hebo_space(space) and returns: ds