def test_does_quack_feature_importance_explanation_negative(self):
        NoFeatureExp = type('InvalidFeatureImportanceExplanation', (BaseValid,), {})
        assert not FeatureImportanceExplanation._does_quack(NoFeatureExp())

        class FeatImpNoFeatures(object):
            @property
            def is_raw(self):
                return True

            @property
            def is_engineered(self):
                return False

        FeatImpNoFeaturesExp = type('InvalidFeatureImportanceExplanation', (FeatImpNoFeatures, BaseValid), {})
        assert not FeatureImportanceExplanation._does_quack(FeatImpNoFeaturesExp())

        class FeatImpNoRawTag(object):
            @property
            def features(self):
                return None

            @property
            def is_engineered(self):
                return None

        FeatImpNoRawTagExp = type('InvalidFeatureImportanceExplanation', (FeatImpNoRawTag, BaseValid), {})
        assert not FeatureImportanceExplanation._does_quack(FeatImpNoRawTagExp())

        class FeatImpIsRawNonBool(object):
            @property
            def features(self):
                return None

            @property
            def is_raw(self):
                return [1, 2, 3]

            @property
            def is_engineered(self):
                return False

        FeatImpIsRawNonBoolExp = type('InvalidFeatureImportanceExplanation', (FeatImpIsRawNonBool, BaseValid), {})
        assert not FeatureImportanceExplanation._does_quack(FeatImpIsRawNonBoolExp())
    def list(self):
        """List information about the ExplainerManager.

        :return: A dictionary of properties.
        :rtype: dict
        """
        props = {ListProperties.MANAGER_TYPE: self.name}
        if self._explanation:
            props[Keys.ID] = self._explanation.id
            props[Keys.METHOD] = self._explanation.method
            props[Keys.MODEL_TASK] = self._explanation.model_task
            props[Keys.MODEL_TYPE] = self._explanation.model_type
            if FeatureImportanceExplanation._does_quack(self._explanation):
                props[Keys.IS_RAW] = self._explanation.is_raw
                props[Keys.IS_ENGINEERED] = self._explanation.is_engineered
            props[Keys.IS_COMPUTED] = True
        else:
            props[Keys.IS_COMPUTED] = False
        return props
 def test_does_quack_feature_importance_explanation(self):
     ValidFeatureImportanceExplanation = type('ValidFeatureImportanceExplanation',
                                              (BaseValid, FeatureImportanceValid),
                                              {})
     assert FeatureImportanceExplanation._does_quack(ValidFeatureImportanceExplanation())