def get_list_of_all_vms(Hypervisors): vmList = Parallel(LOG) vmList.hosts = [hv.hostname for hv in Hypervisors] vm_tables = (vmList.start("nova hypervisor-servers")) all_vms = [] index = 0 for vm_table in vm_tables: vms = [] lines = vm_table['stdout'].split('\n') # Logic to return if no VMs on the hypervisor if len(lines) > 5: for line in lines[3:len(lines) - 2]: uuid = line.split(" ")[1] vm = VirtualMachine(uuid) # Fetch all the information about the VM from nova vm.preprocess() vms.append(vm) Hypervisors[index].vms = vms all_vms.extend(vms) index = index + 1 return all_vms
def __init__(self, game, nnet, args, game_args): self.args = args self.game_args = game_args #Game_args object contains information about matrix A and observed vector y. THIS SINGLE GAME ARGS IS USED FOR GENERATING THE A AND y FOR SELF PLAY GAMES!!! ONLY. self.arena_game_args = Game_args() #object used to generate instances of A and y across all arenas objects in learn self.game = game self.nnet = nnet #new neural network wrapper object # the competitor network. SZ: Our competitor network is just another network which plays the same game as another network # and we compare which network picks the sparsest vector. The network which picks the sparsest vector is chosen and we remember these weights. self.pnet = self.nnet.__class__(self.args) #past neural network. self.nnet is a NNetWrapper object, and self.pnet = self.nnet.__class__(self.args) instantiates another instance of the NNetWrapper object with self.args as input. self.pnet and self.nnet are not pointing to the same thing. #self.skip_nnet = skip_nnet self.parallel = Parallel(self.args, self.nnet) #initialize parallelization object for parllel search. self.threaded_mcts = Threading_MCTS(self.args, self.nnet) self.trainExamplesHistory = [] # history of examples from args.numItersForTrainExamplesHistory latest iterations self.skipFirstSelfPlay = False # can be overriden in loadTrainExamples()
def reboot_all(VMs): if VMs: vmList = Parallel(LOG) vmList.hosts = [vm.uuid for vm in VMs] vmList.start("nova reboot") time.sleep(80)
def start_all(VMs): if VMs: vmList = Parallel(LOG) vmList.hosts = [vm.uuid for vm in VMs] vmList.start("nova start")
def Curves2_Curve(self, name=None): if (not name): name = self.Curves2_Name() self.Calc = True if (name == "Circle"): self.Curve = Circle() elif (name == "Parabola"): self.Curve = Parabola() elif (name == "Ellipsis"): self.Curve = Ellipsis() elif (name == "Hyperbola"): self.Curve = Hyperbola() elif (name == "Descartes"): self.Curve = Descartes() elif (name == "Rose"): self.Curve = Rose() elif (name == "Superellipse"): self.Curve = Super() elif (name == "Cycloid"): self.Curve = Cycloid() elif (name == "Trochoid"): self.Curve = Trochoid() elif (name == "Hypocycloid"): self.Curve = Hypocycloid() elif (name == "Hypotrochoid"): self.Curve = Hypotrochoid() elif (name == "Epicycloid"): self.Curve = Epicycloid() elif (name == "Epitrochoid"): self.Curve = Epitrochoid() elif (name == "Super"): self.Curve = Super() elif (name == "LatexTables"): self.Latex_Curves_Table_Generate() elif (name == "Parallel"): self.Curve = Parallel() self.Curve.Base_Curve() self.Curve.Run() else: self.Calc = False self.Name = name if (self.Curves2_Args()): self.Calc = False return self.Curve
class Curves2_Names(): def Curves2_Curve(self, name=None): if (not name): name = self.Curves2_Name() self.Calc = True if (name == "Circle"): self.Curve = Circle() elif (name == "Parabola"): self.Curve = Parabola() elif (name == "Ellipsis"): self.Curve = Ellipsis() elif (name == "Hyperbola"): self.Curve = Hyperbola() elif (name == "Descartes"): self.Curve = Descartes() elif (name == "Rose"): self.Curve = Rose() elif (name == "Superellipse"): self.Curve = Super() elif (name == "Cycloid"): self.Curve = Cycloid() elif (name == "Trochoid"): self.Curve = Trochoid() elif (name == "Hypocycloid"): self.Curve = Hypocycloid() elif (name == "Hypotrochoid"): self.Curve = Hypotrochoid() elif (name == "Epicycloid"): self.Curve = Epicycloid() elif (name == "Epitrochoid"): self.Curve = Epitrochoid() elif (name == "Super"): self.Curve = Super() elif (name == "LatexTables"): self.Latex_Curves_Table_Generate() elif (name == "Parallel"): self.Curve = Parallel() self.Curve.Base_Curve() self.Curve.Run() else: self.Calc = False self.Name = name if (self.Curves2_Args()): self.Calc = False return self.Curve def Curves2_Names(self): return [ "Circle", "Parabola", "Ellipsis", "Hyperbola", "Superellipse", "Cycloid", "Trochoid", "Hypocycloid", "Hypotrochoid", "Epicycloid", "Epitrochoid", "Descartes", "Rose", "Super", "Parallel", "LatexTables", ] def Curves2_Name(self): curve = None if (self.CGI_Is()): curve = self.CGI_GET_Get("Curve") else: if (len(sys.argv) > 1 and re.search(self.Curves2_Regex() + '$', sys.argv[1])): curve = sys.argv[1] return curve
def results_button(app): parallel = Parallel(app) parallel.execute(True) # True to execute minimizing window
def confirm_button(app): parallel = Parallel(app) parallel.execute()