# Path: onecodex/exceptions.py
# class OneCodexException(Exception):
#     pass


import datetime
from onecodex.exceptions import OneCodexException
        from IPython.display import display
        from IPython.display import display
        from IPython.display import display
        from IPython.display import display
        from IPython.display import display
        from IPython.display import display
        from IPython.display import display
        from IPython.display import display
        from IPython.display import display
        from IPython.display import display

    You want to insert a reference into a figure legend, using `report.legend`.

        report.legend(
            'As you can clearly see in the above figure, the data supports my conclusion '
            'and does not support the conclusion of my peers{reference(label='similar_paper1')}. '
            'This is most likely because I am smarter and more attractive than the authors of '
            'those other publications{reference(label='ego_and_insecurity1')}.'
        )
    """

    def __init__(self, text=None, label=None):
        if text is None and label is None:
            raise OneCodexException("Please specify at least one of: text, label")

        self.text = text or ""
        self.label = label or ""

        try:
            ipy = get_ipython()
            self.ref_list = ipy.meta.get("references", {})
        except NameError:
            raise OneCodexException("Must be run from within IPython")

        if text:
            # has this reference already been cited?
            for ref_label, (ref_num, ref_text) in self.ref_list.items():
                print(ref_label, ref_num, ref_text)
                if text == ref_text:
                    if label and label != ref_label:

# Path: onecodex/exceptions.py
# class OneCodexException(Exception):
#     pass


# Path: onecodex/notebooks/report.py
import datetime
from onecodex.exceptions import OneCodexException
        from IPython.display import display
        from IPython.display import display
        from IPython.display import display
        from IPython.display import display
        from IPython.display import display
        from IPython.display import display
        from IPython.display import display
        from IPython.display import display
        from IPython.display import display
        from IPython.display import display


    You want to insert a reference into a figure legend, using `report.legend`.

        report.legend(
            'As you can clearly see in the above figure, the data supports my conclusion '
            'and does not support the conclusion of my peers{reference(label='similar_paper1')}. '
            'This is most likely because I am smarter and more attractive than the authors of '
            'those other publications{reference(label='ego_and_insecurity1')}.'
        )
    """

    def __init__(self, text=None, label=None):
        if text is None and label is None:
            raise OneCodexException("Please specify at least one of: text, label")

        self.text = text or ""
        self.label = label or ""

        try:
            ipy = get_ipython()
            self.ref_list = ipy.meta.get("references", {})
        except NameError:
            raise OneCodexException("Must be run from within IPython")

        if text:
            # has this reference already been cited?
            for ref_label, (ref_num, ref_text) in self.ref_list.items():
                print(ref_label, ref_num, ref_text)
                if text == ref_text:
                    if label and label != ref_label:

                        raise OneCodexException(