def update(metadata, mtime=None):
    try:
        metadata.size = os.path.getsize(metadata.path)

        if not mtime:
            mtime = os.path.getmtime(metadata.path)
        metadata.extra['revision'] = mtime
    except (IOError, __HOLE__) as e:
        raise ServiceError(
            u"Error updating file '{}': {}".format(metadata.path, e)
        )
    else:
        plug.update_file(metadata)
dataset/ETHPy150Open onitu/onitu/drivers/local_storage/onitu_local_storage/local_storage.py/update