本文整理匯總了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),
})