def convert(self):
        document, extension = os.path.splitext(self.filename)
        extension_from = extension.strip(".")

        if self.extension_to is None or self.extension_to == extension_from:
            self.file_obj.seek(0)
            content = self.file_obj.read()
            self.file_obj.close()
            mime = magic.Magic(mime=True)
            mimetype = mime.from_buffer(content)
            return [mimetype, content]
        try:
            func = getattr(self, '%s_to_%s' % (extension_from, self.extension_to))
            return func()
        except AttributeError:
            return None
dataset/ETHPy150Open adlibre/Adlibre-DMS/adlibre_dms/libraries/adlibre/converter.py/FileConverter.convert/original