def get_param_length(param: Any) -> int:
        """Return the length (computed recursively) of the input parameter."""
        if isinstance(param, SearchParameter):
            if isinstance(param, Categorical):
                return sum(
                    (
                        SearchSpace.get_param_length(suggestion)
                        if isinstance(suggestion, (SearchParameter, SearchSpace))
                        else 1
                    )
                    for suggestion in param.get_support()
                )

            elif isinstance(param, Conditional):
                # For conditional search parameters, length is computed based on the support
                # that has the most choices. See explanation above.
                return max(SearchSpace.get_param_length(support) for support in param.support.values())

        elif isinstance(param, SearchSpace):
            return len(param)

        return 0
Return the length (computed recursively) of the input parameter.
olive/search/search_space.py