def _query_explainability_result(
        self,
        attr: Union[dict[str, Any], list[dict[str, Any]]],
        component: str,
    ) -> Any:
        """
        Helper that extracts and returns the explainability result attribute for a given component.

        Parameters
        ----------
        attr
            An explainability result attribute from which to extract the component.
        component
            The component for which to return the content of the attribute.
        """
        component = self._validate_input_for_querying_explainability_result(component)
        if isinstance(attr, list):
            return [attr_[component] for attr_ in attr]
        else:
            return attr[component]

        Helper that extracts and returns the explainability result attribute for a given component.

        Parameters
        ----------
        attr
            An explainability result attribute from which to extract the component.
        component
            The component for which to return the content of the attribute.
        
darts/explainability/explainability_result.py