@contract
def append_host_data_locally(path, cpu_mhz, data_length):
    if not os.access(path, os.F_OK):
        with open(path, 'w') as f:
            f.write(str(cpu_mhz) + '\n')
    else:
        with open(path, 'r+') as f:
            values = deque(f.read().strip().splitlines(), data_length)
            values.append(cpu_mhz)
            f.truncate(0)
            f.seek(0)
            f.write('\n'.join([str(x) for x in values]) + '\n')
Write a CPU MHz value for the host.
dataset/ETHPy150Open beloglazov/openstack-neat/neat/locals/collector.py/append_host_data_locally