本文整理汇总了Python中machine.Machine.write_features方法的典型用法代码示例。如果您正苦于以下问题:Python Machine.write_features方法的具体用法?Python Machine.write_features怎么用?Python Machine.write_features使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类machine.Machine
的用法示例。
在下文中一共展示了Machine.write_features方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run_model
# 需要导入模块: from machine import Machine [as 别名]
# 或者: from machine.Machine import write_features [as 别名]
def run_model(config_file, machine_id):
print "Running {}".format(machine_id)
machine = Machine(config_file)
machine.get_id(machine_id)
memory = Memory(machine)
networking = Networking(machine)
ai_features = dict(memory.ai_features().items() + networking.ai_features().items())
procfs_features = dict(memory.procfs_features().items() + networking.procfs_features().items())
sysfs_features = dict(memory.sysfs_features().items() + networking.sysfs_features().items())
machine.write_features('ai_features', ai_features)
machine.write_features('procfs', procfs_features)
machine.write_features('sysfs', sysfs_features)
machine.write_features('quick', {
'Security': 0,
'Stats': len(procfs_features) + len(sysfs_features),
})