# -*- coding: utf-8 -*-
"""
Dispatch module. Explanation functions for conctere estimator classes
are defined in submodules.
"""
from singledispatch import singledispatch


@singledispatch
def explain_prediction(estimator, doc, **kwargs):
    """ Return an explanation of an estimator """
    return {
        "estimator": repr(estimator),
        "description": "Error: estimator %r is not supported" % estimator,
    }


@singledispatch
def explain_weights(estimator, **kwargs):
    """ Return an explanation of an estimator """
    return {
        "estimator": repr(estimator),
        "description": "Error: estimator %r is not supported" % estimator,
    }

@@ -165,16 +165,51 @@
 spatch%0A%0A
+from eli5.base import Explanation%0A%0A
 %0A@single
@@ -305,32 +305,43 @@
 of an estimator 
+prediction 
 %22%22%22%0A    return %7B
@@ -331,33 +331,44 @@
  %22%22%22%0A    return 
-%7B
+Explanation(
 %0A        %22estima
@@ -352,33 +352,32 @@
 nation(%0A        
-%22
 estimator%22: repr
@@ -361,35 +361,33 @@
        estimator
-%22: 
+=
 repr(estimator),
@@ -395,39 +395,23 @@
         
-%22description%22: %22E
+e
 rror
-: 
+=%22
 estimato
@@ -450,17 +450,17 @@
 or,%0A    
-%7D
+)
 %0A%0A%0A@sing
@@ -558,16 +558,24 @@
 timator 
+weights 
 %22%22%22%0A    
@@ -585,9 +585,20 @@
 urn 
-%7B
+Explanation(
 %0A   
@@ -602,17 +602,16 @@
         
-%22
 estimato
@@ -611,19 +611,17 @@
 stimator
-%22: 
+=
 repr(est
@@ -641,31 +641,15 @@
     
-%22description%22: %22E
+e
 rror
-: 
+=%22
 esti
@@ -696,6 +696,6 @@
     
-%7D
+)
 %0A

Fix return values of placeholder functions