(self, name, new_name=None, raise_on_missing=True, unattached=False)
Display output from a named source of the notebook.

        Parameters
        ----------
        name : str
            name of scrap object
        new_name : str
            replacement name for scrap
        raise_error : bool
            indicator for if the resketch should print a message or error on missing snaps
        unattached : bool
            indicator for rendering without making the display recallable as scrapbook data
Display output from a named source of the notebook.
Display output from a named source of the notebook .
def reglue(self, name, new_name=None, raise_on_missing=True, unattached=False):
        """
        Display output from a named source of the notebook.

        Parameters
        ----------
        name : str
            name of scrap object
        new_name : str
            replacement name for scrap
        raise_error : bool
            indicator for if the resketch should print a message or error on missing snaps
        unattached : bool
            indicator for rendering without making the display recallable as scrapbook data
        """
        # Avoid circular imports and make slow imports lazy
        from .api import _prepare_ipy_data_format, _prepare_ipy_display_format
        from IPython.display import display as ip_display

        if name not in self.scraps:
            if raise_on_missing:
                raise ScrapbookException(
                    "Scrap '{}' is not available in this notebook.".format(name)
                )
            else:
                ip_display("No scrap found with name '{}' in this notebook".format(name))
        else:
            scrap = self.scraps[name]
            if new_name:
                scrap = scrap._replace(name=new_name)
            if scrap.data is not None:
                data, metadata = _prepare_ipy_data_format(
                    scrap.name, scrap_to_payload(scrap), scrap.encoder
                )
                # Skip saving data for later regluing and remove 'scrapbook'
                # from keys, when unattached
                if unattached:
                    metadata = self._strip_scrapbook_metadata(metadata)
                ip_display(data, metadata=metadata, raw=True)
            if scrap.display is not None:
                scrap_data = scrap.display.get("data", {})
                scrap_metadata = self._strip_scrapbook_metadata(scrap.display.get("metadata", {}))
                data, metadata = _prepare_ipy_display_format(scrap.name, scrap_data, scrap_metadata)
                if unattached:
                    # Remove 'scrapbook' from keys if we want it unassociated
                    metadata = self._strip_scrapbook_metadata(metadata)
                ip_display(data, metadata=metadata, raw=True)
def reglue ( self , name , new_name = None , raise_on_missing = True , unattached = False ) : # Avoid circular imports and make slow imports lazy from . api import _prepare_ipy_data_format , _prepare_ipy_display_format from IPython . display import display as ip_display if name not in self . scraps : if raise_on_missing : raise ScrapbookException ( "Scrap '{}' is not available in this notebook." . format ( name ) ) else : ip_display ( "No scrap found with name '{}' in this notebook" . format ( name ) ) else : scrap = self . scraps [ name ] if new_name : scrap = scrap . _replace ( name = new_name ) if scrap . data is not None : data , metadata = _prepare_ipy_data_format ( scrap . name , scrap_to_payload ( scrap ) , scrap . encoder ) # Skip saving data for later regluing and remove 'scrapbook' # from keys, when unattached if unattached : metadata = self . _strip_scrapbook_metadata ( metadata ) ip_display ( data , metadata = metadata , raw = True ) if scrap . display is not None : scrap_data = scrap . display . get ( "data" , { } ) scrap_metadata = self . _strip_scrapbook_metadata ( scrap . display . get ( "metadata" , { } ) ) data , metadata = _prepare_ipy_display_format ( scrap . name , scrap_data , scrap_metadata ) if unattached : # Remove 'scrapbook' from keys if we want it unassociated metadata = self . _strip_scrapbook_metadata ( metadata ) ip_display ( data , metadata = metadata , raw = True )