(ip)
Load the extension in IPython.
Load the extension in IPython.
Load the extension in IPython .
def load_ipython_extension(ip):
    """Load the extension in IPython."""
    global _loaded
    if not _loaded:
        # Get the formatter.
        mime = 'application/json'
        formatter = ip.display_formatter.formatters[mime]

        # Register handlers.
        # The first argument is the full module name where the class is defined.
        # The second argument is the class name.
        # The third argument is the Python handler that takes an instance of
        # this class, and returns a JSON string.
        formatter.for_type_by_name('galry.galryplot', 'GalryPlot', get_json)

        _loaded = True
def load_ipython_extension ( ip ) : global _loaded if not _loaded : # Get the formatter. mime = 'application/json' formatter = ip . display_formatter . formatters [ mime ] # Register handlers. # The first argument is the full module name where the class is defined. # The second argument is the class name. # The third argument is the Python handler that takes an instance of # this class, and returns a JSON string. formatter . for_type_by_name ( 'galry.galryplot' , 'GalryPlot' , get_json ) _loaded = True