

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)):
        document.file_obj.seek(0)
        content = self.file_obj.read()
        mime = magic.Magic(mime=True)
        mimetype = mime.from_buffer(content)
        return [mimetype, self.file_obj]
    try:
        func = getattr(self, ('%s_to_%s' % (extension_from, self.extension_to)))
        return func()
    except AttributeError:
        return (None, None)

dataset/ETHPy150Open adlibre/Adlibre-DMS/adlibre_dms/libraries/adlibre/converter.py NewFileConverter.convert/VarMisuse@57/65 `self`->`document`