@plug.handler()
def end_upload(metadata):
    plug.logger.debug(u"Ending upload of file {}", metadata.path)
    try:
        stat_res = sftp.stat(metadata.path)
        update_metadata(metadata, stat_res.st_mtime,
                        update_file=False)
    except (IOError, OSError) as e:
        raise ServiceError(u"Error during upload ending on file '{}': {}"
                           .format(metadata.path, e))
    finally:
        if events_to_ignore in metadata.path:
            plug.logger.debug(u"Removing {} of ignored files", metadata.path)
            events_to_ignore.remove(metadata.path)
dataset/ETHPy150Open onitu/onitu/drivers/sftp/onitu_sftp/sftp.py/end_upload/swapped operands of `in`