class_docstr: Convert an Orion space into a configspace
docstr: Convert a categorical dimension into a configspace equivalent
docstr_tok: ["Convert","a","categorical","dimension","into","a","configspace","equivalent"]
code: def categorical(self, dim: Categorical) -> CategoricalHyperparameter:
      """Convert a categorical dimension into a configspace equivalent"""
      return CategoricalHyperparameter(
          name=dim.name,
          choices=dim.categories,
          weights=dim._probs,
      )
  
imports: from __future__ import annotations
  from copy import deepcopy
  from functools import singledispatch
  from math import log10
  from orion.algo.space import Categorical, Dimension, Fidelity, Integer, Real, Space, SpaceConverter, to_orionspace
label_desc: Use image node_id 5 for calling the ToConfigSpace obj's underlying member method code with example usage: obj.categorical(dim) and returns: CategoricalHyperparameter