def _validate(self, obj, fmt):
        if isinstance(obj, tuple(self.widgets.values())):
            return obj, 'html'
        plot = self.get_plot(obj)

        fig_formats = self.mode_formats['fig'][self.mode]
        holomap_formats = self.mode_formats['holomap'][self.mode]

        if fmt in ['auto', None]:
            if ((len(plot) == 1 and not plot.dynamic)
                or (len(plot) > 1 and self.holomap is None)):
                fmt = fig_formats[0] if self.fig=='auto' else self.fig
            else:
                fmt = holomap_formats[0] if self.holomap=='auto' else self.holomap

        if fmt in self.widgets:
            plot = self.get_widget(plot, fmt, display_options={'fps': self.fps})
            fmt = 'html'

        all_formats = set(fig_formats + holomap_formats)
        if fmt not in all_formats:
            raise Exception("Format %r not supported by mode %r. Allowed formats: %r"
                            % (fmt, self.mode, fig_formats + holomap_formats))
        self.last_plot = plot
        return plot, fmt
Helper method to be used in the __call__ method to get a
dataset/ETHPy150Open ioam/holoviews/holoviews/plotting/renderer.py/Renderer._validate