<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load_styles(path_or_doc):
 """Return a dictionary of all styles contained in an ODF document."""

    if isinstance(path_or_doc, string_types):
        doc = load(path_or_doc)
    else:
        # Recover the OpenDocumentText instance.
        if isinstance(path_or_doc, ODFDocument):
            doc = path_or_doc._doc
        else:
            doc = path_or_doc
        assert isinstance(doc, OpenDocument), doc
    styles = {_style_name(style): style for style in doc.styles.childNodes}
    return styles