def read(self, nb):
        assert nb['nbformat'] >= 4

        yield {
            'cell_type': 'notebook_metadata',
            "metadata": nb['metadata']
        }

        for cell in nb['cells']:
            ipymd_cell = {}
            metadata = self.clean_meta(cell)
            if metadata:
                ipymd_cell['metadata'] = metadata
            ctype = cell['cell_type']
            ipymd_cell['cell_type'] = ctype
            if ctype == 'code':
                ipymd_cell['input'] = _cell_input(cell)
                ipymd_cell['output'] = _cell_output(cell)
            elif ctype == 'markdown':
                ipymd_cell['source'] = _ensure_string(cell['source'])
            else:
                continue
            yield ipymd_cell
dataset/ETHPy150Open rossant/ipymd/ipymd/formats/notebook.py/NotebookReader.read/original