def mount_ramdisk(size, path):
    "Mount RAM disk at `path` with `size` in bytes."
    sectors = size / 512

    os.makedirs(path)

    dev_path = run('hdid', '-nomount', sectors % 'ram://%d')
    run('newfs_hfs', '-v', 'RAMdisk', dev_path)
    run('mount', '-o', 'noatime', '-t', 'hfs', dev_path, path)

    return dev_path
dataset/ETHPy150Open grantjenks/python-diskcache/tests/utils.py/mount_ramdisk/swapped operands of `%`