# Path: onecodex/exceptions.py
# class UploadException(Exception):
#     """An exception for when things go wrong with uploading."""
# 
#     pass
# 
# Path: onecodex/notebooks/report.py
# class set_style(object):
# class set_center_header(object):
# class set_date(object):
# class title(object):
# class set_logo(object):
# class legend(object):
# class reference(object):
# class bibliography(object):
# class page_break(object):
# class cover_sheet(object):
#     def __init__(self, style):
#     def display(self):
#     def _repr_mimebundle_(self, include=None, exclude=None):
#     def __init__(self, text, style=None):
#     def display(self):
#     def _repr_mimebundle_(self, include=None, exclude=None):
#     def __init__(self, date=None, style=None):
#     def display(self):
#     def _repr_mimebundle_(self, include=None, exclude=None):
#     def __init__(self, text, style=None):
#     def display(self):
#     def _repr_mimebundle_(self, include=None, exclude=None):
#     def __init__(self, url, position="left", style=None):
#     def display(self):
#     def _repr_mimebundle_(self, include=None, exclude=None):
#     def __init__(self, text, heading=None, fignum=None, style=None):
#     def display(self):
#     def _repr_mimebundle_(self, include=None, exclude=None):
#     def __init__(self, text=None, label=None):
#     def display(self):
#     def _repr_mimebundle_(self, include=None, exclude=None):
#     def __str__(self):
#     def __init__(self, style=None):
#     def display(self):
#     def _repr_mimebundle_(self, include=None, exclude=None):
#     def display(self):
#     def _repr_mimebundle_(self, include=None, exclude=None):
#     def __init__(self, title, prepared_for, prepared_by, project_details, add_br=True):
#     def display(self):
#     def _repr_mimebundle_(self, include=None, exclude=None):


from base64 import b64encode
from builtins import bytes
from io import BytesIO
from nbconvert.exporters.html import HTMLExporter
from nbconvert.preprocessors import Preprocessor
from traitlets import default
from onecodex.exceptions import UploadException
from onecodex.notebooks import report
            from jupyter_contrib_nbextensions.nbconvert_support import (  # noqa
                PyMarkdownPreprocessor,
            )
        from weasyprint import HTML, CSS
        from onecodex import Api
        from onecodex.lib.upload import _upload_document_fileobj
import copy
import datetime
import json
import os
import pytz
        import sentry_sdk

        Notes
        -----
        This exporter will only save cells generated with Altair/Vega if they have an SVG image type
        stored with them. This data is only stored if our fork of `ipyvega` is installed or the onecodex
        # renderer is used--otherwise, they will be low-resolution PNGs, which will not be exported.
        """
        nb = copy.deepcopy(nb)

        # setup our dictionary that's accessible from within jinja templates
        if resources is None:
            resources = {"metadata": {}}
        elif "metadata" not in resources:
            resources["metadata"] = {}

        # iterate over cells in the notebook and transform data as necessary
        do_not_insert_date = False

        # add one codex logo unless told not to
        if not os.environ.get("ONE_CODEX_REPORT_NO_LOGO", False):
            img = b64encode(
                bytes(open(os.path.join(ASSETS_PATH, "one_codex_logo.png"), "rb").read())
            ).decode()
            img = "data:image/png;charset=utf-8;base64,%s" % (img,)
            logo_html = report.set_logo(img, position="right")._repr_mimebundle_()["text/html"]
            head_block = resources["metadata"].get("head_block", "") + logo_html
            resources["metadata"]["head_block"] = head_block

        # add today's date unless told not to (i.e. a custom date was specified)
        if not do_not_insert_date:

# Path: onecodex/exceptions.py
# class UploadException(Exception):
#     """An exception for when things go wrong with uploading."""
# 
#     pass
# 
# Path: onecodex/notebooks/report.py
# class set_style(object):
# class set_center_header(object):
# class set_date(object):
# class title(object):
# class set_logo(object):
# class legend(object):
# class reference(object):
# class bibliography(object):
# class page_break(object):
# class cover_sheet(object):
#     def __init__(self, style):
#     def display(self):
#     def _repr_mimebundle_(self, include=None, exclude=None):
#     def __init__(self, text, style=None):
#     def display(self):
#     def _repr_mimebundle_(self, include=None, exclude=None):
#     def __init__(self, date=None, style=None):
#     def display(self):
#     def _repr_mimebundle_(self, include=None, exclude=None):
#     def __init__(self, text, style=None):
#     def display(self):
#     def _repr_mimebundle_(self, include=None, exclude=None):
#     def __init__(self, url, position="left", style=None):
#     def display(self):
#     def _repr_mimebundle_(self, include=None, exclude=None):
#     def __init__(self, text, heading=None, fignum=None, style=None):
#     def display(self):
#     def _repr_mimebundle_(self, include=None, exclude=None):
#     def __init__(self, text=None, label=None):
#     def display(self):
#     def _repr_mimebundle_(self, include=None, exclude=None):
#     def __str__(self):
#     def __init__(self, style=None):
#     def display(self):
#     def _repr_mimebundle_(self, include=None, exclude=None):
#     def display(self):
#     def _repr_mimebundle_(self, include=None, exclude=None):
#     def __init__(self, title, prepared_for, prepared_by, project_details, add_br=True):
#     def display(self):
#     def _repr_mimebundle_(self, include=None, exclude=None):


# Path: onecodex/notebooks/exporters.py
from base64 import b64encode
from builtins import bytes
from io import BytesIO
from nbconvert.exporters.html import HTMLExporter
from nbconvert.preprocessors import Preprocessor
from traitlets import default
from onecodex.exceptions import UploadException
from onecodex.notebooks import report
            from jupyter_contrib_nbextensions.nbconvert_support import (  # noqa
                PyMarkdownPreprocessor,
            )
        from weasyprint import HTML, CSS
        from onecodex import Api
        from onecodex.lib.upload import _upload_document_fileobj
import copy
import datetime
import json
import os
import pytz
        import sentry_sdk


        Notes
        -----
        This exporter will only save cells generated with Altair/Vega if they have an SVG image type
        stored with them. This data is only stored if our fork of `ipyvega` is installed or the onecodex
        # renderer is used--otherwise, they will be low-resolution PNGs, which will not be exported.
        """
        nb = copy.deepcopy(nb)

        # setup our dictionary that's accessible from within jinja templates
        if resources is None:
            resources = {"metadata": {}}
        elif "metadata" not in resources:
            resources["metadata"] = {}

        # iterate over cells in the notebook and transform data as necessary
        do_not_insert_date = False

        # add one codex logo unless told not to
        if not os.environ.get("ONE_CODEX_REPORT_NO_LOGO", False):
            img = b64encode(
                bytes(open(os.path.join(ASSETS_PATH, "one_codex_logo.png"), "rb").read())
            ).decode()
            img = "data:image/png;charset=utf-8;base64,%s" % (img,)
            logo_html = report.set_logo(img, position="right")._repr_mimebundle_()["text/html"]
            head_block = resources["metadata"].get("head_block", "") + logo_html
            resources["metadata"]["head_block"] = head_block

        # add today's date unless told not to (i.e. a custom date was specified)
        if not do_not_insert_date:

            date_div = report.set_date()._repr_mimebundle_()[0]["text/html"]