def widget ( self , f ) : return self . cls ( f , self . opts , * * self . kwargs )
python ipywidgets 'function' object is not subscriptable
Return an interactive function widget for the given function .
def widget(self, f):
        """
        Return an interactive function widget for the given function.

        The widget is only constructed, not displayed nor attached to
        the function.

        Returns
        -------
        An instance of ``self.cls`` (typically :class:`interactive`).

        Parameters
        ----------
        f : function
            The function to which the interactive widgets are tied.
        """
        return self.cls(f, self.opts, **self.kwargs)