code: def _validate(self, obj, fmt, **kwargs):
          
          if isinstance(obj, tuple(self.widgets.values())):
              return obj, 'html'
          plot = self.get_plot(obj, renderer=self, **kwargs)
  
          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) or
                  (plot.dynamic and len(plot.keys[0]) == 0)) or
                  not unbound_dimensions(plot.streams, plot.dimensions, no_duplicates=False)):
                  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
docs: Helper method to be used in the __call__ method to get a
          suitable plot or widget object and the appropriate format.