def METHOD_NAME(key: str, hp: SearchSpace) -> Hyperparameter:
    def val_to_str(v):
        if v is None:
            return "_lale_none"
        else:
            return v
    if isinstance(hp, SearchSpaceEnum):
        return CategoricalHyperparameter(key, [val_to_str(x) for x in hp.vals])
    elif isinstance(hp, SearchSpaceNumber):
        return SearchSpaceNumberToSMAC(key, hp)
    elif isinstance(hp, SearchSpaceArray):
        raise ValueError(
            f"Arrays are not yet supported by the SMAC backend (key: {key})"
        )
    else:
        raise ValueError(
            f"Not yet supported hp description ({type(hp)}) (key: {key}) in the GridSearchCV backend"
        )