本文整理汇总了Python中fire.Fire方法的典型用法代码示例。如果您正苦于以下问题:Python fire.Fire方法的具体用法?Python fire.Fire怎么用?Python fire.Fire使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fire
的用法示例。
在下文中一共展示了fire.Fire方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: same_run_eval
# 需要导入模块: import fire [as 别名]
# 或者: from fire import Fire [as 别名]
def same_run_eval(black_num=0, white_num=0, completions=4):
"""Shorthand to spawn a job matching up two models from the same run,
identified by their model number """
if black_num <= 0 or white_num <= 0:
print("Need real model numbers")
return
b = fsdb.get_model(black_num)
w = fsdb.get_model(white_num)
b_model_path = os.path.join(fsdb.models_dir(), b)
w_model_path = os.path.join(fsdb.models_dir(), w)
flags_path = fsdb.eval_flags_path()
obj = launch_eval_job(b_model_path + ".pb",
w_model_path + ".pb",
"{:d}-{:d}".format(black_num, white_num),
bucket_name=flags.FLAGS.bucket_name,
flags_path=flags_path,
completions=completions)
# Fire spams the retval to stdout, so...
return "{} job launched ok".format(obj[1].metadata.name)
示例2: main
# 需要导入模块: import fire [as 别名]
# 或者: from fire import Fire [as 别名]
def main():
version = get_version()
if version:
print("APSConnect-cli v{}".format(get_version()))
try:
log_entry = ("=============================\n{}\n".format(" ".join(sys.argv)))
Logger(LOG_FILE).log(log_entry)
fire.Fire(APSConnectUtil, name='apsconnect')
except Exception as e:
print("Error: {}".format(e))
sys.exit(1)
示例3: main
# 需要导入模块: import fire [as 别名]
# 或者: from fire import Fire [as 别名]
def main():
from .mock_group import MockGroupType
gc = GroupCommands(
group_types={MockGroupType.MOCK_TYPE: MockGroupType},
region='us-west-2'
)
fire.Fire(gc)
示例4: main
# 需要导入模块: import fire [as 别名]
# 或者: from fire import Fire [as 别名]
def main(commands_dict):
"""Similar to fire.Fire, but with support for multiple commands without having a class."""
class _Commands:
def __init__(self):
for name, cmd in commands_dict.items():
setattr(self, name, cmd)
fire.Fire(_Commands)
示例5: main
# 需要导入模块: import fire [as 别名]
# 或者: from fire import Fire [as 别名]
def main():
fire.Fire(TerminalCli)
示例6: main
# 需要导入模块: import fire [as 别名]
# 或者: from fire import Fire [as 别名]
def main(unused_argv):
fire.Fire(download)
示例7: main
# 需要导入模块: import fire [as 别名]
# 或者: from fire import Fire [as 别名]
def main(_=None):
fire.Fire(reinitialize.train)
示例8: main
# 需要导入模块: import fire [as 别名]
# 或者: from fire import Fire [as 别名]
def main(_=None):
fire.Fire(lottery_experiment.train)
示例9: main
# 需要导入模块: import fire [as 别名]
# 或者: from fire import Fire [as 别名]
def main(_=None):
fire.Fire(train.train)
示例10: main
# 需要导入模块: import fire [as 别名]
# 或者: from fire import Fire [as 别名]
def main(unused_argv):
fire.Fire(run)
示例11: entry
# 需要导入模块: import fire [as 别名]
# 或者: from fire import Fire [as 别名]
def entry():
fire.Fire(LKI)
示例12: main
# 需要导入模块: import fire [as 别名]
# 或者: from fire import Fire [as 别名]
def main():
fire.Fire(ramile_cli(), name='ramile')
示例13: stylecloud_cli
# 需要导入模块: import fire [as 别名]
# 或者: from fire import Fire [as 别名]
def stylecloud_cli(**kwargs):
"""Entrypoint for the stylecloud CLI."""
fire.Fire(gen_stylecloud)
示例14: main
# 需要导入模块: import fire [as 别名]
# 或者: from fire import Fire [as 别名]
def main():
fire.Fire(TelegramPublisher)
示例15: main
# 需要导入模块: import fire [as 别名]
# 或者: from fire import Fire [as 别名]
def main():
fire.Fire(MessageProcessor)