def condition(self, parent_values: dict[str, Any]) -> SearchParameter:
        """Fix the parent value and return a new search parameter."""
        assert set(parent_values.keys()).issubset(set(self.parents)), "parent values keys not a subset of the parents"

        # if there is only one parent, return the support for the given parent value
        if len(self.parents) == 1:
            parent_values = (parent_values[self.parents[0]],)
            return self.support.get(parent_values, self.default)

        # condition the first parent and create a new conditional
        parent_idx = len(self.parents) - 1
        parent = None
        for i, parent in enumerate(self.parents):
            if parent in parent_values:
                parent_value = parent_values[parent]
                parent_idx = i
                break
        new_parents = self.parents[:parent_idx] + self.parents[parent_idx + 1 :]
        new_support = {
            key[:parent_idx] + key[parent_idx + 1 :]: value
            for key, value in self.support.items()
            if key[parent_idx] == parent_value
        }
        # if there is no support for the given parent value, return the default
        if new_support == {}:
            return self.default
        # create a new conditional
        new_conditional = Conditional(new_parents, new_support, self.default)

        # condition the new conditional if there are more parents to condition, else return the new conditional
        del parent_values[parent]
        if len(parent_values) == 0:
            return new_conditional
        return new_conditional.condition(parent_values)
Fix the parent value and return a new search parameter.
olive/search/search_parameter.py