code: def _is_valid_explainer(proposed_explainer, expected_explainer_type):
      try:
          explainer_type = proposed_explainer.explainer_type
          available_explanations = (
              proposed_explainer.available_explanations
          )
  
          if explainer_type != expected_explainer_type:
              _log.warning(
                  "Proposed explainer is not a {}.".format(
                      expected_explainer_type
                  )
              )
              return False
  
          for available_explanation in available_explanations:
              has_explain_method = hasattr(
                  proposed_explainer, "explain_" + available_explanation
              )
              if not has_explain_method:
                  _log.warning(
                      "Proposed explainer has available explanation {} but has no respective method.".format(
                          available_explanation
                      )
                  )
                  return False
  
          return True
  
      except Exception as e:
          _log.warning("Validate function threw exception {}".format(e))
          return False
  
file_path: interpret/python/interpret-core/interpret/ext/extension.py
imports: import logging
label_desc: Use image node_id 1 for calling a global function with example usage: _is_valid_explainer(proposed_explainer, expected_explainer_type) and returns: True, False, False, False