class_docstr: Wraps a method so that the results is serialized after it is run
class_docstr_tok: ["Wraps","a","method","so","that","the","results","is","serialized","after","it","is","run"]
code: def __call__(self, *args, **kwargs):
      obj = self.attr(*args, **kwargs)
  
      if isinstance(obj, matplotlib.axes.Axes):
          return figure2html(obj.get_figure())
      elif isinstance(obj, matplotlib.figure.Figure):
          return figure2html(obj)
      elif hasattr(obj, "to_html"):
          return obj.to_html()
      else:
          raise TypeError("Unsupported type {}".format(type(obj)))
  
file_path: sklearn-evaluation/src/sklearn_evaluation/report/serialize.py
imports: from functools import reduce
  import base64
  from six import BytesIO
  import matplotlib
label_desc: Use image node_id 2 for calling the HTMLSerializableCallable obj's underlying member method code with example usage: obj.__call__() and returns: figure2html, figure2html, obj