code: def to_ng_space(orion_space: Space) -> Instrumentation:
      """Convert an orion space to a nevergrad space."""
      import_optional.ensure()
      converted_dimensions: dict[str, Parameter] = {}
      for name, dim in orion_space.items():
          try:
              converted_dimensions[name] = registry[
                  dim.type, dim.prior_name
              ](dim)
          except KeyError as exc:
              raise RuntimeError(
                  f"Dimension with type and prior: {exc.args[0]} cannot be converted to nevergrad."
              ) from exc
  
      return ng.p.Instrumentation(**converted_dimensions)
  
imports: from __future__ import annotations
  import logging
  import pickle
  from typing import Callable, Iterable, Sequence, SupportsInt
  from orion.algo.base import BaseAlgorithm
  from orion.algo.space import Categorical, Dimension, Fidelity, Integer, Real, Space
  from orion.core.utils.format_trials import dict_to_trial
  from orion.core.utils.module_import import ImportOptional
  from orion.core.worker.trial import Trial
label_desc: Use image node_id 2 for calling a global function with example usage: to_ng_space(orion_space) and returns: ng