def base64_encode(nb):
for ws in nb.worksheets:<EOL><INDENT>for cell in ws.cells:<EOL><INDENT>if cell.cell_type == '<STR_LIT:code>':<EOL><INDENT>for output in cell.outputs:<EOL><INDENT>if '<STR_LIT>' in output:<EOL><INDENT>output.png = encodestring(output.png).decode('<STR_LIT:ascii>')<EOL><DEDENT>if '<STR_LIT>' in output:<EOL><INDENT>output.jpeg = encodestring(output.jpeg).decode('<STR_LIT:ascii>')<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>return nb<EOL>
Base64 encode all bytes objects in the notebook.

    These will be b64-encoded unicode strings

    Note: This is never used