def cast_bytes(s, encoding='utf8'):  # NOQA
        if isinstance(s, bytes):
            return s
        return str(s).encode(encoding)
Copy images, settings, etc from the stylesheet doc into target doc.
dataset/ETHPy150Open circus-tent/circus/circus/py3compat.py/cast_bytes--crossover with--dataset/ETHPy150Open timonwong/OmniMarkupPreviewer/OmniMarkupLib/Renderers/libs/python3/docutils/writers/odf_odt/__init__.py/Writer.copy_from_stylesheet