How to use the scrapbook.scraps.payload_to_scrap function in scrapbook

To help you get started, we’ve selected a few scrapbook examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nteract / scrapbook / scrapbook / models.py View on Github external
def _extract_output_data_scraps(self, output):
        output_scraps = Scraps()
        for sig, payload in output.get("data", {}).items():
            # Backwards compatibility for papermill
            scrap = self._extract_papermill_output_data(sig, payload)
            if scrap is None and sig.startswith(GLUE_PAYLOAD_PREFIX):
                scrap = encoder_registry.decode(payload_to_scrap(payload))
            if scrap:
                output_scraps[scrap.name] = scrap

        return output_scraps