本文整理汇总了Python中manager.Manager方法的典型用法代码示例。如果您正苦于以下问题:Python manager.Manager方法的具体用法?Python manager.Manager怎么用?Python manager.Manager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类manager
的用法示例。
在下文中一共展示了manager.Manager方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import manager [as 别名]
# 或者: from manager import Manager [as 别名]
def main(_):
run_config = tf.ConfigProto()
run_config.gpu_options.allow_growth = True
with tf.Session(config=run_config) as sess:
#print used dataset
print "Dataset: %s"%args.data
print "Model: %s"%args.model
if args.model == "baseline_network":
model = baseline_network(args)
elif args.model == "capsule_dynamic":
model = capsule_dynamic(args)
elif args.model == "capsule_em":
model = capsule_em(args)
#create graph and checkpoints folder if they don't exist
if not os.path.exists(args.checkpoints_path):
os.makedirs(args.checkpoints_path)
if not os.path.exists(args.graph_path):
os.makedirs(args.graph_path)
#create a subfolder in checkpoints folder
args.checkpoints_path = os.path.join(args.checkpoints_path, args.model + "/")
if not os.path.exists(args.checkpoints_path):
os.makedirs(args.checkpoints_path)
args.graph_path = os.path.join(args.graph_path, args.model + "/")
if not os.path.exists(args.graph_path):
os.makedirs(args.graph_path)
#manager performs all the training/testing
manager = Manager(args)
if args.is_train:
print 'Start Training...'
manager.train(sess, model)
else:
print 'Start Testing...'
manager.test(sess, model)
示例2: main
# 需要导入模块: import manager [as 别名]
# 或者: from manager import Manager [as 别名]
def main():
args = parse_args()
logging.basicConfig(
level=args.loglevel,
format='%(name)s [%(process)d] %(levelname)s %(message)s')
if args.loglevel and not args.debug_requests:
logging.getLogger('requests').setLevel(logging.WARN)
LOG.info('Starting up')
LOG.info('Kubernetes is %s', args.kube_endpoint)
LOG.info('Etcd is %s', args.etcd_endpoint)
LOG.info('Managing interface %s', args.interface)
if args.no_driver:
iface_driver = None
fw_driver = None
else:
iface_driver = interface.Interface(args.interface)
fw_driver = firewall.Firewall(fwchain=args.fwchain,
fwmark=args.fwmark)
mgr = manager.Manager(etcd_endpoint=args.etcd_endpoint,
kube_endpoint=args.kube_endpoint,
etcd_prefix=args.etcd_prefix,
iface_driver=iface_driver,
fw_driver=fw_driver,
cidr_ranges=args.cidr_range,
refresh_interval=args.refresh_interval,
id=args.agent_id)
LOG.info('My id is: %s', mgr.id)
mgr.run()
示例3: create_manager
# 需要导入模块: import manager [as 别名]
# 或者: from manager import Manager [as 别名]
def create_manager(hostname, username, password):
"""
Creates and returns a manager for the OpenWRT instance for the specified information.
Args:
hostname: the hostname to the OpenWRT instance
username: the configured Luci username
password: the configured luci password
Raises:
AuthenticationError: any call can raise this when authentication fails
"""
import manager
return manager.Manager(hostname, username, password)
示例4: __init__
# 需要导入模块: import manager [as 别名]
# 或者: from manager import Manager [as 别名]
def __init__(self, session, args = 0):
self.printconfig()
self.session = session
Screen.__init__(self, session)
Screen.setTitle(self, _("AutoBouquetsMaker"))
self.frontend = None
self.rawchannel = None
self.postScanService = None
self.providers = Manager().getProviders()
self["actions"] = ActionMap(["OkCancelActions", "ColorActions"],
{
"cancel": self.keyCancel,
"red": self.keyCancel,
}, -2)
# self["background"] = Pixmap()
self["action"] = Label(_("Starting scanner"))
self["status"] = Label("")
self["progress"] = ProgressBar()
self["progress_text"] = Progress()
self["tuner_text"] = Label("")
self["Frontend"] = FrontendStatus(frontend_source = lambda : self.frontend, update_interval = 100)
# dependent providers
self.dependents = {}
for provider_key in self.providers:
if len(self.providers[provider_key]["dependent"]) > 0 and self.providers[provider_key]["dependent"] in self.providers:
if self.providers[provider_key]["dependent"] not in self.dependents:
self.dependents[self.providers[provider_key]["dependent"]] = []
self.dependents[self.providers[provider_key]["dependent"]].append(provider_key)
# get ABM config string including dependents
self.abm_settings_str = self.getABMsettings()
self.actionsList = []
self.onFirstExecBegin.append(self.firstExec)