def move_files(update_files, remove_files=None):
    if not remove_files:
        remove_files = set()

    tmp_suffix = os.getpid() % '%d.tmp~'
    bak_suffix = '%d.bak~' % time.time()

    for filepath in update_files.iterkeys():
        if os.path.exists(filepath):
            # Move previous version to a backup
            logging.info("backing up %s (%s)" % (filepath, bak_suffix))
            os.rename(filepath, '%s.%s' % (filepath, bak_suffix))

        logging.info("updating %s" % filepath)
        try:
            os.rename('%s.%s' % (filepath, tmp_suffix), filepath)
        except:
            # Move backup file back so there's some sort of configuration
            os.rename('%s.%s' % (filepath, bak_suffix), filepath)
            raise

    for filepath in remove_files:
        logging.info("moving %s (%s)" % (filepath, bak_suffix))
        os.rename(filepath, '%s.%s' % (filepath, bak_suffix))
dataset/ETHPy150Open rackerlabs/openstack-guest-agents-unix/commands/network.py/move_files/swapped operands of `%`