hexsha
stringlengths
40
40
size
int64
7
1.04M
ext
stringclasses
10 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
247
max_stars_repo_name
stringlengths
4
125
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
368k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
4
247
max_issues_repo_name
stringlengths
4
125
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
116k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
4
247
max_forks_repo_name
stringlengths
4
125
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
1
1.04M
avg_line_length
float64
1.77
618k
max_line_length
int64
1
1.02M
alphanum_fraction
float64
0
1
original_content
stringlengths
7
1.04M
filtered:remove_function_no_docstring
int64
-102
942k
filtered:remove_class_no_docstring
int64
-354
977k
filtered:remove_delete_markers
int64
0
60.1k
b2aaa6515bcb932dbc07057cb9192a90b18de559
32
py
Python
hello.py
OmalleyTomas98/graphTheoryProject
ec68b39b5984764cce8d1ff14ab770f29d957dea
[ "MIT" ]
null
null
null
hello.py
OmalleyTomas98/graphTheoryProject
ec68b39b5984764cce8d1ff14ab770f29d957dea
[ "MIT" ]
null
null
null
hello.py
OmalleyTomas98/graphTheoryProject
ec68b39b5984764cce8d1ff14ab770f29d957dea
[ "MIT" ]
null
null
null
print("Hello world from my VM")
16
31
0.71875
print("Hello world from my VM")
0
0
0
b1623d3f56fc0fa6bbaddb4f58484a547d21715c
255
py
Python
mundo1/parte3/ex019.py
fcdennis/CursoPython
485ef7e706af74eae9ee336714ddd8b493bd8e5d
[ "MIT" ]
null
null
null
mundo1/parte3/ex019.py
fcdennis/CursoPython
485ef7e706af74eae9ee336714ddd8b493bd8e5d
[ "MIT" ]
null
null
null
mundo1/parte3/ex019.py
fcdennis/CursoPython
485ef7e706af74eae9ee336714ddd8b493bd8e5d
[ "MIT" ]
null
null
null
from random import choice aluno1 = input("Primeiro aluno: ") aluno2 = input("Segundo aluno: ") aluno3 = input("Terceiro aluno: ") aluno4 = input("Quarto aluno: ") alunos = [aluno1, aluno2, aluno3, aluno4] print(f"O aluno escolhido foi {choice(alunos)}.")
31.875
49
0.709804
from random import choice aluno1 = input("Primeiro aluno: ") aluno2 = input("Segundo aluno: ") aluno3 = input("Terceiro aluno: ") aluno4 = input("Quarto aluno: ") alunos = [aluno1, aluno2, aluno3, aluno4] print(f"O aluno escolhido foi {choice(alunos)}.")
0
0
0
d220f289cd513f31406914ccd9394bc9d4ab089d
15,328
py
Python
pvn3d/lib/utils/pvn3d_eval_utils.py
Jialn/PVN3D
076c6f2e112cb310d9b14adfb19fab4aa444b7f1
[ "MIT" ]
null
null
null
pvn3d/lib/utils/pvn3d_eval_utils.py
Jialn/PVN3D
076c6f2e112cb310d9b14adfb19fab4aa444b7f1
[ "MIT" ]
null
null
null
pvn3d/lib/utils/pvn3d_eval_utils.py
Jialn/PVN3D
076c6f2e112cb310d9b14adfb19fab4aa444b7f1
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 import os import time import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn from torch.nn.modules.loss import _Loss from torch.autograd import Variable import concurrent.futures import numpy as np import pickle as pkl from common import Config from lib.utils.basic_utils import Basic_Utils from lib.utils.meanshift_pytorch import MeanShiftTorch config = Config(dataset_name='ycb') bs_utils = Basic_Utils(config) config_lm = Config(dataset_name="linemod") bs_utils_lm = Basic_Utils(config_lm) cls_lst = config.ycb_cls_lst # vim: ts=4 sw=4 sts=4 expandtab
36.669856
86
0.591336
#!/usr/bin/env python3 import os import time import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn from torch.nn.modules.loss import _Loss from torch.autograd import Variable import concurrent.futures import numpy as np import pickle as pkl from common import Config from lib.utils.basic_utils import Basic_Utils from lib.utils.meanshift_pytorch import MeanShiftTorch config = Config(dataset_name='ycb') bs_utils = Basic_Utils(config) config_lm = Config(dataset_name="linemod") bs_utils_lm = Basic_Utils(config_lm) cls_lst = config.ycb_cls_lst class VotingType: BB8=0 BB8C=1 BB8S=2 VanPts=3 Farthest=5 Farthest4=6 Farthest12=7 Farthest16=8 Farthest20=9 def cal_frame_poses( pcld, mask, ctr_of, pred_kp_of, use_ctr, n_cls, use_ctr_clus_flter ): n_kps, n_pts, _ = pred_kp_of.size() pred_ctr = pcld - ctr_of[0] pred_kp = pcld.view(1, n_pts, 3).repeat(n_kps, 1, 1) - pred_kp_of radius=0.04 if use_ctr: cls_kps = torch.zeros(n_cls, n_kps+1, 3).cuda() else: cls_kps = torch.zeros(n_cls, n_kps, 3).cuda() pred_cls_ids = np.unique(mask[mask>0].contiguous().cpu().numpy()) if use_ctr_clus_flter: ctrs = [] truely_pred_cls = [] for icls, cls_id in enumerate(pred_cls_ids): if cls_id == 18: print(cls_id) cls_msk = (mask == cls_id) ms = MeanShiftTorch(bandwidth=radius) ctr_list, ctrs_labels_list = ms.fit(pred_ctr[cls_msk, :]) for ctr in ctr_list: ctrs.append(ctr.detach().contiguous().cpu().numpy()) truely_pred_cls.append(cls_id) truely_pred_cls = np.array(truely_pred_cls, dtype=np.int64) ctrs = torch.from_numpy(np.array(ctrs).astype(np.float32)).cuda() print(ctrs) n_ctrs = ctrs.size()[0] print("centers.size:" + str(ctrs.size())) print(n_ctrs) pred_ctr_rp = pred_ctr.view(n_pts, 1, 3).repeat(1, n_ctrs, 1) ctrs_rp = ctrs.view(1, n_ctrs, 3).repeat(n_pts, 1, 1) ctr_dis = torch.norm((pred_ctr_rp - ctrs_rp), dim=2) min_dis, min_idx = torch.min(ctr_dis, dim=1) msk_closest_ctr = torch.LongTensor(truely_pred_cls).cuda()[min_idx] new_msk = mask.clone() for cls_id in truely_pred_cls: if cls_id == 0: break min_msk = min_dis < config.ycb_r_lst[cls_id-1] * 0.8 update_msk = (mask > 0) & (msk_closest_ctr == cls_id) & min_msk new_msk[update_msk] = msk_closest_ctr[update_msk] mask = new_msk pred_pose_lst = [] truely_pred_cls = [] for icls, cls_id in enumerate(pred_cls_ids): if cls_id == 0: break cls_msk = mask == cls_id if cls_msk.sum() < 1: pred_pose_lst.append(np.identity(4)[:3,:]) truely_pred_cls.append(cls_id) continue cls_msk_idx = [] for _i, msk in enumerate(cls_msk.cpu().numpy()): if msk: cls_msk_idx.append(_i) ms = MeanShiftTorch(bandwidth=radius) ctr_list, ctr_labels_list = ms.fit(pred_ctr[cls_msk, :]) for ctr, ctr_labels in zip(ctr_list, ctr_labels_list): if ctr_labels.sum() < 1: ctr_labels[0] = 1 if use_ctr: cls_kps[cls_id, n_kps, :] = ctr cls_msk_obj = []#torch.zeros(cls_msk.shape[0], dtype=uint8).cuda() for _i, val in enumerate(ctr_labels.cpu().numpy()): if val: # cls_msk_obj[cls_msk_idx[_i]] = 1 cls_msk_obj.append(cls_msk_idx[_i]) cls_voted_kps = pred_kp[:, cls_msk_obj, :] # if use_ctr_clus_flter: # in_pred_kp = cls_voted_kps[:, ctr_labels, :] # else: # in_pred_kp = cls_voted_kps in_pred_kp = cls_voted_kps for ikp, kps3d in enumerate(in_pred_kp): cls_kps[cls_id, ikp, :], _ = ms.fit(kps3d, multi_object=False) mesh_kps = bs_utils.get_kps(cls_lst[cls_id-1]) if use_ctr: mesh_ctr = bs_utils.get_ctr(cls_lst[cls_id-1]).reshape(1,3) mesh_kps = np.concatenate((mesh_kps, mesh_ctr), axis=0) mesh_kps = torch.from_numpy(mesh_kps.astype(np.float32)).cuda() pred_RT = bs_utils.best_fit_transform( mesh_kps.contiguous().cpu().numpy(), cls_kps[cls_id].squeeze().contiguous().cpu().numpy() ) truely_pred_cls.append(cls_id) pred_pose_lst.append(pred_RT) return (truely_pred_cls, pred_pose_lst) def eval_metric(cls_ids, pred_pose_lst, pred_cls_ids, RTs, mask, label): n_cls = config.n_classes cls_add_dis = [list() for i in range(n_cls)] cls_adds_dis = [list() for i in range(n_cls)] for icls, cls_id in enumerate(cls_ids): if cls_id == 0: break cls_msk = mask == cls_id cls_idx = np.where(pred_cls_ids == cls_id[0].item())[0] if len(cls_idx) == 0: pred_RT = torch.zeros(3,4).cuda() else: pred_RT = pred_pose_lst[cls_idx[0]] pred_RT = torch.from_numpy(pred_RT.astype(np.float32)).cuda() gt_RT = RTs[icls] mesh_pts = bs_utils.get_pointxyz_cuda(cls_lst[cls_id-1]).clone() add = bs_utils.cal_add_cuda(pred_RT, gt_RT, mesh_pts) adds = bs_utils.cal_adds_cuda(pred_RT, gt_RT, mesh_pts) cls_add_dis[cls_id].append(add.item()) cls_adds_dis[cls_id].append(adds.item()) cls_add_dis[0].append(add.item()) cls_adds_dis[0].append(adds.item()) return (cls_add_dis, cls_adds_dis) def eval_one_frame_pose( item ): pcld, mask, ctr_of, pred_kp_of, RTs, cls_ids, use_ctr, n_cls, \ min_cnt, use_ctr_clus_flter, label, epoch, ibs = item pred_cls_ids, pred_pose_lst = cal_frame_poses( pcld, mask, ctr_of, pred_kp_of, use_ctr, n_cls, use_ctr_clus_flter ) cls_add_dis, cls_adds_dis = eval_metric( cls_ids, pred_pose_lst, pred_cls_ids, RTs, mask, label ) return (cls_add_dis, cls_adds_dis) def cal_frame_poses_lm( pcld, mask, ctr_of, pred_kp_of, use_ctr, n_cls, use_ctr_clus_flter, obj_id ): n_kps, n_pts, _ = pred_kp_of.size() pred_ctr = pcld - ctr_of[0] pred_kp = pcld.view(1, n_pts, 3).repeat(n_kps, 1, 1) - pred_kp_of radius=0.08 if use_ctr: cls_kps = torch.zeros(n_cls, n_kps+1, 3).cuda() else: ls_kps = torch.zeros(n_cls, n_kps, 3).cuda() pred_pose_lst = [] cls_id = 1 cls_msk = mask == cls_id if cls_msk.sum() < 1: pred_pose_lst.append(np.identity(4)[:3,:]) else: cls_voted_kps = pred_kp[:, cls_msk, :] ms = MeanShiftTorch(bandwidth=radius) ctr, ctr_labels = ms.fit(pred_ctr[cls_msk, :]) if ctr_labels.sum() < 1: ctr_labels[0] = 1 if use_ctr: cls_kps[cls_id, n_kps, :] = ctr if use_ctr_clus_flter: in_pred_kp = cls_voted_kps[:, ctr_labels, :] else: in_pred_kp = cls_voted_kps for ikp, kps3d in enumerate(in_pred_kp): cls_kps[cls_id, ikp, :], _ = ms.fit(kps3d) mesh_kps = bs_utils_lm.get_kps(obj_id, ds_type="linemod") if use_ctr: mesh_ctr = bs_utils_lm.get_ctr(obj_id, ds_type="linemod").reshape(1,3) mesh_kps = np.concatenate((mesh_kps, mesh_ctr), axis=0) mesh_kps = torch.from_numpy(mesh_kps.astype(np.float32)).cuda() pred_RT = bs_utils_lm.best_fit_transform( mesh_kps.contiguous().cpu().numpy(), cls_kps[cls_id].squeeze().contiguous().cpu().numpy() ) pred_pose_lst.append(pred_RT) return pred_pose_lst def eval_metric_lm(cls_ids, pred_pose_lst, RTs, mask, label, obj_id): n_cls = config.n_classes cls_add_dis = [list() for i in range(n_cls)] cls_adds_dis = [list() for i in range(n_cls)] pred_RT = pred_pose_lst[0] pred_RT = torch.from_numpy(pred_RT.astype(np.float32)).cuda() gt_RT = RTs[0] mesh_pts = bs_utils_lm.get_pointxyz_cuda(obj_id, ds_type="linemod").clone() add = bs_utils_lm.cal_add_cuda(pred_RT, gt_RT, mesh_pts) adds = bs_utils_lm.cal_adds_cuda(pred_RT, gt_RT, mesh_pts) cls_add_dis[obj_id].append(add.item()) cls_adds_dis[obj_id].append(adds.item()) cls_add_dis[0].append(add.item()) cls_adds_dis[0].append(adds.item()) return (cls_add_dis, cls_adds_dis) def eval_one_frame_pose_lm( item ): pcld, mask, ctr_of, pred_kp_of, RTs, cls_ids, use_ctr, n_cls, \ min_cnt, use_ctr_clus_flter, label, epoch, ibs, obj_id = item pred_pose_lst = cal_frame_poses_lm( pcld, mask, ctr_of, pred_kp_of, use_ctr, n_cls, use_ctr_clus_flter, obj_id ) cls_add_dis, cls_adds_dis = eval_metric_lm( cls_ids, pred_pose_lst, RTs, mask, label, obj_id ) return (cls_add_dis, cls_adds_dis) class TorchEval(): def __init__(self): n_cls = 22 self.n_cls = 22 self.cls_add_dis = [list() for i in range(n_cls)] self.cls_adds_dis = [list() for i in range(n_cls)] self.cls_add_s_dis = [list() for i in range(n_cls)] self.sym_cls_ids = [] def cal_auc(self): add_auc_lst = [] adds_auc_lst = [] add_s_auc_lst = [] for cls_id in range(1, self.n_cls): if (cls_id) in config.ycb_sym_cls_ids: self.cls_add_s_dis[cls_id] = self.cls_adds_dis[cls_id] else: self.cls_add_s_dis[cls_id] = self.cls_add_dis[cls_id] self.cls_add_s_dis[0] += self.cls_add_s_dis[cls_id] for i in range(self.n_cls): add_auc = bs_utils.cal_auc(self.cls_add_dis[i]) adds_auc = bs_utils.cal_auc(self.cls_adds_dis[i]) add_s_auc = bs_utils.cal_auc(self.cls_add_s_dis[i]) add_auc_lst.append(add_auc) adds_auc_lst.append(adds_auc) add_s_auc_lst.append(add_s_auc) if i == 0: continue print(cls_lst[i-1]) print("***************add:\t", add_auc) print("***************adds:\t", adds_auc) print("***************add(-s):\t", add_s_auc) print("Average of all object:") print("***************add:\t", np.mean(add_auc_lst[1:])) print("***************adds:\t", np.mean(adds_auc_lst[1:])) print("***************add(-s):\t", np.mean(add_s_auc_lst[1:])) print("All object (following PoseCNN):") print("***************add:\t", add_auc_lst[0]) print("***************adds:\t", adds_auc_lst[0]) print("***************add(-s):\t", add_s_auc_lst[0]) sv_info = dict( add_dis_lst = self.cls_add_dis, adds_dis_lst = self.cls_adds_dis, add_auc_lst = add_auc_lst, adds_auc_lst = adds_auc_lst, add_s_auc_lst = add_s_auc_lst, ) sv_pth = os.path.join( config.log_eval_dir, 'pvn3d_eval_cuda_{}_{}_{}.pkl'.format( adds_auc_lst[0], add_auc_lst[0], add_s_auc_lst[0] ) ) pkl.dump(sv_info, open(sv_pth, 'wb')) def cal_lm_add(self, obj_id, test_occ=False): add_auc_lst = [] adds_auc_lst = [] add_s_auc_lst = [] cls_id = obj_id if (obj_id) in config_lm.lm_sym_cls_ids: self.cls_add_s_dis[cls_id] = self.cls_adds_dis[cls_id] else: self.cls_add_s_dis[cls_id] = self.cls_add_dis[cls_id] self.cls_add_s_dis[0] += self.cls_add_s_dis[cls_id] add_auc = bs_utils_lm.cal_auc(self.cls_add_dis[cls_id]) adds_auc = bs_utils_lm.cal_auc(self.cls_adds_dis[cls_id]) add_s_auc = bs_utils_lm.cal_auc(self.cls_add_s_dis[cls_id]) add_auc_lst.append(add_auc) adds_auc_lst.append(adds_auc) add_s_auc_lst.append(add_s_auc) d = config_lm.lm_r_lst[obj_id]['diameter'] / 1000.0 * 0.1 print("obj_id: ", obj_id, "0.1 diameter: ", d) add = np.mean(np.array(self.cls_add_dis[cls_id]) < d) * 100 adds = np.mean(np.array(self.cls_adds_dis[cls_id]) < d) * 100 cls_type = config_lm.lm_id2obj_dict[obj_id] print(obj_id, cls_type) print("***************add auc:\t", add_auc) print("***************adds auc:\t", adds_auc) print("***************add(-s) auc:\t", add_s_auc) print("***************add < 0.1 diameter:\t", add) print("***************adds < 0.1 diameter:\t", adds) sv_info = dict( add_dis_lst = self.cls_add_dis, adds_dis_lst = self.cls_adds_dis, add_auc_lst = add_auc_lst, adds_auc_lst = adds_auc_lst, add_s_auc_lst = add_s_auc_lst, add = add, adds = adds, ) occ = "occlusion" if test_occ else "" sv_pth = os.path.join( config_lm.log_eval_dir, 'pvn3d_eval_cuda_{}_{}_{}_{}.pkl'.format( cls_type, occ, add, adds ) ) pkl.dump(sv_info, open(sv_pth, 'wb')) def eval_pose_parallel( self, pclds, rgbs, masks, pred_ctr_ofs, gt_ctr_ofs, labels, cnt, cls_ids, RTs, pred_kp_ofs, min_cnt=20, merge_clus=False, bbox=False, ds='YCB', cls_type=None, use_p2d = False, vote_type=VotingType.Farthest, use_ctr_clus_flter=True, use_ctr=True, ds_type="ycb", obj_id=0 ): bs, n_kps, n_pts, c = pred_kp_ofs.size() masks = masks.long() cls_ids = cls_ids.long() use_ctr_lst = [use_ctr for i in range(bs)] n_cls_lst = [self.n_cls for i in range(bs)] min_cnt_lst = [min_cnt for i in range(bs)] epoch_lst = [cnt*bs for i in range(bs)] bs_lst = [i for i in range(bs)] use_ctr_clus_flter_lst = [use_ctr_clus_flter for i in range(bs)] obj_id_lst = [obj_id for i in range(bs)] if ds_type == "ycb": data_gen = zip( pclds, masks, pred_ctr_ofs, pred_kp_ofs, RTs, cls_ids, use_ctr_lst, n_cls_lst, min_cnt_lst, use_ctr_clus_flter_lst, labels, epoch_lst, bs_lst ) else: data_gen = zip( pclds, masks, pred_ctr_ofs, pred_kp_ofs, RTs, cls_ids, use_ctr_lst, n_cls_lst, min_cnt_lst, use_ctr_clus_flter_lst, labels, epoch_lst, bs_lst, obj_id_lst ) with concurrent.futures.ThreadPoolExecutor( max_workers= bs ) as executor: if ds_type == "ycb": eval_func = eval_one_frame_pose else: eval_func = eval_one_frame_pose_lm for res in executor.map(eval_func, data_gen): cls_add_dis_lst, cls_adds_dis_lst = res self.cls_add_dis = self.merge_lst( self.cls_add_dis, cls_add_dis_lst ) self.cls_adds_dis = self.merge_lst( self.cls_adds_dis, cls_adds_dis_lst ) def merge_lst(self, targ, src): for i in range(len(targ)): targ[i] += src[i] return targ # vim: ts=4 sw=4 sts=4 expandtab
14,258
120
319
4f484fda998fc2aa847e19bbc6cf5feda8c464ba
49
py
Python
enthought/util/tree.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
3
2016-12-09T06:05:18.000Z
2018-03-01T13:00:29.000Z
enthought/util/tree.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
1
2020-12-02T00:51:32.000Z
2020-12-02T08:48:55.000Z
enthought/util/tree.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
null
null
null
# proxy module from codetools.util.tree import *
16.333333
33
0.77551
# proxy module from codetools.util.tree import *
0
0
0
9f3c7a09553fabff8cb8a75a68011d2f21504bde
2,432
py
Python
modules/polling_client.py
qbalsdon/horai
4188dc1ec2a0bf69475fa6216ec773e6f3a26c5b
[ "MIT" ]
null
null
null
modules/polling_client.py
qbalsdon/horai
4188dc1ec2a0bf69475fa6216ec773e6f3a26c5b
[ "MIT" ]
null
null
null
modules/polling_client.py
qbalsdon/horai
4188dc1ec2a0bf69475fa6216ec773e6f3a26c5b
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 import queue import threading import time from modules import device_tray as DC class PollingClient: """ Launch the main part of the GUI and the worker thread. periodicCall and endApplication could reside in the GUI part, but putting them here means that you have all the thread controls in a single place. """ def __init__(self, root_view, load_settings, save_settings): """ Start the GUI and the asynchronous threads. We are in the main (original) thread of the application, which will later be used by the GUI as well. We spawn a new thread for the worker (I/O). """ self.root_view = root_view self.load_settings = load_settings self.save_settings = save_settings # Create the queue self.queue = queue.Queue() # Set up the GUI part self.gui = DC.DeviceTray(self.root_view, self.queue, self.load_settings, self.save_settings, self.endApplication) # Set up the thread to do asynchronous I/O # More threads can also be created and used, if necessary self.running = 1 self.poll_thread = threading.Thread(target=self.workerThread) self.poll_thread.start() # Start the periodic call in the GUI to check if the queue contains # anything self.periodicCall() def periodicCall(self): """ Check every 200 ms if there is something new in the queue. """ self.gui.processIncoming() if not self.running: # This is the brutal stop of the system. You may want to do # some cleanup before actually shutting it down. import sys sys.exit(1) self.root_view.after(200, self.periodicCall) def workerThread(self): """ This is where we handle the asynchronous I/O. For example, it may be a 'select()'. One important thing to remember is that the thread has to yield control pretty regularly, by select or otherwise. """ while self.running: # To simulate asynchronous I/O, we create a random number at # random intervals. Replace the following two lines with the real # thing. time.sleep(0.25) message = 0 self.queue.put(message)
35.246377
121
0.634457
#!/usr/bin/env python3 import queue import threading import time from modules import device_tray as DC class PollingClient: """ Launch the main part of the GUI and the worker thread. periodicCall and endApplication could reside in the GUI part, but putting them here means that you have all the thread controls in a single place. """ def __init__(self, root_view, load_settings, save_settings): """ Start the GUI and the asynchronous threads. We are in the main (original) thread of the application, which will later be used by the GUI as well. We spawn a new thread for the worker (I/O). """ self.root_view = root_view self.load_settings = load_settings self.save_settings = save_settings # Create the queue self.queue = queue.Queue() # Set up the GUI part self.gui = DC.DeviceTray(self.root_view, self.queue, self.load_settings, self.save_settings, self.endApplication) # Set up the thread to do asynchronous I/O # More threads can also be created and used, if necessary self.running = 1 self.poll_thread = threading.Thread(target=self.workerThread) self.poll_thread.start() # Start the periodic call in the GUI to check if the queue contains # anything self.periodicCall() def periodicCall(self): """ Check every 200 ms if there is something new in the queue. """ self.gui.processIncoming() if not self.running: # This is the brutal stop of the system. You may want to do # some cleanup before actually shutting it down. import sys sys.exit(1) self.root_view.after(200, self.periodicCall) def workerThread(self): """ This is where we handle the asynchronous I/O. For example, it may be a 'select()'. One important thing to remember is that the thread has to yield control pretty regularly, by select or otherwise. """ while self.running: # To simulate asynchronous I/O, we create a random number at # random intervals. Replace the following two lines with the real # thing. time.sleep(0.25) message = 0 self.queue.put(message) def endApplication(self): self.running = 0 self.root_view.quit()
59
0
27
90dc25c8a18dd125b4ddeb26e11e4d4e4cf0fdd1
1,238
py
Python
scripts/addons/animation_nodes/sockets/mesh.py
Tilapiatsu/blender-custom_conf
05592fedf74e4b7075a6228b8448a5cda10f7753
[ "MIT" ]
2
2020-04-16T22:12:40.000Z
2022-01-22T17:18:45.000Z
scripts/addons/animation_nodes/sockets/mesh.py
Tilapiatsu/blender-custom_conf
05592fedf74e4b7075a6228b8448a5cda10f7753
[ "MIT" ]
null
null
null
scripts/addons/animation_nodes/sockets/mesh.py
Tilapiatsu/blender-custom_conf
05592fedf74e4b7075a6228b8448a5cda10f7753
[ "MIT" ]
2
2019-05-16T04:01:09.000Z
2020-08-25T11:42:26.000Z
import bpy from .. data_structures import Mesh from .. base_types import AnimationNodeSocket, PythonListSocket
26.340426
67
0.650242
import bpy from .. data_structures import Mesh from .. base_types import AnimationNodeSocket, PythonListSocket class MeshSocket(bpy.types.NodeSocket, AnimationNodeSocket): bl_idname = "an_MeshSocket" bl_label = "Mesh Socket" dataType = "Mesh" drawColor = (0.2, 0.7, 1, 1) storable = True comparable = False @classmethod def getDefaultValue(cls): return Mesh() @classmethod def getCopyExpression(cls): return "value.copy()" @classmethod def correctValue(cls, value): if isinstance(value, Mesh): return value, 0 return cls.getDefaultValue(), 2 class MeshListSocket(bpy.types.NodeSocket, PythonListSocket): bl_idname = "an_MeshListSocket" bl_label = "Mesh List Socket" dataType = "Mesh List" baseType = MeshSocket drawColor = (0.18, 0.32, 1, 0.5) storable = True comparable = False @classmethod def getCopyExpression(cls): return "[element.copy() for element in value]" @classmethod def correctValue(cls, value): if isinstance(value, list): if all(isinstance(element, Mesh) for element in value): return value, 0 return cls.getDefaultValue(), 2
419
661
46
1ded913682c8d8c0349a8dc8dde23f91d30eca9e
1,601
py
Python
photon/common/logging_common.py
nytimes/photon-common-demo
0fe382477a70010e2e9929f413afd1b6784a5e98
[ "Apache-2.0" ]
null
null
null
photon/common/logging_common.py
nytimes/photon-common-demo
0fe382477a70010e2e9929f413afd1b6784a5e98
[ "Apache-2.0" ]
null
null
null
photon/common/logging_common.py
nytimes/photon-common-demo
0fe382477a70010e2e9929f413afd1b6784a5e98
[ "Apache-2.0" ]
null
null
null
import pathlib import logging from logging import Logger from logging.handlers import RotatingFileHandler from photon.common.config_context_common import ConfigContextCommon class LoggingCommon: """ Helper class for logging. """ def __init__(self, config: ConfigContextCommon) -> None: """ Args: config: A config object. """ self._root_logger = logging.getLogger() self._root_logger.setLevel(config.LOG_LEVEL) self._formatter = logging.Formatter(fmt=config.LOG_FORMAT, style="{") self._logname = config.PACKAGE_NAME self._logdirp = ( pathlib.Path("/usr/local/var") / config.PACKAGE_FAMILY / config.PACKAGE_NAME ) self._file_handler() self._console_handler() def get_root_logger(self) -> Logger: """ Return the root logger. Returns: The root logger. """ return self._root_logger
28.589286
88
0.64772
import pathlib import logging from logging import Logger from logging.handlers import RotatingFileHandler from photon.common.config_context_common import ConfigContextCommon class LoggingCommon: """ Helper class for logging. """ def __init__(self, config: ConfigContextCommon) -> None: """ Args: config: A config object. """ self._root_logger = logging.getLogger() self._root_logger.setLevel(config.LOG_LEVEL) self._formatter = logging.Formatter(fmt=config.LOG_FORMAT, style="{") self._logname = config.PACKAGE_NAME self._logdirp = ( pathlib.Path("/usr/local/var") / config.PACKAGE_FAMILY / config.PACKAGE_NAME ) self._file_handler() self._console_handler() def _file_handler(self) -> None: self._logdirp.mkdir(parents=True, exist_ok=True) # mkdir for mac logp = self._logdirp / f"{self._logname}.log" file_handler = RotatingFileHandler( str(logp), maxBytes=128 * 1024 * 1024, backupCount=3 ) file_handler.setFormatter(self._formatter) self._root_logger.addHandler(file_handler) # log to /usr/local/var def _console_handler(self) -> None: console_handler = logging.StreamHandler() console_handler.setFormatter(self._formatter) self._root_logger.addHandler(console_handler) # log to stdout def get_root_logger(self) -> Logger: """ Return the root logger. Returns: The root logger. """ return self._root_logger
576
0
54
a8cdd4a51587b1b2bec2e1fa6eb7a361fe019d8d
2,670
py
Python
Hand_gesture_final.py
sourav9064/python-hand-recognition
24a193ba3342afe6b56c44bd85d8ff41f897ad72
[ "MIT" ]
null
null
null
Hand_gesture_final.py
sourav9064/python-hand-recognition
24a193ba3342afe6b56c44bd85d8ff41f897ad72
[ "MIT" ]
null
null
null
Hand_gesture_final.py
sourav9064/python-hand-recognition
24a193ba3342afe6b56c44bd85d8ff41f897ad72
[ "MIT" ]
null
null
null
# IMPORTING LIBRARIES import numpy as np import cv2 import math #LOADING HAND CASCADE hand_cascade = cv2.CascadeClassifier('Hand_haar_cascade.xml') # VIDEO CAPTURE cap = cv2.VideoCapture(0) while True: ret, img = cap.read() blur = cv2.GaussianBlur(img,(5,5),0) # BLURRING IMAGE TO SMOOTHEN EDGES gray = cv2.cvtColor(blur, cv2.COLOR_BGR2GRAY) # BGR -> GRAY CONVERSION retval2,thresh1 = cv2.threshold(gray,70,255,cv2.THRESH_BINARY_INV+cv2.THRESH_OTSU) # THRESHOLDING IMAGE hand = hand_cascade.detectMultiScale(thresh1, 1.3, 5) # DETECTING HAND IN THE THRESHOLDE IMAGE mask = np.zeros(thresh1.shape, dtype = "uint8") # CREATING MASK for (x,y,w,h) in hand: # MARKING THE DETECTED ROI cv2.rectangle(img,(x,y),(x+w,y+h), (122,122,0), 2) cv2.rectangle(mask, (x,y),(x+w,y+h),255,-1) img2 = cv2.bitwise_and(thresh1, mask) final = cv2.GaussianBlur(img2,(7,7),0) contours, hierarchy = cv2.findContours(final, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) cv2.drawContours(img, contours, 0, (255,255,0), 3) cv2.drawContours(final, contours, 0, (255,255,0), 3) if len(contours) > 0: cnt=contours[0] hull = cv2.convexHull(cnt, returnPoints=False) # finding convexity defects defects = cv2.convexityDefects(cnt, hull) count_defects = 0 # applying Cosine Rule to find angle for all defects (between fingers) # with angle > 90 degrees and ignore defect if defects!= None: for i in range(defects.shape[0]): p,q,r,s = defects[i,0] finger1 = tuple(cnt[p][0]) finger2 = tuple(cnt[q][0]) dip = tuple(cnt[r][0]) # find length of all sides of triangle a = math.sqrt((finger2[0] - finger1[0])**2 + (finger2[1] - finger1[1])**2) b = math.sqrt((dip[0] - finger1[0])**2 + (dip[1] - finger1[1])**2) c = math.sqrt((finger2[0] - dip[0])**2 + (finger2[1] - dip[1])**2) # apply cosine rule here angle = math.acos((b**2 + c**2 - a**2)/(2*b*c)) * 57.29 # ignore angles > 90 and highlight rest with red dots if angle <= 90: count_defects += 1 #cv2.putText(img,"THIS IS 1", (50, 50), cv2.FONT_HERSHEY_SIMPLEX, 2, 2) # define actions required if count_defects == 1: cv2.putText(img,"THIS IS 2", (50, 50), cv2.FONT_HERSHEY_SIMPLEX, 2, 2) elif count_defects == 2: cv2.putText(img, "THIS IS 3", (50, 50), cv2.FONT_HERSHEY_SIMPLEX, 2, 2) elif count_defects == 3: cv2.putText(img,"This is 4", (50, 50), cv2.FONT_HERSHEY_SIMPLEX, 2, 2) elif count_defects == 4: cv2.putText(img,"THIS IS 5", (50, 50), cv2.FONT_HERSHEY_SIMPLEX, 2, 2) cv2.imshow('img',thresh1) cv2.imshow('img1',img) cv2.imshow('img2',img2) k = cv2.waitKey(30) & 0xff if k == 27: break cap.release() cv2.destroyAllWindows()
37.605634
104
0.670787
# IMPORTING LIBRARIES import numpy as np import cv2 import math #LOADING HAND CASCADE hand_cascade = cv2.CascadeClassifier('Hand_haar_cascade.xml') # VIDEO CAPTURE cap = cv2.VideoCapture(0) while True: ret, img = cap.read() blur = cv2.GaussianBlur(img,(5,5),0) # BLURRING IMAGE TO SMOOTHEN EDGES gray = cv2.cvtColor(blur, cv2.COLOR_BGR2GRAY) # BGR -> GRAY CONVERSION retval2,thresh1 = cv2.threshold(gray,70,255,cv2.THRESH_BINARY_INV+cv2.THRESH_OTSU) # THRESHOLDING IMAGE hand = hand_cascade.detectMultiScale(thresh1, 1.3, 5) # DETECTING HAND IN THE THRESHOLDE IMAGE mask = np.zeros(thresh1.shape, dtype = "uint8") # CREATING MASK for (x,y,w,h) in hand: # MARKING THE DETECTED ROI cv2.rectangle(img,(x,y),(x+w,y+h), (122,122,0), 2) cv2.rectangle(mask, (x,y),(x+w,y+h),255,-1) img2 = cv2.bitwise_and(thresh1, mask) final = cv2.GaussianBlur(img2,(7,7),0) contours, hierarchy = cv2.findContours(final, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) cv2.drawContours(img, contours, 0, (255,255,0), 3) cv2.drawContours(final, contours, 0, (255,255,0), 3) if len(contours) > 0: cnt=contours[0] hull = cv2.convexHull(cnt, returnPoints=False) # finding convexity defects defects = cv2.convexityDefects(cnt, hull) count_defects = 0 # applying Cosine Rule to find angle for all defects (between fingers) # with angle > 90 degrees and ignore defect if defects!= None: for i in range(defects.shape[0]): p,q,r,s = defects[i,0] finger1 = tuple(cnt[p][0]) finger2 = tuple(cnt[q][0]) dip = tuple(cnt[r][0]) # find length of all sides of triangle a = math.sqrt((finger2[0] - finger1[0])**2 + (finger2[1] - finger1[1])**2) b = math.sqrt((dip[0] - finger1[0])**2 + (dip[1] - finger1[1])**2) c = math.sqrt((finger2[0] - dip[0])**2 + (finger2[1] - dip[1])**2) # apply cosine rule here angle = math.acos((b**2 + c**2 - a**2)/(2*b*c)) * 57.29 # ignore angles > 90 and highlight rest with red dots if angle <= 90: count_defects += 1 #cv2.putText(img,"THIS IS 1", (50, 50), cv2.FONT_HERSHEY_SIMPLEX, 2, 2) # define actions required if count_defects == 1: cv2.putText(img,"THIS IS 2", (50, 50), cv2.FONT_HERSHEY_SIMPLEX, 2, 2) elif count_defects == 2: cv2.putText(img, "THIS IS 3", (50, 50), cv2.FONT_HERSHEY_SIMPLEX, 2, 2) elif count_defects == 3: cv2.putText(img,"This is 4", (50, 50), cv2.FONT_HERSHEY_SIMPLEX, 2, 2) elif count_defects == 4: cv2.putText(img,"THIS IS 5", (50, 50), cv2.FONT_HERSHEY_SIMPLEX, 2, 2) cv2.imshow('img',thresh1) cv2.imshow('img1',img) cv2.imshow('img2',img2) k = cv2.waitKey(30) & 0xff if k == 27: break cap.release() cv2.destroyAllWindows()
0
0
0
f75caa520876078c57de5bdf0097e2c7210892ce
37,224
py
Python
zmk/nyokaserver/nyokaUtilities.py
center3d/MLW
192cc991df61bd8991a51702a53df6a09448d4f7
[ "Apache-2.0" ]
1
2020-02-29T12:18:39.000Z
2020-02-29T12:18:39.000Z
zmk/nyokaserver/nyokaUtilities.py
MfalhiTechnology/MLW
192cc991df61bd8991a51702a53df6a09448d4f7
[ "Apache-2.0" ]
null
null
null
zmk/nyokaserver/nyokaUtilities.py
MfalhiTechnology/MLW
192cc991df61bd8991a51702a53df6a09448d4f7
[ "Apache-2.0" ]
1
2020-02-29T12:18:28.000Z
2020-02-29T12:18:28.000Z
# nyokaUtilities.py import numpy as np from random import choice from string import ascii_uppercase import copy,json import ast,pathlib import traceback from nyoka import PMML43Ext as ny global MEMORY_DICT_ARCHITECTURE,MEMORY_OF_LAYERS settingFilePath='./settingFiles/' savedModels='./SavedModels/' MEMORY_OF_LAYERS={} from trainModel.mergeTrainingV2 import PMMLMODELSTORAGE layerDetail=open(settingFilePath+'listOflayers.json','r') MEMORY_OF_LAYERS=json.loads(layerDetail.read()) #########################################All functions is to write PMML############################### ###################Below script is to get detaisl from a PMML file######################## #####################Add Update layer Utility Functions
46.763819
247
0.570653
# nyokaUtilities.py import numpy as np from random import choice from string import ascii_uppercase import copy,json import ast,pathlib import traceback from nyoka import PMML43Ext as ny global MEMORY_DICT_ARCHITECTURE,MEMORY_OF_LAYERS settingFilePath='./settingFiles/' savedModels='./SavedModels/' MEMORY_OF_LAYERS={} from trainModel.mergeTrainingV2 import PMMLMODELSTORAGE layerDetail=open(settingFilePath+'listOflayers.json','r') MEMORY_OF_LAYERS=json.loads(layerDetail.read()) #########################################All functions is to write PMML############################### class NyokaUtilities: def convertToStandardJson(self,pp): tempData={} tempData['connectionLayerId']=pp['connectionLayerId'] tempData['itemType']=pp['itemType'] tempData['layerType']=pp['layerType'] tempData['connectionLayerId']=pp['connectionLayerId'] tempData['layerId']=pp['layerId'] tempData['name']=pp['name'] tempData['properties']={} for j in pp['properties']: tempData['properties'][j['id']]=j['value'] return tempData def calculateOutputSize(self,N,S,F,P=None): if P==None: P=0 val=((N-F+(2*P))/S)+1 return int(val) def calculatePadding(self,N,O,S,F): val=abs((N-(O*S)-F+S)/2) return int(val) def outputForDepthWiseConv2D(self,tempData): try: tempData=self.convertToStandardJson(tempData) wid,heig,channel=tempData['properties']['inputDimension'] widFil,heigFil=tempData['properties']['kernel'] widStri,heigStri=tempData['properties']['stride'] if tempData['properties']['paddingType']=='valid': padding=0 widthOutput=self.calculateOutputSize(wid,widStri,widFil,padding) heightOutput=self.calculateOutputSize(heig,heigStri,heigFil,padding) elif tempData['properties']['paddingType']=='same': padding=self.calculatePadding(wid,wid,widStri,widFil) widthOutput=self.calculateOutputSize(wid,widStri,widFil,padding) heightOutput=self.calculateOutputSize(heig,heigStri,heigFil,padding) out_filter=channel*tempData['properties']['depthMultiplier'] return((widthOutput,heightOutput,out_filter),'success','success') except Exception as e: errorMessage='Error while calculating output >> '+ str(e) errorTraceback=str(traceback.format_exc()) wid,heig,out_filter=(0,0,0) return((wid,heig,out_filter),errorMessage,errorTraceback) def outputForConv2D(self,tempData2): try: tempData2=self.convertToStandardJson(tempData2) wid,heig,channel=tempData2['properties']['inputDimension'] widFil,heigFil=tempData2['properties']['kernel'] widStri,heigStri=tempData2['properties']['stride'] try: featureMaps=tempData2['properties']['featureMaps'] except: featureMaps=None if tempData2['properties']['paddingType']=='valid': padding=0 widthOutput=self.calculateOutputSize(wid,widStri,widFil,padding) heightOutput=self.calculateOutputSize(heig,heigStri,heigFil,padding) elif tempData2['properties']['paddingType']=='same': padding=self.calculatePadding(wid,heig,widStri,widFil) widthOutput=self.calculateOutputSize(wid,widStri,widFil,padding) heightOutput=self.calculateOutputSize(heig,heigStri,heigFil,padding) if featureMaps==None: return ((widthOutput,heightOutput,channel), 'success','success') else: return ((widthOutput,heightOutput,featureMaps), 'success','success') except Exception as e: # print('No input came') errorMessage='Error while calculating output >> '+ str(e) errorTraceback=str(traceback.format_exc()) widthOutput,heightOutput,featureMaps=0,0,0 return ((widthOutput,heightOutput,featureMaps), errorMessage,errorTraceback) def outputForMaxPooling1D(self,tempData): try: tempData=self.convertToStandardJson(tempData) N = tempData['properties']['inputDimension'][-2] S = tempData['properties']['stride'] F = tempData['properties']['poolSize'] return ((self.calculateOutputSize(N, S, F), tempData['properties']['inputDimension'][-1]), 'success','success') except Exception as e: # print('No input came') errorMessage='Error while calculating output >> '+ str(e) errorTraceback=str(traceback.format_exc()) return ((0,0), errorMessage,errorTraceback) def outputForMaxPooling2D(self,tempData): # print('>>>>>> outputForMaxpooling1D', tempData) try: tempData=self.convertToStandardJson(tempData) N1, N2 = tempData['properties']['inputDimension'][:-1] if len(tempData['properties']['stride']) == 1: S1 = tempData['properties']['stride'][0] else: S1, S2 = tempData['properties']['stride'] if len(tempData['properties']['poolSize']) == 1: F1 = tempData['properties']['poolSize'][0] else: F1, F2 = tempData['properties']['poolSize'] return ((self.calculateOutputSize(N1, S1, F1), self.calculateOutputSize(N2, S1, F1), \ tempData['properties']['inputDimension'][-1]), 'success','success') except Exception as e: # print('No input came') errorMessage='Error while calculating output >> '+ str(e) errorTraceback=str(traceback.format_exc()) return ((0,0,0),errorMessage,errorTraceback) def outputForInput(self,inputDimension): # print ('$$$$$$$$$$$$$outputForInput >>>>>> ',inputDimension) inputDimension=self.convertToStandardJson(inputDimension) if len(inputDimension['properties']['inputDimension'])==1: return ((inputDimension['properties']['inputDimension'][0],1),'success','success') else: return ((inputDimension['properties']['inputDimension']),'success','success') def outputForFlatten(self,tempData4): try: tempData4=self.convertToStandardJson(tempData4) tomul=tempData4['properties']['inputDimension'] val=int(np.prod(tomul)) return ((val,1), 'success','success') except Exception as e: # print('No input came') errorMessage='Error while calculating output >> '+ str(e) errorTraceback=str(traceback.format_exc()) return ((0,0), errorMessage,errorTraceback) def outputFor1DPadding(self,tempData): try: tempData=self.convertToStandardJson(tempData) width,height=tempData['properties']['inputDimension'] if len(tempData['properties']['paddingDims']) == 1: left_pad = right_pad = tempData['properties']['paddingDims'][0] else: left_pad, right_pad=tempData['properties']['paddingDims'] width=width+left_pad+right_pad return ((width, height),'success','success') except Exception as e: # print('No input came') errorMessage='Error while calculating output >> '+ str(e) errorTraceback=str(traceback.format_exc()) return ((0,0), errorMessage,errorTraceback) def outputFor2DPadding(self,tempData6): try: tempData6=self.convertToStandardJson(tempData6) width,height,channel=tempData6['properties']['inputDimension'] if len(tempData6['properties']['paddingDims']) == 1: top_pad = bottom_pad = left_pad = right_pad = tempData6['properties']['paddingDims'][0] elif len(tempData6['properties']['paddingDims']) == 2: top_pad, left_pad=tempData6['properties']['paddingDims'] bottom_pad, right_pad = top_pad, left_pad else: top_pad, bottom_pad,left_pad, right_pad=tempData6['properties']['paddingDims'] width=width+left_pad+right_pad height=height+top_pad+bottom_pad return ((width,height,channel), 'success','success') except Exception as e: # print('No input came') errorMessage='Error while calculating output >> '+ str(e) errorTraceback=str(traceback.format_exc()) return ((0,0,0), errorMessage,errorTraceback) def outputForDense(self,tempdata7): try: tempdata7=self.convertToStandardJson(tempdata7) tomul=tempdata7['properties']['units'] if tomul.__class__.__name__ != 'int': raise Exception("Expected integer value for units, got string/empty value",tomul) return ((tomul,1),'success','success') except Exception as e : errorMessage='Error while calculating output >> '+ str(e) errorTraceback=str(traceback.format_exc()) # print('No input came>>', errorMessage) tomul=0 return ((tomul,1),errorMessage,errorTraceback) def outputForGlobalAverage2D(self,tempdata7): try: tempdata7=self.convertToStandardJson(tempdata7) tomul=tempdata7['properties']['inputDimension'][2] return ((1,1,tomul), 'success','success') except Exception as e : errorMessage='Error while calculating output >> '+ str(e) errorTraceback=str(traceback.format_exc()) # print('No input came') tomul=0 return ((0,0,0),errorMessage,errorTraceback) def outputForReshape(self,tempdata7): try: # print('>>>>>>>>Reshape', tempdata7) tempdata7=self.convertToStandardJson(tempdata7) return (tempdata7['properties']['reshapeTarget'],'success','success') except Exception as e : errorMessage='Error while calculating output >> '+ str(e) errorTraceback=str(traceback.format_exc()) # print('No input came') return ((0,0,0),errorMessage,errorTraceback) def selectArchitecture(self,checkTemplateID): if checkTemplateID=='mobilenetArch': pmmlObj = ny.parse(open(settingFilePath+'MobilenetArch.pmml','r'), silence=True) templateArch=self.pmmlToJson(settingFilePath+'MobilenetArch.pmml') elif checkTemplateID=='vgg16Arch': pmmlObj = ny.parse(open(settingFilePath+'vGG16Arch.pmml','r'), silence=True) templateArch=self.pmmlToJson(settingFilePath+'vGG16Arch.pmml') elif checkTemplateID=='vgg19Arch': pmmlObj = ny.parse(open(settingFilePath+'vGG19Arch.pmml','r'), silence=True) templateArch=self.pmmlToJson(settingFilePath+'vGG19Arch.pmml') return templateArch,pmmlObj def addLayertoJson(self,tempData): if tempData['layerType'] in ['Input']: valRet,messageInfo,traceBack=self.outputForInput(tempData) [j for j in tempData['properties'] if j['id']=='outputDimension' ][0]['value']=valRet [j for j in tempData['properties'] if j['id']=='inputDimension' ][0]['value']=valRet elif tempData['layerType'] in ['Reshape']: valRet,messageInfo,traceBack=self.outputForReshape(tempData) [j for j in tempData['properties'] if j['id']=='outputDimension' ][0]['value']=valRet elif tempData['layerType'] in ['Activation','Dropout']: # print ('$$$$$$$$$$$$$ Activation',tempData) valRet,messageInfo,traceBack=self.outputForInput(tempData) [j for j in tempData['properties'] if j['id']=='outputDimension' ][0]['value']=valRet elif tempData['layerType'] in ['BatchNormalization']: valRet,messageInfo,traceBack=self.outputForInput(tempData) [j for j in tempData['properties'] if j['id']=='outputDimension' ][0]['value']=valRet elif tempData['layerType'] in ['Conv2D']: valRet,messageInfo,traceBack=self.outputForConv2D(tempData) [j for j in tempData['properties'] if j['id']=='outputDimension' ][0]['value']=valRet elif tempData['layerType'] in ['DepthwiseConv2D']: valRet,messageInfo,traceBack=self.outputForDepthWiseConv2D(tempData) [j for j in tempData['properties'] if j['id']=='outputDimension' ][0]['value']=valRet elif tempData['layerType'] in ['Flatten']: valRet,messageInfo,traceBack=self.outputForFlatten(tempData) [j for j in tempData['properties'] if j['id']=='outputDimension' ][0]['value']=valRet elif tempData['layerType'] in ['ZeroPadding2D']: valRet,messageInfo,traceBack=self.outputFor2DPadding(tempData) [j for j in tempData['properties'] if j['id']=='outputDimension' ][0]['value']=valRet elif tempData['layerType'] in ['ZeroPadding1D']: valRet,messageInfo,traceBack=self.outputFor1DPadding(tempData) [j for j in tempData['properties'] if j['id']=='outputDimension' ][0]['value']=valRet elif tempData['layerType'] in ['Dense']: valRet,messageInfo,traceBack=self.outputForDense(tempData) [j for j in tempData['properties'] if j['id']=='outputDimension' ][0]['value']=valRet elif tempData['layerType'] in ['GlobalAveragePooling2D']: valRet,messageInfo,traceBack=self.outputForGlobalAverage2D(tempData) [j for j in tempData['properties'] if j['id']=='outputDimension' ][0]['value']=valRet elif tempData['layerType'] in ['MaxPooling2D', 'AveragePooling2D']: valRet,messageInfo,traceBack=self.outputForMaxPooling2D(tempData) [j for j in tempData['properties'] if j['id']=='outputDimension' ][0]['value']=valRet elif tempData['layerType'] in ['MaxPooling1D','AveragePooling1D']: valRet,messageInfo,traceBack=self.outputForMaxPooling1D(tempData) [j for j in tempData['properties'] if j['id']=='outputDimension' ][0]['value']=valRet # print ('NyokaUtilities $$$$$$$$$$$$$tempData',tempData) if messageInfo != 'success': tempData['errorMessage']=messageInfo tempData['errorTraceback']=traceBack return tempData ###################Below script is to get detaisl from a PMML file######################## def getDataFields(self,tempObj): fieldNames=[] temp=tempObj['DataDictionary'] temp=temp.get_DataField() for j in temp: fieldNames.append(j.name) return {'Column Names': fieldNames} def getHeaderInfo(self,tempObj): temp=tempObj['Header'] tempDict={} tempDict['Time File Created']=temp.Timestamp.get_valueOf_() tempDict['Description']=temp.description return tempDict def getInfoNearestNeighborModel(self,tempObj): temp=tempObj['NearestNeighborModel'][0] tempDict={} tempDict['Model information']=[] tempDict['Model information'].append({'Algorithm Name':temp.algorithmName}) tempDict['Model information'].append({'Function Type':temp.functionName}) tempDict['Model information'].append({'Model Name':temp.modelName}) tempDict['Model information'].append({'Number Of Neighbours':temp.numberOfNeighbors}) return tempDict def getInfoOfDeepNetwork(self,tempObj): temp=tempObj['DeepNetwork'][0] tempDict={} tempDict['DeepNetwork information']=[] tempDict['DeepNetwork information'].append({'Function Type':temp.functionName}) tempDict['DeepNetwork information'].append({'Model Name':temp.modelName}) tempDict['DeepNetwork information'].append({'Number Of Layers':temp.numberOfLayers}) return tempDict def getInfoMiningModel(self,tempObj): temp=tempObj['MiningModel'][0] tempDict={} tempDict['Model information']=[] tempDict['Model information'].append({'Function Type':temp.functionName}) tempDict['Model information'].append({'Model Name':temp.modelName}) if temp.Segmentation.multipleModelMethod=='modelChain': tempDict['Model information'].append({'Number of trees':len(temp.Segmentation.Segment[0].MiningModel.Segmentation.Segment)}) else: tempDict['Model information'].append({'Number of trees':len(temp.Segmentation.Segment)}) tempDict['Model information'].append({'Model Method':temp.Segmentation.multipleModelMethod}) return tempDict def getInfoSupportVectorMachineModel(self,tempObj): temp=tempObj['SupportVectorMachineModel'][0] tempDict={} tempDict['Model information']=[] tempDict['Model information'].append({'Function Type':temp.functionName}) tempDict['Model information'].append({'Model Name':temp.modelName}) tempDict['Model information'].append({'Model Kernel description':temp.RadialBasisKernelType.description}) tempDict['Model information'].append({'Model Method':temp.classificationMethod}) return tempDict def getInfoTreeModel(self,tempObj): temp=tempObj['TreeModel'][0] tempDict={} tempDict['Model information']=[] tempDict['Model information'].append({'Function Type':temp.functionName}) tempDict['Model information'].append({'Model Name':temp.modelName}) return tempDict def getInfoLinearModel(self,tempObj): temp=tempObj['RegressionModel'][0] tempDict={} tempDict['Model information']=[] tempDict['Model information'].append({'Function Type':temp.functionName}) tempDict['Model information'].append({'Model Name':temp.modelName}) return tempDict def getInfoOfNaiveBayesModel(self,tempObj): temp=tempObj['NaiveBayesModel'][0] tempDict={} tempDict['Model information']=[] tempDict['Model information'].append({'Function Type':temp.functionName}) tempDict['Model information'].append({'Model Name':temp.modelName}) return tempDict def getInfoOfAnomalyDetectionModel(self,tempObj): temp=tempObj['AnomalyDetectionModel'][0] tempDict={} tempDict['Model information']=[] tempDict['Model information'].append({'Function Type':temp.functionName}) tempDict['Model information'].append({'Model Name':temp.modelName}) tempDict['Model information'].append({'Algorithm Type':temp.algorithmType}) return tempDict def changeStructure(self,mm): allInfo={} allInfo['information']=[] for j in mm: if j in ['Model information','DeepNetwork information']: if j =='Model information': allInfo['modelGeneratedFrom']='SKLearn' else: allInfo['modelGeneratedFrom']='DeepNetwork' for k in mm[j]: for l in k: tempDict={} tempDict['property']=l tempDict['value']=k[l] allInfo['information'].append(tempDict) else: tempDict={} tempDict['property']=j tempDict['value']=mm[j] allInfo['information'].append(tempDict) if 'type' in mm: if mm['type']=='multi': allInfo['modelGeneratedFrom']='Workflow' return allInfo def pmmlToJson(self,filePath): pmmlObj=ny.parse(filePath,silence=True) pmmlDictObj=pmmlObj.__dict__ # print ('0'*100,pmmlObj.get_type()) if pmmlObj.get_type()=='multi': print ('came to Workflow') # print('*'*100) # print(PMMLMODELSTORAGE) # print('*'*100) import pathlib from trainModel.mergeTrainingV2 import TrainingViewModels pmmlFileObj=pathlib.Path(filePath) pmmlFileForKey=pmmlFileObj.name.replace(pmmlFileObj.suffix,'') from trainModel.mergeTrainingV2 import NewModelOperations NewModelOperations().loadExecutionModel(filePath) modelInformation=PMMLMODELSTORAGE[pmmlFileForKey] # print ('PMMLMODELSTORAGE after >>>>>>>>>>> ',PMMLMODELSTORAGE) # print (modelInformation) toexp=TrainingViewModels().restructureModelInforForExportDict(modelInformation) # print ('toexp'*20) # print ('toexportDictN >>>>>>>> ',toexp) import copy,json tempSec={"name":"Section", "layerId":"Section", "children":[], "itemType":"FOLDING", "icon":"mdi mdi-group", "class":"wide", "modelType":"Workflow", "id":"id", "sectionId":"modName", "layerIndex":None,'connectionLayerId':None} tempData={"name":"Data","icon":"mdi mdi-database-plus","itemType":"DATA","layerId":None, "trainable":False,"modelType":"Workflow","id":None,"layerIndex":None,"connectionLayerId":None, "url":None,"filePath":None} tempCode={"name":"Code","icon":"mdi mdi-code-braces","itemType":"CODE","layerId":None, "trainable":False,"modelType":"Workflow","id":"K2PVI4HZ3NBGF","layerIndex":None,"connectionLayerId":None, "url":None,"filePath":None, "taskType":None,"scriptOutput":None,"scriptPurpose":None} tempModel={"name":"Model","icon":"mdi mdi-xml","itemType":"MODEL","layerId":None,"trainable":False, "modelType":"Workflow","id":None,"layerIndex":None,"connectionLayerId":None, "url":None,"filePath":None,"taskType":None} # toexp={'K2PSSUKYFRSMF': {'hyperparameters': None, # 'data': 'C:/Users/swsh/Desktop/ZMODGit/ZMOD/ZMOD/Data/newData2', # 'preProcessingScript': {'scripts': ['def addVal(x):\n return x\n'], 'scriptpurpose': ['trainAndscore'], 'scriptOutput': ['DATA'], 'scriptPath': ['C:/Users/swsh/Desktop/ZMODGit/ZMOD/ZMOD/Code/scriptToTest.py']}, # 'modelObj': None, # 'pipelineObj': None, # 'featuresUsed': ['cylinders', 'displacement', 'horsepower', 'weight', 'acceleration'], # 'targetName': 'mpg', # 'postProcessingScript': {'scripts': [], 'scriptpurpose': [], 'scriptOutput': [], 'scriptPath': []}, # 'taskType': 'trainAndscore', # 'modelPath': 'C:\\Users\\swsh\\Desktop\\ZMODGit\\ZMOD\\ZMOD\\Models\\autoML2.pmml'}} workflowArch=[] for modTemp in list(toexp.keys()): temSecCop=copy.deepcopy(tempSec)#.copy() temSecCop['sectionId']=modTemp temSecCop["layerId"]=modTemp if toexp[modTemp]['data'] != None: dataInfo=copy.deepcopy(tempData) import pathlib fileName=pathlib.Path(toexp[modTemp]['data']).name dataInfo['layerId']=fileName dataInfo['url']='/Data/'+fileName dataInfo['filePath']=toexp[modTemp]['data'] temSecCop['children'].append(dataInfo) for numSc,sC in enumerate(toexp[modTemp]['preProcessingScript']['scriptPath']): codeInfo=copy.deepcopy(tempCode) fileName=pathlib.Path(toexp[modTemp]['preProcessingScript']['scriptPath'][numSc]).name codeInfo['layerId']=fileName codeInfo['url']='/Code/'+fileName codeInfo['filePath']=toexp[modTemp]['preProcessingScript']['scriptPath'][numSc] codeInfo['taskType']='PREPROCESSING' codeInfo['scriptOutput']=toexp[modTemp]['preProcessingScript']['scriptOutput'][numSc] codeInfo['scriptPurpose']=toexp[modTemp]['preProcessingScript']['scriptpurpose'][numSc] temSecCop['children'].append(codeInfo) modtempC=copy.deepcopy(tempModel) fileName=pathlib.Path(toexp[modTemp]['modelPath']).name modtempC['layerId']=fileName modtempC['url']='/Model/'+fileName modtempC['filePath']=toexp[modTemp]['modelPath'] modtempC['taskType']=toexp[modTemp]['taskType'] temSecCop['children'].append(modtempC) for numSc,sC in enumerate(toexp[modTemp]['postProcessingScript']['scriptPath']): codeInfo=copy.deepcopy(tempCode) fileName=pathlib.Path(toexp[modTemp]['postProcessingScript']['scriptPath'][numSc]).name codeInfo['layerId']=fileName codeInfo['url']='/Code/'+fileName codeInfo['filePath']=toexp[modTemp]['postProcessingScript']['scriptPath'][numSc] codeInfo['taskType']='POSTPROCESSING' codeInfo['scriptOutput']=toexp[modTemp]['postProcessingScript']['scriptOutput'][numSc] codeInfo['scriptPurpose']=toexp[modTemp]['postProcessingScript']['scriptpurpose'][numSc] temSecCop['children'].append(codeInfo) workflowArch.append(temSecCop) from random import choice from string import ascii_uppercase for num,i in enumerate(workflowArch): if i['itemType']=='FOLDING': i['layerIndex']=num i['id']=''.join(choice(ascii_uppercase) for i in range(12)) for num2,j in enumerate(i['children']): j['layerIndex']=num2 j['id']=''.join(choice(ascii_uppercase) for i in range(12)) else: i['layerIndex']=num i['id']=''.join(choice(ascii_uppercase) for i in range(12)) # print ('l'*200) # print ('workflowArch',workflowArch) return workflowArch else: overAll=[] deepObject=pmmlDictObj['DeepNetwork'][0] listOfNetworkLayer=deepObject.NetworkLayer for lay in listOfNetworkLayer: networkDict=lay.__dict__ tempDict={} tempDict['layerParam']={} tempDict['netParam']={} for j in networkDict: if networkDict[j] is not None: if j not in [ 'original_tagname_','LayerWeights','LayerParameters','Extension','LayerBias']: tempDict['netParam'][j]=networkDict[j] layerDict=networkDict['LayerParameters'].__dict__ for kk in layerDict: if layerDict[kk] is not None: if kk not in [ 'original_tagname_','Extension']: try: evalVal=list(ast.literal_eval(layerDict[kk])) except: evalVal=layerDict[kk] tempDict['layerParam'][kk]=evalVal tempDict['layerParam']['trainable']=False if layerDict['trainable'] == False else True if len(networkDict['Extension']) > 0: ttt=networkDict['Extension'][0] sectionVal=ttt.get_value() import ast tempDict['sectionId']=ast.literal_eval(sectionVal)['sectionId'] else: tempDict['sectionId']=None overAll.append(tempDict) allLayers=MEMORY_OF_LAYERS['layerinfo'][0]['layers'] listOFLayersName=[j['name'] for j in MEMORY_OF_LAYERS['layerinfo'][0]['layers']] architecture=[] for tempLay in overAll: import copy tempSpace=copy.deepcopy(allLayers[listOFLayersName.index(tempLay['netParam']['layerType'])]) layerPARA=tempLay['layerParam'] netWorkPARA=tempLay['netParam'] for j in netWorkPARA: try: tempSpace[j]=netWorkPARA[j] except: pass for k in layerPARA: for k2 in tempSpace['properties']: if k2['id']==k: k2['value']=layerPARA[k] try: tempSpace['sectionId']=tempLay['sectionId'] except: pass tempSpace['trainable']=layerPARA['trainable'] architecture.append(tempSpace) forLoopSection=[j['sectionId'] for j in architecture] # print ('forLoopSection $$$$$$$$$$$$$$$',forLoopSection) tempSection={'children': [],'class': 'wide','icon': 'mdi mdi-group','id': '', 'itemType': 'FOLDING','layerId': 'Section','layerIndex': '','name': 'Section', 'sectionId': '',"sectionCollapse":True} import copy newarchitecture=[] tempSectionA=copy.deepcopy(tempSection) for num,secInfo in enumerate(forLoopSection): if secInfo is None: newarchitecture.append(architecture[num]) else: if (num+1 < len(forLoopSection)) and (forLoopSection[num]==forLoopSection[num+1]): tempSectionA['children'].append(architecture[num]) else: tempSectionA['children'].append(architecture[num]) tempSectionA['sectionId']=secInfo tempSectionA['layerId']='Section_'+str(num) tempSectionA['name']='Section_'+str(num) newarchitecture.append(tempSectionA) tempSectionA=copy.deepcopy(tempSection) hd=pmmlDictObj['Header'] scrptVal=pmmlDictObj['script'] DataVal=pmmlDictObj['Data'] import ast,pathlib try: try: dataUrl=DataVal[0].filePath except: dataUrl='Some issue' print ('$$$$$$$$$$$$$$$$$$$$$$',dataUrl) if dataUrl !='Some issue': fObj=pathlib.Path(dataUrl) dataCon={'icon': 'mdi mdi-database-plus','id': 'NNN', 'itemType': 'DATA','layerId':fObj.name ,'layerIndex': 0,'name': 'Data','url': dataUrl} newarchitecture.insert(0,dataCon) for counT,sc in enumerate(scrptVal): import pathlib scriptPurpose=sc.scriptPurpose modelVal=sc.for_ classVal=sc.class_ filePathUrl=sc.filePath fObjScrpt=pathlib.Path(filePathUrl) scriptCon= {"name": "Code","icon": "mdi mdi-code-braces","itemType": "CODE","modelFor":modelVal, "layerId": fObjScrpt.name,"scriptPurpose":scriptPurpose,'url':filePathUrl,"layerIndex": "NA",'useFor':classVal} newarchitecture.insert(counT+1,scriptCon) else: pass except Exception as e: for counT,sc in enumerate(scrptVal): scriptUrl=sc.class_ import pathlib fObjScrpt=pathlib.Path(scriptUrl) scriptCon= {"name": "Code","icon": "mdi mdi-code-braces","itemType": "CODE", "layerId": fObjScrpt.name,'url':scriptUrl,"layerIndex": "NA"} newarchitecture.insert(counT,scriptCon) print (e,'some error occured') for num,i in enumerate(newarchitecture): if i['itemType']=='FOLDING': i['layerIndex']=num i['id']=''.join(choice(ascii_uppercase) for i in range(12)) for num2,j in enumerate(i['children']): j['layerIndex']=num2 j['id']=''.join(choice(ascii_uppercase) for i in range(12)) else: i['layerIndex']=num from random import choice from string import ascii_uppercase i['id']=''.join(choice(ascii_uppercase) for i in range(12)) return newarchitecture #####################Add Update layer Utility Functions def checkItemType(self,inputDict): return inputDict['itemType'] def checkChildren(self,inputDict): try: kk= inputDict['children'] return True except: return False def getIndexOfInput(self,inputDict): return inputDict['layerIndex'] def getIdOfInput(self,inputDict): return inputDict['id'] def getIdOfSection(self,inputDict): try: return inputDict['sectionId'] except: return None def addindex(self,inputDict): inputDict['layerIndex']=inputDict['layerIndex']+1 return inputDict def getTemplateId(processTheInput): try: return processTheInput['templateId'] except: return None def detailsofExistingArch(self,existingArch): listOFIndices=[i['layerIndex'] for i in existingArch] listOFIDS=[] listOfIdOFSections=[] listOfIdOFLayers=[] for j in existingArch: listOfIdOFLayers.append(j['id']) if j['itemType']=='FOLDING': for k in j['children']: # print ('###################Came') listOFIDS.append(k['id']) listOfIdOFSections.append(k['id']) else: listOFIDS.append(j['id']) return (listOFIDS,listOFIndices,listOfIdOFSections,listOfIdOFLayers) def getLayerType(self,processTheInput): # print ('processTheInput',processTheInput) try: if processTheInput['itemType'] =='FOLDING': return 'SECTION' elif processTheInput['itemType']=='TEMPLATE': return 'TEMPLATE' elif processTheInput['itemType'] == 'LAYER': try: kk=processTheInput['sectionId'] if kk != None: return 'SECTION' else: return 'LAYER' except: return 'LAYER' else: return 'LAYER' except: if processTheInput['itemType']=='TEMPLATE': return 'TEMPLATE' else: return 'LAYER' def checkAboutChildren(self,processTheInput): try: val=processTheInput['children'] return True except: return False def hasSectionID(self,processTheInput): try: processTheInput['sectionId'] return True except: False def detailsofSectionArch(self,sectionArch): listOFIDS=[i['id'] for i in sectionArch['children']] listOFIndices=[i['layerIndex'] for i in sectionArch['children']] listOFIdIndex=[(i['layerIndex'],i['id']) for i in sectionArch['children']] return (listOFIDS,listOFIndices,listOFIdIndex) def makeModification(self,existingArch,processTheInput): indexInObj=self.getIndexOfInput(processTheInput) newArch=[] for lay in existingArch: _layIndex=self.getIndexOfInput(lay) if _layIndex==indexInObj: # print ('>>>>{} Index {} is equal to layer'.format(_layIndex,indexInObj)) newArch.append(processTheInput.copy()) lay1=self.addindex(lay) newArch.append(lay1.copy()) elif _layIndex < indexInObj: # print ('>>>>{} Index {} is greater to layer'.format(_layIndex,indexInObj)) newArch.append(lay.copy()) # newArch.append(processTheInput.copy()) elif _layIndex > indexInObj: # print ('>>>>{} Index {} is lesser to layer'.format(_layIndex,indexInObj)) lay1=self.addindex(lay) newArch.append(lay1.copy()) return newArch
35,282
0
1,162
2baa7b89737d8491f36306787fe02ae8273664e3
246
py
Python
djangobench/benchmarks/query_update/benchmark.py
Bouke/djangobench
94fc28d99f95c65d26d0fad8af44e46c49282220
[ "BSD-3-Clause" ]
3
2016-11-27T22:25:34.000Z
2018-12-12T20:06:40.000Z
djangobench/benchmarks/query_update/benchmark.py
Bouke/djangobench
94fc28d99f95c65d26d0fad8af44e46c49282220
[ "BSD-3-Clause" ]
null
null
null
djangobench/benchmarks/query_update/benchmark.py
Bouke/djangobench
94fc28d99f95c65d26d0fad8af44e46c49282220
[ "BSD-3-Clause" ]
null
null
null
from djangobench.utils import run_benchmark from query_update.models import Book run_benchmark( benchmark, meta = { 'description': 'A simple QuerySet.update().', } )
18.923077
53
0.678862
from djangobench.utils import run_benchmark from query_update.models import Book def benchmark(): Book.objects.all().update(title='z') run_benchmark( benchmark, meta = { 'description': 'A simple QuerySet.update().', } )
36
0
23
bf63d6b3f884140597fd481021eebe9d27449cb2
10,386
py
Python
tasks.py
streamengineer/cellpy
59a83065297ce0ba370fc11181085c98f587101e
[ "MIT" ]
38
2016-08-16T10:54:56.000Z
2022-03-03T04:43:20.000Z
tasks.py
streamengineer/cellpy
59a83065297ce0ba370fc11181085c98f587101e
[ "MIT" ]
88
2016-08-16T13:10:27.000Z
2022-03-29T10:36:39.000Z
tasks.py
streamengineer/cellpy
59a83065297ce0ba370fc11181085c98f587101e
[ "MIT" ]
13
2019-01-02T03:57:52.000Z
2022-01-19T08:06:49.000Z
import sys import io import re import os from pathlib import Path from contextlib import contextmanager from invoke import task import requests """Tasks for cellpy development. You need to have invoke installed in your python environment for this to work. Examples: # build and upload to pypi: > invoke build --upload # build only the docs > invoke build --docs # clean up > invoke clean # clean up and build > invoke clean build """ def get_platform(): """get the platform you are running on""" platforms = { "linux1": "Linux", "linux2": "Linux", "darwin": "OS X", "win32": "Windows", "win64": "Windows", } if sys.platform not in platforms: return sys.platform return platforms[sys.platform] @contextmanager def capture(): """context manager to capture output from a running subproject""" o_stream = io.StringIO() yield o_stream print(o_stream.getvalue()) o_stream.close() def get_pypi_info(package="cellpy"): """get version number and sha256 for a pypi package Args: package (str): name of package Returns: [version, sha256] """ url = f"https://pypi.org/pypi/{package}/json" response = requests.get(url) if not response: print(f"url {url} not responding") return None, None response = response.json() version = response["info"]["version"] release = response["releases"][version][-1] sha256 = release["digests"]["sha256"] return version, sha256 @task def pypi(c, package="cellpy"): """Query pypi""" version, sha = get_pypi_info(package=package) if version: print(f"version: {version}") print(f"sha256: {sha}") @task def commit(c, push=True, comment="automatic commit"): """Simply commit and push""" cos = get_platform() print(" Running commit task ".center(80, "=")) print(f"Running on platform: {cos}") print(" status ".center(80, "-")) with capture() as o: c.run("git status", out_stream=o) status_lines = o.getvalue() # it seems it is also possible to do # out = c.run(command) # status_lines = out.stdout new_files_regex = re.compile(r"modified:[\s]+([\S]+)") new_files = new_files_regex.search(status_lines) if new_files: print(new_files.groups()) print(" staging ".center(80, "-")) c.run("git add .") print(" committing ".center(80, "-")) c.run(f'git commit . -m "{comment}"') if push: print(" pushing ".center(80, "-")) c.run("git push") print(" finished ".center(80, "-")) @task def clean(c, docs=False, bytecode=False, extra=""): """Clean up stuff from previous builds""" print(" Cleaning ".center(80, "=")) patterns = ["dist", "build", "cellpy.egg-info"] if docs: print(" - cleaning doc builds") patterns.append("docs/_build") if bytecode: print(" - cleaning bytecode (i.e. pyc-files)") patterns.append("**/*.pyc") if extra: print(f" - cleaning {extra}") patterns.append(extra) for pattern in patterns: print(".", end="") c.run("rm -rf {}".format(pattern)) print() print(f"Cleaned {patterns}") @task def info(c, full=False): """Get info about your cellpy""" import cellpy from pathlib import Path print() version_file_path = Path("cellpy") / "_version.py" version_ns = {} with open(version_file_path) as f: exec(f.read(), {}, version_ns) version, sha = get_pypi_info(package="cellpy") print(" INFO ".center(80, "=")) print(" version ".center(80, "-")) print(f"version (by import cellpy): cellpy {cellpy.__version__}") print(f"version (in _version.py): cellpy {version_ns['__version__']}") if version: print(f"version on PyPI: cellpy {version}") @task @task @task @task def test(c): """Run tests with coverage""" c.run("pytest --cov=cellpy tests/") @task def build(c, docs=False, upload=True): """Create distribution (and optionally upload to PyPI)""" print(" Creating distribution ".center(80, "=")) print("Running python setup.py sdist") c.run("python setup.py sdist") if docs: print(" Building docs ".center(80, "-")) c.run("sphinx-build docs docs/_build") if upload: print(" Uploading to PyPI ".center(80, "=")) print(" Running 'twine upload dist/*'") print(" Trying with using username and password from keyring.") c.run("twine upload dist/*") else: print(" To upload to pypi: 'twine upload dist/*'") @task def conda_build(c, upload=False): """Create conda distribution""" recipe_path = Path("./recipe/meta.yaml") print(" Creating conda distribution ".center(80, "=")) if not recipe_path.is_file(): print(f"conda recipe not found ({str(recipe_path.resolve())})") return version, sha = get_pypi_info(package="cellpy") update_dict = {"name": "cellpy", "version": version, "sha": sha} print("Updating meta.yml") update_meta_yaml(recipe_path, update_dict) print("Running conda build") print(update_dict) with capture() as o: c.run("conda build recipe", out_stream=o) status_lines = o.getvalue() new_files_regex = re.compile(r"TEST END: (.+)") new_files = new_files_regex.search(status_lines) path = new_files.group(1) if upload: upload_cmd = f"anaconda upload {path}" c.run(upload_cmd) else: print(f"\nTo upload: anaconda upload {path}") print("\nTo convert to different OS-es: conda convert --platform all PATH") print("e.g.") print("cd builds") print( r"conda convert --platform all " r"C:\miniconda\envs\cellpy_dev\conda-bld\win-" r"64\cellpy-0.3.0.post1-py37_0.tar.bz2" ) @task def help(c): """Print some help""" print(" available invoke tasks ".center(80, "-")) c.run("invoke -l") print() print(" info from dev_testutils.py ".center(80, "-")) dev_help_file_path = Path("dev_utils/helpers") / "dev_testutils.py" with open(dev_help_file_path) as f: while True: line = f.readline() parts = line.split() if parts: if parts[0].isupper(): print(line.strip()) if not line: break print(" bye ".center(80, "-"))
28.61157
86
0.606297
import sys import io import re import os from pathlib import Path from contextlib import contextmanager from invoke import task import requests """Tasks for cellpy development. You need to have invoke installed in your python environment for this to work. Examples: # build and upload to pypi: > invoke build --upload # build only the docs > invoke build --docs # clean up > invoke clean # clean up and build > invoke clean build """ def get_platform(): """get the platform you are running on""" platforms = { "linux1": "Linux", "linux2": "Linux", "darwin": "OS X", "win32": "Windows", "win64": "Windows", } if sys.platform not in platforms: return sys.platform return platforms[sys.platform] @contextmanager def capture(): """context manager to capture output from a running subproject""" o_stream = io.StringIO() yield o_stream print(o_stream.getvalue()) o_stream.close() def get_pypi_info(package="cellpy"): """get version number and sha256 for a pypi package Args: package (str): name of package Returns: [version, sha256] """ url = f"https://pypi.org/pypi/{package}/json" response = requests.get(url) if not response: print(f"url {url} not responding") return None, None response = response.json() version = response["info"]["version"] release = response["releases"][version][-1] sha256 = release["digests"]["sha256"] return version, sha256 def update_meta_yaml_line(line, update_dict): if line.find("set name") >= 0: v = update_dict["name"] line = f'{{% set name = "{v}" %}}\n' if line.find("set version") >= 0: v = update_dict["version"] line = f'{{% set version = "{v}" %}}\n' if line.find("set sha256") >= 0: v = update_dict["sha"] line = f'{{% set sha256 = "{v}" %}}\n' return line def update_meta_yaml(meta_filename, update_dict): lines = [] with open(meta_filename, "r") as ifile: while 1: line = ifile.readline() if not line: break if line.find("{%") >= 0: line = update_meta_yaml_line(line, update_dict) lines.append(line) with open(meta_filename, "w") as ofile: for line in lines: ofile.write(line) @task def pypi(c, package="cellpy"): """Query pypi""" version, sha = get_pypi_info(package=package) if version: print(f"version: {version}") print(f"sha256: {sha}") @task def commit(c, push=True, comment="automatic commit"): """Simply commit and push""" cos = get_platform() print(" Running commit task ".center(80, "=")) print(f"Running on platform: {cos}") print(" status ".center(80, "-")) with capture() as o: c.run("git status", out_stream=o) status_lines = o.getvalue() # it seems it is also possible to do # out = c.run(command) # status_lines = out.stdout new_files_regex = re.compile(r"modified:[\s]+([\S]+)") new_files = new_files_regex.search(status_lines) if new_files: print(new_files.groups()) print(" staging ".center(80, "-")) c.run("git add .") print(" committing ".center(80, "-")) c.run(f'git commit . -m "{comment}"') if push: print(" pushing ".center(80, "-")) c.run("git push") print(" finished ".center(80, "-")) @task def clean(c, docs=False, bytecode=False, extra=""): """Clean up stuff from previous builds""" print(" Cleaning ".center(80, "=")) patterns = ["dist", "build", "cellpy.egg-info"] if docs: print(" - cleaning doc builds") patterns.append("docs/_build") if bytecode: print(" - cleaning bytecode (i.e. pyc-files)") patterns.append("**/*.pyc") if extra: print(f" - cleaning {extra}") patterns.append(extra) for pattern in patterns: print(".", end="") c.run("rm -rf {}".format(pattern)) print() print(f"Cleaned {patterns}") @task def info(c, full=False): """Get info about your cellpy""" import cellpy from pathlib import Path print() version_file_path = Path("cellpy") / "_version.py" version_ns = {} with open(version_file_path) as f: exec(f.read(), {}, version_ns) version, sha = get_pypi_info(package="cellpy") print(" INFO ".center(80, "=")) print(" version ".center(80, "-")) print(f"version (by import cellpy): cellpy {cellpy.__version__}") print(f"version (in _version.py): cellpy {version_ns['__version__']}") if version: print(f"version on PyPI: cellpy {version}") @task def sha(c, version=None): import cellpy if version is None: version = f"{cellpy.__version__}" full_version = f"cellpy/{version}" pypi_version, sha_hash = get_pypi_info(package=full_version) print(f"ver: {pypi_version}") print(f"sha: {sha_hash}") @task def jupyterlab(c): print("installing jupyter lab-extensions") extensions = [ "@jupyter-widgets/jupyterlab-manager@2.0", "@pyviz/jupyterlab_pyviz", "@jupyter-widgets/jupyterlab-toc", ] for extension in extensions: print(f"installing {extension}") c.run(f"jupyter labextension install {extension}") print("OK") @task def man(c): print("-----") print("CONDA") print("-----") print("\ncreate new environment from environment.yml file:") print("> conda env create -f environment.yml") print("\nremove environment:") print("> conda env remove --name myenv") print("\nadd conda env to jupyter:") print( "(assuming you are already in the conda env you would like to add to jupyter)" ) print("> python -m ipykernel install --user --name=firstEnv") print("----------") print("JUPYTERLAB") print("----------") print("> jupyter labextension install @jupyter-widgets/jupyterlab-manager@2.0") print("> jupyter labextension install @pyviz/jupyterlab_pyviz") print("> jupyter labextension build") print("> jupyter labextension list") print( """ This is a short description in how to update the conda-forge recipe: - (If not done): make a fork of https://github.com/conda-forge/cellpy-feedstock - (if not done): clone the repo (jepegit/cellpy-feedstock) >>> git clone https://github.com/jepegit/cellpy-feedstok.git >>> git remote add upstream https://github.com/conda-forge/cellpy-feedstock - Get recent changes git fetch upstream git rebase upstream/master - Make a new branch in your local clone git checkout -b update_x_x_x - Edit hash and version and build number (hash: pypi - release history - Download files) (version: use normalized format e.g. 0.5.2a3 not 0.5.2.a3!) (build number: should be 0 for new versions) - Add and commit (e.g. updated feedstock to version 1.0.1) - Push >>> git push origin <branch-name> - re-render if needed (different requirements, platforms, issues) >>> conda install -c conda-forge conda-smithy >>> conda smithy rerender -c auto - Create a pull request via the web interface by navigating to https://github.com/jepegit/cellpy-feedstok.git with your web browser and clicking the button create pull request. - Wait for the automatic checks have complete (takes several minutes) - Merge pull request (big green button) - Drink a cup of coffee or walk the dog - check if the new version is there: >>> conda search -f cellpy - now you can delete the branch (if you want) """ ) @task def test(c): """Run tests with coverage""" c.run("pytest --cov=cellpy tests/") @task def build(c, docs=False, upload=True): """Create distribution (and optionally upload to PyPI)""" print(" Creating distribution ".center(80, "=")) print("Running python setup.py sdist") c.run("python setup.py sdist") if docs: print(" Building docs ".center(80, "-")) c.run("sphinx-build docs docs/_build") if upload: print(" Uploading to PyPI ".center(80, "=")) print(" Running 'twine upload dist/*'") print(" Trying with using username and password from keyring.") c.run("twine upload dist/*") else: print(" To upload to pypi: 'twine upload dist/*'") @task def conda_build(c, upload=False): """Create conda distribution""" recipe_path = Path("./recipe/meta.yaml") print(" Creating conda distribution ".center(80, "=")) if not recipe_path.is_file(): print(f"conda recipe not found ({str(recipe_path.resolve())})") return version, sha = get_pypi_info(package="cellpy") update_dict = {"name": "cellpy", "version": version, "sha": sha} print("Updating meta.yml") update_meta_yaml(recipe_path, update_dict) print("Running conda build") print(update_dict) with capture() as o: c.run("conda build recipe", out_stream=o) status_lines = o.getvalue() new_files_regex = re.compile(r"TEST END: (.+)") new_files = new_files_regex.search(status_lines) path = new_files.group(1) if upload: upload_cmd = f"anaconda upload {path}" c.run(upload_cmd) else: print(f"\nTo upload: anaconda upload {path}") print("\nTo convert to different OS-es: conda convert --platform all PATH") print("e.g.") print("cd builds") print( r"conda convert --platform all " r"C:\miniconda\envs\cellpy_dev\conda-bld\win-" r"64\cellpy-0.3.0.post1-py37_0.tar.bz2" ) @task def help(c): """Print some help""" print(" available invoke tasks ".center(80, "-")) c.run("invoke -l") print() print(" info from dev_testutils.py ".center(80, "-")) dev_help_file_path = Path("dev_utils/helpers") / "dev_testutils.py" with open(dev_help_file_path) as f: while True: line = f.readline() parts = line.split() if parts: if parts[0].isupper(): print(line.strip()) if not line: break print(" bye ".center(80, "-"))
3,754
0
112
8e1e65f2add69583316cef2dcba580af72b9582b
52,666
py
Python
discordrpg/discordrpg.py
ThePheonixGuy/DiscordRPG
5100fcc864692fa7f1dac42b145fdf4751b23c24
[ "MIT" ]
null
null
null
discordrpg/discordrpg.py
ThePheonixGuy/DiscordRPG
5100fcc864692fa7f1dac42b145fdf4751b23c24
[ "MIT" ]
null
null
null
discordrpg/discordrpg.py
ThePheonixGuy/DiscordRPG
5100fcc864692fa7f1dac42b145fdf4751b23c24
[ "MIT" ]
null
null
null
# Discord import discord from discord.ext import commands from cogs.utils.dataIO import dataIO from .utils import checks from __main__ import send_cmd_help # Others import os from copy import deepcopy, copy import datetime import time import math import random try: import validators validatorsAvail = True except: validatorsAvail = False class DiscordRPG: """The Discord RPG. I mean, *Thee Discord RPG*""" @commands.group(name='rpgset', pass_context=True) async def rpgset(self, ctx): """Settings for the RPG on this server""" if ctx.invoked_subcommand is None: await send_cmd_help(ctx) @rpgset.command(pass_context=True) async def townname(self, ctx, *, name): """Allows you to set a name for this server's Home Town""" author = ctx.message.author sid = ctx.message.server await self.town.set_town_name(ctx, name) @rpgset.command(pass_context=True) async def townavatar(self, ctx, *, avatarurl): """Allows you to set a new Avatar picture for this server's Home Town""" # TODOLATER allow attachment grabbing. its possible, but im lazy author = ctx.message.author sid = ctx.message.server.id if validators.url(avatarurl): await self.town.set_town_avatar(sid, avatarurl) else: await self.bot.say("Not a valid URL. Try again.") @commands.group(name="rpg", pass_context=True) async def rpg(self, ctx): """General RPG stuff.""" if ctx.invoked_subcommand is None: await send_cmd_help(ctx) @rpg.command(pass_context=True) @checks.admin_or_permissions(manage_server=True) async def signup(self, ctx): """Allows an admin or moderator to signup this server into the RPG""" await self.town.create_town(ctx) @rpg.command(pass_context=True) async def character(self, ctx): """Character options menu""" author = ctx.message.author sid = ctx.message.server current_player = {} player_exists = await self.player.check_player(author.id) if player_exists: current_player = await self.player.get_player_records(author.id) else: await self.bot.say("You have not yet joined the RPG. Please register using `{}rpg register`".format(ctx.prefix)) return embed = discord.Embed(title="Options for {}".format(current_player[ 'CharName']), description="Use the numbers to make a choice.", colour=0xfd0000) embed.add_field( name='Options', value="`1.` Get Character Sheet\n`2.` Change Avatar\n`3.` Change Bio\n`4.` View Home Town", inline=False) embed.set_author(name='{}'.format(author.name), icon_url='{}'.format(author.avatar_url)) embed.set_thumbnail( url='https://i.ytimg.com/vi/Pq824AM9ZHQ/maxresdefault.jpg') await self.bot.say("", embed=embed) response = await self.bot.wait_for_message(author=author) if '1' in response.content: # Return the character sheet await self.player.getCharacterSheet(author) elif '2' in response.content: # Grab url, validate it and save to the players profile in # players.json await self.bot.say("Please provide me with a url only, to use as an image for your character sheet.") # TODOLATER allow attachment grabbing. its possible, but im lazy avatarurl = await self.bot.wait_for_message(author=author) if validators.url(avatarurl.content): await self.player.setProfileAvatar(author.id, avatarurl.content) else: await self.bot.say("Not a valid URL. Try again.") elif '3' in response.content: await self.player.setBio(ctx, author.id) elif '4' in response.content: self.town.savetowns() await self.town.reload_town_records() await self.town.get_town_sheet(current_player['HomeTownID']) else: await self.bot.say("Invalid response. Please try again.") @rpg.command(pass_context=True, no_pm=False) async def register(self, ctx): """Registers and Creates your RPG Character.""" author = ctx.message.author sid = ctx.message.server.id townExists = await self.town.check_town(sid) if not townExists: await self.bot.say("Oops. Your town is still in piles of rubble. Please ask an admin or moderator of this channel to get your town started with `{}rpg signup`".format(ctx.prefix)) return player_exists = await self.player.check_player(author.id) if player_exists: await self.bot.say("You are already regsitered. You can use `{}rpg character` to do things.".format(ctx.prefix)) return await self.bot.say("Thanks for joining {}! We are going to need some information...".format(author.mention)) await self.player._createplayer(ctx) @rpg.command(pass_context=True, no_pm=False) async def viewtown(self, ctx): """View the details of the guild's town you are currently in""" sid = ctx.message.server.id await self.town.get_town_sheet(sid) @rpg.command(pass_context=True, no_pm=False) async def viewmonster(self, ctx, *, monsterID): """Testing Stub. Please do not use.""" await self.monster.getMonsterSheet(monsterID) @rpg.command(pass_context=True, no_pm=False) async def viewtile(self, ctx, locX: int, locY: int): """Testing sub. Please do not use.""" user = ctx.message.author location = {"X" : locX, "Y" : locY} current_player = await self.player.get_player_records(user.id) tile = await self.map.map_provider(user, location) await self.bot.say(tile) @rpg.command(pass_context=True, no_pm=False) async def findtile(self, ctx, tile_type): """Stub. Do not Use""" user = ctx.message.author tile = await self.map.find_tile(tile_type) await self.bot.say(tile) @rpg.command(pass_context = True, no_pm = False) @rpg.command(pass_context=True, no_pm=False) async def viewplayer(self, ctx, user: discord.Member): """Allows you to see the character sheet of another player in the game.""" hasProfile = await self.player.check_player(user.id) if hasProfile: await self.player.getCharacterSheet(user) else: await self.bot.say("That player does not yet exist. Perhaps consider asking them to join using `{}rpg register`?".format(ctx.prefix)) @rpg.command(pass_context=True, no_pm=False) async def logout(self, ctx): """Logs you out of your current session, if there is one""" await self._logout(ctx) @rpg.command(pass_context=True, no_pm=False) async def play(self, ctx): """Runs a session of DiscordRPG""" # from this point onwards, CTX cannot be used for resources like server ID's. # Needs to be pulled from the existing resources, in the dicts. userDO = ctx.message.author await self.reload_town_records() current_player = await self.player.get_player_records(userDO.id) if current_player is None: await self.bot.say("It seems you have never registered with the rpg." " Please try `{}rpg register`".format(ctx.prefix)) return player_town = await self.town.get_town_records(current_player['HomeTownID']) if player_town is None: await self.bot.say("Hmmm... It appears your town is still in Rubble unfortunately." "Torn down by a war long since forgotten. " "Get an admin of this server to try `{}rpg signup`".format(ctx.prefix)) return if not self._login(userDO): await self.bot.say("You already have an Ongoing play session. " "If you can't find it, please try " "`{}rpg logout`".format(ctx.prefix)) return # TODO remove when complete. await self.bot.say("This is still under construction. Any bugs are please to be reported using `;;contact` followed by the error given. Thanks for testing out DiscordRPG!") if 'Never' in current_player['Last_Played']: await self.bot.say("Thank you for signing up. Welcome to your next grand adventure") await self.first_adventure_town(ctx, current_player, player_town)
41.998405
214
0.579824
# Discord import discord from discord.ext import commands from cogs.utils.dataIO import dataIO from .utils import checks from __main__ import send_cmd_help # Others import os from copy import deepcopy, copy import datetime import time import math import random try: import validators validatorsAvail = True except: validatorsAvail = False class DiscordRPG: """The Discord RPG. I mean, *Thee Discord RPG*""" def __init__(self, bot): self.bot = bot self.playerPath = "data/discordrpg/players.json" self.inventoryPath = "data/discordrpg/inventories.json" self.monsterPath = "data/discordrpg/monsters.json" self.townPath = "data/discordrpg/towns.json" self.tilePath = "data/discordrpg/tiletypes.json" self.mapPath = "data/discordrpg/map.json" self.player = Player(bot, self.playerPath, self.inventoryPath) self.monster = Monster(bot, self.monsterPath) self.town = Town(bot, self.player, "data/discordrpg/towns.json") self.map = Map( self.player, bot, "data/discordrpg/tiletypes.json", "data/discordrpg/map.json") self.settings_path = "data/discordrpg/settings.json" self.settings = dataIO.load_json(self.settings_path) self.logged_in_users = [] self.default_options = ["Survey the Landscape", "Have a look around", "Check Inventory", "Meditate", "Rest"] @commands.group(name='rpgset', pass_context=True) async def rpgset(self, ctx): """Settings for the RPG on this server""" if ctx.invoked_subcommand is None: await send_cmd_help(ctx) @rpgset.command(pass_context=True) async def townname(self, ctx, *, name): """Allows you to set a name for this server's Home Town""" author = ctx.message.author sid = ctx.message.server await self.town.set_town_name(ctx, name) @rpgset.command(pass_context=True) async def townavatar(self, ctx, *, avatarurl): """Allows you to set a new Avatar picture for this server's Home Town""" # TODOLATER allow attachment grabbing. its possible, but im lazy author = ctx.message.author sid = ctx.message.server.id if validators.url(avatarurl): await self.town.set_town_avatar(sid, avatarurl) else: await self.bot.say("Not a valid URL. Try again.") @commands.group(name="rpg", pass_context=True) async def rpg(self, ctx): """General RPG stuff.""" if ctx.invoked_subcommand is None: await send_cmd_help(ctx) @rpg.command(pass_context=True) @checks.admin_or_permissions(manage_server=True) async def signup(self, ctx): """Allows an admin or moderator to signup this server into the RPG""" await self.town.create_town(ctx) @rpg.command(pass_context=True) async def character(self, ctx): """Character options menu""" author = ctx.message.author sid = ctx.message.server current_player = {} player_exists = await self.player.check_player(author.id) if player_exists: current_player = await self.player.get_player_records(author.id) else: await self.bot.say("You have not yet joined the RPG. Please register using `{}rpg register`".format(ctx.prefix)) return embed = discord.Embed(title="Options for {}".format(current_player[ 'CharName']), description="Use the numbers to make a choice.", colour=0xfd0000) embed.add_field( name='Options', value="`1.` Get Character Sheet\n`2.` Change Avatar\n`3.` Change Bio\n`4.` View Home Town", inline=False) embed.set_author(name='{}'.format(author.name), icon_url='{}'.format(author.avatar_url)) embed.set_thumbnail( url='https://i.ytimg.com/vi/Pq824AM9ZHQ/maxresdefault.jpg') await self.bot.say("", embed=embed) response = await self.bot.wait_for_message(author=author) if '1' in response.content: # Return the character sheet await self.player.getCharacterSheet(author) elif '2' in response.content: # Grab url, validate it and save to the players profile in # players.json await self.bot.say("Please provide me with a url only, to use as an image for your character sheet.") # TODOLATER allow attachment grabbing. its possible, but im lazy avatarurl = await self.bot.wait_for_message(author=author) if validators.url(avatarurl.content): await self.player.setProfileAvatar(author.id, avatarurl.content) else: await self.bot.say("Not a valid URL. Try again.") elif '3' in response.content: await self.player.setBio(ctx, author.id) elif '4' in response.content: self.town.savetowns() await self.town.reload_town_records() await self.town.get_town_sheet(current_player['HomeTownID']) else: await self.bot.say("Invalid response. Please try again.") @rpg.command(pass_context=True, no_pm=False) async def register(self, ctx): """Registers and Creates your RPG Character.""" author = ctx.message.author sid = ctx.message.server.id townExists = await self.town.check_town(sid) if not townExists: await self.bot.say("Oops. Your town is still in piles of rubble. Please ask an admin or moderator of this channel to get your town started with `{}rpg signup`".format(ctx.prefix)) return player_exists = await self.player.check_player(author.id) if player_exists: await self.bot.say("You are already regsitered. You can use `{}rpg character` to do things.".format(ctx.prefix)) return await self.bot.say("Thanks for joining {}! We are going to need some information...".format(author.mention)) await self.player._createplayer(ctx) @rpg.command(pass_context=True, no_pm=False) async def viewtown(self, ctx): """View the details of the guild's town you are currently in""" sid = ctx.message.server.id await self.town.get_town_sheet(sid) @rpg.command(pass_context=True, no_pm=False) async def viewmonster(self, ctx, *, monsterID): """Testing Stub. Please do not use.""" await self.monster.getMonsterSheet(monsterID) @rpg.command(pass_context=True, no_pm=False) async def viewtile(self, ctx, locX: int, locY: int): """Testing sub. Please do not use.""" user = ctx.message.author location = {"X" : locX, "Y" : locY} current_player = await self.player.get_player_records(user.id) tile = await self.map.map_provider(user, location) await self.bot.say(tile) @rpg.command(pass_context=True, no_pm=False) async def findtile(self, ctx, tile_type): """Stub. Do not Use""" user = ctx.message.author tile = await self.map.find_tile(tile_type) await self.bot.say(tile) @rpg.command(pass_context = True, no_pm = False) async def viewsurrounds(self,ctx, loc_x:int,loc_y:int): location={'X': loc_x,'Y':loc_y} user = ctx.message.author await self.map.get_surrounds(user,location) @rpg.command(pass_context=True, no_pm=False) async def viewplayer(self, ctx, user: discord.Member): """Allows you to see the character sheet of another player in the game.""" hasProfile = await self.player.check_player(user.id) if hasProfile: await self.player.getCharacterSheet(user) else: await self.bot.say("That player does not yet exist. Perhaps consider asking them to join using `{}rpg register`?".format(ctx.prefix)) @rpg.command(pass_context=True, no_pm=False) async def logout(self, ctx): """Logs you out of your current session, if there is one""" await self._logout(ctx) @rpg.command(pass_context=True, no_pm=False) async def play(self, ctx): """Runs a session of DiscordRPG""" # from this point onwards, CTX cannot be used for resources like server ID's. # Needs to be pulled from the existing resources, in the dicts. userDO = ctx.message.author await self.reload_town_records() current_player = await self.player.get_player_records(userDO.id) if current_player is None: await self.bot.say("It seems you have never registered with the rpg." " Please try `{}rpg register`".format(ctx.prefix)) return player_town = await self.town.get_town_records(current_player['HomeTownID']) if player_town is None: await self.bot.say("Hmmm... It appears your town is still in Rubble unfortunately." "Torn down by a war long since forgotten. " "Get an admin of this server to try `{}rpg signup`".format(ctx.prefix)) return if not self._login(userDO): await self.bot.say("You already have an Ongoing play session. " "If you can't find it, please try " "`{}rpg logout`".format(ctx.prefix)) return # TODO remove when complete. await self.bot.say("This is still under construction. Any bugs are please to be reported using `;;contact` followed by the error given. Thanks for testing out DiscordRPG!") if 'Never' in current_player['Last_Played']: await self.bot.say("Thank you for signing up. Welcome to your next grand adventure") await self.first_adventure_town(ctx, current_player, player_town) async def first_adventure_town(self, ctx, current_player, player_town): user = ctx.message.author player_race = current_player['Race'] player_old_wep = "" if 'W' in player_race: player_old_wep = "Half Blade" elif 'R' in player_race: player_old_wep = "Dagger" elif 'S' in player_race: player_old_wep = "Wand" header = ["Awakening", ("First, nothing. Then, just white pain." " You wake up on the cold, hard stones." " Dazed and Confused," " you wonder how it is you ended up here." " Opening your eyes to the eye-shattering sunlight," " you sit yourself up and take a look around." " Doesn't look like much," " a simple town you think to yourself." " You stand up and decide to have a look around.")] option = ["Take a look around."] em1 = await self.embed_builder(ctx, current_player, header, option) await self.bot.say("", embed=em1) valid = False while not valid: response = await self.loop_checks(ctx) if not response: valid = True return elif '1' in response.content: option = ["Try for the gate. It's time to get out of here.", "Approach the Fountain.", "Take a closer look at the buildings around you."] # the 1 reference here is to keep the "Awakening chapter heading" header[1] = (" You pull yourself to your feet. As you do, " "a stranger calls out to you, 'Woah hold on there friend! Name's Timm.' " "He hands you a tankard,which you gulp down.\n " "Timm continues, 'Some big fella's dragged you in overnight. " "I saw it from my shop, Timms Town Improvement! " "How about you come round and have a look when you're ready? " "I've also put some coin in your pocket. You could use it.'" "\n You have a look around the town. It's all in a circle, " "clearly having only just being rebuilt from Rubble. " "You see a dirty Fountain in the centre of the courtyard. " "You notice a Gate behind you, seemingly ungaurded.\n\n " "What shall you do next?") em1 = await self.embed_builder(ctx, current_player, header, option) await self.bot.say("", embed=em1) valid = True break else: await self.bot.say("No correct response detected. Please try again.") continue valid = False while not valid: response = await self.loop_checks(ctx) if not response: valid = True return elif '1' in response.content: # Approach the gate. option = ["Turn Around. You don't have enough strength to face that yet.", "Ignore the advice. Ask to leave the gate."] header[0] = ("The Gate and the Gate Keeper") header[1] = ("It's a sad, wooden afair." " The wood looks rotted and pieced together." " How this serves as protection for anything is anyone's guess." "\n Out of your periphery you notice a large being approaching." " You turn suddenly, reaching for your trusty {}" ", but you remember it's not there. All your things, gone." "\n A large Orcish man approaches you, easily twice your height." " 'I am the gate keeper here. Why do you wish to leave?'" ". Clearly not looking to fight, he lowers his weapon, a large golden axe." " 'The road is not safe. The town's only just been built back up." " We are still clearing the area around the town.' ".format(player_old_wep)) em1 = await self.embed_builder(ctx, current_player, header, option) await self.bot.say("", embed=em1) response = await self.loop_checks(ctx) if not response: valid = True return if '1' in response.content: await self.bot.say("Please repeat your option.") valid = False continue elif '2' in response.content: await self.first_adventure_outside(ctx, current_player, player_town) valid = True break elif '2' in response.content: # Look at the fountain option = ["Try for the gate. It's time to get out of here.", "Stay staring at the fountain.", "Take a closer look at the buildings around you."] header[0] = ("The Old Fountain") header[1] = (" It seems no-one has gotten around to sorting this out." " It has a dirty, worn out plaque underneath it, barely readable." "\n Still covered in Algae, the base is cracked." " There are some old coins, some still glittering, most are faded." "\n The fountain itself is a very plain structure," " with three bowl-shaped tiers.") em1 = await self.embed_builder(ctx, current_player, header, option) await self.bot.say("", embed=em1) #TODO interactable that allows you to dive into the fountain for some extra cash. # naaaah. to lazy continue elif '3' in response.content: # Look around at the buildings. town_name = player_town['Town_Name'] town_buildings = ", ".join(player_town['Buildings']) building_info_string = "" building_info = dataIO.load_json( "data/discordrpg/buildings.json") for building in player_town['Buildings']: info = building_info[building] building_info_string += "**{}**: *{}*\n".format(building, info['Desc']) option = ["Try for the gate. It's time to get out of here.", "Approach the Fountain."] header[0] = ("{}, the town.".format(town_name)) header[1] = ("Doing a quick roundabout, you notice the town has a {}." ". Nothing all too impressive, but a decent start," " you think to yourself." "\n\n{}".format(town_buildings, building_info_string)) em1 = await self.embed_builder(ctx, current_player, header, option) await self.bot.say("", embed=em1) continue else: await self.bot.say("No correct response detected. Please try again.") continue async def first_adventure_outside(self, ctx, current_player, player_town): #TODO continue gameplay here # get location of town. Add 1 to loc_y. # get tile details for that location. # from details, return a string of the tile. # options? default tile interaction options? user = ctx.message.author player_race = current_player['Race'] location = player_town['Location'] location['Y'] += 1 tile = await self.map.get_tile_records(user, location) current_player = await self.player.update_location(user, location) option = self.default_options header = ["Title","Description"] header[0] = "The Green Mile" header[1] = ("The Gate Keeper reluctantly opens the gate." " He warns you one last time, you should wait," " but you're a {}, and waiting isn't in your blood." " There is no stone beneath your feet, just cold grass." " You realise you must be {}.".format(player_race, "in a grassland")) em1 = await self.embed_builder(ctx, current_player, header, option) await self.bot.say("", embed=em1) valid = False while not valid: response = await self.loop_checks(ctx) if not response: valid = True return elif '1' in response.content: surrounds = await self.map.get_surrounds(user, location) #TODO Now CUT down. All tiles around are too much detail. Provide a basic for each. await self.bot.say(surrounds["North"]) async def survey_landscape(self, ctx, user, current_player, option, location): surrounds = await self.map.get_surrounds(user, location) header = [] #two value, tile and desc. option = [] #option list to go with it. em1 = await self.embed_builder(ctx, current_player, header, option) # stuff to create the pretty embed. return em1 async def reload_town_records(self): self.town = Town(self.bot, self.player, "data/discordrpg/towns.json") async def exit_check(self, text): text = text.lower() if 'exit' in text: return True else: return False def _login(self, user): if user.id in self.logged_in_users: return False else: self.logged_in_users.append(user.id) print(self.logged_in_users) return True # TODO return as an embed, # a login message as well as details last played # and current location. async def _logout(self, ctx): user = ctx.message.author try: self.logged_in_users.remove(user.id) print(self.logged_in_users) await self.bot.say("Logged out succesfully..") except: await self.bot.say("It seems you are not currently logged in. " "Have you tried `{}rpg play`?".format(ctx.prefix)) async def loop_checks(self, ctx): user = ctx.message.author if user.id not in self.logged_in_users: return False response = await self.bot.wait_for_message(timeout=600, author=user) if response is None: await self._logout(ctx) return False if await self.exit_check(response.content): await self.bot.say(("Are you sure you wish to end the session here?" " Say `yes` to confirm")) response = await self.bot.wait_for_message(timeout=600, author=user) if response is None: await self._logout(ctx) return False elif 'y' in response.content.lower(): await self._logout(ctx) return False return response async def embed_builder(self, ctx, user, header, option): value = "" count = 1 for item in option: value += "`{}.`{}\n".format(count, item) count += 1 em = discord.Embed(title="{}".format( header[0]), description="{}".format(header[1]), colour=0xfd0000) em.add_field(name='Use the numbers to Indicate your Choice.', value=value, inline=False) em.set_author(name='{}'.format(user["CharName"])) em.set_thumbnail(url=user['Avatar']) em.set_footer(text="Say Exit to logout from this session.") return em async def generic_adventure(self, ctx, current_player, player_town): option = [] em1 = discord.Embed(title="{}".format( option[0]), description="{}".format(option[1]), colour=0xfd0000) em1.add_field(name='Use the numbers to Indicate your Choice.', value="`1.`{}\n`2.`{}\n`3.`{}\n`4.`{}\n".format( option[2], option[3], option[4], option[5]), inline=False) await self.bot.say("", embed=embed1) class Player: def __init__(self, bot, player_path, invent_path): self.bot = bot self.playerRoster = dataIO.load_json(player_path) self.playerInventories = dataIO.load_json(invent_path) self.monster = Monster(bot, "data/discordrpg/monsters.json") self.town = Town(bot, self, "data/discordrpg/towns.json") self.map = Map(self, bot, "data/discordrpg/tiletypes.json", "data/discordrpg/map.json") async def check_player(self, userID): try: if userID in self.playerRoster: return True else: return False except: return False async def check_inventory(self, userID): try: if userID in self.playerInventories: return True else: return False except: return False async def get_player_records(self, userID): if await self.check_player(userID): return deepcopy(self.playerRoster[userID]) else: return None async def get_player_invent(self, userID): if self.check_player(userID): return deepcopy(self.playerInventories[userID]) else: return False async def _createplayer(self, ctx): # order = charname, race, hometown, bio. stats to be inferred from # race. author = ctx.message.author newplayer = {} race = "" charname = "" bio = "" hometownid = ctx.message.server.id hometownname = ctx.message.server.name await self.town.reload_town_records() town_record = await self.town.get_town_records(hometownid) print("New player is registering in {} from server {}".format( town_record['Town_Name'], ctx.message.server.name)) completion = "yes" embed = discord.Embed( title="Pick a Class", description="Let's start off by finding what class your character is.", colour=0xff0000) embed.add_field( name='Class', value="Choose from the following Classes:", inline=False) embed.add_field(name='Warrior', value='The Melee Class. Specialising in close quarters combat, the warrior is lethal with a selecton of weapons.\n*Type `1` to select this class.*', inline=False) embed.add_field(name='Rogue', value='Specialising in ranged combat and steath, the Rogue is Death from a Distance, with a touch of magic to make life easier\n*Type `2` to select this class.*', inline=False) embed.add_field( name='Sorcerer', value="Nothing above their power, the arcane arts allow the Sorcerers to bend any element to their will\n*Type `3` to select this class.*", inline=False) embed.set_thumbnail( url='http://unrealitymag.com/wp-content/uploads/2011/11/torchlight1.jpg') await self.bot.say(' ', embed=embed) raceChoice = await self.bot.wait_for_message(author=author) if '1' in raceChoice.content: await self.bot.say("Awesome! Now, What is this Warrior's name?") race = "Warrior" elif '2' in raceChoice.content: await self.bot.say("Awesome! Now, What is this Rogue's name?") race = "Rogue" elif '3' in raceChoice.content: await self.bot.say("Awesome! Now, What is this Sorcerers's name?") race = "Sorcerer" charname = await self.bot.wait_for_message(author=author) charname = charname.content await self.bot.say("Please provide a short backstory about yourself, {}".format(charname)) bio = await self.bot.wait_for_message(author=author) await self.bot.say("Great, welcome to {}, {}".format(town_record['Town_Name'], charname)) # TODO add session counter for tut purposes. newplayer['User'] = author.name newplayer['HomeTownID'] = hometownid newplayer['CharName'] = charname newplayer['Race'] = race newplayer['Level'] = 1 newplayer['Gold'] = 100 newplayer['Location'] = town_record['Location'] newplayer['Bio'] = bio.content newplayer['Last_Played'] = 'Never' newplayer['Sessions'] = 0 if 'W' in race: newplayer['BaseStats'] = {'HP': 50, 'Mana': 10, 'Stamina': 30} newplayer[ 'Avatar'] = "https://s-media-cache-ak0.pinimg.com/736x/77/02/6b/77026b08f33fb0b4a35434553c4fccc8.jpg" elif 'R' in race: newplayer['BaseStats'] = {'HP': 40, 'Mana': 15, 'Stamina': 20} newplayer[ 'Avatar'] = "https://s-media-cache-ak0.pinimg.com/736x/8c/2b/da/8c2bdafd9c5c5b2ec38b81741aa5e879.jpg" elif 'S' in race: newplayer['BaseStats'] = {'HP': 35, 'Mana': 30, 'Stamina': 15} newplayer[ 'Avatar'] = "https://s-media-cache-ak0.pinimg.com/originals/c3/e5/25/c3e525a719eaa6ae0df486baa672391c.jpg" else: await self.bot.say("Sorry... there seems to be an issue with your class. Please try again.") return if await self.check_player(author.id): self.playerRoster[author.id] = newplayer else: self.playerRoster[author.id] = {} self.playerRoster[author.id] = newplayer has_invent = await self.check_inventory(author.id) if not has_invent: self.playerInventories[author.id] = {} self.saveplayers() self.saveinventories() await self.getCharacterSheet(author) print("New player registered in {} from server {}. Details: \n{}".format( town_record['Town_Name'], ctx.message.server.name, newplayer)) self.saveplayers() self.saveinventories() return completion async def getCharacterSheet(self, user): author = user char_profile = await self.get_player_records(user.id) townID = char_profile['HomeTownID'] char_town = await self.town.get_town_records(townID) current_loc = await self.map.get_distance_from_home(user, char_profile['Location']) if current_loc == 0: # Change to tile provider when complete. current_loc = "Currently in {}".format(char_town['Town_Name']) else: current_loc = "{} MU from {}".format( current_loc, char_town['Town_Name']) # TODO will require a location provider. Part of map Class. embed = discord.Embed(title="{}".format( char_profile['CharName']), description=current_loc, color=0xff0000) embed.add_field(name='Bio', value="Hailing from **{}**, *{}* is a {}. In his own words, '*{}*' ".format( char_town['Town_Name'], char_profile['CharName'], char_profile['Race'], char_profile['Bio']), inline=False) embed.add_field(name='Last Played', value=char_profile[ 'Last_Played'], inline=True) embed.add_field(name='Level', value=char_profile['Level'], inline=True) embed.add_field(name='Health', value=char_profile[ 'BaseStats']['HP'], inline=True) embed.add_field(name='Mana', value=char_profile[ 'BaseStats']['Mana'], inline=True) embed.add_field(name='Stamina', value=char_profile[ 'BaseStats']['Stamina'], inline=True) embed.add_field(name='Gold', value=char_profile['Gold'], inline=True) embed.set_author(name='{}'.format(author.name), icon_url='{}'.format(author.avatar_url)) embed.set_thumbnail(url=char_profile['Avatar']) await self.bot.say(" ", embed=embed) async def setProfileAvatar(self, userID, url): # TODO check it for keyerror. use check method. if await self.check_player(userID): self.playerRoster[userID]['Avatar'] = url self.saveplayers() await self.bot.say("Done!") else: await self.bot.say("You might not be registered with the RPG. Please try registering first.") async def setBio(self, ctx, userID): author = ctx.message.author current_player = await self.get_player_records(userID) if current_player == None: await self.bot.say("No current records for you, {}. Please use `{}rpg register to enter the game".format(author.mention, ctx.prefix)) return await self.bot.say("Please provide me with a new Bio.") new_bio = await self.bot.wait_for_message(author=author) current_player['Bio'] = new_bio.content self.playerRoster[userID] = current_player await self.bot.say("Done!") self.saveplayers() async def update_location(self, user, location): current_player = await self.get_player_records(user.id) current_player['Location'] = location return current_player def saveplayers(self): f = "data/discordrpg/players.json" dataIO.save_json(f, self.playerRoster) def saveinventories(self): f = "data/discordrpg/inventories.json" dataIO.save_json(f, self.playerInventories) class Monster: def __init__(self, bot, monster_path): self.bot = bot self.npcmonsters = dataIO.load_json(monster_path) async def getMonsterSheet(self, monsterID): await self.bot.say(monsterID) if monsterID in self.npcmonsters: # this method stub is actually a part check_monster method. pass class Map: def __init__(self, player, bot, tile_path, map_path): self.bot = bot self.fieldmap = dataIO.load_json(map_path) self.tiletypes = dataIO.load_json(tile_path) self.town = Town(bot, player, "data/discordrpg/towns.json") self.player = player async def reload_map(self): self.fieldmap = dataIO.load_json("data/discordrpg/towns.json") async def oldtown_generator(self, location, town_info): try: tile_info = dataIO.load_json("data/discordrpg/tiletypes.json") except: raise RuntimeError("Tile type data is corrupt. Please reload it") try: tile_details = dataIO.load_json("data/discordrpg/tiledetails.json") except: raise RuntimeError("Tile type data is corrupt. Please reload it") x = str(location['X']) y = str(location['Y']) if x not in self.fieldmap: if y not in self.fieldmap: tile = "Old_Town" tile_dict = tile_details[tile] tile_dict['Name'] = town_info["Town_Name"] tile = town_info["Town_Name"] tile_details = {"Name" : town_info["Town_Name"], town_info["Town_Name"] : tile_dict} tile_details[tile]["Name"] = town_info["Town_Name"] tile_details[tile]["Location"] = {'X' : location['X'], 'Y' : location['Y']} #TODO make create_town make the founding member these. tile_details[tile]["Distance"] = "" tile_details[tile]["Founding_Player"] = "" x = str(location['X']) y = str(location['Y']) try: oldmap_at_x = self.fieldmap[x] except: self.fieldmap[x] = {} self.fieldmap[x][y] = tile_details self.savemap() return tile_details else: return None else: return None async def map_generator(self, user, location): # TODO # take the location. Check if its in the map using check tile. # if not, select tile. # selection based off dist from town. <- pulled from user object. # should be the only thing? if else for it? try: tile_info = dataIO.load_json("data/discordrpg/tiletypes.json") except: raise RuntimeError("Tile type data is corrupt. Please reload it") try: tile_details = dataIO.load_json("data/discordrpg/tiledetails.json") except: raise RuntimeError("Tile type data is corrupt. Please reload it") tile = None #logic and choose tile and save it. dist = await self.get_distance_from_home(user, location) print(dist) player_record = await self.player.get_player_records(user.id) #choose tile by level #TODO implement multiple selections based off distance. ie lvl 4 to 6. if dist < 5: #level 1 level_list = [] first_level = tile_info['01'] for tile in first_level: level_list.append(tile) print(level_list) tile = random.choice(level_list) tile_dict = tile_details[tile] tile_details = {"Name" : tile, tile : tile_dict} tile_details[tile]["Name"] = tile tile_details[tile]["Location"] = {'X' : location['X'], 'Y' : location['Y']} tile_details[tile]["Distance"] = dist tile_details[tile]["Founding_Player"] = player_record["CharName"] elif dist < 10: #level 2 level_list = [] first_level = tile_info['01'] for tile in first_level: level_list.append(tile) second_level = tile_info['02'] for tile in second_level: level_list.append(tile) print(level_list) tile = random.choice(level_list) tile_dict = tile_details[tile] tile_details = {"Name" : tile, tile : tile_dict} tile_details[tile]["Name"] = tile tile_details[tile]["Location"] = {'X' : location['X'], 'Y' : location['Y']} tile_details[tile]["Distance"] = dist tile_details[tile]["Founding_Player"] = player_record["CharName"] elif dist < 15: #level 3 level_list = [] first_level = tile_info['01'] for tile in first_level: level_list.append(tile) second_level = tile_info['02'] for tile in second_level: level_list.append(tile) third_level = tile_info['03'] for tile in third_level: level_list.append(tile) print(level_list) tile = random.choice(level_list) tile_dict = tile_details[tile] tile_details = {"Name" : tile, tile : tile_dict} tile_details[tile]["Name"] = tile tile_details[tile]["Location"] = {'X' : location['X'], 'Y' : location['Y']} tile_details[tile]["Distance"] = dist tile_details[tile]["Founding_Player"] = player_record["CharName"] elif dist < 20: #level 4 level_list = [] first_level = tile_info['02'] for tile in first_level: level_list.append(tile) second_level = tile_info['03'] for tile in second_level: level_list.append(tile) third_level = tile_info['04'] for tile in third_level: level_list.append(tile) print(level_list) tile = random.choice(level_list) tile_dict = tile_details[tile] tile_details = {"Name" : tile, tile : tile_dict} tile_details[tile]["Name"] = tile tile_details[tile]["Location"] = {'X' : location['X'], 'Y' : location['Y']} tile_details[tile]["Distance"] = dist tile_details[tile]["Founding_Player"] = player_record["CharName"] elif dist < 25: #level 5 level_list = [] first_level = tile_info['04'] for tile in first_level: level_list.append(tile) second_level = tile_info['05'] for tile in second_level: level_list.append(tile) third_level = tile_info['06'] for tile in third_level: level_list.append(tile) print(level_list) tile = random.choice(level_list) tile_dict = tile_details[tile] tile_details = {"Name" : tile, tile : tile_dict} tile_details[tile]["Name"] = tile tile_details[tile]["Location"] = {'X' : location['X'], 'Y' : location['Y']} tile_details[tile]["Distance"] = dist tile_details[tile]["Founding_Player"] = player_record["CharName"] elif dist >= 25: #level 6+ #data structure changed. Import a second json, tiledetails.json level_list = [] first_level = tile_info['04'] for tile in first_level: level_list.append(tile) second_level = tile_info['05'] for tile in second_level: level_list.append(tile) third_level = tile_info['06'] for tile in third_level: level_list.append(tile) print(level_list) tile = random.choice(level_list) tile_dict = tile_details[tile] tile_details = {"Name" : tile, tile : tile_dict} tile_details[tile]["Name"] = tile tile_details[tile]["Location"] = {'X' : location['X'], 'Y' : location['Y']} tile_details[tile]["Distance"] = dist tile_details[tile]["Founding_Player"] = player_record["CharName"] #TODO refine the required elements and pull them correctly. #save tile to map. x = str(location['X']) y = str(location['Y']) try: oldmap_at_x = self.fieldmap[x] except: self.fieldmap[x] = {} self.fieldmap[x][y] = tile_details self.savemap() return tile_details async def map_provider(self, user, location): tileRecord = await self.get_tile_records(user, location) if tileRecord is None: tileRecord = await self.map_generator(user, location) return tileRecord async def get_distance_from_home(self, user, location): """def for returning the distance from home, because of how important this is""" locX = location['X'] locY = location['Y'] player_record = await self.player.get_player_records(user.id) homeTownID = player_record["HomeTownID"] homeTown = await self.town.get_town_records(homeTownID) townLocation = homeTown['Location'] townX = townLocation['X'] townY = townLocation['Y'] distX = locX - townX distY = locY - townY pDistance = math.hypot(distX, distY) pDistance = round(pDistance) return (pDistance) async def get_surrounds(self, user, location): # gets users current location. # checks self.fieldmap for all nine tiles around it, be # x;y, x;y+, x;y-, x+;y, x+;y+, x+;y-, x-:y, x-;y+, x-;y- # ^^ nine tiles. pass and call for each option to the map provider. # TODO SOON for now. x = location['X'] y = location['Y'] north = {'X': x , 'Y': (y + 1) ,} north_tile = await self.map_provider(user, north) north_east = {'X': (x +1) , 'Y': (y+1) ,} north_east_tile = await self.map_provider(user, north_east) east = {'X': (x+1) , 'Y': y ,} east_tile = await self.map_provider(user, east) south_east = {'X': (x+1) , 'Y': (y-1) ,} south_east_tile = await self.map_provider(user, south_east) south = {'X': x , 'Y': (y-1) ,} south_tile = await self.map_provider(user, south) south_west = {'X': (x-1) , 'Y': (y-1) ,} south_west_tile = await self.map_provider(user, south_west) west = {'X': (x-1) , 'Y': y ,} west_tile = await self.map_provider(user, west) north_west = {'X': (x-1) , 'Y': (y+1) ,} north_west_tile = await self.map_provider(user, north_west) surrounds = { "North" : north_tile, "North East" : north_east_tile, "North West" : north_west_tile, "East" : east_tile, "West" : west_tile, "South" : south_tile, "South East" : south_east_tile, "South West" : south_west_tile } print(surrounds) return surrounds async def check_tile(self, location): """ takes the give location and checks if its in fieldmap""" x = str(location['X']) y = str(location['Y']) try: if x in self.fieldmap: if y in self.fieldmap[x]: return True else: return False else: return False except: return False async def get_tile_records(self, user, location): tileExists = await self.check_tile(location) x = str(location['X']) y = str(location['Y']) if tileExists: return deepcopy(self.fieldmap[x][y]) else: await self.map_generator(user, location) return deepcopy(self.fieldmap[x][y]) async def find_tile(self, tile_type): item = await self._find_tile_type(self.fieldmap, tile_type) return item async def _find_tile_type(self, obj, tile_type): #TODO modify mapgen to add a location subdict if tile_type in obj: return obj[tile_type] for k, v in obj.items(): if isinstance(v,dict): item = await self._find_tile_type(v, tile_type) if item is not None: return item return None async def replace_town(self, town_info, user): #TODO location provider for the new towns. isLocation = await self.find_tile("Old_Town") location = {} available_location = True town_name = town_info["Town_Name"] if isLocation is None: available_location = False while not available_location: # random x between -30 and 30, same for y. # create a tile. # search at that location. If old town, replace data with town. # return the location x = random.randint(-30,30) y = random.randint(-30,30) location = {'X' : x, 'Y' : y} tile = await self.oldtown_generator(location, town_info) print(tile) if tile['Name'] == town_name: available_location = True return location break else: continue print(isLocation) def savemap(self): f = "data/discordrpg/map.json" dataIO.save_json(f, self.fieldmap) class Town: def __init__(self, bot, player, towns_path): self.bot = bot self.player = player self.known_towns = dataIO.load_json(towns_path) async def reload_town_records(self): self.known_towns = dataIO.load_json("data/discordrpg/towns.json") async def check_town(self, townID): try: if townID in self.known_towns: return True else: return False except: return False async def get_town_records(self, townID): if await self.check_town(townID): print("Town Lookup request for {}".format(townID)) return deepcopy(self.known_towns[townID]) else: return None async def get_town_sheet(self, townID): town_record = await self.get_town_records(townID) if town_record is None: await self.bot.say("Hmmm... It appears the town you are looking for is still in Rubble unfortunately. Torn down by a war long since forgotten.") return location = "X: {}\nY: {}".format( town_record['Location']['X'], town_record['Location']['Y']) buildings = ", ".join(town_record['Buildings']) embed = discord.Embed(title="{}".format(town_record['Town_Name']), description="The humble {} was rebuilt from the rubble on {}. \n{}".format( town_record['Town_Name'], town_record['Created_At'], town_record['Description']), color=0xff0000) embed.add_field(name='Location', value=location, inline=True) embed.add_field(name='Level', value=town_record['Level'], inline=True) embed.add_field(name='Current Buildings', value=buildings, inline=False) # TODO NOW list iterator for display purposes. embed.set_thumbnail(url=town_record['Avatar']) await self.bot.say(" ", embed=embed) async def create_town(self, ctx): newTown = {} sid = ctx.message.server.id author = ctx.message.author if await self.check_town(sid): await self.bot.say("This guild is already signed up." " If you would like to change something," " Please try `{}rpgset`".format(ctx.prefix)) return else: await self.bot.say("Hey there, {}. Thanks for signing up your server." "Please provide a name for your new town!" " This will be the name of the whole server's town.".format(author.mention)) # TODO timeout response = await self.bot.wait_for_message(author=author) townName = response.content await self.bot.say("{}? Alright, if you say so." " Gimme a second to get things set up," " I'll get back to you.".format(townName)) townLevelDetail = dataIO.load_json( "data/discordrpg/townlevels.json") newTown['Town_Name'] = townName newTown['Created_At'] = datetime.datetime.ctime( datetime.datetime.now()) newTown['Level'] = 1 newTown[ 'Avatar'] = "http://orig09.deviantart.net/2440/f/2013/249/7/a/fantasy_rpg_town_by_e_mendoza-d6lb9td.jpg" newTown['Buildings'] = townLevelDetail["001"]["Buildings"] newTown['Description'] = townLevelDetail["001"]["Description"] # TODO change to map provider. fieldmap = Map(self.bot, self.player, "data/discordrpg/tiletypes.json", "data/discordrpg/map.json") location = await fieldmap.replace_town(newTown, author) print(location) newTown['Location'] = location self.known_towns[sid] = newTown # TODO add town bio. Would be nice. # TODO Basic buildings tavern and Town Builder. await self.bot.say("Thank you for signing your guild up! Details for this town are to follow.") await self.get_town_sheet(sid) self.savetowns() return newTown async def set_town_avatar(self, townID, url): if self.check_town(townID): self.known_towns[townID]['Avatar'] = url await self.bot.say("Done!") else: await self.bot.say("Your town might not be signed up with the RPG. Please try signup first.") self.savetowns() async def set_town_name(self, ctx, name): sid = ctx.message.server.id # TODO make a hollow container to a method of the town class when town # customization becomes a thing. if sid not in self.known_towns: await self.bot.say("This town has never actually been created before," " but I'll go ahead and establish your great wonder") await self.create_town(ctx) return self.known_towns[sid]['Town_Name'] = name await self.bot.say("The Town Name for this guild is now {}".format(self.known_towns[sid]['Town_Name'])) self.savetowns() def savetowns(self): f = "data/discordrpg/towns.json" dataIO.save_json(f, self.known_towns) def check_folders(): if not os.path.exists("data/discordrpg"): print("Creating data/discordrpg folder...") os.makedirs("data/discordrpg") def check_files(): f = "data/discordrpg/settings.json" if not dataIO.is_valid_json(f): print("Creating default RPG's settings.json...") dataIO.save_json(f, {}) f = "data/discordrpg/players.json" if not dataIO.is_valid_json(f): print("Creating empty players.json...") dataIO.save_json(f, {}) f = "data/discordrpg/inventories.json" if not dataIO.is_valid_json(f): print("Creating empty inventories.json...") dataIO.save_json(f, {}) f = "data/discordrpg/towns.json" if not dataIO.is_valid_json(f): print("Creating empty towns.json...") dataIO.save_json(f, {}) f = "data/discordrpg/map.json" if not dataIO.is_valid_json(f): print("Creating empty map.json...") dataIO.save_json(f, {}) f = "data/discordrpg/tiletypes.json" if not dataIO.is_valid_json(f): raise RuntimeError( "Data file tiletypes.json is either missing from the data folder or corrupt. Please redownload it and place it in your bot's data/discordrpg/ folder") f = "data/discordrpg/monsters.json" if not dataIO.is_valid_json(f): raise RuntimeError( "Data file monsters.json is either missing from the data folder or corrupt. Please redownload it and place it in your bot's data/discordrpg/ folder") f = "data/discordrpg/townlevels.json" if not dataIO.is_valid_json(f): raise RuntimeError( "Data file townlevels.json is either missing from the data folder or corrupt. Please redownload it and place it in your bot's data/discordrpg/ folder") def setup(bot): check_folders() check_files() if validatorsAvail: bot.add_cog(DiscordRPG(bot)) else: raise RuntimeError("You need to run pip3 install validators")
41,498
1,377
1,105
5cf5fbec585953a762b664389d280dac6ad671b1
432
py
Python
src/classify/edge.py
JUSTINGBB/tianditu-python
3565bafae910844928313b0822f199b9dd9bd083
[ "Apache-2.0" ]
1
2021-11-25T10:23:47.000Z
2021-11-25T10:23:47.000Z
src/classify/edge.py
wangjiyuan007/tianditu-python
360eed6f444673d1db58cdf964f063b41a9ab282
[ "Apache-2.0" ]
null
null
null
src/classify/edge.py
wangjiyuan007/tianditu-python
360eed6f444673d1db58cdf964f063b41a9ab282
[ "Apache-2.0" ]
1
2020-03-14T09:22:50.000Z
2020-03-14T09:22:50.000Z
#! /usr/bin/env python # -*- coding: utf-8 -*- # __file__: edge # 图像边缘检测 import numpy as np import cv2 if __name__ == '__main__': path = './res/river_color_bg.png' edge(pic_path=path)
18
43
0.550926
#! /usr/bin/env python # -*- coding: utf-8 -*- # __file__: edge # 图像边缘检测 import numpy as np import cv2 def edge(pic_path): image = cv2.imread(pic_path) kernel = np.array([ [-1, -1, -1], [-1, 8, -1], [-1, -1, -1], ]) edges = cv2.filter2D(image, -1, kernel) cv2.imwrite("./res/edges.jpg", edges) if __name__ == '__main__': path = './res/river_color_bg.png' edge(pic_path=path)
214
0
23
3c4e0e23484b5f0a02ce6423826655d5c60cdb05
2,330
py
Python
HDDcost.py
space-physics/histutils
f2add29c73be5c62d8675139cc58250ece92f477
[ "MIT" ]
null
null
null
HDDcost.py
space-physics/histutils
f2add29c73be5c62d8675139cc58250ece92f477
[ "MIT" ]
3
2015-05-27T15:20:23.000Z
2015-12-14T07:55:18.000Z
HDDcost.py
space-physics/histutils
f2add29c73be5c62d8675139cc58250ece92f477
[ "MIT" ]
null
null
null
#!/usr/bin/env python """ computes cost of storing camera data """ from __future__ import division # %% print("quantities are for full data rate") Zyla = Cam(2560 * 2160, 100, 4, 1500) print("\n--------------------------") print("Zyla") print(f"MB/sec: {Zyla.bytesec/1e6:.1f} GB/hour: {Zyla.bytehour/1e9:.0f}") print(f"SSD: ${Zyla.HDDcosthour:.2f}/hour") print(f"{Zyla.hddTB} TB SSD fills in {Zyla.hourstorage:.2f} hours") NeoDMC = Cam(2560 / 4 * 2160 / 4, 30, 8, cost=220) print("\n--------------------------") print("Neo Marshall DMC (4x4 full frame binning)") print(f"MB/sec: {NeoDMC.bytesec/1e6:.1f} GB/hour: {NeoDMC.bytehour/1e9:.0f}") print(f"SSD: ${NeoDMC.HDDcosthour:.2f}/hour") print(f"{NeoDMC.hddTB} TB HDD fills in {NeoDMC.hourstorage:.2f} hours") U897 = Cam(512 * 512, 56, 8, 220) print("\n--------------------------") print("Ultra 897") print("MB/sec: {:.1f} GB/hour: {:.0f}".format(U897.bytesec / 1e6, U897.bytehour / 1e9)) print("HDD: ${:.2f}/hour".format(U897.HDDcosthour)) print("{} TB HDD fills in {:.1f} hours".format(U897.hddTB, U897.hourstorage)) U888 = Cam(1024 * 1024, 26, 8, 220) print("\n--------------------------") print("Ultra 888") print("MB/sec: {:.1f} GB/hour: {:.0f}".format(U888.bytesec / 1e6, U888.bytehour / 1e9)) print("HDD: ${:.2f}/hour".format(U888.HDDcosthour)) print("{} TB HDD fills in {:.1f} hours".format(U888.hddTB, U888.hourstorage)) # %% print( "{} month season {} % retained: {:.1f} TB".format( U888.monthsseason, U888.goodfrac * 100, U888.TBseason ) )
33.768116
90
0.61073
#!/usr/bin/env python """ computes cost of storing camera data """ from __future__ import division class Cam: def __init__(self, npix, fps, hddTB, cost, nbit=16, goodfrac=0.05): self.goodfrac = goodfrac hoursrecday = 8 # avg hours per night cameras on self.monthsseason = 8 # months of year recording dayspermonth = 30 self.hoursperseason = self.monthsseason * dayspermonth * hoursrecday self.npix = npix self.fps = fps self.nbit = nbit self.hddTB = hddTB self.costTB = cost / self.hddTB self.bytesec = self.npix * self.nbit // 8 * self.fps self.bytehour = self.bytesec * 3600 self.HDDcosthour = self.costTB * self.bytehour / 1e12 self.hourstorage = self.hddTB / (self.bytehour / 1e12) self.TBseason = self.hoursperseason * self.bytehour / 1e12 * self.goodfrac # %% print("quantities are for full data rate") Zyla = Cam(2560 * 2160, 100, 4, 1500) print("\n--------------------------") print("Zyla") print(f"MB/sec: {Zyla.bytesec/1e6:.1f} GB/hour: {Zyla.bytehour/1e9:.0f}") print(f"SSD: ${Zyla.HDDcosthour:.2f}/hour") print(f"{Zyla.hddTB} TB SSD fills in {Zyla.hourstorage:.2f} hours") NeoDMC = Cam(2560 / 4 * 2160 / 4, 30, 8, cost=220) print("\n--------------------------") print("Neo Marshall DMC (4x4 full frame binning)") print(f"MB/sec: {NeoDMC.bytesec/1e6:.1f} GB/hour: {NeoDMC.bytehour/1e9:.0f}") print(f"SSD: ${NeoDMC.HDDcosthour:.2f}/hour") print(f"{NeoDMC.hddTB} TB HDD fills in {NeoDMC.hourstorage:.2f} hours") U897 = Cam(512 * 512, 56, 8, 220) print("\n--------------------------") print("Ultra 897") print("MB/sec: {:.1f} GB/hour: {:.0f}".format(U897.bytesec / 1e6, U897.bytehour / 1e9)) print("HDD: ${:.2f}/hour".format(U897.HDDcosthour)) print("{} TB HDD fills in {:.1f} hours".format(U897.hddTB, U897.hourstorage)) U888 = Cam(1024 * 1024, 26, 8, 220) print("\n--------------------------") print("Ultra 888") print("MB/sec: {:.1f} GB/hour: {:.0f}".format(U888.bytesec / 1e6, U888.bytehour / 1e9)) print("HDD: ${:.2f}/hour".format(U888.HDDcosthour)) print("{} TB HDD fills in {:.1f} hours".format(U888.hddTB, U888.hourstorage)) # %% print( "{} month season {} % retained: {:.1f} TB".format( U888.monthsseason, U888.goodfrac * 100, U888.TBseason ) )
756
-11
49
b3c1974126c90a2411a8867c49943ba8ca401093
4,021
py
Python
lifetracker/tracker/migrations/0001_initial.py
KenN7/LifeTracker
6efbe974ddfd5486ad662ed51a69c6d63d4a6379
[ "Apache-2.0" ]
null
null
null
lifetracker/tracker/migrations/0001_initial.py
KenN7/LifeTracker
6efbe974ddfd5486ad662ed51a69c6d63d4a6379
[ "Apache-2.0" ]
null
null
null
lifetracker/tracker/migrations/0001_initial.py
KenN7/LifeTracker
6efbe974ddfd5486ad662ed51a69c6d63d4a6379
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations
32.427419
114
0.495897
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('auth', '0001_initial'), ] operations = [ migrations.CreateModel( name='Events', fields=[ ('id', models.AutoField(verbose_name='ID', auto_created=True, primary_key=True, serialize=False)), ('name', models.CharField(max_length=50)), ('date', models.DateTimeField(auto_now_add=True)), ('desc', models.TextField()), ], options={ }, bases=(models.Model,), ), migrations.CreateModel( name='EventType', fields=[ ('id', models.AutoField(verbose_name='ID', auto_created=True, primary_key=True, serialize=False)), ('name', models.CharField(max_length=20)), ], options={ }, bases=(models.Model,), ), migrations.CreateModel( name='Icon', fields=[ ('id', models.AutoField(verbose_name='ID', auto_created=True, primary_key=True, serialize=False)), ('name', models.CharField(max_length=30)), ('path', models.FilePathField()), ], options={ }, bases=(models.Model,), ), migrations.CreateModel( name='Pad', fields=[ ('id', models.AutoField(verbose_name='ID', auto_created=True, primary_key=True, serialize=False)), ('name', models.CharField(max_length=30)), ], options={ }, bases=(models.Model,), ), migrations.CreateModel( name='Period', fields=[ ('id', models.AutoField(verbose_name='ID', auto_created=True, primary_key=True, serialize=False)), ('frequency', models.IntegerField()), ], options={ }, bases=(models.Model,), ), migrations.CreateModel( name='Todo', fields=[ ('id', models.AutoField(verbose_name='ID', auto_created=True, primary_key=True, serialize=False)), ('name', models.CharField(max_length=50)), ('done', models.BooleanField()), ], options={ }, bases=(models.Model,), ), migrations.AddField( model_name='events', name='eventtype', field=models.ForeignKey(to='tracker.EventType', related_name='events'), preserve_default=True, ), migrations.AddField( model_name='events', name='icon', field=models.ForeignKey(to='tracker.Icon', related_name='events'), preserve_default=True, ), migrations.AddField( model_name='events', name='recurent', field=models.ForeignKey(to='tracker.Period', related_name='events'), preserve_default=True, ), migrations.CreateModel( name='User', fields=[ ], options={ 'proxy': True, }, bases=('auth.user',), ), migrations.AddField( model_name='events', name='author', field=models.ForeignKey(to='tracker.User', related_name='events'), preserve_default=True, ), migrations.AddField( model_name='pad', name='user', field=models.OneToOneField(to='tracker.User'), preserve_default=True, ), migrations.AddField( model_name='todo', name='author', field=models.ForeignKey(to='tracker.User', related_name='todo'), preserve_default=True, ), ]
0
3,891
23
449ef113c35324b9c41c01b08e20a64524134ae8
1,218
py
Python
volume.py
charradighassen/Jarvis
67d31ed73bc52e8edff6534297128ed8ed0d0450
[ "MIT" ]
null
null
null
volume.py
charradighassen/Jarvis
67d31ed73bc52e8edff6534297128ed8ed0d0450
[ "MIT" ]
null
null
null
volume.py
charradighassen/Jarvis
67d31ed73bc52e8edff6534297128ed8ed0d0450
[ "MIT" ]
null
null
null
import alsaaudio import sys m = alsaaudio.Mixer() vol = m.getvolume() if len(sys.argv) == 1 or sys.argv[1] == "g": print "Current volume is " + str(getVolume()) + " percent" if len(sys.argv)>=3: if sys.argv[1] == "i": try: i = int(sys.argv[2]) increase(i) except ValueError: print "Please specify a number after saying increase volume by" elif sys.argv[1] == "d": try: d = int(sys.argv[2]) decrease(d) except: print "Please specify a number after saying decrease volume by" elif sys.argv[1] == "s": try: s = int(sys.argv[2]) setVolume(s) except: print "Please specify a number after saying set volume to"
21.75
67
0.599343
import alsaaudio import sys m = alsaaudio.Mixer() vol = m.getvolume() def getVolume(): global vol return vol[0] def increase(n): global vol if (vol[0] + n)>100: vol[0]= 100 - n m.setvolume(vol[0] + n) vol = m.getvolume() print "Volume increased to " + str(vol[0]) + " percent" def decrease(n): global vol if (vol[0] - n)>100: vol[0]= 100 + n m.setvolume(vol[0] - n) vol = m.getvolume() print "Volume decreased to " + str(vol[0]) + " percent" def setVolume(n): global vol m.setvolume(n) vol = m.getvolume() print "Volume set to " + str(vol[0]) + " percent" if len(sys.argv) == 1 or sys.argv[1] == "g": print "Current volume is " + str(getVolume()) + " percent" if len(sys.argv)>=3: if sys.argv[1] == "i": try: i = int(sys.argv[2]) increase(i) except ValueError: print "Please specify a number after saying increase volume by" elif sys.argv[1] == "d": try: d = int(sys.argv[2]) decrease(d) except: print "Please specify a number after saying decrease volume by" elif sys.argv[1] == "s": try: s = int(sys.argv[2]) setVolume(s) except: print "Please specify a number after saying set volume to"
437
0
100
a7508a40a819238a793b403d52c96ed1cd19c382
3,819
py
Python
vistrails/vistrails_server.py
remram44/VisTrails-mybinder
ee7477b471920d738f3ac430932f01901b56ed44
[ "BSD-3-Clause" ]
83
2015-01-05T14:50:50.000Z
2021-09-17T19:45:26.000Z
vistrails/vistrails_server.py
remram44/VisTrails-mybinder
ee7477b471920d738f3ac430932f01901b56ed44
[ "BSD-3-Clause" ]
254
2015-01-02T20:39:19.000Z
2018-11-28T17:16:44.000Z
vistrails/vistrails_server.py
remram44/VisTrails-mybinder
ee7477b471920d738f3ac430932f01901b56ed44
[ "BSD-3-Clause" ]
40
2015-04-17T16:46:36.000Z
2021-09-28T22:43:24.000Z
#!/usr/bin/env python ############################################################################### ## ## Copyright (C) 2014-2016, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions are met: ## ## - Redistributions of source code must retain the above copyright notice, ## this list of conditions and the following disclaimer. ## - Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## - Neither the name of the New York University nor the names of its ## contributors may be used to endorse or promote products derived from ## this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ## THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; ## OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ## WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR ## OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ## ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ## ############################################################################### """Main file for running VisTrails in server mode""" import os import sys if __name__ == '__main__': fix_paths() # Set locale to English import locale locale.setlocale(locale.LC_ALL, 'C') import vistrails.gui.requirements vistrails.gui.requirements.require_pyqt4_api2() import vistrails.gui.application_server try: optionsDict = { 'interactiveMode': False, 'enablePackagesSilently': False, 'handlerDontAsk': True, } v = vistrails.gui.application_server.start_server(optionsDict, args=sys.argv[1:]) app = vistrails.gui.application_server.VistrailsServer() except SystemExit, e: print str(e) sys.exit(e) except Exception, e: import traceback print "Uncaught exception on initialization: %s" % ( traceback._format_final_exc_line(type(e).__name__, e)) traceback.print_exc() sys.exit(255) v = app.run_server() vistrails.gui.application_server.stop_server() sys.exit(v)
40.2
83
0.658549
#!/usr/bin/env python ############################################################################### ## ## Copyright (C) 2014-2016, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions are met: ## ## - Redistributions of source code must retain the above copyright notice, ## this list of conditions and the following disclaimer. ## - Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## - Neither the name of the New York University nor the names of its ## contributors may be used to endorse or promote products derived from ## this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ## THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; ## OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ## WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR ## OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ## ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ## ############################################################################### """Main file for running VisTrails in server mode""" import os import sys def fix_paths(): import site if not hasattr(site, "USER_BASE"): return # We are running py2app # Fix import path: add parent directory(so that we can # import vistrails.[gui|...] and remove other paths below it (we might have # been started from a subdir) # A better solution is probably to move run.py up a # directory in the repo old_dir = os.path.realpath(os.path.dirname(__file__)) vistrails_dir = os.path.realpath(os.path.join(os.path.dirname(__file__), '..')) i = 0 while i < len(sys.path): rpath = os.path.realpath(sys.path[i]) if rpath.startswith(old_dir): del sys.path[i] else: i += 1 if vistrails_dir not in sys.path: sys.path.insert(0, vistrails_dir) if __name__ == '__main__': fix_paths() # Set locale to English import locale locale.setlocale(locale.LC_ALL, 'C') import vistrails.gui.requirements vistrails.gui.requirements.require_pyqt4_api2() import vistrails.gui.application_server try: optionsDict = { 'interactiveMode': False, 'enablePackagesSilently': False, 'handlerDontAsk': True, } v = vistrails.gui.application_server.start_server(optionsDict, args=sys.argv[1:]) app = vistrails.gui.application_server.VistrailsServer() except SystemExit, e: print str(e) sys.exit(e) except Exception, e: import traceback print "Uncaught exception on initialization: %s" % ( traceback._format_final_exc_line(type(e).__name__, e)) traceback.print_exc() sys.exit(255) v = app.run_server() vistrails.gui.application_server.stop_server() sys.exit(v)
745
0
23
20b1d4b4caa09b867ca3f4d3798679c3d61bcea2
475
py
Python
cah/game/routing.py
alkelaun/cah
9063bf1ece6b0dec359fc26980935b0b10ae9c36
[ "MIT" ]
null
null
null
cah/game/routing.py
alkelaun/cah
9063bf1ece6b0dec359fc26980935b0b10ae9c36
[ "MIT" ]
null
null
null
cah/game/routing.py
alkelaun/cah
9063bf1ece6b0dec359fc26980935b0b10ae9c36
[ "MIT" ]
null
null
null
from channels.routing import ProtocolTypeRouter, URLRouter from channels.auth import AuthMiddlewareStack from django.urls import re_path from . import consumers websocket_urlpatterns = [ re_path(r'ws/game/(?P<room_name>\w+)/$', consumers.ChatConsumer), ] application = ProtocolTypeRouter({ # Empty for now (http->django views is added by default) 'websocket': AuthMiddlewareStack( URLRouter( websocket_urlpatterns ) ), })
22.619048
69
0.705263
from channels.routing import ProtocolTypeRouter, URLRouter from channels.auth import AuthMiddlewareStack from django.urls import re_path from . import consumers websocket_urlpatterns = [ re_path(r'ws/game/(?P<room_name>\w+)/$', consumers.ChatConsumer), ] application = ProtocolTypeRouter({ # Empty for now (http->django views is added by default) 'websocket': AuthMiddlewareStack( URLRouter( websocket_urlpatterns ) ), })
0
0
0
6e054504f0a2b2cda67af60ecb451b8401a99b07
704
py
Python
nltk_api/tests/tag/test_sentence.py
mdgh26/nltk-api
d8269370ecc7e5bdc8803bf95883a625ad3c3074
[ "MIT" ]
4
2017-05-01T20:03:49.000Z
2021-12-24T07:42:14.000Z
nltk_api/tests/tag/test_sentence.py
mdgh26/nltk-api
d8269370ecc7e5bdc8803bf95883a625ad3c3074
[ "MIT" ]
1
2017-08-28T16:04:13.000Z
2017-08-28T16:04:13.000Z
nltk_api/tests/tag/test_sentence.py
mdgh26/nltk-api
d8269370ecc7e5bdc8803bf95883a625ad3c3074
[ "MIT" ]
3
2017-07-09T12:04:57.000Z
2021-02-21T13:34:04.000Z
import unittest from nltk_api.tag.sentence import tag_sentences
39.111111
84
0.681818
import unittest from nltk_api.tag.sentence import tag_sentences class SentenceTaggerTestCase(unittest.TestCase): def testTagWithSymbols(self): test_sentences = ['I walk over him', 'I like to watch'] actual = tag_sentences(test_sentences, True) self.assertTupleEqual(('I', 'PRP'), actual[0][0]) self.assertTupleEqual(('walk', 'VBP'), actual[0][1]) def testTagWithHumanizedSymbols(self): test_sentences = ['I walk over him', 'I like to watch'] actual = tag_sentences(test_sentences, False) self.assertTupleEqual(('I', 'pronoun_personal'), actual[0][0]) self.assertTupleEqual(('walk', 'verb_present_not_3rd_person'), actual[0][1])
535
27
76
008e072ff6d89b1025169cdfa400c36770746268
2,324
py
Python
DjangoTraining/IPLcricket/matches/management/commands/load_data.py
udhayprakash/Django_Projects
5c5257944d36a552428f8b8a926110d64055fc12
[ "Apache-2.0" ]
null
null
null
DjangoTraining/IPLcricket/matches/management/commands/load_data.py
udhayprakash/Django_Projects
5c5257944d36a552428f8b8a926110d64055fc12
[ "Apache-2.0" ]
27
2020-06-05T23:26:44.000Z
2022-02-10T11:21:31.000Z
DjangoTraining/IPLcricket/matches/management/commands/load_data.py
udhayprakash/Django_Projects
5c5257944d36a552428f8b8a926110d64055fc12
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/python """ Purpose: """ from django.core.management.base import BaseCommand import os import csv from IPLcricket import settings from matches.models import MatchesPlayed, Deliveries from datetime import datetime from django.db.utils import DataError import pandas as pd
32.732394
112
0.635972
#!/usr/bin/python """ Purpose: """ from django.core.management.base import BaseCommand import os import csv from IPLcricket import settings from matches.models import MatchesPlayed, Deliveries from datetime import datetime from django.db.utils import DataError import pandas as pd def load_matches(file_name): file_path = os.path.join(settings.DOCS_PATH, file_name) with open(file_path, 'r') as fh: file_content = tuple(csv.DictReader(fh)) print(f'total_records_count :{len(file_content):4}') newly_created_objs = 0 for each_row in file_content: # print(each_row) if each_row['date']: each_row['date'] = datetime.strptime(each_row['date'], '%d-%m-%y') try: # # TO create a new object # obj = MatchesPlayed.objects.create(**each_row) # obj.save() _, is_new_obj = MatchesPlayed.objects.update_or_create(id=each_row.pop('id'), defaults=each_row) if is_new_obj: newly_created_objs += 1 except DataError as ex: print(ex) print(f'newly_created_objs :{newly_created_objs:4}') def load_deliveries(file_name): file_path = os.path.join(settings.DOCS_PATH, file_name) deliveries_df = pd.read_csv(file_path, delimiter=',', skip_blank_lines=True) print(f'total_records_count :{len(deliveries_df):4}') columns = tuple(deliveries_df.columns) newly_created_objs = 0 for _index, each in deliveries_df.iterrows(): each_obj = dict(each.items()) # print(each_obj) try: _, is_new_obj = Deliveries.objects.update_or_create(id=_index+1, defaults=each_obj) if is_new_obj: newly_created_objs += 1 except DataError as ex: print(ex) print(f'newly_created_objs :{newly_created_objs:4}') class Command(BaseCommand): help = 'Create random users' def add_arguments(self, parser): parser.add_argument('file_name', type=str, help='file to load') def handle(self, *args, **kwargs): file_name = kwargs.get('file_name') if file_name == 'matches.csv': load_matches(file_name) elif file_name == 'deliveries.csv': load_deliveries(file_name)
1,878
93
69
0a6fcb880da10a3b5d30d4c0a55aecbedcb4ce85
3,058
py
Python
solumclient/tests/common/test_base.py
rackerlabs/arborlabs_client
bafae3fd164cb0536efcd0b082a8a11714e97163
[ "Apache-2.0" ]
null
null
null
solumclient/tests/common/test_base.py
rackerlabs/arborlabs_client
bafae3fd164cb0536efcd0b082a8a11714e97163
[ "Apache-2.0" ]
null
null
null
solumclient/tests/common/test_base.py
rackerlabs/arborlabs_client
bafae3fd164cb0536efcd0b082a8a11714e97163
[ "Apache-2.0" ]
null
null
null
# Copyright 2013 - Noorul Islam K M # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from solumclient.common import base as solum_base from solumclient.openstack.common.apiclient import base as apiclient_base from solumclient.openstack.common.apiclient import client from solumclient.openstack.common.apiclient import fake_client from solumclient.tests import base as test_base fixture1 = { '/foo_resource': { 'GET': ( {}, {'id': 1, 'name': 'foo'} ), } } fixture2 = { '/foo_resource': { 'GET': ( {}, {'foo_resource': {'id': 1, 'name': 'foo'}} ), } } fixture3 = { '/foo_resources': { 'GET': ( {}, [ {'id': 1, 'name': 'foo'}, {'id': 2, 'name': 'bar'} ] ), } } fixture4 = { '/foo_resources': { 'GET': ( {}, {'foo_resources': [ {'id': 1, 'name': 'foo'}, {'id': 2, 'name': 'bar'} ]} ), } }
26.136752
75
0.628842
# Copyright 2013 - Noorul Islam K M # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from solumclient.common import base as solum_base from solumclient.openstack.common.apiclient import base as apiclient_base from solumclient.openstack.common.apiclient import client from solumclient.openstack.common.apiclient import fake_client from solumclient.tests import base as test_base fixture1 = { '/foo_resource': { 'GET': ( {}, {'id': 1, 'name': 'foo'} ), } } fixture2 = { '/foo_resource': { 'GET': ( {}, {'foo_resource': {'id': 1, 'name': 'foo'}} ), } } fixture3 = { '/foo_resources': { 'GET': ( {}, [ {'id': 1, 'name': 'foo'}, {'id': 2, 'name': 'bar'} ] ), } } fixture4 = { '/foo_resources': { 'GET': ( {}, {'foo_resources': [ {'id': 1, 'name': 'foo'}, {'id': 2, 'name': 'bar'} ]} ), } } class FooResource(apiclient_base.Resource): pass class FooResourceManager(solum_base.BaseManager): resource_class = FooResource def get(self): return self._get("/foo_resource") def get_with_response_key(self): return self._get("/foo_resource", "foo_resource") def list(self): return self._list("/foo_resources") def list_with_response_key(self): return self._list("/foo_resources", "foo_resources") class TestClient(client.BaseClient): service_type = "test" def __init__(self, http_client, extensions=None): super(TestClient, self).__init__( http_client, extensions=extensions) self.foo_resource = FooResourceManager(self) class BaseManagerTest(test_base.TestCase): def test_get(self): http_client = fake_client.FakeHTTPClient(fixtures=fixture1) tc = TestClient(http_client) tc.foo_resource.get() def test_get_with_response_key(self): http_client = fake_client.FakeHTTPClient(fixtures=fixture2) tc = TestClient(http_client) tc.foo_resource.get_with_response_key() def test_list(self): http_client = fake_client.FakeHTTPClient(fixtures=fixture3) tc = TestClient(http_client) tc.foo_resource.list() def test_list_with_response_key(self): http_client = fake_client.FakeHTTPClient(fixtures=fixture4) tc = TestClient(http_client) tc.foo_resource.list_with_response_key()
995
290
200
b504d106a44165bf42202480f7bd66da720a362e
2,532
py
Python
models/lib/positional_encoding.py
Maxi-0902/DRAN
c3dbfcbc018446544150dc4e151442d6a9fcd4d9
[ "MIT" ]
null
null
null
models/lib/positional_encoding.py
Maxi-0902/DRAN
c3dbfcbc018446544150dc4e151442d6a9fcd4d9
[ "MIT" ]
null
null
null
models/lib/positional_encoding.py
Maxi-0902/DRAN
c3dbfcbc018446544150dc4e151442d6a9fcd4d9
[ "MIT" ]
null
null
null
import torch def BoxRelationalEmbedding(f_g, dim_g=64, wave_len=1000, trignometric_embedding=True): """ Given a tensor with bbox coordinates for detected objects on each batch image, this function computes a matrix for each image with entry (i,j) given by a vector representation of the displacement between the coordinates of bbox_i, and bbox_j input: np.array of shape=(batch_size, max_nr_bounding_boxes, 4) output: np.array of shape=(batch_size, max_nr_bounding_boxes, max_nr_bounding_boxes, 64) """ # returns a relational embedding for each pair of bboxes, with dimension = dim_g # follow implementation of https://github.com/heefe92/Relation_Networks-pytorch/blob/master/model.py#L1014-L1055 batch_size = f_g.size(0) x_min, y_min, x_max, y_max = torch.chunk(f_g, 4, dim=-1) cx = (x_min + x_max) * 0.5 cy = (y_min + y_max) * 0.5 w = (x_max - x_min) + 1. h = (y_max - y_min) + 1. # cx.view(1,-1) transposes the vector cx, and so dim(delta_x) = (dim(cx), dim(cx)) delta_x = cx - cx.view(batch_size, 1, -1) delta_x = torch.clamp(torch.abs(delta_x / w), min=1e-3) delta_x = torch.log(delta_x) delta_y = cy - cy.view(batch_size, 1, -1) delta_y = torch.clamp(torch.abs(delta_y / h), min=1e-3) delta_y = torch.log(delta_y) delta_w = torch.log(w / w.view(batch_size, 1, -1)) delta_h = torch.log(h / h.view(batch_size, 1, -1)) matrix_size = delta_h.size() delta_x = delta_x.view(batch_size, matrix_size[1], matrix_size[2], 1) delta_y = delta_y.view(batch_size, matrix_size[1], matrix_size[2], 1) delta_w = delta_w.view(batch_size, matrix_size[1], matrix_size[2], 1) delta_h = delta_h.view(batch_size, matrix_size[1], matrix_size[2], 1) position_mat = torch.cat((delta_x, delta_y, delta_w, delta_h), -1) # bs * r * r *4 if trignometric_embedding == True: feat_range = torch.arange(dim_g / 8).cuda() dim_mat = feat_range / (dim_g / 8) dim_mat = 1. / (torch.pow(wave_len, dim_mat)) dim_mat = dim_mat.view(1, 1, 1, -1) position_mat = position_mat.view(batch_size, matrix_size[1], matrix_size[2], 4, -1) position_mat = 100. * position_mat mul_mat = position_mat * dim_mat mul_mat = mul_mat.view(batch_size, matrix_size[1], matrix_size[2], -1) sin_mat = torch.sin(mul_mat) cos_mat = torch.cos(mul_mat) embedding = torch.cat((sin_mat, cos_mat), -1) else: embedding = position_mat return (embedding)
41.508197
116
0.662717
import torch def BoxRelationalEmbedding(f_g, dim_g=64, wave_len=1000, trignometric_embedding=True): """ Given a tensor with bbox coordinates for detected objects on each batch image, this function computes a matrix for each image with entry (i,j) given by a vector representation of the displacement between the coordinates of bbox_i, and bbox_j input: np.array of shape=(batch_size, max_nr_bounding_boxes, 4) output: np.array of shape=(batch_size, max_nr_bounding_boxes, max_nr_bounding_boxes, 64) """ # returns a relational embedding for each pair of bboxes, with dimension = dim_g # follow implementation of https://github.com/heefe92/Relation_Networks-pytorch/blob/master/model.py#L1014-L1055 batch_size = f_g.size(0) x_min, y_min, x_max, y_max = torch.chunk(f_g, 4, dim=-1) cx = (x_min + x_max) * 0.5 cy = (y_min + y_max) * 0.5 w = (x_max - x_min) + 1. h = (y_max - y_min) + 1. # cx.view(1,-1) transposes the vector cx, and so dim(delta_x) = (dim(cx), dim(cx)) delta_x = cx - cx.view(batch_size, 1, -1) delta_x = torch.clamp(torch.abs(delta_x / w), min=1e-3) delta_x = torch.log(delta_x) delta_y = cy - cy.view(batch_size, 1, -1) delta_y = torch.clamp(torch.abs(delta_y / h), min=1e-3) delta_y = torch.log(delta_y) delta_w = torch.log(w / w.view(batch_size, 1, -1)) delta_h = torch.log(h / h.view(batch_size, 1, -1)) matrix_size = delta_h.size() delta_x = delta_x.view(batch_size, matrix_size[1], matrix_size[2], 1) delta_y = delta_y.view(batch_size, matrix_size[1], matrix_size[2], 1) delta_w = delta_w.view(batch_size, matrix_size[1], matrix_size[2], 1) delta_h = delta_h.view(batch_size, matrix_size[1], matrix_size[2], 1) position_mat = torch.cat((delta_x, delta_y, delta_w, delta_h), -1) # bs * r * r *4 if trignometric_embedding == True: feat_range = torch.arange(dim_g / 8).cuda() dim_mat = feat_range / (dim_g / 8) dim_mat = 1. / (torch.pow(wave_len, dim_mat)) dim_mat = dim_mat.view(1, 1, 1, -1) position_mat = position_mat.view(batch_size, matrix_size[1], matrix_size[2], 4, -1) position_mat = 100. * position_mat mul_mat = position_mat * dim_mat mul_mat = mul_mat.view(batch_size, matrix_size[1], matrix_size[2], -1) sin_mat = torch.sin(mul_mat) cos_mat = torch.cos(mul_mat) embedding = torch.cat((sin_mat, cos_mat), -1) else: embedding = position_mat return (embedding)
0
0
0
df3f47d175b122c0b7bdf9b060ee806d63b3e489
355
py
Python
src/main/python/utils/logging.py
meowpunch/bobsim-research
4411ac6eaf5b760611f689b0a9e290546e2f5435
[ "MIT" ]
2
2020-03-01T17:42:44.000Z
2020-03-09T06:13:34.000Z
src/main/python/utils/logging.py
meowpunch/bobsim-research
4411ac6eaf5b760611f689b0a9e290546e2f5435
[ "MIT" ]
2
2020-04-01T16:48:06.000Z
2020-04-04T11:04:10.000Z
src/main/python/utils/logging.py
meowpunch/bobsim-research
4411ac6eaf5b760611f689b0a9e290546e2f5435
[ "MIT" ]
null
null
null
import yaml import logging import logging.config from utils.executable import get_destination
23.666667
56
0.757746
import yaml import logging import logging.config from utils.executable import get_destination def init_logger(name='__main__'): config_path = 'config/logging.yaml' with open(get_destination(config_path)) as file: config = yaml.load(file, Loader=yaml.FullLoader) logging.config.dictConfig(config) return logging.getLogger(name)
236
0
23
60f34830065311493487a436bb967817a75d6ce5
24
py
Python
emailusernames/__init__.py
hansg60/django-email-as-username
f2eb6aee4711287c041cdeedc04c63fda47ea827
[ "Unlicense" ]
null
null
null
emailusernames/__init__.py
hansg60/django-email-as-username
f2eb6aee4711287c041cdeedc04c63fda47ea827
[ "Unlicense" ]
null
null
null
emailusernames/__init__.py
hansg60/django-email-as-username
f2eb6aee4711287c041cdeedc04c63fda47ea827
[ "Unlicense" ]
1
2021-08-31T20:58:46.000Z
2021-08-31T20:58:46.000Z
__version__ = '1.7.1.2'
12
23
0.625
__version__ = '1.7.1.2'
0
0
0
29323dee51c3196a2ff45b480f287b18705c4183
3,131
py
Python
Fig6_replay/replay_nodndinh/plot_spike_2comp_nopos.py
TatsuyaHaga/preplaymodel_codes
548df9ef5f85358fb03ed5f7f4cdc9e03a04bbf3
[ "MIT" ]
1
2019-02-26T04:15:16.000Z
2019-02-26T04:15:16.000Z
Fig6_replay/replay_nodndinh/plot_spike_2comp_nopos.py
TatsuyaHaga/preplaymodel_codes
548df9ef5f85358fb03ed5f7f4cdc9e03a04bbf3
[ "MIT" ]
null
null
null
Fig6_replay/replay_nodndinh/plot_spike_2comp_nopos.py
TatsuyaHaga/preplaymodel_codes
548df9ef5f85358fb03ed5f7f4cdc9e03a04bbf3
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 import sys import numpy #import matplotlib #matplotlib.use("SVG") import pylab pylab.rcParams["font.size"]=8 pylab.rcParams["legend.fontsize"]=8 #pylab.rcParams["lines.linewidth"]=1 #pylab.rcParams["axes.linewidth"]=2 #pylab.rcParams["axes.labelsize"]="large" #pylab.rcParams["axes.labelweight"]="bold" pylab.rcParams["xtick.major.size"]=0 pylab.rcParams["xtick.minor.size"]=0 pylab.rcParams["ytick.major.size"]=0 pylab.rcParams["ytick.minor.size"]=0 #pylab.rcParams["xtick.direction"]="out" #pylab.rcParams["ytick.direction"]="out" #pylab.rcParams["figure.figsize"]=(3, 3) #activity colormap="hot" #"jet", "bwr" spikeEsom=numpy.loadtxt("spike_som.csv", delimiter=",") spikeEdnd=numpy.loadtxt("spike_dnd.csv", delimiter=",") inhinput=numpy.loadtxt("inhinput_dnd.csv", delimiter=",") som_max=0.16 som_min=0.0 dnd_max=1.0 dnd_min=0.0 time=spikeEsom[:,0] pylab.clf() pylab.figure(figsize=(6,3)) pylab.subplot2grid([4,1],[0,0], rowspan=2) pylab.imshow(spikeEsom[:, 1:].T, aspect="auto", interpolation="none", cmap=colormap, extent=[spikeEsom[0,0], spikeEsom[-1,0], len(spikeEsom[0,1:]), 1], vmax=som_max, vmin=som_min) #limit=numpy.max(numpy.abs(xE[:,1:])) #pylab.clim([-limit, limit]) #pylab.colorbar() pylab.xticks([]) #pylab.xlabel("time [s]") pylab.ylabel("neuron #") pylab.subplot2grid([4,1],[2,0], rowspan=2) pylab.imshow(spikeEdnd[:, 1:].T, aspect="auto", interpolation="none", cmap=colormap, extent=[spikeEdnd[0,0], spikeEdnd[-1,0], len(spikeEdnd[0,1:]), 1], vmax=dnd_max, vmin=dnd_min) #limit=numpy.max(numpy.abs(xE[:,1:])) #pylab.clim([-limit, limit]) #pylab.colorbar() pylab.xlabel("time [s]") pylab.ylabel("neuron #") pylab.tight_layout() pylab.savefig("spike.pdf") #part part_len=10*100 part_num=int(len(spikeEsom[:,0])//part_len) for i in range(part_num): pylab.clf() pylab.figure(figsize=(3.5,3)) pylab.subplot(3,1,1) pylab.imshow(spikeEsom[i*part_len:(i+1)*part_len, 1:].T, aspect="auto", interpolation="none", cmap=colormap, extent=[spikeEsom[i*part_len,0], spikeEsom[(i+1)*part_len-1,0], len(spikeEsom[0,1:]), 1], vmax=som_max, vmin=som_min) pylab.colorbar() pylab.xticks([]) pylab.yticks([1, len(spikeEsom[0,1:])]) #pylab.xlabel("time [s]") pylab.ylabel("CA3 firing rate") pylab.subplot(3,1,2) pylab.imshow(spikeEdnd[i*part_len:(i+1)*part_len, 1:].T, aspect="auto", interpolation="none", cmap=colormap, extent=[spikeEdnd[i*part_len,0], spikeEdnd[(i+1)*part_len-1,0], len(spikeEdnd[0,1:]), 1], vmax=dnd_max, vmin=dnd_min) pylab.colorbar() pylab.xticks([]) pylab.yticks([1, len(spikeEsom[0,1:])]) #pylab.xlabel("time [s]") pylab.ylabel("dendritic\nactivity") pylab.subplot(3,1,3) pylab.imshow(inhinput[i*part_len:(i+1)*part_len, 1:].T, aspect="auto", interpolation="none", cmap=colormap, extent=[inhinput[i*part_len,0], inhinput[(i+1)*part_len-1,0], len(inhinput[0,1:]), 1], vmin=0.0) pylab.colorbar() pylab.yticks([1, len(spikeEsom[0,1:])]) pylab.xlabel("time [s]") pylab.ylabel("inhibitory inputs\nto dendrites") pylab.tight_layout() pylab.savefig("spike_part"+str(i)+".pdf")
34.788889
230
0.687001
#!/usr/bin/env python3 import sys import numpy #import matplotlib #matplotlib.use("SVG") import pylab pylab.rcParams["font.size"]=8 pylab.rcParams["legend.fontsize"]=8 #pylab.rcParams["lines.linewidth"]=1 #pylab.rcParams["axes.linewidth"]=2 #pylab.rcParams["axes.labelsize"]="large" #pylab.rcParams["axes.labelweight"]="bold" pylab.rcParams["xtick.major.size"]=0 pylab.rcParams["xtick.minor.size"]=0 pylab.rcParams["ytick.major.size"]=0 pylab.rcParams["ytick.minor.size"]=0 #pylab.rcParams["xtick.direction"]="out" #pylab.rcParams["ytick.direction"]="out" #pylab.rcParams["figure.figsize"]=(3, 3) #activity colormap="hot" #"jet", "bwr" spikeEsom=numpy.loadtxt("spike_som.csv", delimiter=",") spikeEdnd=numpy.loadtxt("spike_dnd.csv", delimiter=",") inhinput=numpy.loadtxt("inhinput_dnd.csv", delimiter=",") som_max=0.16 som_min=0.0 dnd_max=1.0 dnd_min=0.0 time=spikeEsom[:,0] pylab.clf() pylab.figure(figsize=(6,3)) pylab.subplot2grid([4,1],[0,0], rowspan=2) pylab.imshow(spikeEsom[:, 1:].T, aspect="auto", interpolation="none", cmap=colormap, extent=[spikeEsom[0,0], spikeEsom[-1,0], len(spikeEsom[0,1:]), 1], vmax=som_max, vmin=som_min) #limit=numpy.max(numpy.abs(xE[:,1:])) #pylab.clim([-limit, limit]) #pylab.colorbar() pylab.xticks([]) #pylab.xlabel("time [s]") pylab.ylabel("neuron #") pylab.subplot2grid([4,1],[2,0], rowspan=2) pylab.imshow(spikeEdnd[:, 1:].T, aspect="auto", interpolation="none", cmap=colormap, extent=[spikeEdnd[0,0], spikeEdnd[-1,0], len(spikeEdnd[0,1:]), 1], vmax=dnd_max, vmin=dnd_min) #limit=numpy.max(numpy.abs(xE[:,1:])) #pylab.clim([-limit, limit]) #pylab.colorbar() pylab.xlabel("time [s]") pylab.ylabel("neuron #") pylab.tight_layout() pylab.savefig("spike.pdf") #part part_len=10*100 part_num=int(len(spikeEsom[:,0])//part_len) for i in range(part_num): pylab.clf() pylab.figure(figsize=(3.5,3)) pylab.subplot(3,1,1) pylab.imshow(spikeEsom[i*part_len:(i+1)*part_len, 1:].T, aspect="auto", interpolation="none", cmap=colormap, extent=[spikeEsom[i*part_len,0], spikeEsom[(i+1)*part_len-1,0], len(spikeEsom[0,1:]), 1], vmax=som_max, vmin=som_min) pylab.colorbar() pylab.xticks([]) pylab.yticks([1, len(spikeEsom[0,1:])]) #pylab.xlabel("time [s]") pylab.ylabel("CA3 firing rate") pylab.subplot(3,1,2) pylab.imshow(spikeEdnd[i*part_len:(i+1)*part_len, 1:].T, aspect="auto", interpolation="none", cmap=colormap, extent=[spikeEdnd[i*part_len,0], spikeEdnd[(i+1)*part_len-1,0], len(spikeEdnd[0,1:]), 1], vmax=dnd_max, vmin=dnd_min) pylab.colorbar() pylab.xticks([]) pylab.yticks([1, len(spikeEsom[0,1:])]) #pylab.xlabel("time [s]") pylab.ylabel("dendritic\nactivity") pylab.subplot(3,1,3) pylab.imshow(inhinput[i*part_len:(i+1)*part_len, 1:].T, aspect="auto", interpolation="none", cmap=colormap, extent=[inhinput[i*part_len,0], inhinput[(i+1)*part_len-1,0], len(inhinput[0,1:]), 1], vmin=0.0) pylab.colorbar() pylab.yticks([1, len(spikeEsom[0,1:])]) pylab.xlabel("time [s]") pylab.ylabel("inhibitory inputs\nto dendrites") pylab.tight_layout() pylab.savefig("spike_part"+str(i)+".pdf")
0
0
0
ef01352693ca865bbc445a10090d3af46ba13137
158
py
Python
04/01/instance_method/replace.py
pylangstudy/201709
53d868786d7327a83bfa7f4149549c6f9855a6c6
[ "CC0-1.0" ]
null
null
null
04/01/instance_method/replace.py
pylangstudy/201709
53d868786d7327a83bfa7f4149549c6f9855a6c6
[ "CC0-1.0" ]
32
2017-09-01T00:52:17.000Z
2017-10-01T00:30:02.000Z
04/01/instance_method/replace.py
pylangstudy/201709
53d868786d7327a83bfa7f4149549c6f9855a6c6
[ "CC0-1.0" ]
null
null
null
import datetime now = datetime.datetime.now() print(now) print(now.replace(1999, 12, 31)) print(now) # インスタンスの操作ではなく、新しいインスタンスを返すらしい。インスタンスメソッドなのに。これはわかりづらい。
22.571429
56
0.791139
import datetime now = datetime.datetime.now() print(now) print(now.replace(1999, 12, 31)) print(now) # インスタンスの操作ではなく、新しいインスタンスを返すらしい。インスタンスメソッドなのに。これはわかりづらい。
0
0
0
a59c1ec4875830401a38c2564d02d4e60051d5da
2,211
py
Python
Stanford/03_DivideAndConquerModel/3B_StrassensSubcubicMatrixMultiplication/strassens_algorithm.py
jeffvswanson/DataStructuresAndAlgorithms
82605a1dea4e52480f006956645e812fe2cb02dc
[ "MIT" ]
4
2019-07-10T21:51:03.000Z
2020-04-01T01:52:53.000Z
Stanford/03_DivideAndConquerModel/3B_StrassensSubcubicMatrixMultiplication/strassens_algorithm.py
jeffvswanson/DataStructuresAndAlgorithms
82605a1dea4e52480f006956645e812fe2cb02dc
[ "MIT" ]
null
null
null
Stanford/03_DivideAndConquerModel/3B_StrassensSubcubicMatrixMultiplication/strassens_algorithm.py
jeffvswanson/DataStructuresAndAlgorithms
82605a1dea4e52480f006956645e812fe2cb02dc
[ "MIT" ]
null
null
null
# strassens_algorithm.py # A demonstration of Strassen's subcubic runtime matrix multiplication # algorithm on square matrices using the divide and conquer model. import numpy as np if __name__ == "__main__": main()
33
78
0.584803
# strassens_algorithm.py # A demonstration of Strassen's subcubic runtime matrix multiplication # algorithm on square matrices using the divide and conquer model. import numpy as np def main(): m1 = np.array([[1,2],[3,4]]) m2 = np.array([[5,6],[7,8]]) print("The first square matrix is: ") print(m1) print("The second square matrix is: ") print(m2) output_matrix = strassens_algorithm(m1, m2) expected_matrix = np.matmul(m1, m2) print("When taking the dot product of m1 and m2 we expected an \ output matrix of:") print(expected_matrix) print("Using Strassen's subcubic runtime matrix multiplication \ algorithm we got:") print(output_matrix) def strassens_algorithm(m1, m2): # Base case: A matrix of shape 1x1 is solved by default if np.shape(m1) == (1, 1): return np.asscalar(m1 * m2) # Pre-calculate the n/2 value. We'll be using it a lot and it's the same # for matrix 1 and matrix 2 since they have equivalent square dimensions. n_over_2 = len(m1)//2 # Divide # Create submatrix blocks from quadrants of m1 # |A B| # |C D| A = m1[0:n_over_2, 0:n_over_2] B = m1[0:n_over_2, n_over_2:] C = m1[n_over_2:, 0:n_over_2] D = m1[n_over_2:, n_over_2:] # Create submatrix blocks from quadrants of m2 # |E F| # |G H| E = m2[0:n_over_2, 0:n_over_2] F = m2[0:n_over_2, n_over_2:] G = m2[n_over_2:, 0:n_over_2] H = m2[n_over_2:, n_over_2:] # Conquer # Calculate the 7 products: (elements matrix 1) * (elements matrix 2) p1 = strassens_algorithm(A, F-H) # p1 = A * (F - H) p2 = strassens_algorithm(A+B, H) # p2 = (A + B) * H p3 = strassens_algorithm(C+D, E) # p3 = (C + D) * E p4 = strassens_algorithm(D, G-E) # p4 = D * (G - E) p5 = strassens_algorithm(A+D, E+H) # p5 = (A + D) * (E + H) p6 = strassens_algorithm(B-D, G+H) # p6 = (B - D) * (G + H) p7 = strassens_algorithm(A-C, E+F) # p7 = (A - C) * (E + F) # Combine return np.array([[p5+p4-p2+p6, p1+p2],[p3+p4, p1+p5-p3-p7]]) if __name__ == "__main__": main()
1,930
0
50
72a02a8fd07d6c0e1acbb4c91959a9aa9aab7811
4,487
py
Python
webserver/webserver.py
JonasTrampe/hucon
9cf9fa995292649a097ca8b3d09c4bed9568ae0d
[ "BSD-3-Clause" ]
null
null
null
webserver/webserver.py
JonasTrampe/hucon
9cf9fa995292649a097ca8b3d09c4bed9568ae0d
[ "BSD-3-Clause" ]
2
2021-08-18T16:21:08.000Z
2021-10-05T16:36:33.000Z
webserver/webserver.py
JonasTrampe/hucon
9cf9fa995292649a097ca8b3d09c4bed9568ae0d
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/python """ webserver.py - Flask based web server to handle all legal requests. Copyright (C) 2019 Basler AG All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ import http def set_led(red, green, blue): """ Use the hucon eye driver to set the eye color. """ try: from hucon import Eye Eye(1, Eye.RGB).set_color(red, green, blue) Eye(2, Eye.RGB).set_color(red, green, blue) Eye(3, Eye.RGB).set_color(red, green, blue) Eye(4, Eye.RGB).set_color(red, green, blue) except Exception as ex: print(ex) # Set the led eyes to yellow at the beginning set_led(249, 166, 2) import argparse import logging import threading import time try: import httplib except: import http.client as httplib from flask import Flask from flask import request from flask import render_template from flask_socketio import SocketIO from HuConJsonRpc import HuConJsonRpc json_rpc = HuConJsonRpc() COLLECT_STATIC_ROOT = "/opt/hucon/webserver/static" COLLECT_STORAGE = 'flask_collect.storage.file' app = Flask(json_rpc._SERVER_NAME) app.config["SECRET_KEY"] = "SECRET_KEY" socketio = SocketIO(app, logger=True)#, async_mode='eventlet' @app.context_processor def detect_browser_language(): """ Returns the current user browser language. """ supported_browser_languages = ["en", "de"] lang = request.accept_languages.best_match(supported_browser_languages) if lang == None: lang = 'en' return dict(browser_language=lang) @app.route('/') @app.route('/index.html') def index(): """ Returns index page """ return render_template('index.html') @app.route('/blockly.html') def blockly(): """ Returns blockly programming page """ return render_template('blockly.html') @app.route('/editor.html') def editor(): """ Returns python editor page """ return render_template('editor.html') @app.route('/mobile.html') def mobile(): """ Returns mobile page """ return render_template('mobile.html') @app.route('/settings.html') def settings(): """ Returns settings page """ return render_template('settings.html') @app.route('/remote_control.html') def remote_control(): """ Returns remote control page """ return render_template('remote_control.html') @app.route('/API', methods=['GET', 'POST']) def api(): """ Returns api page or handle the request on POST """ if request.method == 'POST': data = request.get_json(force=True) if not data: return ('Bad Request.', 400) return json_rpc.handle_control(data) return render_template('api.html') @app.before_first_request def before_first_request(): """ Set the eyes to green and after a while to off. This will gibe the user teh ability to see that the service is running. """ set_led(0, 255, 0) time.sleep(2) set_led(0, 0, 0) def check_service(): """ Check if the page is running. """ not_started = True while not_started: time.sleep(10) try: conn = http.client.HTTPConnection('localhost', json_rpc._LISTENING_PORT, timeout=5) conn.request('GET', '/') res = conn.getresponse() if res.status == 200: not_started = False except Exception as ex: print(ex) if __name__ == '__main__': """ Create the Server and listen on each incoming request. """ parser = argparse.ArgumentParser(description='Start the %s web server.' % json_rpc._SERVER_NAME) parser.add_argument('--debug', dest='debug', action='store_true', help='Print more debug messages on the console during running.') args = parser.parse_args() if not args.debug: # Reduce the log messages. log = logging.getLogger('werkzeug') log.setLevel(logging.ERROR) # Run a thread to check the flask service. # thread = threading.Thread(target=check_service) # thread.start() socketio.start_background_task(target=check_service) socketio.run(app, host='0.0.0.0', port=json_rpc._LISTENING_PORT, debug=args.debug)
26.394118
101
0.628037
#!/usr/bin/python """ webserver.py - Flask based web server to handle all legal requests. Copyright (C) 2019 Basler AG All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ import http def set_led(red, green, blue): """ Use the hucon eye driver to set the eye color. """ try: from hucon import Eye Eye(1, Eye.RGB).set_color(red, green, blue) Eye(2, Eye.RGB).set_color(red, green, blue) Eye(3, Eye.RGB).set_color(red, green, blue) Eye(4, Eye.RGB).set_color(red, green, blue) except Exception as ex: print(ex) # Set the led eyes to yellow at the beginning set_led(249, 166, 2) import argparse import logging import threading import time try: import httplib except: import http.client as httplib from flask import Flask from flask import request from flask import render_template from flask_socketio import SocketIO from HuConJsonRpc import HuConJsonRpc json_rpc = HuConJsonRpc() COLLECT_STATIC_ROOT = "/opt/hucon/webserver/static" COLLECT_STORAGE = 'flask_collect.storage.file' app = Flask(json_rpc._SERVER_NAME) app.config["SECRET_KEY"] = "SECRET_KEY" socketio = SocketIO(app, logger=True)#, async_mode='eventlet' @app.context_processor def detect_browser_language(): """ Returns the current user browser language. """ supported_browser_languages = ["en", "de"] lang = request.accept_languages.best_match(supported_browser_languages) if lang == None: lang = 'en' return dict(browser_language=lang) @app.route('/') @app.route('/index.html') def index(): """ Returns index page """ return render_template('index.html') @app.route('/blockly.html') def blockly(): """ Returns blockly programming page """ return render_template('blockly.html') @app.route('/editor.html') def editor(): """ Returns python editor page """ return render_template('editor.html') @app.route('/mobile.html') def mobile(): """ Returns mobile page """ return render_template('mobile.html') @app.route('/settings.html') def settings(): """ Returns settings page """ return render_template('settings.html') @app.route('/remote_control.html') def remote_control(): """ Returns remote control page """ return render_template('remote_control.html') @app.route('/API', methods=['GET', 'POST']) def api(): """ Returns api page or handle the request on POST """ if request.method == 'POST': data = request.get_json(force=True) if not data: return ('Bad Request.', 400) return json_rpc.handle_control(data) return render_template('api.html') @app.before_first_request def before_first_request(): """ Set the eyes to green and after a while to off. This will gibe the user teh ability to see that the service is running. """ set_led(0, 255, 0) time.sleep(2) set_led(0, 0, 0) def check_service(): """ Check if the page is running. """ not_started = True while not_started: time.sleep(10) try: conn = http.client.HTTPConnection('localhost', json_rpc._LISTENING_PORT, timeout=5) conn.request('GET', '/') res = conn.getresponse() if res.status == 200: not_started = False except Exception as ex: print(ex) if __name__ == '__main__': """ Create the Server and listen on each incoming request. """ parser = argparse.ArgumentParser(description='Start the %s web server.' % json_rpc._SERVER_NAME) parser.add_argument('--debug', dest='debug', action='store_true', help='Print more debug messages on the console during running.') args = parser.parse_args() if not args.debug: # Reduce the log messages. log = logging.getLogger('werkzeug') log.setLevel(logging.ERROR) # Run a thread to check the flask service. # thread = threading.Thread(target=check_service) # thread.start() socketio.start_background_task(target=check_service) socketio.run(app, host='0.0.0.0', port=json_rpc._LISTENING_PORT, debug=args.debug)
0
0
0
5e8a6de69ef5a7c05a1abbab887105db3084040b
2,434
py
Python
cellxgene_gateway/env.py
fidelram/cellxgene-gateway
11bbc1aba8509b02865c145be78b021b70e22fda
[ "Apache-2.0" ]
null
null
null
cellxgene_gateway/env.py
fidelram/cellxgene-gateway
11bbc1aba8509b02865c145be78b021b70e22fda
[ "Apache-2.0" ]
null
null
null
cellxgene_gateway/env.py
fidelram/cellxgene-gateway
11bbc1aba8509b02865c145be78b021b70e22fda
[ "Apache-2.0" ]
null
null
null
# Copyright 2019 Novartis Institutes for BioMedical Research Inc. Licensed # under the Apache License, Version 2.0 (the "License"); you may not use # this file except in compliance with the License. You may obtain a copy # of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless # required by applicable law or agreed to in writing, software distributed # under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES # OR CONDITIONS OF ANY KIND, either express or implied. See the License for # the specific language governing permissions and limitations under the License. import os import logging import socket cellxgene_location = os.environ.get("CELLXGENE_LOCATION") cellxgene_data = os.environ.get("CELLXGENE_DATA") gateway_port = int(os.environ.get("GATEWAY_PORT", "5005")) external_host = os.environ.get("EXTERNAL_HOST", os.environ.get("GATEWAY_HOST", f"localhost:{gateway_port}")) external_protocol = os.environ.get("EXTERNAL_PROTOCOL", os.environ.get("GATEWAY_PROTOCOL", "http")) ip = os.environ.get("GATEWAY_IP") extra_scripts = os.environ.get("GATEWAY_EXTRA_SCRIPTS") ttl = os.environ.get("GATEWAY_TTL") enable_upload = os.environ.get("GATEWAY_ENABLE_UPLOAD", "").lower() in ['true', '1'] enable_annotations = os.environ.get("GATEWAY_ENABLE_ANNOTATIONS", "").lower() in ['true', '1'] env_vars = { "CELLXGENE_LOCATION": cellxgene_location, "CELLXGENE_DATA": cellxgene_data, "GATEWAY_IP": ip, } optional_env_vars = { "EXTERNAL_HOST": external_host, "EXTERNAL_PROTOCOL": external_protocol, "GATEWAY_PORT": gateway_port, "GATEWAY_EXTRA_SCRIPTS": extra_scripts, "GATEWAY_TTL": ttl, "GATEWAY_ENABLE_UPLOAD": enable_upload, "GATEWAY_ENABLE_ANNOTATIONS": enable_annotations, }
39.901639
108
0.733361
# Copyright 2019 Novartis Institutes for BioMedical Research Inc. Licensed # under the Apache License, Version 2.0 (the "License"); you may not use # this file except in compliance with the License. You may obtain a copy # of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless # required by applicable law or agreed to in writing, software distributed # under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES # OR CONDITIONS OF ANY KIND, either express or implied. See the License for # the specific language governing permissions and limitations under the License. import os import logging import socket cellxgene_location = os.environ.get("CELLXGENE_LOCATION") cellxgene_data = os.environ.get("CELLXGENE_DATA") gateway_port = int(os.environ.get("GATEWAY_PORT", "5005")) external_host = os.environ.get("EXTERNAL_HOST", os.environ.get("GATEWAY_HOST", f"localhost:{gateway_port}")) external_protocol = os.environ.get("EXTERNAL_PROTOCOL", os.environ.get("GATEWAY_PROTOCOL", "http")) ip = os.environ.get("GATEWAY_IP") extra_scripts = os.environ.get("GATEWAY_EXTRA_SCRIPTS") ttl = os.environ.get("GATEWAY_TTL") enable_upload = os.environ.get("GATEWAY_ENABLE_UPLOAD", "").lower() in ['true', '1'] enable_annotations = os.environ.get("GATEWAY_ENABLE_ANNOTATIONS", "").lower() in ['true', '1'] env_vars = { "CELLXGENE_LOCATION": cellxgene_location, "CELLXGENE_DATA": cellxgene_data, "GATEWAY_IP": ip, } optional_env_vars = { "EXTERNAL_HOST": external_host, "EXTERNAL_PROTOCOL": external_protocol, "GATEWAY_PORT": gateway_port, "GATEWAY_EXTRA_SCRIPTS": extra_scripts, "GATEWAY_TTL": ttl, "GATEWAY_ENABLE_UPLOAD": enable_upload, "GATEWAY_ENABLE_ANNOTATIONS": enable_annotations, } def validate(): if not all(env_vars.values()): raise ValueError( f""" Please ensure that environment variables are set correctly. The ones with None below are missing and need to be set. {env_vars} Set them at the terminal before running the gateway. An example is: export CELLXGENE_LOCATION=~/anaconda/envs/cellxgene-dev/bin/cellxgene export CELLXGENE_DATA=../cellxgene_data export GATEWAY_IP=127.0.0.1 """ ) else: logging.getLogger("cellxgene_gateway").info(f"Got required env: {env_vars}", ) logging.getLogger("cellxgene_gateway").info(f"Got optional env: {optional_env_vars}")
662
0
23
7e46c6fbe1c4893ffaf4d0a700a444ef316e8539
11,024
py
Python
hikyuu/flat/Spot.py
scanfyu/hikyuu
55265de4d8d4773391f2dcd1211acec9fe901f53
[ "MIT" ]
null
null
null
hikyuu/flat/Spot.py
scanfyu/hikyuu
55265de4d8d4773391f2dcd1211acec9fe901f53
[ "MIT" ]
null
null
null
hikyuu/flat/Spot.py
scanfyu/hikyuu
55265de4d8d4773391f2dcd1211acec9fe901f53
[ "MIT" ]
null
null
null
# automatically generated by the FlatBuffers compiler, do not modify # namespace: flat import flatbuffers from flatbuffers.compat import import_numpy np = import_numpy()
29.319149
99
0.661466
# automatically generated by the FlatBuffers compiler, do not modify # namespace: flat import flatbuffers from flatbuffers.compat import import_numpy np = import_numpy() class Spot(object): __slots__ = ['_tab'] @classmethod def GetRootAsSpot(cls, buf, offset): n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) x = Spot() x.Init(buf, n + offset) return x # Spot def Init(self, buf, pos): self._tab = flatbuffers.table.Table(buf, pos) # Spot def Market(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) if o != 0: return self._tab.String(o + self._tab.Pos) return None # Spot def Code(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) if o != 0: return self._tab.String(o + self._tab.Pos) return None # Spot def Name(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) if o != 0: return self._tab.String(o + self._tab.Pos) return None # Spot def Datetime(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) if o != 0: return self._tab.String(o + self._tab.Pos) return None # Spot def YesterdayClose(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def Open(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def High(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def Low(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def Close(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def Amount(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def Volumn(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def Bid1(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(26)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def Bid1Amount(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(28)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def Bid2(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(30)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def Bid2Amount(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(32)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def Bid3(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(34)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def Bid3Amount(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(36)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def Bid4(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(38)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def Bid4Amount(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(40)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def Bid5(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(42)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def Bid5Amount(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(44)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def Ask1(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(46)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def Ask1Amount(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(48)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def Ask2(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(50)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def Ask2Amount(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(52)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def Ask3(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(54)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def Ask3Amount(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(56)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def Ask4(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(58)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def Ask4Amount(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(60)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def Ask5(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(62)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 # Spot def Ask5Amount(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(64)) if o != 0: return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 def SpotStart(builder): builder.StartObject(31) def SpotAddMarket(builder, market): builder.PrependUOffsetTRelativeSlot( 0, flatbuffers.number_types.UOffsetTFlags.py_type(market), 0 ) def SpotAddCode(builder, code): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(code), 0) def SpotAddName(builder, name): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) def SpotAddDatetime(builder, datetime): builder.PrependUOffsetTRelativeSlot( 3, flatbuffers.number_types.UOffsetTFlags.py_type(datetime), 0 ) def SpotAddYesterdayClose(builder, yesterdayClose): builder.PrependFloat32Slot(4, yesterdayClose, 0.0) def SpotAddOpen(builder, open): builder.PrependFloat32Slot(5, open, 0.0) def SpotAddHigh(builder, high): builder.PrependFloat32Slot(6, high, 0.0) def SpotAddLow(builder, low): builder.PrependFloat32Slot(7, low, 0.0) def SpotAddClose(builder, close): builder.PrependFloat32Slot(8, close, 0.0) def SpotAddAmount(builder, amount): builder.PrependFloat32Slot(9, amount, 0.0) def SpotAddVolumn(builder, volumn): builder.PrependFloat32Slot(10, volumn, 0.0) def SpotAddBid1(builder, bid1): builder.PrependFloat32Slot(11, bid1, 0.0) def SpotAddBid1Amount(builder, bid1Amount): builder.PrependFloat32Slot(12, bid1Amount, 0.0) def SpotAddBid2(builder, bid2): builder.PrependFloat32Slot(13, bid2, 0.0) def SpotAddBid2Amount(builder, bid2Amount): builder.PrependFloat32Slot(14, bid2Amount, 0.0) def SpotAddBid3(builder, bid3): builder.PrependFloat32Slot(15, bid3, 0.0) def SpotAddBid3Amount(builder, bid3Amount): builder.PrependFloat32Slot(16, bid3Amount, 0.0) def SpotAddBid4(builder, bid4): builder.PrependFloat32Slot(17, bid4, 0.0) def SpotAddBid4Amount(builder, bid4Amount): builder.PrependFloat32Slot(18, bid4Amount, 0.0) def SpotAddBid5(builder, bid5): builder.PrependFloat32Slot(19, bid5, 0.0) def SpotAddBid5Amount(builder, bid5Amount): builder.PrependFloat32Slot(20, bid5Amount, 0.0) def SpotAddAsk1(builder, ask1): builder.PrependFloat32Slot(21, ask1, 0.0) def SpotAddAsk1Amount(builder, ask1Amount): builder.PrependFloat32Slot(22, ask1Amount, 0.0) def SpotAddAsk2(builder, ask2): builder.PrependFloat32Slot(23, ask2, 0.0) def SpotAddAsk2Amount(builder, ask2Amount): builder.PrependFloat32Slot(24, ask2Amount, 0.0) def SpotAddAsk3(builder, ask3): builder.PrependFloat32Slot(25, ask3, 0.0) def SpotAddAsk3Amount(builder, ask3Amount): builder.PrependFloat32Slot(26, ask3Amount, 0.0) def SpotAddAsk4(builder, ask4): builder.PrependFloat32Slot(27, ask4, 0.0) def SpotAddAsk4Amount(builder, ask4Amount): builder.PrependFloat32Slot(28, ask4Amount, 0.0) def SpotAddAsk5(builder, ask5): builder.PrependFloat32Slot(29, ask5, 0.0) def SpotAddAsk5Amount(builder, ask5Amount): builder.PrependFloat32Slot(30, ask5Amount, 0.0) def SpotEnd(builder): return builder.EndObject()
8,753
1,283
782
4e97ea72605e36622f8478966b97d91ba2f46471
7,178
py
Python
app.py
mbeckem/blabber
2c149f9e92ad3aee861c5d54a630606a860fb402
[ "MIT" ]
null
null
null
app.py
mbeckem/blabber
2c149f9e92ad3aee861c5d54a630606a860fb402
[ "MIT" ]
null
null
null
app.py
mbeckem/blabber
2c149f9e92ad3aee861c5d54a630606a860fb402
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 import aiohttp import asyncio import concurrent import datetime import jinja2 import logging import os # This is our native database module import blabber_database from aiohttp import web logger = logging.getLogger(__name__) DEV = True ROOT_DIRECTORY = os.path.dirname(os.path.realpath(__file__)) DATABASE_PATH = "./blabber.db" # File path of our database file DATABASE_CACHE_SIZE = (10 * 2**20) // 4096; # Memory cache size (unit is blocks of 4 KiB) # Called from html templates # Run the database operations in a worker thread so we don't block other network I/O. # The database does not support multithreading right now, so more than one worker would be useless. # We only allow a maximum number of pending operations in case our database is too slow # to handle the incoming requests (they would queue up without bounds otherwise). # Returns path to the index page. # Returns the path to the page for the post with the given id. # Returns the path to the submit-post endpoint. # Returns the path to the submit-comment endpoint. if __name__ == "__main__": main()
34.344498
107
0.624547
#!/usr/bin/env python3 import aiohttp import asyncio import concurrent import datetime import jinja2 import logging import os # This is our native database module import blabber_database from aiohttp import web logger = logging.getLogger(__name__) DEV = True ROOT_DIRECTORY = os.path.dirname(os.path.realpath(__file__)) DATABASE_PATH = "./blabber.db" # File path of our database file DATABASE_CACHE_SIZE = (10 * 2**20) // 4096; # Memory cache size (unit is blocks of 4 KiB) # Called from html templates def format_datetime(timestamp): dt = datetime.datetime.fromtimestamp(timestamp, datetime.timezone.utc) local = dt.astimezone(tz = None) return str(local) # TODO def newline_to_br(value): result = str(jinja2.escape(value)).replace("\n", "<br>\n"); return jinja2.Markup(result) class BlabberHandlers: def __init__(self, app): self._app = app self._loop = asyncio.get_event_loop() # Jinja settings self._jinjaenv = jinja2.Environment( autoescape = True, trim_blocks = True, lstrip_blocks = True, auto_reload = True if DEV else False, loader = jinja2.FileSystemLoader(os.path.join(ROOT_DIRECTORY, "templates"))) self._jinjaenv.filters["datetime"] = format_datetime self._jinjaenv.filters["newline_to_br"] = newline_to_br self._jinjaenv.globals.update(index_location = self._index_location, post_location = self._post_location, submit_post_location = self._submit_post_location, submit_comment_location = self._submit_comment_location) # Database state self._dbexec = concurrent.futures.ThreadPoolExecutor(max_workers = 1) self._dbpending = 0 # Run the database operations in a worker thread so we don't block other network I/O. # The database does not support multithreading right now, so more than one worker would be useless. # We only allow a maximum number of pending operations in case our database is too slow # to handle the incoming requests (they would queue up without bounds otherwise). async def _dbop(self, op): if self._dbpending > 1000: raise RuntimeError("Too many pending db queries.") self._dbpending += 1 try: return await self._loop.run_in_executor(self._dbexec, op) finally: self._dbpending -= 1 def _render_html(self, tmpl_name, **context): template = self._jinjaenv.get_template(tmpl_name) html = template.render(**context) return web.Response( status = 200, content_type = "text/html", text = html ) # Returns path to the index page. def _index_location(self): return self._app.router["index"].url_for() # Returns the path to the page for the post with the given id. def _post_location(self, post_id): return self._app.router["show_post"].url_for(post_id = str(post_id)) # Returns the path to the submit-post endpoint. def _submit_post_location(self): return self._app.router["submit_post"].url_for() # Returns the path to the submit-comment endpoint. def _submit_comment_location(self, post_id): return self._app.router["submit_comment"].url_for(post_id = str(post_id)) async def _show_index_impl(self, request, existing_form): db = request.app["db"] frontpage = await self._dbop(lambda: db.fetch_frontpage(max_posts = 100)) form = dict() return self._render_html("index.html", frontpage = frontpage, form = existing_form) async def _show_post_impl(self, request, post_id, existing_form): db = request.app["db"] post = await self._dbop(lambda: db.fetch_post(post_id = post_id, max_comments = 100)) if post is None: raise web.HTTPNotFound() return self._render_html("post.html", post = post, form = existing_form) async def index(self, request): return await self._show_index_impl(request, None) async def show_post(self, request): post_id = int(request.match_info["post_id"]) return await self._show_post_impl(request, post_id, None) async def submit_post(self, request): db = request.app["db"] data = await request.post() form_errors = [] user = data["user"].strip() if user == "": form_errors.append("Please enter a non-empty user name.") title = data["title"].strip() if title == "": form_errors.append("Please enter a non-empty post title.") content = data["content"].strip() if content == "": form_errors.append("Please enter a non-empty post content.") if form_errors: form = { "errors": form_errors, "user": user, "title": title, "content": content } return await self._show_index_impl(request, form) post_id = await self._dbop(lambda: db.create_post(user = user, title = title, content = content)) raise web.HTTPFound(self._post_location(post_id)) async def submit_comment(self, request): db = request.app["db"] data = await request.post() form_errors = [] post_id = int(request.match_info["post_id"]) user = data["user"].strip() if user == "": form_errors.append("Please enter a non-empty user name.") content = data["content"].strip() if content == "": form_errors.append("Please enter a non-empty comment.") if form_errors: form = { "errors": form_errors, "user": user, "content": content, } return await self._show_post_impl(request, post_id, form) ok = await self._dbop(lambda: db.create_comment(post_id = post_id, user = user, content = content)) if not ok: raise web.HTTPNotFound() raise web.HTTPFound(self._post_location(post_id)) async def dump(self, request): db = request.app["db"] data = await self._dbop(lambda: db.dump()) return web.Response(text = data) def main(): async def run_database(app): app["db"] = blabber_database.Database(DATABASE_PATH, DATABASE_CACHE_SIZE) yield app["db"].finish() app = web.Application() app.cleanup_ctx.append(run_database) blabber = BlabberHandlers(app) app.add_routes([ web.get("/", blabber.index, name = "index"), web.post("/post", blabber.submit_post, name = "submit_post"), web.get("/post/{post_id:\d+}", blabber.show_post, name = "show_post"), web.post("/post/{post_id:\d+}/comment", blabber.submit_comment, name = "submit_comment"), web.get("/dump", blabber.dump, name = "dump"), ]) app.router.add_static("/static", path = os.path.join(ROOT_DIRECTORY, "static"), name = "static") web.run_app(app) if __name__ == "__main__": main()
5,559
1
463
6118e584cc90198222e3b048eb0bb3e2154ebfc6
26,107
py
Python
Pyscripts/GoogleEE/GEE02_LandsatMovie.py
ArdenB/fireflies
cff2d6292c30fc49f0d1564b135c5c4abd75fdc8
[ "MIT" ]
null
null
null
Pyscripts/GoogleEE/GEE02_LandsatMovie.py
ArdenB/fireflies
cff2d6292c30fc49f0d1564b135c5c4abd75fdc8
[ "MIT" ]
null
null
null
Pyscripts/GoogleEE/GEE02_LandsatMovie.py
ArdenB/fireflies
cff2d6292c30fc49f0d1564b135c5c4abd75fdc8
[ "MIT" ]
null
null
null
""" Script goal, Test out the google earth engine to see what i can do - find a landsat collection for a single point """ #============================================================================== __title__ = "GEE Movie Maker" __author__ = "Arden Burrell" __version__ = "v1.0(04.04.2019)" __email__ = "arden.burrell@gmail.com" #============================================================================== # +++++ Check the paths and set ex path to fireflies folder +++++ import os import sys if not os.getcwd().endswith("fireflies"): if "fireflies" in os.getcwd(): p1, p2, _ = os.getcwd().partition("fireflies") os.chdir(p1+p2) else: raise OSError( "This script was called from an unknown path. CWD can not be set" ) sys.path.append(os.getcwd()) #============================================================================== # Import packages import numpy as np import pandas as pd import geopandas as gpd import argparse import datetime as dt import warnings as warn import xarray as xr import bottleneck as bn import scipy as sp import glob import time from collections import OrderedDict from scipy import stats from numba import jit # Import the Earth Engine Python Package import ee import ee.mapclient from ee import batch from geetools import batch as gee_batch # from netCDF4 import Dataset, num2date, date2num # from scipy import stats # import statsmodels.stats.multitest as smsM # Import plotting and colorpackages import matplotlib.pyplot as plt import matplotlib.colors as mpc import matplotlib as mpl import palettable import fiona fiona.drvsupport.supported_drivers['kml'] = 'rw' # enable KML support which is disabled by default fiona.drvsupport.supported_drivers['KML'] = 'rw' # enable KML support which is disabled by default # import seaborn as sns # import cartopy.crs as ccrs # import cartopy.feature as cpf # from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER import geopy.distance as geodis import myfunctions.corefunctions as cf # # Import debugging packages # import socket # print(socket.gethostname()) import ipdb print("numpy version : ", np.__version__) print("pandas version : ", pd.__version__) print("xarray version : ", xr.__version__) #============================================================================== #============================================================================== def GEE_geotifexp(coords, spath, program, fails = None): """ function takes in coordinate infomation and begins the save out processs """ try: geom = ee.Geometry.Polygon([ [coords.lonr_min[0],coords.latr_min[0]], [coords.lonr_max[0],coords.latr_min[0]], [coords.lonr_max[0],coords.latr_max[0]], [coords.lonr_min[0],coords.latr_max[0]]]) except: geom = ee.Geometry.Polygon([ [coords.lonr_min,coords.latr_min], [coords.lonr_max,coords.latr_min], [coords.lonr_max,coords.latr_max], [coords.lonr_min,coords.latr_max]]) # ========== Rename the LS8 bands to match landsat archive ========== # ========== Define the image collection ========== # bandlist = ['B4','B3', 'B2', 'B1'] # ========== setup and reverse the bandlists ========== bandlist = ['B', 'G', 'R', 'NIR', 'SWIR1', 'SWIR2', 'pixel_qa'] bandlist.reverse() # program = "sentinal" if program == "LANDSAT": dschoice = "SR"# dsinfom = "LANDSAT_5_7_8" dsbands = "SNRGB" # dschoice = "TOA" ls8c = "LANDSAT/LC08/C01/T1_%s" % dschoice L5coll = ee.ImageCollection( "LANDSAT/LT05/C01/T1_%s" % dschoice).filter( ee.Filter.lt('CLOUD_COVER',15)).map( renamebandsETM).filterBounds(geom).select(bandlist) L7coll = ee.ImageCollection( 'LANDSAT/LE07/C01/T1_%s' % dschoice).filter( ee.Filter.lt('CLOUD_COVER',15)).map( renamebandsETM).filterBounds(geom).map(LS7fix).select(bandlist) L8coll = ee.ImageCollection( ls8c).filter( ee.Filter.lt('CLOUD_COVER', 15)).map( renamebands).filterBounds(geom).select(bandlist) collection = ee.ImageCollection(L5coll.merge(L7coll.merge(L8coll))).sort('system:time_start', True) else: ipdb.set_trace() sys.exit() # ========== Fetch the dates ========== info = [] for elem in collection.getInfo()["features"]: utime = elem["properties"]['system:time_start'] sat = elem["properties"]["SATELLITE"] try: if sat =='LANDSAT_7': uid = elem["properties"]['system:index'] else: uid = elem["properties"]['LANDSAT_ID'] except KeyError: ipdb.set_trace() info.append({"satellite":sat, "time":utime, "unid":uid }) # ========== convert dates to pandas dataframe ========== df = pd.DataFrame(info) df["date"] = pd.to_datetime(df["time"], unit='ms', origin='unix') # df.to_csv("%s%s/%s_%s_%s_timeinfo.csv" % (spath, coords["name"], dsinfom, coords["name"], dsbands)) # coords.to_csv("%s%s/%s_%s_gridinfo.csv" % (spath, coords["name"], program, coords["name"])) # sys.exit() # gee_batch.imagecollection.toDrive( # collection, # "FIREFLIES_geotifs" , # namePattern='%s_%s_%s_%s_{system_date}_{id}' % (dsbands, dsinfom, coords["name"], dsbands), # region=geom, # crs = "EPSG:4326", # fileFormat='GeoTIFF' # ) print("Starting to create GeoTIFF's for %s at:" % coords["name"], pd.Timestamp.now()) print("Attempting manual creation") # ========== Convert the collection into a selection of images img_list = collection.toList(collection.size()) for nx, info in df.iterrows(): # ========== Built to allow for scripts to be redone ========== if not fails is None: if not nx in fails: continue # ========== convert the datatype ========== img = ee.Image(img_list.get(nx)).toFloat() # ========== Create the name and path ========== name = '%s_%s_%s_%04d' % (dsinfom, coords["name"], dsbands, nx) folder = "FIREFLIES_geotifs" string = "\r Sending image %d of %d to the cloud for processing" % (nx, df.index.max()) sys.stdout.write(string) sys.stdout.flush() # ========== Send the task to the cloud ========== try: task = ee.batch.Export.image.toDrive( image=img, description=name, folder=folder, crs = "EPSG:4326", region=( [coords.lonr_min[0],coords.latr_min[0]], [coords.lonr_max[0],coords.latr_min[0]], [coords.lonr_max[0],coords.latr_max[0]], [coords.lonr_min[0],coords.latr_max[0]]), scale=30, fileFormat='GeoTIFF') except: task = ee.batch.Export.image.toDrive( image=img, description=name, folder=folder, crs = "EPSG:4326", region=( [coords.lonr_min,coords.latr_min], [coords.lonr_max,coords.latr_min], [coords.lonr_max,coords.latr_max], [coords.lonr_min,coords.latr_max]), scale=30, fileFormat='GeoTIFF') try: process = batch.Task.start(task) except Exception as er: sle = 0 print(str(er)) warn.warn("Hit a task limit, sleeping for an hour to let tasks complete") while sle < 61: sle += 1 string = "\r Starting sleep number %d at %s" % (sle, str(pd.Timestamp.now())) sys.stdout.write(string) sys.stdout.flush() time.sleep(60) process = batch.Task.start(task) # sys.exit() # ========== Code for old video export ========== oldvideo = False if oldvideo: # This is the way to use the google earth engine to make videos, i've # left the code here in case i need it again in the future ## Convert bands to output video if dschoice == "TOA": outputVideo = collection.map(convertBit) else: outputVideo = collection.map(convertBitV2) if len(bandlist)> 3: outputVideo = outputVideo.select(['B3', 'B2', 'B1']) testfirst = False if testfirst: task_config = { # 'description': 'imageToDriveTestExample', 'scale': 30, 'region': geom, "crs" : "EPSG:4326", "fileFormat":'GeoTIFF' } task = batch.Export.image.toDrive(outputVideo.first(), "testimage", task_config) task.start() # Export video to Google Drive print("Starting to create video for %s at:" % coords["name"], pd.Timestamp.now()) out = batch.Export.video.toDrive( outputVideo, description='%s_%s_%s' % (dsinfom, coords["name"], dsbands), folder = "/GEE_VIDEO_EXPORTS", framesPerSecond = 1, #dimensions = 1080, region=( [coords.lonr_min[0],coords.latr_min[0]], [coords.lonr_max[0],coords.latr_min[0]], [coords.lonr_max[0],coords.latr_max[0]], [coords.lonr_min[0],coords.latr_max[0]]), crs = "EPSG:4326", maxFrames=10000) process = batch.Task.start(out) print("Process sent to cloud") if fails is None: # ========== Save out the relevant infomation ========== df.to_csv("%s%s/%s_%s_%s_timeinfo.csv" % (spath, coords["name"], dsinfom, coords["name"], dsbands)) coords.to_csv("%s%s/%s_%s_gridinfo.csv" % (spath, coords["name"], program, coords["name"])) # ========== Going to sleep to give GEE a rest before i slam it with new requests ========== print("\n Starting 20 minutes of sleep at", pd.Timestamp.now(), "\n") sle = 0 while sle < 20: sle += 1 string = "\r Starting sleep number %d at %s" % (sle, str(pd.Timestamp.now())) sys.stdout.write(string) sys.stdout.flush() time.sleep(60) #============================================================================== #============================================================================== #============================================================================== ## Make 8 bit data def geom_builder(site = "Burn2015 UP"): """ function to make the geometery """ # ========== Load the site data ========== pointfn = "./data/field/Points.kml" pointdt = gpd.read_file(pointfn, driver="kml") sitenm = [] latit = [] longi = [] year = [] # ========== Loop over the names 2019 ========== for nm in pointdt.Name: if nm in ["Burn2015 UP", "GROUP BOX2 TRANS1-6"]: sitenm.append(nm) latit.append(pointdt[pointdt.Name == nm].geometry.y.values[0]) longi.append(pointdt[pointdt.Name == nm].geometry.x.values[0]) year.append(2019) elif "GROUP BOX" in nm: pass elif nm[-2:] == '-0': sitenm.append(nm) latit.append(pointdt[pointdt.Name == nm].geometry.y.values[0]) longi.append(pointdt[pointdt.Name == nm].geometry.x.values[0]) year.append(2019) # ========== add 2018 ========== fd18 = pd.read_csv("./data/field/2018data/siteDescriptions18.csv") fd18.sort_values(by=["site number"],inplace=True) for nx, row in fd18.iterrows(): sitenm.append("Site%02d" % row["site number"]) latit.append(row.lat) longi.append(row.lon) year.append(2018) # ========== add 2017 ========== fd17 = pd.read_csv("./data/field/2017data/siteDescriptions17.csv") fd17.sort_values(by=["site number"],inplace=True) for nx, row in fd17.iterrows(): stnm = "Site%02d" % row["site number"] if not stnm in sitenm: sitenm.append(stnm) latit.append(row.strtY) longi.append(row.strtX) year.append(2017) # ========== Check the distance ========== # def distance_check(p1, p2): # pass STdf = pd.DataFrame({"siteds":sitenm, "lat":latit , "lon":longi , "year":year}) STdf["Skip"] = 0 STdf["SkipSite"] = "" for nx, row in STdf.iterrows(): if STdf["Skip"][nx] > 0: # THis location has laready been skipped continue else: dist = np.array([geodis.distance((row.lat, row.lon), (lat, lon)).km for lat, lon in zip(STdf.lat[nx+1:].values, STdf.lon[nx+1:].values)]) STdf["Skip"][nx+1:] += (dist<1).astype(int) close = [easy(inp, row.siteds) for inp in (dist<1)] STdf["SkipSite"][nx+1:] = STdf["SkipSite"][nx+1:].values + close # ipdb.set_trace() df = STdf[STdf.Skip == 0].reset_index(drop=True) def _sitemaker(site, sampleset, ds, dsn, sitinfoLS, lat, lon): """ wrapper to pull out site info as needed """ # ========== Pull out the location of a point ========== # lon = pointdt[pointdt.Name == site].geometry.x.values # lat = pointdt[pointdt.Name == site].geometry.y.values # ========== Check if the site has already been built ========== if dsn == "COPERN": # The site has not been built yet # ========== set the key params ========== boxs = 5 # number of grid cells considered ident = "r" # The indertifing code of the dataset # ========== Create a container ========== coords = OrderedDict() # ========== Get values ready to export ========== if site == "Burn2015 UP": coords["name"] = "TestBurn" elif site == "GROUP BOX2 TRANS1-6": coords["name"] = "G2T1-6" else: coords["name"] = site coords["set"] = sampleset coords["lon"] = lon coords["lat"] = lat # ========== Build the empty parts of the Ordered dic ========== for va_nm in ["r", "b_COP", "b_MOD"]: for ll in ["lon", "lat"]: for mm in ["max", "min"]: coords["%s%s_%s" % (ll, va_nm, mm)] = 0 else: if dsn == "MODIS": boxs = 3 # number of grid cells considered ident = "b_MOD" # The indertifing code of the dataset elif dsn == "COPERN_BA": boxs = 5 # number of grid cells considered ident = "b_COP" # The indertifing code of the dataset coords = sitinfoLS[site] gr_bx = ds_gr.sel({"latitude":lat, "longitude":lon}, method="nearest") # ========== Work out the edges of the grid box ========== latstep = abs(np.unique(np.round(np.diff(ds_gr.latitude.values), decimals=9)))/2.0 lonstep = abs(np.unique(np.round(np.diff(ds_gr.longitude.values), decimals=9)))/2.0 if boxs == 3: coords["lon%s_max" % ident] = float((gr_bx.longitude.values + (lonstep*2)) + lonstep) coords["lon%s_min" % ident] = float((gr_bx.longitude.values - (lonstep*2)) - lonstep) coords["lat%s_max" % ident] = float((gr_bx.latitude.values + (latstep*2)) + latstep) coords["lat%s_min" % ident] = float((gr_bx.latitude.values - (latstep*2)) - latstep) # ipdb.set_trace() elif boxs == 5: coords["lon%s_max" % ident] = float((gr_bx.longitude.values + 2*(lonstep*2)) + lonstep) coords["lon%s_min" % ident] = float((gr_bx.longitude.values - 2*(lonstep*2)) - lonstep) coords["lat%s_max" % ident] = float((gr_bx.latitude.values + 2*(latstep*2)) + latstep) coords["lat%s_min" % ident] = float((gr_bx.latitude.values - 2*(latstep*2)) - latstep) sitinfoLS[site] = coords return sitinfoLS #coords # ========== setup an ordered dict of the names ========== sitinfoLS = OrderedDict() local_data = datasets() for dsn in ["COPERN", "COPERN_BA", "MODIS"]: print(dsn) ldsi = local_data[dsn] # ========== load in the grid data ========== if os.path.isfile(ldsi["fname"]): ds_gr = xr.open_dataset( ldsi["fname"], chunks=ldsi["chunks"])[ldsi["var"]].rename(ldsi["rename"]).isel(time=0) else: ipdb.set_trace() # for nm in sitenm: for nx, row in df.iterrows(): sitinfoLS = _sitemaker(row.siteds, row.year, ds_gr, dsn, sitinfoLS, row.lat, row.lon) # ========== Close the dataset ========== ds_gr = None # ipdb.set_trace() return pd.DataFrame(sitinfoLS).transpose()[sitinfoLS["Burn2015 UP"].keys()] def Field_data(year = 2018): """ # Aim of this function is to look at the field data a bit To start it just opens the file and returns the lats and longs i can then use these to look up netcdf fils """ # ========== Load in the relevant data ========== if year == 2018: fd18 = pd.read_csv("./data/field/2018data/siteDescriptions18.csv") else: fd18 = pd.read_csv("./data/field/2018data/siteDescriptions17.csv") fd18.sort_values(by=["site number"],inplace=True) # ========== Create and Ordered Dict for important info ========== info = OrderedDict() info["sn"] = fd18["site number"] try: info["lat"] = fd18.lat info["lon"] = fd18.lon info["RF"] = fd18.rcrtmnt except AttributeError: info["lat"] = fd18.strtY info["lon"] = fd18.strtX info["RF"] = fd18.recruitment # ========== function to return nan when a value is missing ========== # info[den] = [_missingvalfix( # fcut[fcut.sn == sn][den].values) for sn in info['sn']] # info["RF17"] = [_missingvalfix( # fcut[fcut.sn == sn]["RF2017"].values) for sn in info['sn']] info["fireyear"] = [_fireyear(fyv) for fyv in fd18["estimated fire year"].values] # ========== Convert to dataframe and replace codes ========== RFinfo = pd.DataFrame(info).set_index("sn") return RFinfo def string_format(string, replacement): """ Format a string using variables (as str.format) """ s = ee.String(string) repl = ee.Dictionary(replacement) keys = repl.keys() values = repl.values().map(lambda v: ee.Algorithms.String(v)) z = keys.zip(values) newstr = z.iterate(wrap, s) return ee.String(newstr) def convertDataType(newtype): """ Convert an image to the specified data type :param newtype: the data type. One of 'float', 'int', 'byte', 'double', 'Uint8','int8','Uint16', 'int16', 'Uint32','int32' :type newtype: str :return: a function to map over a collection :rtype: function """ return wrap #============================================================================== if __name__ == '__main__': # ========== Set the args Description ========== description='Script to make movies' parser = argparse.ArgumentParser(description=description) # ========== Add additional arguments ========== parser.add_argument( "-s", "--site", type=str, default=None, help="Site to work with ") # parser.add_argument( # "--gparts", type=int, default=None, # help="the max partnumber that has not been redone") parser.add_argument( "-f", "--force", action="store_true", help="the max partnumber that has not been redone") args = parser.parse_args() # ========== Call the main function ========== main(args) else: warn.warn("called from another script") # ========== Set the args Description ========== description='Script to make movies' parser = argparse.ArgumentParser(description=description) # ========== Add additional arguments ========== parser.add_argument( "-s", "--site", type=str, default=None, help="Site to work with ") # parser.add_argument( # "-x", "--cordforce", action="store_true", # help="just produce the cordinates without sending things to google earth engine") parser.add_argument( "-f", "--force", action="store_true", help="the max partnumber that has not been redone") args = parser.parse_args() # ========== Call the main function ========== main(args)
32.63375
140
0.616693
""" Script goal, Test out the google earth engine to see what i can do - find a landsat collection for a single point """ #============================================================================== __title__ = "GEE Movie Maker" __author__ = "Arden Burrell" __version__ = "v1.0(04.04.2019)" __email__ = "arden.burrell@gmail.com" #============================================================================== # +++++ Check the paths and set ex path to fireflies folder +++++ import os import sys if not os.getcwd().endswith("fireflies"): if "fireflies" in os.getcwd(): p1, p2, _ = os.getcwd().partition("fireflies") os.chdir(p1+p2) else: raise OSError( "This script was called from an unknown path. CWD can not be set" ) sys.path.append(os.getcwd()) #============================================================================== # Import packages import numpy as np import pandas as pd import geopandas as gpd import argparse import datetime as dt import warnings as warn import xarray as xr import bottleneck as bn import scipy as sp import glob import time from collections import OrderedDict from scipy import stats from numba import jit # Import the Earth Engine Python Package import ee import ee.mapclient from ee import batch from geetools import batch as gee_batch # from netCDF4 import Dataset, num2date, date2num # from scipy import stats # import statsmodels.stats.multitest as smsM # Import plotting and colorpackages import matplotlib.pyplot as plt import matplotlib.colors as mpc import matplotlib as mpl import palettable import fiona fiona.drvsupport.supported_drivers['kml'] = 'rw' # enable KML support which is disabled by default fiona.drvsupport.supported_drivers['KML'] = 'rw' # enable KML support which is disabled by default # import seaborn as sns # import cartopy.crs as ccrs # import cartopy.feature as cpf # from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER import geopy.distance as geodis import myfunctions.corefunctions as cf # # Import debugging packages # import socket # print(socket.gethostname()) import ipdb print("numpy version : ", np.__version__) print("pandas version : ", pd.__version__) print("xarray version : ", xr.__version__) #============================================================================== def main(args): # ========== Initialize the Earth Engine object ========== ee.Initialize() # ========== Set an overwrite ========= force = False cordf = True #force the creation of a new maskter coord list tsite = args.site cordg = True # ========== Create the system specific paths ========== sysname = os.uname()[1] if sysname == 'DESKTOP-CSHARFM': # LAPTOP spath = "/mnt/c/Users/arden/Google Drive/UoL/FIREFLIES/VideoExports/" elif sysname == "owner": spath = "/mnt/c/Users/user/Google Drive/UoL/FIREFLIES/VideoExports/" elif sysname == "ubuntu": # Work PC spath = "/media/ubuntu/Seagate Backup Plus Drive/Data51/VideoExports/" else: warn.warn("Paths not created for this computer") # spath = "/media/ubuntu/Seagate Backup Plus Drive" ipdb.set_trace() cf.pymkdir(spath) # ========== create the geometery ========== cordname = "./data/other/GEE_sitelist.csv" if not os.path.isfile(cordname) or cordf: print("Generating and saving a new master coord table") site_coords = geom_builder() for col in site_coords.columns[1:]: site_coords = site_coords.astype({col:float}) site_coords.to_csv(cordname) else: print("Loading master coord table") site_coords = pd.read_csv(cordname, index_col=0)#, parse_dates=True # warn.warn("THere is some form of bug here, going interactive. Look at the dataframe") # ipdb.set_trace() program = "LANDSAT" cordf = True # ========== Loop over each site ========== for index, coords in site_coords.iterrows(): # ========== Check if the pathe and file exists ========== checkfile = "%s%s/%s_%s_gridinfo.csv" % (spath, coords["name"], program, coords["name"]) if not args.site is None: # check is the site is correct if tsite == coords["name"]: # ========== Get the start time ========== t0 = pd.Timestamp.now() if os.path.isfile("%s%s/raw/failed_geotifs.npy" % (spath, tsite)): fails = np.load("%s%s/raw/failed_geotifs.npy" % (spath, tsite)) # Export the geotifs GEE_geotifexp(coords, spath, program, fails=fails) td = pd.Timestamp.now() - t0 print("\n Data for %s sent sent for cloud processing. it took " % coords["name"], td) else: # ========== Get the start time ========== t0 = pd.Timestamp.now() # Export the geotifs GEE_geotifexp(coords, spath, program) td = pd.Timestamp.now() - t0 print("\n Data for %s sent sent for cloud processing. it took " % coords["name"], td) elif cordg: print("Building a new cords file for %s" % coords["name"]) ipdb.set_trace() coords.to_csv("%s%s/%s_%s_gridinfo.csv" % (spath, coords["name"], program, coords["name"]), header=True) elif os.path.isfile(checkfile) and not force: print("Data has already been exported for %s" % coords["name"]) if cordf: coords.to_csv("%s%s/%s_%s_gridinfo.csv" % (spath, coords["name"], program, coords["name"]), header=True) else: # ipdb.set_trace() # sys.exit() # ========== Get the start time ========== t0 = pd.Timestamp.now() # make the dir cf.pymkdir(spath+coords["name"]) # Export the geotifs GEE_geotifexp(coords, spath, program) td = pd.Timestamp.now() - t0 print("\n Data for %s sent sent for cloud processing. it took " % coords["name"], td) if tsite is None: ipdb.set_trace() sys.exit() #============================================================================== def GEE_geotifexp(coords, spath, program, fails = None): """ function takes in coordinate infomation and begins the save out processs """ try: geom = ee.Geometry.Polygon([ [coords.lonr_min[0],coords.latr_min[0]], [coords.lonr_max[0],coords.latr_min[0]], [coords.lonr_max[0],coords.latr_max[0]], [coords.lonr_min[0],coords.latr_max[0]]]) except: geom = ee.Geometry.Polygon([ [coords.lonr_min,coords.latr_min], [coords.lonr_max,coords.latr_min], [coords.lonr_max,coords.latr_max], [coords.lonr_min,coords.latr_max]]) # ========== Rename the LS8 bands to match landsat archive ========== def renamebandsETM(image): # Landsat 4-7 bands = ['B1', 'B2', 'B3', 'B4', 'B5', 'B7', 'pixel_qa'] new_bands = ['B', 'G', 'R', 'NIR', 'SWIR1', 'SWIR2', 'pixel_qa'] return image.select(bands).rename(new_bands) def renamebands(image): # Landsat 8 bands = ['B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'pixel_qa'] new_bands = ['B', 'G', 'R', 'NIR', 'SWIR1', 'SWIR2', 'pixel_qa'] return image.select(bands).rename(new_bands) def LS7fix(image): filled1a = image.focal_mean(1, 'square', 'pixels', 2) # ipdb.set_trace() return filled1a.blend(image).set( 'system:time_start', image.get('system:time_start')).set( "SATELLITE", image.get("SATELLITE")) # ========== Define the image collection ========== # bandlist = ['B4','B3', 'B2', 'B1'] # ========== setup and reverse the bandlists ========== bandlist = ['B', 'G', 'R', 'NIR', 'SWIR1', 'SWIR2', 'pixel_qa'] bandlist.reverse() # program = "sentinal" if program == "LANDSAT": dschoice = "SR"# dsinfom = "LANDSAT_5_7_8" dsbands = "SNRGB" # dschoice = "TOA" ls8c = "LANDSAT/LC08/C01/T1_%s" % dschoice L5coll = ee.ImageCollection( "LANDSAT/LT05/C01/T1_%s" % dschoice).filter( ee.Filter.lt('CLOUD_COVER',15)).map( renamebandsETM).filterBounds(geom).select(bandlist) L7coll = ee.ImageCollection( 'LANDSAT/LE07/C01/T1_%s' % dschoice).filter( ee.Filter.lt('CLOUD_COVER',15)).map( renamebandsETM).filterBounds(geom).map(LS7fix).select(bandlist) L8coll = ee.ImageCollection( ls8c).filter( ee.Filter.lt('CLOUD_COVER', 15)).map( renamebands).filterBounds(geom).select(bandlist) collection = ee.ImageCollection(L5coll.merge(L7coll.merge(L8coll))).sort('system:time_start', True) else: ipdb.set_trace() sys.exit() # ========== Fetch the dates ========== info = [] for elem in collection.getInfo()["features"]: utime = elem["properties"]['system:time_start'] sat = elem["properties"]["SATELLITE"] try: if sat =='LANDSAT_7': uid = elem["properties"]['system:index'] else: uid = elem["properties"]['LANDSAT_ID'] except KeyError: ipdb.set_trace() info.append({"satellite":sat, "time":utime, "unid":uid }) # ========== convert dates to pandas dataframe ========== df = pd.DataFrame(info) df["date"] = pd.to_datetime(df["time"], unit='ms', origin='unix') # df.to_csv("%s%s/%s_%s_%s_timeinfo.csv" % (spath, coords["name"], dsinfom, coords["name"], dsbands)) # coords.to_csv("%s%s/%s_%s_gridinfo.csv" % (spath, coords["name"], program, coords["name"])) # sys.exit() # gee_batch.imagecollection.toDrive( # collection, # "FIREFLIES_geotifs" , # namePattern='%s_%s_%s_%s_{system_date}_{id}' % (dsbands, dsinfom, coords["name"], dsbands), # region=geom, # crs = "EPSG:4326", # fileFormat='GeoTIFF' # ) print("Starting to create GeoTIFF's for %s at:" % coords["name"], pd.Timestamp.now()) print("Attempting manual creation") # ========== Convert the collection into a selection of images img_list = collection.toList(collection.size()) for nx, info in df.iterrows(): # ========== Built to allow for scripts to be redone ========== if not fails is None: if not nx in fails: continue # ========== convert the datatype ========== img = ee.Image(img_list.get(nx)).toFloat() # ========== Create the name and path ========== name = '%s_%s_%s_%04d' % (dsinfom, coords["name"], dsbands, nx) folder = "FIREFLIES_geotifs" string = "\r Sending image %d of %d to the cloud for processing" % (nx, df.index.max()) sys.stdout.write(string) sys.stdout.flush() # ========== Send the task to the cloud ========== try: task = ee.batch.Export.image.toDrive( image=img, description=name, folder=folder, crs = "EPSG:4326", region=( [coords.lonr_min[0],coords.latr_min[0]], [coords.lonr_max[0],coords.latr_min[0]], [coords.lonr_max[0],coords.latr_max[0]], [coords.lonr_min[0],coords.latr_max[0]]), scale=30, fileFormat='GeoTIFF') except: task = ee.batch.Export.image.toDrive( image=img, description=name, folder=folder, crs = "EPSG:4326", region=( [coords.lonr_min,coords.latr_min], [coords.lonr_max,coords.latr_min], [coords.lonr_max,coords.latr_max], [coords.lonr_min,coords.latr_max]), scale=30, fileFormat='GeoTIFF') try: process = batch.Task.start(task) except Exception as er: sle = 0 print(str(er)) warn.warn("Hit a task limit, sleeping for an hour to let tasks complete") while sle < 61: sle += 1 string = "\r Starting sleep number %d at %s" % (sle, str(pd.Timestamp.now())) sys.stdout.write(string) sys.stdout.flush() time.sleep(60) process = batch.Task.start(task) # sys.exit() # ========== Code for old video export ========== oldvideo = False if oldvideo: # This is the way to use the google earth engine to make videos, i've # left the code here in case i need it again in the future ## Convert bands to output video if dschoice == "TOA": outputVideo = collection.map(convertBit) else: outputVideo = collection.map(convertBitV2) if len(bandlist)> 3: outputVideo = outputVideo.select(['B3', 'B2', 'B1']) testfirst = False if testfirst: task_config = { # 'description': 'imageToDriveTestExample', 'scale': 30, 'region': geom, "crs" : "EPSG:4326", "fileFormat":'GeoTIFF' } task = batch.Export.image.toDrive(outputVideo.first(), "testimage", task_config) task.start() # Export video to Google Drive print("Starting to create video for %s at:" % coords["name"], pd.Timestamp.now()) out = batch.Export.video.toDrive( outputVideo, description='%s_%s_%s' % (dsinfom, coords["name"], dsbands), folder = "/GEE_VIDEO_EXPORTS", framesPerSecond = 1, #dimensions = 1080, region=( [coords.lonr_min[0],coords.latr_min[0]], [coords.lonr_max[0],coords.latr_min[0]], [coords.lonr_max[0],coords.latr_max[0]], [coords.lonr_min[0],coords.latr_max[0]]), crs = "EPSG:4326", maxFrames=10000) process = batch.Task.start(out) print("Process sent to cloud") if fails is None: # ========== Save out the relevant infomation ========== df.to_csv("%s%s/%s_%s_%s_timeinfo.csv" % (spath, coords["name"], dsinfom, coords["name"], dsbands)) coords.to_csv("%s%s/%s_%s_gridinfo.csv" % (spath, coords["name"], program, coords["name"])) # ========== Going to sleep to give GEE a rest before i slam it with new requests ========== print("\n Starting 20 minutes of sleep at", pd.Timestamp.now(), "\n") sle = 0 while sle < 20: sle += 1 string = "\r Starting sleep number %d at %s" % (sle, str(pd.Timestamp.now())) sys.stdout.write(string) sys.stdout.flush() time.sleep(60) #============================================================================== #============================================================================== #============================================================================== ## Make 8 bit data def convertBit(image): return image.multiply(512).uint8() def convertBitV2(image): return image.multiply(0.0001).multiply(512).uint8() def geom_builder(site = "Burn2015 UP"): """ function to make the geometery """ # ========== Load the site data ========== pointfn = "./data/field/Points.kml" pointdt = gpd.read_file(pointfn, driver="kml") sitenm = [] latit = [] longi = [] year = [] # ========== Loop over the names 2019 ========== for nm in pointdt.Name: if nm in ["Burn2015 UP", "GROUP BOX2 TRANS1-6"]: sitenm.append(nm) latit.append(pointdt[pointdt.Name == nm].geometry.y.values[0]) longi.append(pointdt[pointdt.Name == nm].geometry.x.values[0]) year.append(2019) elif "GROUP BOX" in nm: pass elif nm[-2:] == '-0': sitenm.append(nm) latit.append(pointdt[pointdt.Name == nm].geometry.y.values[0]) longi.append(pointdt[pointdt.Name == nm].geometry.x.values[0]) year.append(2019) # ========== add 2018 ========== fd18 = pd.read_csv("./data/field/2018data/siteDescriptions18.csv") fd18.sort_values(by=["site number"],inplace=True) for nx, row in fd18.iterrows(): sitenm.append("Site%02d" % row["site number"]) latit.append(row.lat) longi.append(row.lon) year.append(2018) # ========== add 2017 ========== fd17 = pd.read_csv("./data/field/2017data/siteDescriptions17.csv") fd17.sort_values(by=["site number"],inplace=True) for nx, row in fd17.iterrows(): stnm = "Site%02d" % row["site number"] if not stnm in sitenm: sitenm.append(stnm) latit.append(row.strtY) longi.append(row.strtX) year.append(2017) # ========== Check the distance ========== # def distance_check(p1, p2): # pass STdf = pd.DataFrame({"siteds":sitenm, "lat":latit , "lon":longi , "year":year}) STdf["Skip"] = 0 STdf["SkipSite"] = "" for nx, row in STdf.iterrows(): if STdf["Skip"][nx] > 0: # THis location has laready been skipped continue else: dist = np.array([geodis.distance((row.lat, row.lon), (lat, lon)).km for lat, lon in zip(STdf.lat[nx+1:].values, STdf.lon[nx+1:].values)]) STdf["Skip"][nx+1:] += (dist<1).astype(int) def easy(inp, sitenm): if inp: return sitenm else: return "" close = [easy(inp, row.siteds) for inp in (dist<1)] STdf["SkipSite"][nx+1:] = STdf["SkipSite"][nx+1:].values + close # ipdb.set_trace() df = STdf[STdf.Skip == 0].reset_index(drop=True) def _sitemaker(site, sampleset, ds, dsn, sitinfoLS, lat, lon): """ wrapper to pull out site info as needed """ # ========== Pull out the location of a point ========== # lon = pointdt[pointdt.Name == site].geometry.x.values # lat = pointdt[pointdt.Name == site].geometry.y.values # ========== Check if the site has already been built ========== if dsn == "COPERN": # The site has not been built yet # ========== set the key params ========== boxs = 5 # number of grid cells considered ident = "r" # The indertifing code of the dataset # ========== Create a container ========== coords = OrderedDict() # ========== Get values ready to export ========== if site == "Burn2015 UP": coords["name"] = "TestBurn" elif site == "GROUP BOX2 TRANS1-6": coords["name"] = "G2T1-6" else: coords["name"] = site coords["set"] = sampleset coords["lon"] = lon coords["lat"] = lat # ========== Build the empty parts of the Ordered dic ========== for va_nm in ["r", "b_COP", "b_MOD"]: for ll in ["lon", "lat"]: for mm in ["max", "min"]: coords["%s%s_%s" % (ll, va_nm, mm)] = 0 else: if dsn == "MODIS": boxs = 3 # number of grid cells considered ident = "b_MOD" # The indertifing code of the dataset elif dsn == "COPERN_BA": boxs = 5 # number of grid cells considered ident = "b_COP" # The indertifing code of the dataset coords = sitinfoLS[site] gr_bx = ds_gr.sel({"latitude":lat, "longitude":lon}, method="nearest") # ========== Work out the edges of the grid box ========== latstep = abs(np.unique(np.round(np.diff(ds_gr.latitude.values), decimals=9)))/2.0 lonstep = abs(np.unique(np.round(np.diff(ds_gr.longitude.values), decimals=9)))/2.0 if boxs == 3: coords["lon%s_max" % ident] = float((gr_bx.longitude.values + (lonstep*2)) + lonstep) coords["lon%s_min" % ident] = float((gr_bx.longitude.values - (lonstep*2)) - lonstep) coords["lat%s_max" % ident] = float((gr_bx.latitude.values + (latstep*2)) + latstep) coords["lat%s_min" % ident] = float((gr_bx.latitude.values - (latstep*2)) - latstep) # ipdb.set_trace() elif boxs == 5: coords["lon%s_max" % ident] = float((gr_bx.longitude.values + 2*(lonstep*2)) + lonstep) coords["lon%s_min" % ident] = float((gr_bx.longitude.values - 2*(lonstep*2)) - lonstep) coords["lat%s_max" % ident] = float((gr_bx.latitude.values + 2*(latstep*2)) + latstep) coords["lat%s_min" % ident] = float((gr_bx.latitude.values - 2*(latstep*2)) - latstep) sitinfoLS[site] = coords return sitinfoLS #coords # ========== setup an ordered dict of the names ========== sitinfoLS = OrderedDict() local_data = datasets() for dsn in ["COPERN", "COPERN_BA", "MODIS"]: print(dsn) ldsi = local_data[dsn] # ========== load in the grid data ========== if os.path.isfile(ldsi["fname"]): ds_gr = xr.open_dataset( ldsi["fname"], chunks=ldsi["chunks"])[ldsi["var"]].rename(ldsi["rename"]).isel(time=0) else: ipdb.set_trace() # for nm in sitenm: for nx, row in df.iterrows(): sitinfoLS = _sitemaker(row.siteds, row.year, ds_gr, dsn, sitinfoLS, row.lat, row.lon) # ========== Close the dataset ========== ds_gr = None # ipdb.set_trace() return pd.DataFrame(sitinfoLS).transpose()[sitinfoLS["Burn2015 UP"].keys()] def Field_data(year = 2018): """ # Aim of this function is to look at the field data a bit To start it just opens the file and returns the lats and longs i can then use these to look up netcdf fils """ # ========== Load in the relevant data ========== if year == 2018: fd18 = pd.read_csv("./data/field/2018data/siteDescriptions18.csv") else: fd18 = pd.read_csv("./data/field/2018data/siteDescriptions17.csv") fd18.sort_values(by=["site number"],inplace=True) # ========== Create and Ordered Dict for important info ========== info = OrderedDict() info["sn"] = fd18["site number"] try: info["lat"] = fd18.lat info["lon"] = fd18.lon info["RF"] = fd18.rcrtmnt except AttributeError: info["lat"] = fd18.strtY info["lon"] = fd18.strtX info["RF"] = fd18.recruitment # ========== function to return nan when a value is missing ========== def _missingvalfix(val): try: return float(val) except Exception as e: return np.NAN def _fireyear(val): try: year = float(val) if (year <= 2018): return year else: return np.NAN except ValueError: #not a simple values try: year = float(str(val[0]).split(" and ")[0]) if year < 1980: warn.warn("wrong year is being returned") year = float(str(val).split(" ")[0]) # ipdb.set_trace() return year except Exception as e: # ipdb.set_trace() # print(e) print(val) return np.NAN # info[den] = [_missingvalfix( # fcut[fcut.sn == sn][den].values) for sn in info['sn']] # info["RF17"] = [_missingvalfix( # fcut[fcut.sn == sn]["RF2017"].values) for sn in info['sn']] info["fireyear"] = [_fireyear(fyv) for fyv in fd18["estimated fire year"].values] # ========== Convert to dataframe and replace codes ========== RFinfo = pd.DataFrame(info).set_index("sn") return RFinfo def datasets(): # ========== Create the system specific paths ========== sysname = os.uname()[1] if sysname == 'DESKTOP-CSHARFM': # LAPTOP dpath = "/mnt/e" elif sysname == "ubuntu": # Work PC dpath = "/media/ubuntu/Seagate Backup Plus Drive/Data51" elif sysname == "owner": # spath = "/mnt/c/Users/user/Google Drive/UoL/FIREFLIES/VideoExports/" dpath = "/mnt/d/Data51" else: warn.warn("Paths not created for this computer. System" + sysname) # dpath = "/media/ubuntu/Seagate Backup Plus Drive" ipdb.set_trace() # ========== set the filnames ========== data= OrderedDict() data["MODIS"] = ({ "fname":"%s/BurntArea/MODIS/MODIS_MCD64A1.006_500m_aid0001_reprocessedBAv2.nc" % dpath, 'var':"BA", "gridres":"500m", "region":"Siberia", "timestep":"Annual", "start":2001, "end":2018, "rasterio":False, "chunks":{'time':1, 'latitude': 1000}, "rename":None, "maskfn":"/media/ubuntu/Seagate Backup Plus Drive/Data51/BurntArea/MODIS/MASK/MCD12Q1.006_500m_aid0001v2.nc" }) data["COPERN_BA"] = ({ 'fname':"%s/BurntArea/COPERN_BA/processed/COPERN_BA_gls_2014_burntarea_SensorGapFix.nc" % dpath, 'var':"BA", "gridres":"300m", "region":"Global", "timestep":"AnnualMax", "start":2014, "end":2019,"rasterio":False, "chunks":{'time':1, 'latitude': 1000}, "rename":None }) data["esacci"] = ({ "fname":"%s/BurntArea/esacci/processed/esacci_FireCCI_2001_burntarea.nc" % dpath, 'var':"BA", "gridres":"250m", "region":"Asia", "timestep":"Annual", "start":2001, "end":2018, "rasterio":False, "chunks":{'time':1, 'latitude': 1000}, "rename":None, "maskfn":"/media/ubuntu/Seagate Backup Plus Drive/Data51/BurntArea/esacci/processed/esacci_landseamask.nc" # "rename":{"band":"time","x":"longitude", "y":"latitude"} }) data["GIMMS"] = ({ "fname":"./data/veg/GIMMS31g/GIMMS31v1/timecorrected/ndvi3g_geo_v1_1_1982to2017_annualmax.nc", 'var':"ndvi", "gridres":"8km", "region":"global", "timestep":"Annual", "start":1982, "end":2017, "rasterio":False, "chunks":{'time': 36}, "rename":None }) data["COPERN"] = ({ 'fname':"./data/veg/COPERN/NDVI_AnnualMax_1999to2018_global_at_1km_compressed.nc", 'var':"NDVI", "gridres":"1km", "region":"Global", "timestep":"AnnualMax", "start":1999, "end":2018,"rasterio":False, "chunks":{'time':1}, "rename":{"lon":"longitude", "lat":"latitude"} }) return data def string_format(string, replacement): """ Format a string using variables (as str.format) """ s = ee.String(string) repl = ee.Dictionary(replacement) keys = repl.keys() values = repl.values().map(lambda v: ee.Algorithms.String(v)) z = keys.zip(values) def wrap(kv, ini): keyval = ee.List(kv) ini = ee.String(ini) key = ee.String(keyval.get(0)) value = ee.String(keyval.get(1)) pattern = ee.String('{').cat(key).cat(ee.String('}')) return ini.replace(pattern, value) newstr = z.iterate(wrap, s) return ee.String(newstr) def convertDataType(newtype): """ Convert an image to the specified data type :param newtype: the data type. One of 'float', 'int', 'byte', 'double', 'Uint8','int8','Uint16', 'int16', 'Uint32','int32' :type newtype: str :return: a function to map over a collection :rtype: function """ def wrap(image): TYPES = {'float': image.toFloat, 'int': image.toInt, 'byte': image.toByte, 'double': image.toDouble, 'Uint8': image.toUint8, 'int8': image.toInt8, 'Uint16': image.toUint16, 'int16': image.toInt16, 'Uint32': image.toUint32, 'int32': image.toInt32} return TYPES[newtype]() return wrap #============================================================================== if __name__ == '__main__': # ========== Set the args Description ========== description='Script to make movies' parser = argparse.ArgumentParser(description=description) # ========== Add additional arguments ========== parser.add_argument( "-s", "--site", type=str, default=None, help="Site to work with ") # parser.add_argument( # "--gparts", type=int, default=None, # help="the max partnumber that has not been redone") parser.add_argument( "-f", "--force", action="store_true", help="the max partnumber that has not been redone") args = parser.parse_args() # ========== Call the main function ========== main(args) else: warn.warn("called from another script") # ========== Set the args Description ========== description='Script to make movies' parser = argparse.ArgumentParser(description=description) # ========== Add additional arguments ========== parser.add_argument( "-s", "--site", type=str, default=None, help="Site to work with ") # parser.add_argument( # "-x", "--cordforce", action="store_true", # help="just produce the cordinates without sending things to google earth engine") parser.add_argument( "-f", "--force", action="store_true", help="the max partnumber that has not been redone") args = parser.parse_args() # ========== Call the main function ========== main(args)
7,527
0
288
d5f438f5a8a117efddb81ecb880531e3fe605b07
418
py
Python
Easy/UsingLoopToDrawPyramid.py
revanthsenthil/dCoder_select
20662123f1d3e1f9c7e8225eea7732be3a19ae57
[ "MIT" ]
1
2021-08-03T21:23:08.000Z
2021-08-03T21:23:08.000Z
Easy/UsingLoopToDrawPyramid.py
revanthsenthil/dCoder-Solved
20662123f1d3e1f9c7e8225eea7732be3a19ae57
[ "MIT" ]
null
null
null
Easy/UsingLoopToDrawPyramid.py
revanthsenthil/dCoder-Solved
20662123f1d3e1f9c7e8225eea7732be3a19ae57
[ "MIT" ]
1
2021-04-22T09:20:12.000Z
2021-04-22T09:20:12.000Z
""" Problem Description: Draw the pattern specified using loops. Input: Output: The pattern as shown in sample output. First line contain 4 space and 1 star, next line contains 3 space and 3 stars and so on.. Constraints: Try not to hardcode the output. Sample Input: Sample Output: * *** ***** ******* ********* """ for i in range(5): print(" " * (4 - i), end = "") print("*" * ((2 * i) + 1))
15.481481
89
0.598086
""" Problem Description: Draw the pattern specified using loops. Input: Output: The pattern as shown in sample output. First line contain 4 space and 1 star, next line contains 3 space and 3 stars and so on.. Constraints: Try not to hardcode the output. Sample Input: Sample Output: * *** ***** ******* ********* """ for i in range(5): print(" " * (4 - i), end = "") print("*" * ((2 * i) + 1))
0
0
0
b5cf395a897c345e2301d7e7c6f8c1bf4d9ef696
1,451
py
Python
pizzer/common/migrations/0001_initial.py
milashensky/pizzer
4aa5f38a8422282a34fbff9e2e2a9d01f11ce44e
[ "MIT" ]
null
null
null
pizzer/common/migrations/0001_initial.py
milashensky/pizzer
4aa5f38a8422282a34fbff9e2e2a9d01f11ce44e
[ "MIT" ]
null
null
null
pizzer/common/migrations/0001_initial.py
milashensky/pizzer
4aa5f38a8422282a34fbff9e2e2a9d01f11ce44e
[ "MIT" ]
null
null
null
# Generated by Django 3.0.2 on 2020-01-20 14:15 from django.conf import settings from django.db import migrations, models import django.db.models.deletion
39.216216
150
0.62991
# Generated by Django 3.0.2 on 2020-01-20 14:15 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('catalogue', '0001_initial'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Customer', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('created_at', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True)), ('currency', models.ForeignKey(default=840, on_delete=django.db.models.deletion.CASCADE, to='catalogue.Currency')), ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='customer', to=settings.AUTH_USER_MODEL)), ], ), migrations.CreateModel( name='DeliveryAddress', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('details', models.TextField()), ('customer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='delivery_addresses', to='common.Customer')), ], ), ]
0
1,271
23
d9ad1a8e096b873e8f64207d062cf68b2bccafef
54,745
py
Python
cinder/tests/test_hplefthand.py
oodrive/cinder
40b43d6698128ab26b056586e0a5c5e818e21c11
[ "Apache-2.0" ]
1
2015-11-25T10:18:28.000Z
2015-11-25T10:18:28.000Z
cinder/tests/test_hplefthand.py
NeCTAR-RC/cinder
e01da23febc530de218ed8eed6737add150c1587
[ "Apache-2.0" ]
null
null
null
cinder/tests/test_hplefthand.py
NeCTAR-RC/cinder
e01da23febc530de218ed8eed6737add150c1587
[ "Apache-2.0" ]
null
null
null
# (c) Copyright 2014 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # """Unit tests for OpenStack Cinder volume drivers.""" import mock from hplefthandclient import exceptions as hpexceptions from cinder import context from cinder import exception from cinder.openstack.common import log as logging from cinder import test from cinder import units from cinder.volume.drivers.san.hp import hp_lefthand_iscsi from cinder.volume.drivers.san.hp import hp_lefthand_rest_proxy from cinder.volume import volume_types LOG = logging.getLogger(__name__)
38.579986
79
0.590574
# (c) Copyright 2014 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # """Unit tests for OpenStack Cinder volume drivers.""" import mock from hplefthandclient import exceptions as hpexceptions from cinder import context from cinder import exception from cinder.openstack.common import log as logging from cinder import test from cinder import units from cinder.volume.drivers.san.hp import hp_lefthand_iscsi from cinder.volume.drivers.san.hp import hp_lefthand_rest_proxy from cinder.volume import volume_types LOG = logging.getLogger(__name__) class HPLeftHandBaseDriver(): cluster_id = 1 volume_name = "fakevolume" volume_id = 1 volume = { 'name': volume_name, 'provider_location': ('10.0.1.6 iqn.2003-10.com.lefthandnetworks:' 'group01:25366:fakev 0'), 'id': volume_id, 'provider_auth': None, 'size': 1} serverName = 'fakehost' server_id = 0 snapshot_name = "fakeshapshot" snapshot_id = 3 snapshot = { 'name': snapshot_name, 'volume_name': volume_name} cloned_volume_name = "clone_volume" cloned_volume = {'name': cloned_volume_name} cloned_snapshot_name = "clonedshapshot" cloned_snapshot_id = 5 cloned_snapshot = { 'name': cloned_snapshot_name, 'volume_name': volume_name} volume_type_id = 4 init_iqn = 'iqn.1993-08.org.debian:01:222' connector = { 'ip': '10.0.0.2', 'initiator': 'iqn.1993-08.org.debian:01:222', 'host': serverName} driver_startup_call_stack = [ mock.call.login('foo1', 'bar2'), mock.call.getClusterByName('CloudCluster1'), mock.call.getCluster(1)] class TestHPLeftHandCLIQISCSIDriver(HPLeftHandBaseDriver, test.TestCase): def _fake_cliq_run(self, verb, cliq_args, check_exit_code=True): """Return fake results for the various methods.""" def create_volume(cliq_args): """Create volume CLIQ input for test. input = "createVolume description="fake description" clusterName=Cluster01 volumeName=fakevolume thinProvision=0 output=XML size=1GB" """ output = """<gauche version="1.0"> <response description="Operation succeeded." name="CliqSuccess" processingTime="181" result="0"/> </gauche>""" self.assertEqual(cliq_args['volumeName'], self.volume_name) self.assertEqual(cliq_args['thinProvision'], '1') self.assertEqual(cliq_args['size'], '1GB') return output, None def delete_volume(cliq_args): """Delete volume CLIQ input for test. input = "deleteVolume volumeName=fakevolume prompt=false output=XML" """ output = """<gauche version="1.0"> <response description="Operation succeeded." name="CliqSuccess" processingTime="164" result="0"/> </gauche>""" self.assertEqual(cliq_args['volumeName'], self.volume_name) self.assertEqual(cliq_args['prompt'], 'false') return output, None def extend_volume(cliq_args): """Extend volume CLIQ input for test. input = "modifyVolume description="fake description" volumeName=fakevolume output=XML size=2GB" """ output = """<gauche version="1.0"> <response description="Operation succeeded." name="CliqSuccess" processingTime="181" result="0"/> </gauche>""" self.assertEqual(cliq_args['volumeName'], self.volume_name) self.assertEqual(cliq_args['size'], '2GB') return output, None def assign_volume(cliq_args): """Assign volume CLIQ input for test. input = "assignVolumeToServer volumeName=fakevolume serverName=fakehost output=XML" """ output = """<gauche version="1.0"> <response description="Operation succeeded." name="CliqSuccess" processingTime="174" result="0"/> </gauche>""" self.assertEqual(cliq_args['volumeName'], self.volume_name) self.assertEqual(cliq_args['serverName'], self.connector['host']) return output, None def unassign_volume(cliq_args): """Unassign volume CLIQ input for test. input = "unassignVolumeToServer volumeName=fakevolume serverName=fakehost output=XML """ output = """<gauche version="1.0"> <response description="Operation succeeded." name="CliqSuccess" processingTime="205" result="0"/> </gauche>""" self.assertEqual(cliq_args['volumeName'], self.volume_name) self.assertEqual(cliq_args['serverName'], self.connector['host']) return output, None def create_snapshot(cliq_args): """Create snapshot CLIQ input for test. input = "createSnapshot description="fake description" snapshotName=fakesnapshot volumeName=fakevolume output=XML" """ output = """<gauche version="1.0"> <response description="Operation succeeded." name="CliqSuccess" processingTime="181" result="0"/> </gauche>""" self.assertEqual(cliq_args['snapshotName'], self.snapshot_name) self.assertEqual(cliq_args['volumeName'], self.volume_name) return output, None def delete_snapshot(cliq_args): """Delete shapshot CLIQ input for test. input = "deleteSnapshot snapshotName=fakesnapshot prompt=false output=XML" """ output = """<gauche version="1.0"> <response description="Operation succeeded." name="CliqSuccess" processingTime="164" result="0"/> </gauche>""" self.assertEqual(cliq_args['snapshotName'], self.snapshot_name) self.assertEqual(cliq_args['prompt'], 'false') return output, None def create_volume_from_snapshot(cliq_args): """Create volume from snapshot CLIQ input for test. input = "cloneSnapshot description="fake description" snapshotName=fakesnapshot volumeName=fakevolume output=XML" """ output = """<gauche version="1.0"> <response description="Operation succeeded." name="CliqSuccess" processingTime="181" result="0"/> </gauche>""" self.assertEqual(cliq_args['snapshotName'], self.snapshot_name) self.assertEqual(cliq_args['volumeName'], self.volume_name) return output, None def get_cluster_info(cliq_args): """Get cluster info CLIQ input for test. input = "getClusterInfo clusterName=Cluster01 searchDepth=1 verbose=0 output=XML" """ output = """<gauche version="1.0"> <response description="Operation succeeded." name="CliqSuccess" processingTime="1164" result="0"> <cluster blockSize="1024" description="" maxVolumeSizeReplication1="622957690" maxVolumeSizeReplication2="311480287" minVolumeSize="262144" name="Cluster01" pageSize="262144" spaceTotal="633697992" storageNodeCount="2" unprovisionedSpace="622960574" useVip="true"> <nsm ipAddress="10.0.1.7" name="111-vsa"/> <nsm ipAddress="10.0.1.8" name="112-vsa"/> <vip ipAddress="10.0.1.6" subnetMask="255.255.255.0"/> </cluster></response></gauche>""" return output, None def get_volume_info(cliq_args): """Get volume info CLIQ input for test. input = "getVolumeInfo volumeName=fakevolume output=XML" """ output = """<gauche version="1.0"> <response description="Operation succeeded." name="CliqSuccess" processingTime="87" result="0"> <volume autogrowPages="4" availability="online" blockSize="1024" bytesWritten="0" checkSum="false" clusterName="Cluster01" created="2011-02-08T19:56:53Z" deleting="false" description="" groupName="Group01" initialQuota="536870912" isPrimary="true" iscsiIqn="iqn.2003-10.com.lefthandnetworks:group01:25366:fakev" maxSize="6865387257856" md5="9fa5c8b2cca54b2948a63d833097e1ca" minReplication="1" name="vol-b" parity="0" replication="2" reserveQuota="536870912" scratchQuota="4194304" serialNumber="9fa5c8b2cca54b2948a63d8" size="1073741824" stridePages="32" thinProvision="true"> <status description="OK" value="2"/> <permission access="rw" authGroup="api-1" chapName="chapusername" chapRequired="true" id="25369" initiatorSecret="" iqn="" iscsiEnabled="true" loadBalance="true" targetSecret="supersecret"/> </volume></response></gauche>""" return output, None def get_snapshot_info(cliq_args): """Get snapshot info CLIQ input for test. input = "getSnapshotInfo snapshotName=fakesnapshot output=XML" """ output = """<gauche version="1.0"> <response description="Operation succeeded." name="CliqSuccess" processingTime="87" result="0"> <snapshot applicationManaged="false" autogrowPages="32768" automatic="false" availability="online" bytesWritten="0" clusterName="CloudCluster1" created="2013-08-26T07:03:44Z" deleting="false" description="" groupName="CloudGroup1" id="730" initialQuota="536870912" isPrimary="true" iscsiIqn="iqn.2003-10.com.lefthandnetworks:cloudgroup1:73" md5="a64b4f850539c07fb5ce3cee5db1fcce" minReplication="1" name="snapshot-7849288e-e5e8-42cb-9687-9af5355d674b" replication="2" reserveQuota="536870912" scheduleId="0" scratchQuota="4194304" scratchWritten="0" serialNumber="a64b4f850539c07fb5ce3cee5db1fcce" size="2147483648" stridePages="32" volumeSerial="a64b4f850539c07fb5ce3cee5db1fcce"> <status description="OK" value="2"/> <permission access="rw" authGroup="api-34281B815713B78-(trimmed)51ADD4B7030853AA7" chapName="chapusername" chapRequired="true" id="25369" initiatorSecret="" iqn="" iscsiEnabled="true" loadBalance="true" targetSecret="supersecret"/> </snapshot></response></gauche>""" return output, None def get_server_info(cliq_args): """Get server info CLIQ input for test. input = "getServerInfo serverName=fakeName" """ output = """<gauche version="1.0"><response result="0"/> </gauche>""" return output, None def create_server(cliq_args): """Create server CLIQ input for test. input = "createServer serverName=fakeName initiator=something" """ output = """<gauche version="1.0"><response result="0"/> </gauche>""" return output, None def test_error(cliq_args): output = """<gauche version="1.0"> <response description="Volume '134234' not found." name="CliqVolumeNotFound" processingTime="1083" result="8000100c"/> </gauche>""" return output, None def test_paramiko_1_13_0(cliq_args): # paramiko 1.13.0 now returns unicode output = unicode( '<?xml version="1.0" encoding="UTF-8" standalone="no" ?>\n' '<gauche version="1.0">\n\n <response description="Operation' ' succeeded." name="CliqSuccess" processingTime="423" ' 'result="0">\n <cluster adaptiveOptimization="false" ' 'blockSize="1024" description="" maxVolumeSizeReplication1=' '"114594676736" minVolumeSize="262144" name="clusterdemo" ' 'pageSize="262144" spaceTotal="118889644032" storageNodeCount=' '"1" unprovisionedSpace="114594676736" useVip="true">\n' ' <nsm ipAddress="10.10.29.102" name="lefdemo1"/>\n' ' <vip ipAddress="10.10.22.87" subnetMask=' '"255.255.224.0"/>\n </cluster>\n </response>\n\n' '</gauche>\n ') return output, None def test_paramiko_1_10_0(cliq_args): # paramiko 1.10.0 returns python default encoding. output = ( '<?xml version="1.0" encoding="UTF-8" standalone="no" ?>\n' '<gauche version="1.0">\n\n <response description="Operation' ' succeeded." name="CliqSuccess" processingTime="423" ' 'result="0">\n <cluster adaptiveOptimization="false" ' 'blockSize="1024" description="" maxVolumeSizeReplication1=' '"114594676736" minVolumeSize="262144" name="clusterdemo" ' 'pageSize="262144" spaceTotal="118889644032" storageNodeCount=' '"1" unprovisionedSpace="114594676736" useVip="true">\n' ' <nsm ipAddress="10.10.29.102" name="lefdemo1"/>\n' ' <vip ipAddress="10.10.22.87" subnetMask=' '"255.255.224.0"/>\n </cluster>\n </response>\n\n' '</gauche>\n ') return output, None self.assertEqual(cliq_args['output'], 'XML') try: verbs = {'createVolume': create_volume, 'deleteVolume': delete_volume, 'modifyVolume': extend_volume, 'assignVolumeToServer': assign_volume, 'unassignVolumeToServer': unassign_volume, 'createSnapshot': create_snapshot, 'deleteSnapshot': delete_snapshot, 'cloneSnapshot': create_volume_from_snapshot, 'getClusterInfo': get_cluster_info, 'getVolumeInfo': get_volume_info, 'getSnapshotInfo': get_snapshot_info, 'getServerInfo': get_server_info, 'createServer': create_server, 'testError': test_error, 'testParamiko_1.10.1': test_paramiko_1_10_0, 'testParamiko_1.13.1': test_paramiko_1_13_0} except KeyError: raise NotImplementedError() return verbs[verb](cliq_args) def setUp(self): super(TestHPLeftHandCLIQISCSIDriver, self).setUp() self.properties = { 'target_discoverd': True, 'target_portal': '10.0.1.6:3260', 'target_iqn': 'iqn.2003-10.com.lefthandnetworks:group01:25366:fakev', 'volume_id': self.volume_id} def tearDown(self): super(TestHPLeftHandCLIQISCSIDriver, self).tearDown() def default_mock_conf(self): mock_conf = mock.Mock() mock_conf.san_ip = '10.10.10.10' mock_conf.san_login = 'foo' mock_conf.san_password = 'bar' mock_conf.san_ssh_port = 16022 mock_conf.san_clustername = 'CloudCluster1' mock_conf.hplefthand_api_url = None return mock_conf def setup_driver(self, config=None): if config is None: config = self.default_mock_conf() self.driver = hp_lefthand_iscsi.HPLeftHandISCSIDriver( configuration=config) self.driver.do_setup(None) self.driver.proxy._cliq_run = mock.Mock( side_effect=self._fake_cliq_run) return self.driver.proxy._cliq_run def test_create_volume(self): # set up driver with default config mock_cliq_run = self.setup_driver() volume = {'name': self.volume_name, 'size': 1} model_update = self.driver.create_volume(volume) expected_iqn = "iqn.2003-10.com.lefthandnetworks:group01:25366:fakev 0" expected_location = "10.0.1.6:3260,1 %s" % expected_iqn self.assertEqual(model_update['provider_location'], expected_location) expected = [ mock.call( 'createVolume', { 'clusterName': 'CloudCluster1', 'volumeName': 'fakevolume', 'thinProvision': '1', 'output': 'XML', 'size': '1GB'}, True), mock.call( 'getVolumeInfo', { 'volumeName': 'fakevolume', 'output': 'XML'}, True), mock.call( 'getClusterInfo', { 'clusterName': 'Cluster01', 'searchDepth': '1', 'verbose': '0', 'output': 'XML'}, True)] # validate call chain mock_cliq_run.assert_has_calls(expected) def test_delete_volume(self): # set up driver with default config mock_cliq_run = self.setup_driver() volume = {'name': self.volume_name} self.driver.delete_volume(volume) expected = [ mock.call( 'getVolumeInfo', { 'volumeName': 'fakevolume', 'output': 'XML'}, True), mock.call( 'deleteVolume', { 'volumeName': 'fakevolume', 'prompt': 'false', 'output': 'XML'}, True)] # validate call chain mock_cliq_run.assert_has_calls(expected) def test_extend_volume(self): # set up driver with default config mock_cliq_run = self.setup_driver() volume = {'name': self.volume_name} self.driver.extend_volume(volume, 2) expected = [ mock.call( 'modifyVolume', { 'volumeName': 'fakevolume', 'output': 'XML', 'size': '2GB'}, True)] # validate call chain mock_cliq_run.assert_has_calls(expected) def test_initialize_connection(self): # set up driver with default config mock_cliq_run = self.setup_driver() self.driver.proxy._get_iscsi_properties = mock.Mock( return_value=self.properties) volume = {'name': self.volume_name} result = self.driver.initialize_connection(volume, self.connector) self.assertEqual(result['driver_volume_type'], 'iscsi') self.assertDictMatch(result['data'], self.properties) expected = [ mock.call( 'getServerInfo', { 'output': 'XML', 'serverName': 'fakehost'}, False), mock.call( 'assignVolumeToServer', { 'volumeName': 'fakevolume', 'serverName': 'fakehost', 'output': 'XML'}, True)] # validate call chain mock_cliq_run.assert_has_calls(expected) def test_terminate_connection(self): # set up driver with default config mock_cliq_run = self.setup_driver() volume = {'name': self.volume_name} self.driver.terminate_connection(volume, self.connector) expected = [ mock.call( 'unassignVolumeToServer', { 'volumeName': 'fakevolume', 'serverName': 'fakehost', 'output': 'XML'}, True)] # validate call chain mock_cliq_run.assert_has_calls(expected) def test_create_snapshot(self): # set up driver with default config mock_cliq_run = self.setup_driver() snapshot = {'name': self.snapshot_name, 'volume_name': self.volume_name} self.driver.create_snapshot(snapshot) expected = [ mock.call( 'createSnapshot', { 'snapshotName': 'fakeshapshot', 'output': 'XML', 'inheritAccess': 1, 'volumeName': 'fakevolume'}, True)] # validate call chain mock_cliq_run.assert_has_calls(expected) def test_delete_snapshot(self): # set up driver with default config mock_cliq_run = self.setup_driver() snapshot = {'name': self.snapshot_name} self.driver.delete_snapshot(snapshot) expected = [ mock.call( 'getSnapshotInfo', { 'snapshotName': 'fakeshapshot', 'output': 'XML'}, True), mock.call( 'deleteSnapshot', { 'snapshotName': 'fakeshapshot', 'prompt': 'false', 'output': 'XML'}, True)] # validate call chain mock_cliq_run.assert_has_calls(expected) def test_create_volume_from_snapshot(self): # set up driver with default config mock_cliq_run = self.setup_driver() volume = {'name': self.volume_name} snapshot = {'name': self.snapshot_name} model_update = self.driver.create_volume_from_snapshot(volume, snapshot) expected_iqn = "iqn.2003-10.com.lefthandnetworks:group01:25366:fakev 0" expected_location = "10.0.1.6:3260,1 %s" % expected_iqn self.assertEqual(model_update['provider_location'], expected_location) expected = [ mock.call( 'cloneSnapshot', { 'snapshotName': 'fakeshapshot', 'output': 'XML', 'volumeName': 'fakevolume'}, True), mock.call( 'getVolumeInfo', { 'volumeName': 'fakevolume', 'output': 'XML'}, True), mock.call( 'getClusterInfo', { 'clusterName': 'Cluster01', 'searchDepth': '1', 'verbose': '0', 'output': 'XML'}, True)] # validate call chain mock_cliq_run.assert_has_calls(expected) def test_get_volume_stats(self): # set up driver with default config mock_cliq_run = self.setup_driver() volume_stats = self.driver.get_volume_stats(True) self.assertEqual(volume_stats['vendor_name'], 'Hewlett-Packard') self.assertEqual(volume_stats['storage_protocol'], 'iSCSI') expected = [ mock.call('getClusterInfo', { 'searchDepth': 1, 'clusterName': 'CloudCluster1', 'output': 'XML'}, True)] # validate call chain mock_cliq_run.assert_has_calls(expected) def test_cliq_run_xml_paramiko_1_13_0(self): # set up driver with default config self.setup_driver() xml = self.driver.proxy._cliq_run_xml('testParamiko_1.13.1', {}) self.assertIsNotNone(xml) def test_cliq_run_xml_paramiko_1_10_0(self): # set up driver with default config self.setup_driver() xml = self.driver.proxy._cliq_run_xml('testParamiko_1.10.1', {}) self.assertIsNotNone(xml) class TestHPLeftHandRESTISCSIDriver(HPLeftHandBaseDriver, test.TestCase): driver_startup_call_stack = [ mock.call.login('foo1', 'bar2'), mock.call.getClusterByName('CloudCluster1'), mock.call.getCluster(1)] def setUp(self): super(TestHPLeftHandRESTISCSIDriver, self).setUp() def tearDown(self): super(TestHPLeftHandRESTISCSIDriver, self).tearDown() def default_mock_conf(self): mock_conf = mock.Mock() mock_conf.hplefthand_api_url = 'http://fake.foo:8080/lhos' mock_conf.hplefthand_username = 'foo1' mock_conf.hplefthand_password = 'bar2' mock_conf.hplefthand_iscsi_chap_enabled = False mock_conf.hplefthand_debug = False mock_conf.hplefthand_clustername = "CloudCluster1" return mock_conf @mock.patch('hplefthandclient.client.HPLeftHandClient', spec=True) def setup_driver(self, _mock_client, config=None): if config is None: config = self.default_mock_conf() _mock_client.return_value.getClusterByName.return_value = { 'id': 1, 'virtualIPAddresses': [{'ipV4Address': '10.0.1.6'}]} _mock_client.return_value.getCluster.return_value = { 'spaceTotal': units.GiB * 500, 'spaceAvailable': units.GiB * 250} self.driver = hp_lefthand_iscsi.HPLeftHandISCSIDriver( configuration=config) self.driver.do_setup(None) return _mock_client.return_value def test_create_volume(self): # setup drive with default configuration # and return the mock HTTP LeftHand client mock_client = self.setup_driver() # mock return value of createVolume mock_client.createVolume.return_value = { 'iscsiIqn': self.connector['initiator']} # execute driver volume_info = self.driver.create_volume(self.volume) self.assertEqual('10.0.1.6:3260,1 iqn.1993-08.org.debian:01:222 0', volume_info['provider_location']) expected = self.driver_startup_call_stack + [ mock.call.createVolume( 'fakevolume', 1, units.GiB, {'isThinProvisioned': True, 'clusterName': 'CloudCluster1'})] mock_client.assert_has_calls(expected) # mock HTTPServerError mock_client.createVolume.side_effect = hpexceptions.HTTPServerError() # ensure the raised exception is a cinder exception self.assertRaises(exception.VolumeBackendAPIException, self.driver.create_volume, self.volume) @mock.patch.object( volume_types, 'get_volume_type', return_value={'extra_specs': {'hplh:provisioning': 'full'}}) def test_create_volume_with_es(self, _mock_volume_type): # setup drive with default configuration # and return the mock HTTP LeftHand client mock_client = self.setup_driver() volume_with_vt = self.volume volume_with_vt['volume_type_id'] = 1 # mock return value of createVolume mock_client.createVolume.return_value = { 'iscsiIqn': self.connector['initiator']} # execute creat_volume volume_info = self.driver.create_volume(volume_with_vt) self.assertEqual('10.0.1.6:3260,1 iqn.1993-08.org.debian:01:222 0', volume_info['provider_location']) expected = self.driver_startup_call_stack + [ mock.call.createVolume( 'fakevolume', 1, units.GiB, {'isThinProvisioned': False, 'clusterName': 'CloudCluster1'})] mock_client.assert_has_calls(expected) def test_delete_volume(self): # setup drive with default configuration # and return the mock HTTP LeftHand client mock_client = self.setup_driver() # mock return value of getVolumeByName mock_client.getVolumeByName.return_value = {'id': self.volume_id} # execute delete_volume self.driver.delete_volume(self.volume) expected = self.driver_startup_call_stack + [ mock.call.getVolumeByName('fakevolume'), mock.call.deleteVolume(self.volume_id)] mock_client.assert_has_calls(expected) # mock HTTPNotFound (volume not found) mock_client.getVolumeByName.side_effect = hpexceptions.HTTPNotFound() # no exception should escape method self.driver.delete_volume(self.volume) # mock HTTPConflict mock_client.deleteVolume.side_effect = hpexceptions.HTTPConflict() # ensure the raised exception is a cinder exception self.assertRaises(exception.VolumeBackendAPIException, self.driver.delete_volume, self.volume_id) def test_extend_volume(self): # setup drive with default configuration # and return the mock HTTP LeftHand client mock_client = self.setup_driver() # mock return value of getVolumeByName mock_client.getVolumeByName.return_value = {'id': self.volume_id} # execute extend_volume self.driver.extend_volume(self.volume, 2) expected = self.driver_startup_call_stack + [ mock.call.getVolumeByName('fakevolume'), mock.call.modifyVolume(1, {'size': 2 * units.GiB})] # validate call chain mock_client.assert_has_calls(expected) # mock HTTPServerError (array failure) mock_client.modifyVolume.side_effect = hpexceptions.HTTPServerError() # ensure the raised exception is a cinder exception self.assertRaises(exception.VolumeBackendAPIException, self.driver.extend_volume, self.volume, 2) def test_initialize_connection(self): # setup drive with default configuration # and return the mock HTTP LeftHand client mock_client = self.setup_driver() # mock return value of getVolumeByName mock_client.getServerByName.side_effect = hpexceptions.HTTPNotFound() mock_client.createServer.return_value = {'id': self.server_id} mock_client.getVolumeByName.return_value = {'id': self.volume_id} # execute initialize_connection result = self.driver.initialize_connection( self.volume, self.connector) # validate self.assertEqual(result['driver_volume_type'], 'iscsi') self.assertEqual(result['data']['target_discovered'], False) self.assertEqual(result['data']['volume_id'], self.volume_id) self.assertTrue('auth_method' not in result['data']) expected = self.driver_startup_call_stack + [ mock.call.getServerByName('fakehost'), mock.call.createServer ( 'fakehost', 'iqn.1993-08.org.debian:01:222', None ), mock.call.getVolumeByName('fakevolume'), mock.call.addServerAccess(1, 0)] # validate call chain mock_client.assert_has_calls(expected) # mock HTTPServerError (array failure) mock_client.createServer.side_effect = hpexceptions.HTTPServerError() # ensure the raised exception is a cinder exception self.assertRaises( exception.VolumeBackendAPIException, self.driver.initialize_connection, self.volume, self.connector) def test_initialize_connection_with_chaps(self): # setup drive with default configuration # and return the mock HTTP LeftHand client mock_client = self.setup_driver() # mock return value of getVolumeByName mock_client.getServerByName.side_effect = hpexceptions.HTTPNotFound() mock_client.createServer.return_value = { 'id': self.server_id, 'chapAuthenticationRequired': True, 'chapTargetSecret': 'dont_tell'} mock_client.getVolumeByName.return_value = {'id': self.volume_id} # execute initialize_connection result = self.driver.initialize_connection( self.volume, self.connector) # validate self.assertEqual(result['driver_volume_type'], 'iscsi') self.assertEqual(result['data']['target_discovered'], False) self.assertEqual(result['data']['volume_id'], self.volume_id) self.assertEqual(result['data']['auth_method'], 'CHAP') expected = self.driver_startup_call_stack + [ mock.call.getServerByName('fakehost'), mock.call.createServer ( 'fakehost', 'iqn.1993-08.org.debian:01:222', None ), mock.call.getVolumeByName('fakevolume'), mock.call.addServerAccess(1, 0)] # validate call chain mock_client.assert_has_calls(expected) def test_terminate_connection(self): # setup drive with default configuration # and return the mock HTTP LeftHand client mock_client = self.setup_driver() mock_client.getVolumeByName.return_value = {'id': self.volume_id} mock_client.getServerByName.return_value = {'id': self.server_id} # execute terminate_connection self.driver.terminate_connection(self.volume, self.connector) expected = self.driver_startup_call_stack + [ mock.call.getVolumeByName('fakevolume'), mock.call.getServerByName('fakehost'), mock.call.removeServerAccess(1, 0)] # validate call chain mock_client.assert_has_calls(expected) mock_client.getVolumeByName.side_effect = hpexceptions.HTTPNotFound() # ensure the raised exception is a cinder exception self.assertRaises( exception.VolumeBackendAPIException, self.driver.terminate_connection, self.volume, self.connector) def test_create_snapshot(self): # setup drive with default configuration # and return the mock HTTP LeftHand client mock_client = self.setup_driver() mock_client.getVolumeByName.return_value = {'id': self.volume_id} # execute create_snapshot self.driver.create_snapshot(self.snapshot) expected = self.driver_startup_call_stack + [ mock.call.getVolumeByName('fakevolume'), mock.call.createSnapshot( 'fakeshapshot', 1, {'inheritAccess': True})] # validate call chain mock_client.assert_has_calls(expected) # mock HTTPServerError (array failure) mock_client.getVolumeByName.side_effect = hpexceptions.HTTPNotFound() # ensure the raised exception is a cinder exception self.assertRaises( exception.VolumeBackendAPIException, self.driver.create_snapshot, self.snapshot) def test_delete_snapshot(self): # setup drive with default configuration # and return the mock HTTP LeftHand client mock_client = self.setup_driver() mock_client.getSnapshotByName.return_value = {'id': self.snapshot_id} # execute delete_snapshot self.driver.delete_snapshot(self.snapshot) expected = self.driver_startup_call_stack + [ mock.call.getSnapshotByName('fakeshapshot'), mock.call.deleteSnapshot(3)] # validate call chain mock_client.assert_has_calls(expected) mock_client.getSnapshotByName.side_effect = hpexceptions.HTTPNotFound() # no exception is thrown, just error msg is logged self.driver.delete_snapshot(self.snapshot) # mock HTTPServerError (array failure) ex = hpexceptions.HTTPServerError({'message': 'Some message.'}) mock_client.getSnapshotByName.side_effect = ex # ensure the raised exception is a cinder exception self.assertRaises( exception.VolumeBackendAPIException, self.driver.delete_snapshot, self.snapshot) # mock HTTPServerError because the snap is in use ex = hpexceptions.HTTPServerError({ 'message': 'Hey, dude cannot be deleted because it is a clone point duh.'}) mock_client.getSnapshotByName.side_effect = ex # ensure the raised exception is a cinder exception self.assertRaises( exception.SnapshotIsBusy, self.driver.delete_snapshot, self.snapshot) def test_create_volume_from_snapshot(self): # setup drive with default configuration # and return the mock HTTP LeftHand client mock_client = self.setup_driver() mock_client.getSnapshotByName.return_value = {'id': self.snapshot_id} mock_client.cloneSnapshot.return_value = { 'iscsiIqn': self.connector['initiator']} # execute create_volume_from_snapshot model_update = self.driver.create_volume_from_snapshot( self.volume, self.snapshot) expected_iqn = 'iqn.1993-08.org.debian:01:222 0' expected_location = "10.0.1.6:3260,1 %s" % expected_iqn self.assertEqual(model_update['provider_location'], expected_location) expected = self.driver_startup_call_stack + [ mock.call.getSnapshotByName('fakeshapshot'), mock.call.cloneSnapshot('fakevolume', 3)] # validate call chain mock_client.assert_has_calls(expected) def test_create_cloned_volume(self): # setup drive with default configuration # and return the mock HTTP LeftHand client mock_client = self.setup_driver() mock_client.getVolumeByName.return_value = {'id': self.volume_id} # execute create_cloned_volume self.driver.create_cloned_volume( self.cloned_volume, self.volume) expected = self.driver_startup_call_stack + [ mock.call.getVolumeByName('fakevolume'), mock.call.cloneVolume('clone_volume', 1)] # validate call chain mock_client.assert_has_calls(expected) @mock.patch.object(volume_types, 'get_volume_type') def test_extra_spec_mapping(self, _mock_get_volume_type): # setup drive with default configuration self.setup_driver() # 2 extra specs we don't care about, and # 1 that will get mapped _mock_get_volume_type.return_value = { 'extra_specs': { 'foo:bar': 'fake', 'bar:foo': 1234, 'hplh:provisioning': 'full'}} volume_with_vt = self.volume volume_with_vt['volume_type_id'] = self.volume_type_id # get the extra specs of interest from this volume's volume type volume_extra_specs = self.driver.proxy._get_volume_extra_specs( volume_with_vt) extra_specs = self.driver.proxy._get_lh_extra_specs( volume_extra_specs, hp_lefthand_rest_proxy.extra_specs_key_map.keys()) # map the extra specs key/value pairs to key/value pairs # used as optional configuration values by the LeftHand backend optional = self.driver.proxy._map_extra_specs(extra_specs) self.assertDictMatch({'isThinProvisioned': False}, optional) @mock.patch.object(volume_types, 'get_volume_type') def test_extra_spec_mapping_invalid_value(self, _mock_get_volume_type): # setup drive with default configuration self.setup_driver() volume_with_vt = self.volume volume_with_vt['volume_type_id'] = self.volume_type_id _mock_get_volume_type.return_value = { 'extra_specs': { # r-07 is an invalid value for hplh:ao 'hplh:data_pl': 'r-07', 'hplh:ao': 'true'}} # get the extra specs of interest from this volume's volume type volume_extra_specs = self.driver.proxy._get_volume_extra_specs( volume_with_vt) extra_specs = self.driver.proxy._get_lh_extra_specs( volume_extra_specs, hp_lefthand_rest_proxy.extra_specs_key_map.keys()) # map the extra specs key/value pairs to key/value pairs # used as optional configuration values by the LeftHand backend optional = self.driver.proxy._map_extra_specs(extra_specs) # {'hplh:ao': 'true'} should map to # {'isAdaptiveOptimizationEnabled': True} # without hplh:data_pl since r-07 is an invalid value self.assertDictMatch({'isAdaptiveOptimizationEnabled': True}, optional) def test_retype_with_no_LH_extra_specs(self): # setup drive with default configuration # and return the mock HTTP LeftHand client mock_client = self.setup_driver() ctxt = context.get_admin_context() host = {'host': self.serverName} key_specs_old = {'foo': False, 'bar': 2, 'error': True} key_specs_new = {'foo': True, 'bar': 5, 'error': False} old_type_ref = volume_types.create(ctxt, 'old', key_specs_old) new_type_ref = volume_types.create(ctxt, 'new', key_specs_new) diff, equal = volume_types.volume_types_diff(ctxt, old_type_ref['id'], new_type_ref['id']) volume = dict.copy(self.volume) old_type = volume_types.get_volume_type(ctxt, old_type_ref['id']) volume['volume_type'] = old_type volume['host'] = host new_type = volume_types.get_volume_type(ctxt, new_type_ref['id']) self.driver.retype(ctxt, volume, new_type, diff, host) expected = self.driver_startup_call_stack + [ mock.call.getVolumeByName('fakevolume')] # validate call chain mock_client.assert_has_calls(expected) def test_retype_with_only_LH_extra_specs(self): # setup drive with default configuration # and return the mock HTTP LeftHand client mock_client = self.setup_driver() mock_client.getVolumeByName.return_value = {'id': self.volume_id} ctxt = context.get_admin_context() host = {'host': self.serverName} key_specs_old = {'hplh:provisioning': 'thin'} key_specs_new = {'hplh:provisioning': 'full', 'hplh:ao': 'true'} old_type_ref = volume_types.create(ctxt, 'old', key_specs_old) new_type_ref = volume_types.create(ctxt, 'new', key_specs_new) diff, equal = volume_types.volume_types_diff(ctxt, old_type_ref['id'], new_type_ref['id']) volume = dict.copy(self.volume) old_type = volume_types.get_volume_type(ctxt, old_type_ref['id']) volume['volume_type'] = old_type volume['host'] = host new_type = volume_types.get_volume_type(ctxt, new_type_ref['id']) self.driver.retype(ctxt, volume, new_type, diff, host) expected = self.driver_startup_call_stack + [ mock.call.getVolumeByName('fakevolume'), mock.call.modifyVolume( 1, { 'isThinProvisioned': False, 'isAdaptiveOptimizationEnabled': True})] # validate call chain mock_client.assert_has_calls(expected) def test_retype_with_both_extra_specs(self): # setup drive with default configuration # and return the mock HTTP LeftHand client mock_client = self.setup_driver() mock_client.getVolumeByName.return_value = {'id': self.volume_id} ctxt = context.get_admin_context() host = {'host': self.serverName} key_specs_old = {'hplh:provisioning': 'full', 'foo': 'bar'} key_specs_new = {'hplh:provisioning': 'thin', 'foo': 'foobar'} old_type_ref = volume_types.create(ctxt, 'old', key_specs_old) new_type_ref = volume_types.create(ctxt, 'new', key_specs_new) diff, equal = volume_types.volume_types_diff(ctxt, old_type_ref['id'], new_type_ref['id']) volume = dict.copy(self.volume) old_type = volume_types.get_volume_type(ctxt, old_type_ref['id']) volume['volume_type'] = old_type volume['host'] = host new_type = volume_types.get_volume_type(ctxt, new_type_ref['id']) self.driver.retype(ctxt, volume, new_type, diff, host) expected = self.driver_startup_call_stack + [ mock.call.getVolumeByName('fakevolume'), mock.call.modifyVolume(1, {'isThinProvisioned': True})] # validate call chain mock_client.assert_has_calls(expected) def test_retype_same_extra_specs(self): # setup drive with default configuration # and return the mock HTTP LeftHand client mock_client = self.setup_driver() mock_client.getVolumeByName.return_value = {'id': self.volume_id} ctxt = context.get_admin_context() host = {'host': self.serverName} key_specs_old = {'hplh:provisioning': 'full', 'hplh:ao': 'true'} key_specs_new = {'hplh:provisioning': 'full', 'hplh:ao': 'false'} old_type_ref = volume_types.create(ctxt, 'old', key_specs_old) new_type_ref = volume_types.create(ctxt, 'new', key_specs_new) diff, equal = volume_types.volume_types_diff(ctxt, old_type_ref['id'], new_type_ref['id']) volume = dict.copy(self.volume) old_type = volume_types.get_volume_type(ctxt, old_type_ref['id']) volume['volume_type'] = old_type volume['host'] = host new_type = volume_types.get_volume_type(ctxt, new_type_ref['id']) self.driver.retype(ctxt, volume, new_type, diff, host) expected = self.driver_startup_call_stack + [ mock.call.getVolumeByName('fakevolume'), mock.call.modifyVolume( 1, {'isAdaptiveOptimizationEnabled': False})] # validate call chain mock_client.assert_has_calls(expected) def test_migrate_no_location(self): # setup drive with default configuration # and return the mock HTTP LeftHand client mock_client = self.setup_driver() host = {'host': self.serverName, 'capabilities': {}} (migrated, update) = self.driver.migrate_volume( None, self.volume, host) self.assertFalse(migrated) # only startup code is called mock_client.assert_has_calls(self.driver_startup_call_stack) # and nothing else self.assertEqual( len(self.driver_startup_call_stack), len(mock_client.method_calls)) def test_migrate_incorrect_vip(self): # setup drive with default configuration # and return the mock HTTP LeftHand client mock_client = self.setup_driver() mock_client.getClusterByName.return_value = { "virtualIPAddresses": [{ "ipV4Address": "10.10.10.10", "ipV4NetMask": "255.255.240.0"}]} mock_client.getVolumeByName.return_value = {'id': self.volume_id} location = (self.driver.proxy.DRIVER_LOCATION % { 'cluster': 'New_CloudCluster', 'vip': '10.10.10.111'}) host = { 'host': self.serverName, 'capabilities': {'location_info': location}} (migrated, update) = self.driver.migrate_volume( None, self.volume, host) self.assertFalse(migrated) expected = self.driver_startup_call_stack + [ mock.call.getClusterByName('New_CloudCluster')] mock_client.assert_has_calls(expected) # and nothing else self.assertEqual( len(expected), len(mock_client.method_calls)) def test_migrate_with_location(self): # setup drive with default configuration # and return the mock HTTP LeftHand client mock_client = self.setup_driver() mock_client.getClusterByName.return_value = { "virtualIPAddresses": [{ "ipV4Address": "10.10.10.111", "ipV4NetMask": "255.255.240.0"}]} mock_client.getVolumeByName.return_value = {'id': self.volume_id, 'iscsiSessions': None} mock_client.getVolume.return_value = {'snapshots': { 'resource': None}} location = (self.driver.proxy.DRIVER_LOCATION % { 'cluster': 'New_CloudCluster', 'vip': '10.10.10.111'}) host = { 'host': self.serverName, 'capabilities': {'location_info': location}} (migrated, update) = self.driver.migrate_volume( None, self.volume, host) self.assertTrue(migrated) expected = self.driver_startup_call_stack + [ mock.call.getClusterByName('New_CloudCluster'), mock.call.getVolumeByName('fakevolume'), mock.call.getVolume( 1, 'fields=snapshots,snapshots[resource[members[name]]]'), mock.call.modifyVolume(1, {'clusterName': 'New_CloudCluster'})] mock_client.assert_has_calls(expected) # and nothing else self.assertEqual( len(expected), len(mock_client.method_calls)) def test_migrate_with_Snapshots(self): # setup drive with default configuration # and return the mock HTTP LeftHand client mock_client = self.setup_driver() mock_client.getClusterByName.return_value = { "virtualIPAddresses": [{ "ipV4Address": "10.10.10.111", "ipV4NetMask": "255.255.240.0"}]} mock_client.getVolumeByName.return_value = { 'id': self.volume_id, 'iscsiSessions': None} mock_client.getVolume.return_value = {'snapshots': { 'resource': 'snapfoo'}} location = (self.driver.proxy.DRIVER_LOCATION % { 'cluster': 'New_CloudCluster', 'vip': '10.10.10.111'}) host = { 'host': self.serverName, 'capabilities': {'location_info': location}} (migrated, update) = self.driver.migrate_volume( None, self.volume, host) self.assertFalse(migrated) expected = self.driver_startup_call_stack + [ mock.call.getClusterByName('New_CloudCluster'), mock.call.getVolumeByName('fakevolume'), mock.call.getVolume( 1, 'fields=snapshots,snapshots[resource[members[name]]]')] mock_client.assert_has_calls(expected) # and nothing else self.assertEqual( len(expected), len(mock_client.method_calls)) @mock.patch.object(volume_types, 'get_volume_type', return_value={'extra_specs': {'hplh:ao': 'true'}}) def test_create_volume_with_ao_true(self, _mock_volume_type): # setup drive with default configuration # and return the mock HTTP LeftHand client mock_client = self.setup_driver() volume_with_vt = self.volume volume_with_vt['volume_type_id'] = 1 # mock return value of createVolume mock_client.createVolume.return_value = { 'iscsiIqn': self.connector['initiator']} volume_info = self.driver.create_volume(volume_with_vt) self.assertEqual('10.0.1.6:3260,1 iqn.1993-08.org.debian:01:222 0', volume_info['provider_location']) # make sure createVolume is called without # isAdaptiveOptimizationEnabled == true expected = self.driver_startup_call_stack + [ mock.call.createVolume( 'fakevolume', 1, units.GiB, {'isThinProvisioned': True, 'clusterName': 'CloudCluster1'})] mock_client.assert_has_calls(expected) @mock.patch.object(volume_types, 'get_volume_type', return_value={'extra_specs': {'hplh:ao': 'false'}}) def test_create_volume_with_ao_false(self, _mock_volume_type): # setup drive with default configuration # and return the mock HTTP LeftHand client mock_client = self.setup_driver() volume_with_vt = self.volume volume_with_vt['volume_type_id'] = 1 # mock return value of createVolume mock_client.createVolume.return_value = { 'iscsiIqn': self.connector['initiator']} volume_info = self.driver.create_volume(volume_with_vt) self.assertEqual('10.0.1.6:3260,1 iqn.1993-08.org.debian:01:222 0', volume_info['provider_location']) # make sure createVolume is called with # isAdaptiveOptimizationEnabled == false expected = self.driver_startup_call_stack + [ mock.call.createVolume( 'fakevolume', 1, units.GiB, {'isThinProvisioned': True, 'clusterName': 'CloudCluster1', 'isAdaptiveOptimizationEnabled': False})] mock_client.assert_has_calls(expected)
38,448
15,080
69
529ca778f839b2faf431dfcfc9f175e45f67cf11
5,304
py
Python
src/generative_models/CRFClassifier.py
anirban-code-to-live/NamedEntityRecognizer
f37070367685686044f00a2d5775df6af140afa6
[ "MIT" ]
null
null
null
src/generative_models/CRFClassifier.py
anirban-code-to-live/NamedEntityRecognizer
f37070367685686044f00a2d5775df6af140afa6
[ "MIT" ]
null
null
null
src/generative_models/CRFClassifier.py
anirban-code-to-live/NamedEntityRecognizer
f37070367685686044f00a2d5775df6af140afa6
[ "MIT" ]
null
null
null
from collections import Counter # import matplotlib.pyplot as plt import os import scipy.stats from sklearn.metrics import make_scorer from sklearn.model_selection import cross_val_score from sklearn.model_selection import RandomizedSearchCV from sklearn_crfsuite import CRF from sklearn_crfsuite import scorers from sklearn_crfsuite import metrics
42.095238
127
0.647247
from collections import Counter # import matplotlib.pyplot as plt import os import scipy.stats from sklearn.metrics import make_scorer from sklearn.model_selection import cross_val_score from sklearn.model_selection import RandomizedSearchCV from sklearn_crfsuite import CRF from sklearn_crfsuite import scorers from sklearn_crfsuite import metrics class CRFClassifier: def __init__(self): self._crf_model = CRF( algorithm='lbfgs', c1=0.1, c2=0.1, max_iterations=100, all_possible_transitions=True ) self._params_space = { 'c1': scipy.stats.expon(scale=0.5), 'c2': scipy.stats.expon(scale=0.05), } self._best_crf_model = None self._labels = None def train(self, x_train, y_train): self._crf_model.fit(x_train, y_train) self._labels = list(self._crf_model.classes_) f1_scorer = make_scorer(metrics.flat_f1_score, average='weighted', labels=self._labels) self._best_crf_model = RandomizedSearchCV(self._crf_model, self._params_space, cv=3, verbose=1, n_jobs=-1, n_iter=2, scoring=f1_scorer) self._best_crf_model.fit(x_train, y_train) print('best params:', self._best_crf_model.best_params_) print('best CV score:', self._best_crf_model.best_score_) print('model size: {:0.2f}M'.format(self._best_crf_model.best_estimator_.size_ / 1000000)) CRFClassifier.write_to_output_file('\nbest params:' + str(self._best_crf_model.best_params_)) CRFClassifier.write_to_output_file('best CV score:' + str(self._best_crf_model.best_score_)) CRFClassifier.write_to_output_file('model size: {:0.2f}M'.format(self._best_crf_model.best_estimator_.size_ / 1000000)) def test(self, test_x): return self._crf_model.predict(test_x) def get_average_f1_score(self, x_test, y_test): # self._labels = list(self._crf_model.classes_) # y_pred = self._crf_model.predict(x_test) crf = self._best_crf_model.best_estimator_ y_pred = crf.predict(x_test) return metrics.flat_f1_score(y_test, y_pred, average='weighted', labels=self._labels) def accuracy(self, x_test, y_test): y_pred = self._crf_model.predict(x_test) return CRFClassifier.__accuracy(y_pred, y_test) def get_class_f1_score(self, x_test, y_test): # y_pred = self._crf_model.predict(x_test) crf = self._best_crf_model.best_estimator_ y_pred = crf.predict(x_test) labels = list(self._crf_model.classes_) # group B and I results sorted_labels = sorted( labels, key=lambda name: (name[1:], name[0]) ) report = metrics.flat_classification_report(y_test, y_pred, labels=sorted_labels, digits=3) CRFClassifier.write_to_output_file(report) return report # def visualize_parameter_space(self): # plt.style.use('ggplot') # _x = [s.parameters['c1'] for s in self._best_crf_model.grid_scores_] # _y = [s.parameters['c2'] for s in self._best_crf_model.grid_scores_] # _c = [s.mean_validation_score for s in self._best_crf_model.grid_scores_] # # fig = plt.figure() # fig.set_size_inches(12, 12) # ax = plt.gca() # ax.set_yscale('log') # ax.set_xscale('log') # ax.set_xlabel('C1') # ax.set_ylabel('C2') # ax.set_title("Randomized Hyperparameter Search CV Results (min={:0.3}, max={:0.3})".format( # min(_c), max(_c) # )) # ax.scatter(_x, _y, c=_c, s=60, alpha=0.9, edgecolors=[0, 0, 0]) # print("Dark blue => {:0.4}, dark red => {:0.4}".format(min(_c), max(_c))) def print_top_positive_features(self): print("Top positive:") CRFClassifier.write_to_output_file("\nTop positive:") CRFClassifier.__print_state_features(Counter(self._best_crf_model.best_estimator_.state_features_).most_common(5)) def print_top_negative_features(self): print("\nTop negative:") CRFClassifier.write_to_output_file("\nTop negative:") CRFClassifier.__print_state_features(Counter(self._best_crf_model.best_estimator_.state_features_).most_common()[-5:]) @staticmethod def __print_state_features(state_features): for (attr, label), weight in state_features: print("%0.6f %-8s %s" % (weight, label, attr)) CRFClassifier.write_to_output_file("%0.6f %-8s %s" % (weight, label, attr)) @staticmethod def __accuracy(y_prediction, y_test): assert (len(y_prediction) == len(y_test)) test_data_count = len(y_test) correct_classification_count = len([i for i, j in zip(y_prediction, y_test) if i == int(j)]) return correct_classification_count / test_data_count @staticmethod def write_to_output_file(data): path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'output_data') output_file = open(os.path.join(path, 'report_fffff.txt'), 'a') output_file.write(data + '\n') output_file.close()
3,739
1,193
23
875bbdd061319c2630a549029aa0765602086df5
1,202
py
Python
parallel_translation/parallel_translation_requests.py
ChameleonTartu/neurotolge
2b610508f86d8f42c5ebe22691598bc302290dbf
[ "MIT" ]
null
null
null
parallel_translation/parallel_translation_requests.py
ChameleonTartu/neurotolge
2b610508f86d8f42c5ebe22691598bc302290dbf
[ "MIT" ]
9
2018-10-25T18:59:55.000Z
2019-04-19T11:19:44.000Z
parallel_translation/parallel_translation_requests.py
ChameleonTartu/neurotolge
2b610508f86d8f42c5ebe22691598bc302290dbf
[ "MIT" ]
1
2017-07-07T19:04:31.000Z
2017-07-07T19:04:31.000Z
#!/usr/bin/python # -*- encoding: utf-8 -*- import Queue import threading from translators.google import Google from translators.ut import UT from translators.tilde import Tilde
28.619048
112
0.732113
#!/usr/bin/python # -*- encoding: utf-8 -*- import Queue import threading from translators.google import Google from translators.ut import UT from translators.tilde import Tilde def start_thread(object): if "translate" in dir(object): thread = threading.Thread(target=object.translate) thread.daemon = True thread.start() return def get_translations(source_text, language_translate_from, language_translate_to, timeout=3, num_translators=3): queue = Queue.Queue() print("get_translations : language_translate_from", language_translate_from) print("get_translations : language_translate_to", language_translate_to) google = Google(source_text, language_translate_from, language_translate_to, queue) start_thread(google) ut = UT(source_text, language_translate_from, language_translate_to, queue) start_thread(ut) tilde = Tilde(source_text, language_translate_from, language_translate_to, queue) start_thread(tilde) translations = dict() for _ in xrange(num_translators): for key, value in queue.get().iteritems(): translations[key] = value queue.task_done() return translations
973
0
46
45cbf9ca250833104afe87db468b39d33a4b0c86
3,573
py
Python
src/specializer/specializer_spec.py
rrthomas/m
d4b4a2a6f16ebb6e27ba01d3be26f1dc50c051e9
[ "MIT" ]
5
2019-05-13T00:40:40.000Z
2022-03-05T23:16:56.000Z
src/specializer/specializer_spec.py
rrthomas/m
d4b4a2a6f16ebb6e27ba01d3be26f1dc50c051e9
[ "MIT" ]
164
2019-05-07T16:47:50.000Z
2021-02-27T23:37:16.000Z
src/specializer/specializer_spec.py
rrthomas/smite
d4b4a2a6f16ebb6e27ba01d3be26f1dc50c051e9
[ "MIT" ]
1
2021-02-08T09:51:19.000Z
2021-02-08T09:51:19.000Z
''' Specialized Instructions. Copyright (c) 2019-2020 Mit authors The package is distributed under the MIT/X11 License. THIS PROGRAM IS PROVIDED AS IS, WITH NO WARRANTY. USE IS AT THE USER’S RISK. ''' from dataclasses import dataclass from code_util import Code from action import Action, ActionEnum from spec import Instructions, ExtraInstructions from stack import StackEffect, Size @dataclass class Instruction(Action): ''' Specialized VM instruction descriptor. - guard - str - C expression which must evaluate to true for the specialized instruction to be executed. The guard may assume that the stack contains enough items to read `effect.args`. Specialized instructions have only one control flow path. Instructions with more than one control flow path are modelled as several specialized instructions with the same opcode and different guard expressions; the guards for a particular opcode must be exclusive. Specialized instructions cannot be variadic. ''' guard: str terminal: bool=False def _replace_items(picture, replacement): ''' Replaces 'ITEMS' with `replacement` in `picture` ''' ret = [] for item in picture.items: if item.size.count != 0: ret.extend(replacement) else: ret.append(item.name) return ret specialized_instructions = {} for instruction in Instructions: if instruction.action.action.is_variadic: for count in range(4): specialized_instructions[f'{instruction.name}_WITH_{count}'] = \ _gen_variadic_instruction(instruction, count) elif instruction.action.action.effect is not None: specialized_instructions[instruction.name] = \ _gen_ordinary_instruction(instruction) Instructions = ActionEnum( 'Instructions', specialized_instructions, ) # The set of Instructions that might modify the `ir` register. # We cannot guess beyond such an instruction. GUESS_LIMITING = frozenset([ Instructions.NEXT, Instructions.JUMP, Instructions.JUMPZ, ])
29.286885
86
0.652953
''' Specialized Instructions. Copyright (c) 2019-2020 Mit authors The package is distributed under the MIT/X11 License. THIS PROGRAM IS PROVIDED AS IS, WITH NO WARRANTY. USE IS AT THE USER’S RISK. ''' from dataclasses import dataclass from code_util import Code from action import Action, ActionEnum from spec import Instructions, ExtraInstructions from stack import StackEffect, Size @dataclass class Instruction(Action): ''' Specialized VM instruction descriptor. - guard - str - C expression which must evaluate to true for the specialized instruction to be executed. The guard may assume that the stack contains enough items to read `effect.args`. Specialized instructions have only one control flow path. Instructions with more than one control flow path are modelled as several specialized instructions with the same opcode and different guard expressions; the guards for a particular opcode must be exclusive. Specialized instructions cannot be variadic. ''' guard: str terminal: bool=False def __post_init__(self): super().__post_init__() assert not self.is_variadic if self.effect is not None: assert all( item.size == Size(1) for item in self.effect.by_name.values() ), self def __repr__(self): return self.name def _replace_items(picture, replacement): ''' Replaces 'ITEMS' with `replacement` in `picture` ''' ret = [] for item in picture.items: if item.size.count != 0: ret.extend(replacement) else: ret.append(item.name) return ret def _gen_ordinary_instruction(instruction, guard='1'): return ( Instruction( instruction.action.action.effect, instruction.action.action.code, guard, instruction.action.terminal is not None, ), instruction.opcode, ) def _gen_variadic_instruction(instruction, count): replacement = [f'x{i}' for i in range(count)] code = Code() code.append(f'''\ (void)COUNT; // Avoid a warning with -DNDEBUG assert(COUNT == {count}); ''') if count > 0: code.append('// Suppress warnings about possibly unused variables.') for i in range(count): code.append(f'(void)x{i};') code.extend(instruction.action.action.code) return ( Instruction( StackEffect.of( _replace_items(instruction.action.action.effect.args, replacement), _replace_items(instruction.action.action.effect.results, replacement), ), code, f'{{stack_0}} == {count}', instruction.action.terminal is not None, ), instruction.opcode, ) specialized_instructions = {} for instruction in Instructions: if instruction.action.action.is_variadic: for count in range(4): specialized_instructions[f'{instruction.name}_WITH_{count}'] = \ _gen_variadic_instruction(instruction, count) elif instruction.action.action.effect is not None: specialized_instructions[instruction.name] = \ _gen_ordinary_instruction(instruction) Instructions = ActionEnum( 'Instructions', specialized_instructions, ) # The set of Instructions that might modify the `ir` register. # We cannot guess beyond such an instruction. GUESS_LIMITING = frozenset([ Instructions.NEXT, Instructions.JUMP, Instructions.JUMPZ, ])
1,375
0
100
2a210493cc41c55355ae04eaa379ebdd85657040
773
py
Python
tests/agave_mock_server/agave_mock_server/apps_endpoints.py
vdjserver/agave-cli
4ad0826779cd760eb8a102978c456fee214ce8a3
[ "BSD-3-Clause" ]
null
null
null
tests/agave_mock_server/agave_mock_server/apps_endpoints.py
vdjserver/agave-cli
4ad0826779cd760eb8a102978c456fee214ce8a3
[ "BSD-3-Clause" ]
1
2019-06-11T21:48:12.000Z
2019-06-11T22:11:35.000Z
tests/agave_mock_server/agave_mock_server/apps_endpoints.py
vdjserver/agave-cli
4ad0826779cd760eb8a102978c456fee214ce8a3
[ "BSD-3-Clause" ]
null
null
null
""" apps_endpoints.py CLI integration tests for "apps-*" cli commands. """ import json import os from flask import jsonify, request from flask_restful import Resource from .response_templates import response_template_to_json # Sample response for "apps-list" cli command. apps_list_response = response_template_to_json("apps-list.json") class AgaveApps(Resource): """ Test apps-* cli commands """ def get(self): """ Test apps-list utility This test emulates the Agave API endpoint "/apps/v2/" for GET requests. To test it: curl -sk -H "Authorization: Bearer xxx" 'https://localhost:5000/apps/v2?pretty=True' """ pretty_print = request.args.get("pretty", "") return jsonify(apps_list_response)
24.935484
92
0.689521
""" apps_endpoints.py CLI integration tests for "apps-*" cli commands. """ import json import os from flask import jsonify, request from flask_restful import Resource from .response_templates import response_template_to_json # Sample response for "apps-list" cli command. apps_list_response = response_template_to_json("apps-list.json") class AgaveApps(Resource): """ Test apps-* cli commands """ def get(self): """ Test apps-list utility This test emulates the Agave API endpoint "/apps/v2/" for GET requests. To test it: curl -sk -H "Authorization: Bearer xxx" 'https://localhost:5000/apps/v2?pretty=True' """ pretty_print = request.args.get("pretty", "") return jsonify(apps_list_response)
0
0
0
6213176376cdddb03d9071f6e1e1eb584eaf70f9
39
py
Python
dl85/supervised/classifiers/__init__.py
BynaryCobweb/dl8.5
566fd61ecb94fa5a02cf67a901ba889da3c54fe2
[ "MIT" ]
1
2022-03-16T10:30:52.000Z
2022-03-16T10:30:52.000Z
dl85/supervised/classifiers/__init__.py
ubc-systopia/pydl8.5-lbguess
23a3b84bc632c04b5d5093909ea046f0b7902b48
[ "MIT" ]
null
null
null
dl85/supervised/classifiers/__init__.py
ubc-systopia/pydl8.5-lbguess
23a3b84bc632c04b5d5093909ea046f0b7902b48
[ "MIT" ]
1
2022-01-18T21:12:33.000Z
2022-01-18T21:12:33.000Z
from .classifier import DL85Classifier
19.5
38
0.871795
from .classifier import DL85Classifier
0
0
0
d64562eff04b88655662feae48bb4cf358b7ec1d
52,311
py
Python
prism/modellink/_modellink.py
vishalbelsare/PRISM
9565508df8f7f7bba4119f4f523fc4635455a4db
[ "BSD-3-Clause" ]
43
2019-01-28T05:40:43.000Z
2022-03-29T20:46:57.000Z
prism/modellink/_modellink.py
vishalbelsare/PRISM
9565508df8f7f7bba4119f4f523fc4635455a4db
[ "BSD-3-Clause" ]
30
2019-01-28T10:55:27.000Z
2021-02-01T04:06:55.000Z
prism/modellink/_modellink.py
vishalbelsare/PRISM
9565508df8f7f7bba4119f4f523fc4635455a4db
[ "BSD-3-Clause" ]
7
2020-01-10T15:54:55.000Z
2021-02-01T04:46:17.000Z
# -*- coding: utf-8 -*- """ ModelLink ========= Provides the definition of the :class:`~ModelLink` abstract base class. """ # %% IMPORTS # Built-in imports import abc from glob import glob from os import path from tempfile import mktemp import warnings # Package imports import e13tools as e13 import h5py import hickle import numpy as np from sortedcontainers import SortedDict as sdict, SortedSet as sset # PRISM imports from prism import __version__ from prism._docstrings import std_emul_i_doc from prism._internal import ( FeatureWarning, RequestWarning, check_vals, getCLogger, np_array) from prism.modellink.utils import convert_data, convert_parameters # All declaration __all__ = ['ModelLink'] # %% MODELLINK CLASS DEFINITION # TODO: Allow for inter-process methods? # Like, having a method that is called before/after construction. class ModelLink(object, metaclass=abc.ABCMeta): """ Provides an abstract base class definition that allows the :class:`~prism.Pipeline` class to be linked to any model/test object of choice. Every model wrapper used in the :class:`~prism.Pipeline` class must be an instance of the :class:`~ModelLink` class. Description ----------- The :class:`~ModelLink` class is an abstract base class, which forms the base for wrapping a model and allowing *PRISM* to use it effectively. Because it is mandatory for every model to be wrapped in a user-made :class:`~ModelLink` subclass, several tools are provided to the user to make this as versatile as possible. The :class:`~ModelLink` class uses three properties that define the way the subclass will be used by *PRISM*: :attr:`~name`, :attr:`~call_type` and :attr:`~MPI_call`. The first defines what the name of the subclass is, which is used by *PRISM* to identify the subclass with and check if one did not use a different subclass by accident. The other two are flags that determine how the :meth:`~call_model` method should be used. These three properties can be set anywhere during the initialization of the :class:`~ModelLink` subclass, or are set to a default value if they are not modified. Every :class:`~ModelLink` subclass needs to be provided with two different data sets: `model parameters` and `model data`. The model parameters define which parameters the model can take, what their names are and in what value range each parameter must be. The model data on the other hand, states where in a model realization a data value must be retrieved and compared with a provided observational value. One can think of the model data as the observational constraints used to calculate the likelihood in a Bayesian analysis. The model parameters and model data can be set in two different ways. They can be hard-coded into the :class:`~ModelLink` subclass by altering the :meth:`~get_default_model_parameters` and :meth:`~get_default_model_data` methods or set by providing them during class initialization. A combination of both is also possible. More details on this can be found in :meth:`~__init__`. The :class:`~ModelLink` class has two abstract methods that must be overridden before the subclass can be initialized. The :meth:`~call_model` method is the most important method, as it provides *PRISM* with a way of calling the model wrapped in the :class:`~ModelLink` subclass. The :meth:`~get_md_var` method allows for *PRISM* to calculate the model discrepancy variance. Notes ----- The :meth:`~__init__` method may be extended by the :class:`~ModelLink` subclass, but the superclass version must always be called. If required, one can use the :func:`~prism.modellink.test_subclass` function to test a :class:`~ModelLink` subclass on correct functionality. """ def __init__(self, *, model_parameters=None, model_data=None): """ Initialize an instance of the :class:`~ModelLink` subclass. Optional -------- model_parameters, model_data : array_like, dict, str or None.\ Default: None Anything that can be converted to a dict that provides non-default model parameters/data information or *None* if only default information is used from :meth:`~get_default_model_parameters` or :meth:`~get_default_model_data`. For more information on the lay-out of these dicts, see ``Notes``. If array_like, dict(`model_parameters`/`model_data`) must generate a dict with the correct lay-out. If dict, the dict itself must have the correct lay-out. If str, the string must be the path to a file containing the dict keys in the first column and the dict values in the second column, which combined generate a dict with the correct lay-out. Notes (model_parameters) ------------------------ The model parameters provides this :class:`~ModelLink` subclass with the names, ranges and estimates of all model parameters that need to be explored. The model parameters dict requires to have the name of the parameters as the keyword, and a 1D list containing the lower bound, the upper bound and, if applicable, the estimate of this parameter. It is not required to provide an estimate for every parameter. The estimates are used to draw illustrative lines when making projection figures. An example of a model parameters file can be found in the 'data' folder of the *PRISM* package. If required, one can use the :func:`~prism.modellink.convert_parameters` function to validate their formatting. Formatting : ``{par_name: [lower_bnd, upper_bnd, par_est]}`` Notes (model_data) ------------------ The model data provides this :class:`~ModelLink` subclass with the observational data points that need to be used to constrain this model with. The model data dict requires to have the data identifiers (:attr:`~data_idx`) as the keyword, and a 1D list containing the data value (:attr:`~data_val`); the data errors (:attr:`~data_err`) and the data space (:attr:`~data_spc`). If the data errors are given with one value, then the data points are assumed to have a centered :math:`1\\sigma`-confidence interval. If the data errors are given with two values, then the data points are assumed to have a :math:`1\\sigma`-confidence interval defined by the provided upper and lower errors. The data spaces are one of five strings ({'lin', 'log' or 'log_10', 'ln' or 'log_e'}) indicating in which of the three value spaces (linear, log, ln) the data values are. It defaults to 'lin' if it is not provided. The data identifier is a sequence of bools, ints, floats and strings that is unique for every data point. *PRISM* uses it to identify a data point with, which is required in some cases (like MPI), while the model itself can use it as a description of the operations required to extract the data point from the model output. It can be provided as any sequence of any length for any data point. If any sequence contains a single element, it is replaced by just that element instead of a tuple. A simple example of a data identifier is :math:`f(\\text{data_idx}) = \\text{data_val}`, where the output of the model is given by :math:`f(x)`. An example of a model data file can be found in the 'data' folder of the *PRISM* package. If required, one can use the :func:`~prism.modellink.convert_data` function to validate their formatting. Formatting : ``{(data_idx_0, data_idx_1, ..., data_idx_n): [data_val,`` \ ``data_err, data_spc]}`` \n **or** \n ``{(data_idx_0, data_idx_1, ..., data_idx_n): [data_val,`` \ ``upper_data_err, lower_data_err, data_spc]}`` """ # Save name of this class if not saved already if not hasattr(self, '_name'): self.name = self.__class__.__name__ # Set call_type to default ('single') if not modified before if not hasattr(self, '_call_type'): self.call_type = 'single' # Set MPI_call to default (False) if not modified before if not hasattr(self, '_MPI_call'): self.MPI_call = False # Generate model parameter properties self.__set_model_parameters(model_parameters) # Generate model data properties self.__set_model_data(model_data) # Define the representation of a ModelLink object # %% CLASS PROPERTIES # General @property def name(self): """ str: Name associated with an instance of this :class:`~ModelLink` subclass. By default, it is set to the name of this :class:`~ModelLink` subclass. Can be manually manipulated to allow for more user control. """ return(self._name) @name.setter @property def single_call(self): """ bool: Whether :meth:`~call_model` can/should be supplied with a single evaluation sample. At least one of :attr:`~single_call` and :attr:`~multi_call` must be *True*. By default, single model calls are requested (True). """ return(bool(self._single_call)) @property def multi_call(self): """ bool: Whether :meth:`~call_model` can/should be supplied with a set of evaluation samples. At least one of :attr:`~single_call` and :attr:`~multi_call` must be *True*. By default, single model calls are requested (False). """ return(bool(self._multi_call)) @property def call_type(self): """ str: String indicating whether :meth:`call_model` should be supplied with a single evaluation sample ('single') or a set of samples ('multi'), or can be supplied with both ('hybrid'). By default, single model calls are requested ('single'). """ return(self._call_type) @call_type.setter @property def MPI_call(self): """ bool: Whether :meth:`~call_model` can/should be called by all MPI ranks simultaneously instead of by the controller. By default, only the controller rank calls the model (False). """ return(bool(self._MPI_call)) @MPI_call.setter # Model Parameters @property def n_par(self): """ int: Number of model parameters. """ return(self._n_par) @property def par_name(self): """ list of str: List with model parameter names. """ return(self._par_name) @property def par_rng(self): """ dict of :obj:`~numpy.ndarray`: The lower and upper values of the model parameters. """ return(sdict(zip(self._par_name, self._par_rng))) @property def par_est(self): """ dict of {float, None}: The user-defined estimated values of the model parameters. Contains *None* in places where estimates were not provided. """ return(sdict(zip(self._par_name, self._par_est))) @property def model_parameters(self): """ dict of list: The dict of model parameters as used by this :obj:`~ModelLink` instance. This dict can be used as the `model_parameters` argument when initializing this :class:`~ModelLink` subclass. """ # Initialize empty dict of model parameters model_parameters = sdict() # Loop over all parameter properties and add them to the dict for name, rng, est in zip(self._par_name, self._par_rng, self._par_est): # If estimate was not given, only add the parameter range if est is None: model_parameters[name] = [*rng] # Else, add range and estimate else: model_parameters[name] = [*rng, est] # Return model_parameters return(model_parameters) # Model Data @property def n_data(self): """ int: Number of provided data points. """ return(self._n_data) @property def data_val(self): """ dict of float: The values of provided data points. """ return(dict(zip(self._data_idx, self._data_val))) @property def data_err(self): """ dict of float: The upper and lower :math:`1\\sigma`-confidence levels of provided data points. """ return(dict(zip(self._data_idx, self._data_err))) @property def data_spc(self): """ dict of str: The types of value space ({'lin', 'log', 'ln'}) of provided data points. """ return(dict(zip(self._data_idx, self._data_spc))) @property def data_idx(self): """ list of tuples: The user-defined data point identifiers. """ return(self._data_idx) @property def model_data(self): """ dict of list: The dict of model data points as used by this :obj:`~ModelLink` instance. This dict can be used as the `model_data` argument when initializing this :class:`~ModelLink` subclass. """ # Initialize empty dict of model data model_data = {} # Combine data points together, only adding non-default values to dict for idx, val, err, spc in zip(self._data_idx, self._data_val, self._data_err, self._data_spc): # Create data point data_point = [val] # Add data error, add only one value if error is centered if(err[0] == err[1]): data_point.append(err[0]) else: data_point.extend(err) # Add data space if it is not 'lin' if(spc != 'lin'): data_point.append(spc) # Add data_point to model_data dict model_data[idx] = data_point # Return model_data return(model_data) # %% GENERAL CLASS METHODS # This function returns non-default string representations of input args def get_str_repr(self): """ Returns a list of string representations of all additional input arguments with which this :class:`~ModelLink` subclass was initialized. """ return([]) # This function converts values in unit space to parameter space def _to_par_space(self, sam_set): """ Converts provided `sam_set` from unit space ([0, 1]) to parameter space ([lower_bnd, upper_bnd]). """ return(self._par_rng[:, 0]+sam_set*(self._par_rng[:, 1] - self._par_rng[:, 0])) # This function converts values in parameter space to unit space def _to_unit_space(self, sam_set): """ Converts provided `sam_set` from parameter space ([lower_bnd, upper_bnd]) to unit space ([0, 1]). """ return((sam_set-self._par_rng[:, 0]) / (self._par_rng[:, 1]-self._par_rng[:, 0])) # This function converts a sequence of model parameter names/indices def _get_model_par_seq(self, par_seq, name): """ Converts a provided sequence `par_seq` of model parameter names and indices to a list of indices, removes duplicates and checks if every provided name/index is valid. Parameters ---------- par_seq : 1D array_like of {int, str} A sequence of integers and strings determining which model parameters need to be used for a certain operation. name : str A string stating the name of the variable the result of this method will be stored in. Used for error messages. Returns ------- par_seq_conv : list of int The provided sequence `par_seq` converted to a sorted list of model parameter indices. """ # Do some logging logger = getCLogger('INIT') logger.info("Converting sequence of model parameter names/indices.") # Remove all unwanted characters from the string and split it up par_seq = e13.split_seq(par_seq) # Check elements if they are ints or strings, and if they are valid for i, par_idx in enumerate(par_seq): try: # If par_idx is a string, try to use it as a parameter name if isinstance(par_idx, str): par_seq[i] = self._par_name.index(par_idx) # If not, try to use it as a parameter index else: self._par_name[par_idx] par_seq[i] = par_idx % self._n_par # If any operation above fails, raise error except Exception as error: err_msg = ("Input argument %r[%i] is invalid! (%s)" % (name, i, error)) e13.raise_error(err_msg, e13.InputError, logger) # If everything went without exceptions, check if list is not empty and # remove duplicates if par_seq: par_seq = list(sset(par_seq)) else: err_msg = "Input argument %r is empty!" % (name) e13.raise_error(err_msg, ValueError, logger) # Log end logger.info("Finished converting sequence of model parameter " "names/indices.") # Return it return(par_seq) # Returns the hypercube that encloses provided sam_set def _get_sam_space(self, sam_set): """ Returns the boundaries of the hypercube that encloses the parameter space in which the provided `sam_set` is defined. The main use for this function is to determine what part of model parameter space was likely sampled from in order to obtain the provided `sam_set`. Because of this, extra spacing is added to the boundaries to reduce the effect of the used sampling method. Parameters ---------- sam_set : 1D or 2D array_like or dict Parameter/sample set for which an enclosing hypercube is requested. Returns ------- sam_space : 2D :obj:`~numpy.ndarray` object The requested hypercube boundaries. """ # If sam_set is a dict, convert it to a NumPy array if isinstance(sam_set, dict): sam_set = np_array(sdict(sam_set).values()).T # Make sure that sam_set is a 2D NumPy array sam_set = np_array(sam_set, ndmin=2) # Determine the maximum difference between consecutive samples sam_diff = np.apply_along_axis( lambda x: np.max(np.diff(np.sort(x))), axis=0, arr=sam_set) # Determine the min/max values of all samples sam_min = np.min(sam_set, axis=0) sam_max = np.max(sam_set, axis=0) # Add 3*sam_diff as extra spacing to sam_min and sam_max # This reduces the effect of the used sampling method and randomness sam_min -= 3*sam_diff sam_max += 3*sam_diff # Combine sam_min and sam_max to form sam_space sam_space = np.stack([sam_min, sam_max], axis=1) # Make sure that sam_space is within par_space sam_space = np.apply_along_axis( lambda x: np.clip(x, *self._par_rng.T), axis=0, arr=sam_space) # Return sam_space return(sam_space) # This function checks if a provided mod_set is valid def _check_mod_set(self, mod_set, name): """ Checks validity of provided set of model outputs `mod_set` in this :obj:`~ModelLink` instance. Parameters ---------- mod_set : 1D or 2D array_like or dict Model output (set) to validate in this :obj:`~ModelLink` instance. name : str The name of the model output (set), which is used in the error message if the validation fails. Returns ------- mod_set : 1D or 2D :obj:`~numpy.ndarray` object The provided `mod_set` if the validation was successful. If `mod_set` was a dict, it will be converted to a :obj:`~numpy.ndarray` object (sorted on :attr:`~data_idx`). """ # Make logger logger = getCLogger('CHECK') logger.info("Validating provided set of model outputs %r." % (name)) # If mod_set is a dict, try to convert it to a NumPy array if isinstance(mod_set, dict): try: mod_set = np_array([mod_set[idx] for idx in self._data_idx]).T except KeyError as error: err_msg = ("Input argument %r is missing data identifier '%r'!" % (name, error.args[0])) e13.raise_error(err_msg, KeyError, logger) # Make sure that mod_set is a NumPy array mod_set = np_array(mod_set) # Raise error if mod_set is not 1D or 2D if not(mod_set.ndim == 1 or mod_set.ndim == 2): err_msg = ("Input argument %r is not one-dimensional or " "two-dimensional!" % (name)) e13.raise_error(err_msg, e13.ShapeError, logger) # Raise error if mod_set does not have n_data data values if not(mod_set.shape[-1] == self._n_data): err_msg = ("Input argument %r has incorrect number of data values " "(%i != %i)!" % (name, mod_set.shape[-1], self._n_data)) e13.raise_error(err_msg, e13.ShapeError, logger) # Check if mod_set solely consists out of floats mod_set = check_vals(mod_set, name, 'float') # Log again and return mod_set logger.info("Finished validating provided set of model outputs %r." % (name)) return(mod_set) # This function checks if a provided sam_set is valid def _check_sam_set(self, sam_set, name): """ Checks validity of provided set of model parameter samples `sam_set` in this :obj:`~ModelLink` instance. Parameters ---------- sam_set : 1D or 2D array_like or dict Parameter/sample set to validate in this :obj:`~ModelLink` instance. name : str The name of the parameter/sample set, which is used in the error message if the validation fails. Returns ------- sam_set : 1D or 2D :obj:`~numpy.ndarray` object The provided `sam_set` if the validation was successful. If `sam_set` was a dict, it will be converted to a :obj:`~numpy.ndarray` object. """ # Make logger logger = getCLogger('CHECK') logger.info("Validating provided set of model parameter samples %r." % (name)) # If sam_set is a dict, convert it to a NumPy array if isinstance(sam_set, dict): sam_set = np_array(sdict(sam_set).values()).T # Make sure that sam_set is a NumPy array sam_set = np_array(sam_set) # Raise error if sam_set is not 1D or 2D if not(sam_set.ndim == 1 or sam_set.ndim == 2): err_msg = ("Input argument %r is not one-dimensional or " "two-dimensional!" % (name)) e13.raise_error(err_msg, e13.ShapeError, logger) # Raise error if sam_set does not have n_par parameter values if not(sam_set.shape[-1] == self._n_par): err_msg = ("Input argument %r has incorrect number of parameters " "(%i != %i)!" % (name, sam_set.shape[-1], self._n_par)) e13.raise_error(err_msg, e13.ShapeError, logger) # Check if sam_set solely consists out of floats sam_set = check_vals(sam_set, name, 'float') # Check if all samples are within parameter space sam_set_2D = np_array(sam_set, ndmin=2) rng = self._par_rng check = np.apply_along_axis( lambda x: ((rng[:, 0] <= x)*(x <= rng[:, 1])).all(), 1, sam_set_2D) # If check is not empty (can be indexed), raise error try: index = np.argwhere(~check)[0] except IndexError: pass else: err_msg = ("Input argument '%s%s' is outside parameter space!" % (name, index if sam_set.ndim != 1 else '')) e13.raise_error(err_msg, ValueError, logger) # Log again and return sam_set logger.info("Finished validating provided set of model parameter " "samples %r." % (name)) return(sam_set) # This function converts a given sam_set to a sam_dict def _get_sam_dict(self, sam_set): """ Converts a provided set of model parameter samples `sam_set` to a dict for use in this :obj:`~ModelLink` instance. This dict can be used as the `par_set` argument in the :meth:`~call_model` and :meth:`~get_md_var` methods. Parameters ---------- sam_set : 1D or 2D array_like Parameter/sample set to convert for this :obj:`~ModelLink` instance. Returns ------- sam_dict : dict of list Dict of parameter samples. """ # Make sure that sam_set is a NumPy array sam_set = np_array(sam_set) # Check how many dimensions sam_set has and act accordingly if(sam_set.ndim == 1): sam_dict = sdict(zip(self._par_name, sam_set)) else: sam_dict = sdict(zip(self._par_name, sam_set.T)) # Return sam_dict return(sam_dict) # This function checks if a provided md_var is valid def _check_md_var(self, md_var, name): """ Checks validity of provided set of model discrepancy variances `md_var` in this :obj:`~ModelLink` instance. Parameters ---------- md_var : 1D or 2D array_like or dict Model discrepancy variance set to validate in this :obj:`~ModelLink` instance. name : str The name of the model discrepancy set, which is used in the error message if the validation fails. Returns ------- md_var : 2D :obj:`~numpy.ndarray` object The (converted) provided `md_var` if the validation was successful. If `md_var` was a dict, it will be converted to a :obj:`~numpy.ndarray` object. """ # Make logger logger = getCLogger('CHECK') logger.info("Validating provided set of model discrepancy variances " "%r." % (name)) # If md_var is a dict, convert it to a NumPy array if isinstance(md_var, dict): md_var = np_array([md_var[idx] for idx in md_var.keys()]) # Make sure that md_var is a NumPy array md_var = np_array(md_var) # Raise error if md_var is not 1D or 2D if not(md_var.ndim == 1 or md_var.ndim == 2): err_msg = ("Input argument %r is not one-dimensional or " "two-dimensional!" % (name)) e13.raise_error(err_msg, e13.ShapeError, logger) # Check if md_var contains n_data values if not(md_var.shape[0] == self._n_data): err_msg = ("Received array of model discrepancy variances %r has " "incorrect number of data points (%i != %i)!" % (name, md_var.shape[0], self._n_data)) raise e13.ShapeError(err_msg) # Check if single or dual values were given if(md_var.ndim == 1): md_var = np_array([md_var]*2).T elif(md_var.shape[1] == 2): pass else: err_msg = ("Received array of model discrepancy variances %r has " "incorrect number of values (%i != 2)!" % (name, md_var.shape[1])) raise e13.ShapeError(err_msg) # Check if all values are non-negative floats md_var = check_vals(md_var, 'md_var', 'nneg', 'float') # Log again and return md_var logger.info("Finished validating provided set of model discrepancy " "variances %r." % (name)) return(md_var) # This function returns the path to a backup file # TODO: Should backup file be saved in emulator working directory of PRISM? def _get_backup_path(self, emul_i, suffix): """ Returns the absolute path to a backup file made by this :obj:`~ModelLink` instance, using the provided `emul_i` and `suffix`. This method is used by the :meth:`~_make_backup` and :meth:`~_read_backup` methods, and should not be called directly. Parameters ---------- emul_i : int The emulator iteration for which a backup filepath is needed. suffix : str or None If str, determine path to associated backup file using provided `suffix`. If `suffix` is empty, obtain last created backup file. If *None*, create a new path to a backup file. Returns ------- filepath : str Absolute path to requested backup file. """ # Determine the prefix of the backup hdf5-file prefix = "backup_%i_%s(" % (emul_i, self._name) # If suffix is None, generate new backup filepath if suffix is None: # Determine the path of the backup hdf5-file filepath = path.abspath(mktemp(').hdf5', prefix, '.')) # Return determined filepath return(filepath) # If suffix is a string, determine the path elif isinstance(suffix, str): # If the string is empty, find the last created backup file if not suffix: # Make list of all valid backup files in current directory files = glob("%s/%s*" % (path.abspath('.'), prefix)) # If files is not empty, return last one created if files: return(max(files, key=path.getctime)) # Else, raise error else: err_msg = ("No backup files can be found in the current " "directory for input argument 'emul_i'!") raise OSError(err_msg) # If the string is not empty, check if provided suffix is valid else: # Obtain full filepath filepath = path.abspath(path.join( '.', ''.join([prefix, suffix, ').hdf5']))) # If filepath exists, return it if path.exists(filepath): return(filepath) # If not, raise error else: err_msg = ("Input argument 'suffix' does not yield an " "existing path to a backup file (%r)!" % (filepath)) raise OSError(err_msg) # This function makes a backup of args/kwargs to be used during call_model def _make_backup(self, *args, **kwargs): """ WARNING: This is an advanced utility method and probably will not work unless used properly. Use with caution! Creates an HDF5-file backup of the provided `args` and `kwargs` when called by the :meth:`~call_model` method or any of its inner functions. Additionally, the backup will contain the `emul_i`, `par_set` and `data_idx` values that were passed to the :meth:`~call_model` method. It also contains the version of *PRISM* that made the backup. The backup can be restored using the :meth:`~_read_backup` method. If it is detected that this method is used incorrectly, a :class:`~prism._internal.RequestWarning` is raised (and the method returns) rather than a :class:`~prism._internal.RequestError`, in order to not disrupt the call to :meth:`~call_model`. Parameters ---------- args : positional arguments All positional arguments that must be stored in the backup file. kwargs : keyword arguments All keyword arguments that must be stored in the backup file. Notes ----- The name of the created backup file contains the value of `emul_i`, :attr:`~name` and a random string to avoid replacing an already existing backup file. The saved `emul_i`, `par_set` and `data_idx` are the values these variables have locally in the :meth:`~call_model` method at the point this method is called. Because of this, making any changes to them may cause problems and is therefore heavily discouraged. If changes are necessary, it is advised to copy them to a different variable first. """ # Raise warning about this feature being experimental warn_msg = ("The 'call_model' backup system is still experimental and " "it may see significant changes or be (re)moved in the " "future!") warnings.warn(warn_msg, FeatureWarning, stacklevel=2) # Check if any args or kwargs have been provided if not args and not kwargs: # If not, issue a warning about that and return warn_msg = ("No positional or keyword arguments have been " "provided. Backup creation will be skipped!") warnings.warn(warn_msg, RequestWarning, stacklevel=2) return # Obtain the call_model frame caller_frame = e13.get_outer_frame(self.call_model) # If caller_frame is None, the call_model frame was not found if caller_frame is None: # Issue a warning about it and return warn_msg = ("This method has been called from outside the " "'call_model' method. Backup creation will be " "skipped!") warnings.warn(warn_msg, RequestWarning, stacklevel=2) return # Obtain the locals of the call_model frame loc = caller_frame.f_locals # Extract local emul_i, par_set and data_idx # Unless call_model was called using args, below will extract correctly # These one-liners are the equivalent of # try: # emul_i = loc['emul_i'] # except KeyError: # try: # emul_i = loc['kwargs']['emul_i'] # except KeyError: # emul_i = None emul_i = loc.get('emul_i', loc.get('kwargs', {}).get('emul_i')) par_set = loc.get('par_set', loc.get('kwargs', {}).get('par_set')) data_idx = loc.get('data_idx', loc.get('kwargs', {}).get('data_idx')) # If one of these is None, then it is not correctly locally available # This can happen if args are used instead of kwargs for call_model # PRISM code always uses kwargs and never causes this problem if None in (emul_i, par_set, data_idx): warn_msg = ("Required local variables 'emul_i', 'par_set' and " "'data_idx' are not correctly available. Backup " "creation will be skipped!") warnings.warn(warn_msg, RequestWarning, stacklevel=2) return # Obtain path to backup file filepath = self._get_backup_path(emul_i, None) # Save emul_i, par_set, data_idx, args and kwargs to hdf5 with h5py.File(filepath, 'w') as file: file.attrs['emul_i'] = emul_i file.attrs['prism_version'] = __version__ hickle.dump(dict(par_set), file, path='/par_set') hickle.dump(data_idx, file, path='/data_idx') hickle.dump(args, file, path='/args') hickle.dump(kwargs, file, path='/kwargs') # This function reads in a backup made by _make_backup # TODO: Allow for absolute path to backup file to be given? # TODO: Convert to static method to read backups without subclass object? def _read_backup(self, emul_i, *, suffix=None): """ Reads in a backup HDF5-file created by the :meth:`~_make_backup` method, using the provided `emul_i` and the value of :attr:`~name`. Parameters ---------- emul_i : int The emulator iteration that was provided to the :meth:`~call_model` method when the backup was made. Optional -------- suffix : str or None. Default: None The suffix of the backup file (everything between parentheses) that needs to be read. If *None* or empty, the last created backup will be read. Returns ------- filename : str The absolute path to the backup file that has been read. data : dict with keys `('emul_i', 'prism_version', 'par_set',` \ `'data_idx', 'args', 'kwargs')` A dict containing the data that was provided to the :meth:`~_make_backup` method. """ # Raise warning about this feature being experimental warn_msg = ("The 'call_model' backup system is still experimental and " "it may see significant changes or be (re)moved in the " "future!") warnings.warn(warn_msg, FeatureWarning, stacklevel=2) # Check if provided emul_i is an integer emul_i = check_vals(emul_i, 'emul_i', 'int', 'nneg') # Check if provided suffix is None or a string if suffix is None: suffix = '' else: suffix = check_vals(suffix, 'suffix', 'str') # Obtain name of backup file filepath = self._get_backup_path(emul_i, suffix) # Initialize empty data dict data = sdict() # Read emul_i, par_set, data_idx, args and kwargs from hdf5 with h5py.File(filepath, 'r') as file: data['emul_i'] = file.attrs['emul_i'] data['prism_version'] = file.attrs['prism_version'] data['par_set'] = sdict(hickle.load(file, path='/par_set')) data['data_idx'] = hickle.load(file, path='/data_idx') data['args'] = hickle.load(file, path='/args') data['kwargs'] = hickle.load(file, path='/kwargs') # Return data return(filepath, data) @property def _default_model_parameters(self): """ dict: The default model parameters to use for every instance of this :class:`~ModelLink` subclass. """ return(sdict()) def get_default_model_parameters(self): """ Returns the default model parameters to use for every instance of this :class:`~ModelLink` subclass. By default, returns :attr:`~ModelLink._default_model_parameters`. """ return(self._default_model_parameters) def __set_model_parameters(self, add_model_parameters): """ Generates the model parameter properties from the default model parameters and the additional input argument `add_model_parameters`. Parameters ---------- add_model_parameters : array_like, dict, str or None Anything that can be converted to a dict that provides non-default model parameters information or *None* if only default information is used from :meth:`~ModelLink.get_default_model_parameters`. Generates --------- n_par : int Number of model parameters. par_name : list List with model parameter names. par_rng : :obj:`~numpy.ndarray` object Array containing the lower and upper values of the model parameters. par_est : list List containing user-defined estimated values of the model parameters. Contains *None* in places where estimates were not provided. """ # Obtain default model parameters model_parameters =\ convert_parameters(self.get_default_model_parameters()) # If additional model parameters information is given, add it if add_model_parameters is not None: model_parameters.update(convert_parameters(add_model_parameters)) # Save number of model parameters n_par = len(model_parameters.keys()) if(n_par == 1): raise e13.InputError("Number of model parameters must be at least " "2!") else: self._n_par = check_vals(n_par, 'n_par', 'pos') # Create empty parameter name, ranges and estimate lists/arrays self._par_name = [] self._par_rng = np.zeros([self._n_par, 2]) self._par_rng[:, 1] = 1 self._par_est = [] # Save model parameters as class properties for i, (name, (*rng, est)) in enumerate(model_parameters.items()): # Save parameter name, range and est self._par_name.append(name) self._par_rng[i] = rng self._par_est.append(est) @property def _default_model_data(self): """ dict: The default model data to use for every instance of this :class:`~ModelLink` subclass. """ return(dict()) def get_default_model_data(self): """ Returns the default model data to use for every instance of this :class:`~ModelLink` subclass. By default, returns :attr:`~ModelLink._default_model_data`. """ return(self._default_model_data) def __set_model_data(self, add_model_data): """ Generates the model data properties from the default model data and the additional input argument `add_model_data`. Parameters --------- add_model_data : array_like, dict, str or None Anything that can be converted to a dict that provides non-default model data information or *None* if only default data is used from :meth:`~ModelLink.get_default_model_data`. Generates --------- n_data : int Number of provided data points. data_val : list List with values of provided data points. data_err : list of lists List with upper and lower :math:`1\\sigma`-confidence levels of provided data points. data_spc : list List with types of value space ({'lin', 'log', 'ln'}) of provided data points. data_idx : list of tuples List with user-defined data point identifiers. """ # Obtain default model data model_data = convert_data(self.get_default_model_data()) # If additional model data information is given, add it if add_model_data is not None: model_data.update(convert_data(add_model_data)) # Determine the number of data points self._n_data = check_vals(len(model_data), 'n_data', 'pos') # Create empty data value, error, space and identifier lists self._data_val = [] self._data_err = [] self._data_spc = [] self._data_idx = [] # Save model data as class properties for idx, (val, *err, spc) in model_data.items(): # Save data value, errors, space and identifier self._data_val.append(val) self._data_err.append(err) self._data_spc.append(spc) self._data_idx.append(idx) # %% ABSTRACT USER METHODS @abc.abstractmethod @e13.docstring_substitute(emul_i=std_emul_i_doc) def call_model(self, emul_i, par_set, data_idx): """ Calls the model wrapped in this :class:`~ModelLink` subclass at emulator iteration `emul_i` for model parameter values `par_set` and returns the data points corresponding to `data_idx`. This method is called with solely keyword arguments. This is an abstract method and must be overridden by the :class:`~ModelLink` subclass. Parameters ---------- %(emul_i)s par_set : dict of :class:`~numpy.float64` Dict containing the values for all model parameters corresponding to the requested model realization(s). If model is single-called, dict item is formatted as ``{par_name: par_val}``. If multi-called, it is formatted as ``{par_name: [par_val_1, par_val_2, ..., par_val_n]}``. data_idx : list of tuples List containing the user-defined data point identifiers corresponding to the requested data points. Returns ------- data_val : 1D or 2D array_like or dict Array containing the data values corresponding to the requested data points generated by the requested model realization(s). If model is multi-called, `data_val` is of shape ``(n_sam, n_data)``. If dict, it has the identifiers in `data_idx` as its keys with either scalars or 1D array_likes as its values. Note ---- If this model is multi-called, then the parameter sets in the provided `par_set` dict will be sorted in order of parameter name (e.g., sort on first parameter first, then on second parameter, etc.). """ # Raise NotImplementedError if only super() was called raise NotImplementedError("This method must be user-written in the " "ModelLink subclass!") @abc.abstractmethod @e13.docstring_substitute(emul_i=std_emul_i_doc) def get_md_var(self, emul_i, par_set, data_idx): """ Calculates the linear model discrepancy variance at a given emulator iteration `emul_i` for model parameter values `par_set` and given data points `data_idx` for the model wrapped in this :class:`~ModelLink` subclass. This method is always single-called by one MPI rank with solely keyword arguments. This is an abstract method and must be overridden by the :class:`~ModelLink` subclass. Parameters ---------- %(emul_i)s par_set : dict of :class:`~numpy.float64` Dict containing the values for all model parameters corresponding to the requested model realization. data_idx : list of tuples List containing the user-defined data point identifiers corresponding to the requested data points. Returns ------- md_var : 1D or 2D array_like Array containing the linear model discrepancy variance values corresponding to the requested data points. If 1D array_like, data is assumed to have a centered one sigma confidence interval. If 2D array_like, the values determine the upper and lower variances and the array is of shape ``(n_data, 2)``. If dict, it has the identifiers in `data_idx` as its keys with either scalars or 1D array_likes of length 2 as its values. Notes ----- The returned model discrepancy variance values must be of linear form, even for those data values that are returned in logarithmic form by the :meth:`~call_model` method. If not, the possibility exists that the emulation process will not converge properly. """ # Raise NotImplementedError if only super() was called raise NotImplementedError("This method must be user-written in the " "ModelLink subclass!")
38.099782
79
0.605437
# -*- coding: utf-8 -*- """ ModelLink ========= Provides the definition of the :class:`~ModelLink` abstract base class. """ # %% IMPORTS # Built-in imports import abc from glob import glob from os import path from tempfile import mktemp import warnings # Package imports import e13tools as e13 import h5py import hickle import numpy as np from sortedcontainers import SortedDict as sdict, SortedSet as sset # PRISM imports from prism import __version__ from prism._docstrings import std_emul_i_doc from prism._internal import ( FeatureWarning, RequestWarning, check_vals, getCLogger, np_array) from prism.modellink.utils import convert_data, convert_parameters # All declaration __all__ = ['ModelLink'] # %% MODELLINK CLASS DEFINITION # TODO: Allow for inter-process methods? # Like, having a method that is called before/after construction. class ModelLink(object, metaclass=abc.ABCMeta): """ Provides an abstract base class definition that allows the :class:`~prism.Pipeline` class to be linked to any model/test object of choice. Every model wrapper used in the :class:`~prism.Pipeline` class must be an instance of the :class:`~ModelLink` class. Description ----------- The :class:`~ModelLink` class is an abstract base class, which forms the base for wrapping a model and allowing *PRISM* to use it effectively. Because it is mandatory for every model to be wrapped in a user-made :class:`~ModelLink` subclass, several tools are provided to the user to make this as versatile as possible. The :class:`~ModelLink` class uses three properties that define the way the subclass will be used by *PRISM*: :attr:`~name`, :attr:`~call_type` and :attr:`~MPI_call`. The first defines what the name of the subclass is, which is used by *PRISM* to identify the subclass with and check if one did not use a different subclass by accident. The other two are flags that determine how the :meth:`~call_model` method should be used. These three properties can be set anywhere during the initialization of the :class:`~ModelLink` subclass, or are set to a default value if they are not modified. Every :class:`~ModelLink` subclass needs to be provided with two different data sets: `model parameters` and `model data`. The model parameters define which parameters the model can take, what their names are and in what value range each parameter must be. The model data on the other hand, states where in a model realization a data value must be retrieved and compared with a provided observational value. One can think of the model data as the observational constraints used to calculate the likelihood in a Bayesian analysis. The model parameters and model data can be set in two different ways. They can be hard-coded into the :class:`~ModelLink` subclass by altering the :meth:`~get_default_model_parameters` and :meth:`~get_default_model_data` methods or set by providing them during class initialization. A combination of both is also possible. More details on this can be found in :meth:`~__init__`. The :class:`~ModelLink` class has two abstract methods that must be overridden before the subclass can be initialized. The :meth:`~call_model` method is the most important method, as it provides *PRISM* with a way of calling the model wrapped in the :class:`~ModelLink` subclass. The :meth:`~get_md_var` method allows for *PRISM* to calculate the model discrepancy variance. Notes ----- The :meth:`~__init__` method may be extended by the :class:`~ModelLink` subclass, but the superclass version must always be called. If required, one can use the :func:`~prism.modellink.test_subclass` function to test a :class:`~ModelLink` subclass on correct functionality. """ def __init__(self, *, model_parameters=None, model_data=None): """ Initialize an instance of the :class:`~ModelLink` subclass. Optional -------- model_parameters, model_data : array_like, dict, str or None.\ Default: None Anything that can be converted to a dict that provides non-default model parameters/data information or *None* if only default information is used from :meth:`~get_default_model_parameters` or :meth:`~get_default_model_data`. For more information on the lay-out of these dicts, see ``Notes``. If array_like, dict(`model_parameters`/`model_data`) must generate a dict with the correct lay-out. If dict, the dict itself must have the correct lay-out. If str, the string must be the path to a file containing the dict keys in the first column and the dict values in the second column, which combined generate a dict with the correct lay-out. Notes (model_parameters) ------------------------ The model parameters provides this :class:`~ModelLink` subclass with the names, ranges and estimates of all model parameters that need to be explored. The model parameters dict requires to have the name of the parameters as the keyword, and a 1D list containing the lower bound, the upper bound and, if applicable, the estimate of this parameter. It is not required to provide an estimate for every parameter. The estimates are used to draw illustrative lines when making projection figures. An example of a model parameters file can be found in the 'data' folder of the *PRISM* package. If required, one can use the :func:`~prism.modellink.convert_parameters` function to validate their formatting. Formatting : ``{par_name: [lower_bnd, upper_bnd, par_est]}`` Notes (model_data) ------------------ The model data provides this :class:`~ModelLink` subclass with the observational data points that need to be used to constrain this model with. The model data dict requires to have the data identifiers (:attr:`~data_idx`) as the keyword, and a 1D list containing the data value (:attr:`~data_val`); the data errors (:attr:`~data_err`) and the data space (:attr:`~data_spc`). If the data errors are given with one value, then the data points are assumed to have a centered :math:`1\\sigma`-confidence interval. If the data errors are given with two values, then the data points are assumed to have a :math:`1\\sigma`-confidence interval defined by the provided upper and lower errors. The data spaces are one of five strings ({'lin', 'log' or 'log_10', 'ln' or 'log_e'}) indicating in which of the three value spaces (linear, log, ln) the data values are. It defaults to 'lin' if it is not provided. The data identifier is a sequence of bools, ints, floats and strings that is unique for every data point. *PRISM* uses it to identify a data point with, which is required in some cases (like MPI), while the model itself can use it as a description of the operations required to extract the data point from the model output. It can be provided as any sequence of any length for any data point. If any sequence contains a single element, it is replaced by just that element instead of a tuple. A simple example of a data identifier is :math:`f(\\text{data_idx}) = \\text{data_val}`, where the output of the model is given by :math:`f(x)`. An example of a model data file can be found in the 'data' folder of the *PRISM* package. If required, one can use the :func:`~prism.modellink.convert_data` function to validate their formatting. Formatting : ``{(data_idx_0, data_idx_1, ..., data_idx_n): [data_val,`` \ ``data_err, data_spc]}`` \n **or** \n ``{(data_idx_0, data_idx_1, ..., data_idx_n): [data_val,`` \ ``upper_data_err, lower_data_err, data_spc]}`` """ # Save name of this class if not saved already if not hasattr(self, '_name'): self.name = self.__class__.__name__ # Set call_type to default ('single') if not modified before if not hasattr(self, '_call_type'): self.call_type = 'single' # Set MPI_call to default (False) if not modified before if not hasattr(self, '_MPI_call'): self.MPI_call = False # Generate model parameter properties self.__set_model_parameters(model_parameters) # Generate model data properties self.__set_model_data(model_data) # Define the representation of a ModelLink object def __repr__(self): # Obtain representation of model_parameters par_repr = "model_parameters=%s" % (dict(self.model_parameters)) # Obtain representation of model_data data_repr = "model_data=%s" % (self.model_data) # Obtain non-default representation and add default ones str_repr = self.get_str_repr() str_repr.extend([par_repr, data_repr]) # Return representation return("%s(%s)" % (self.__class__.__name__, ", ".join(str_repr))) # %% CLASS PROPERTIES # General @property def name(self): """ str: Name associated with an instance of this :class:`~ModelLink` subclass. By default, it is set to the name of this :class:`~ModelLink` subclass. Can be manually manipulated to allow for more user control. """ return(self._name) @name.setter def name(self, name): # If name is set outside of __init__, save current value outer_frame = e13.get_outer_frame(self.__init__) if outer_frame is None and not hasattr(self, '_init_name'): self._init_name = str(self._name) # Save new name self._name = check_vals(name, 'name', 'str') # If name is set outside of __init__, raise warning if outer_frame is None and (self._name != self._init_name): warn_msg = ("The 'name' property of this %s instance is being set " "outside its constructor. This may have unexpected " "effects. It is advised to set it back to its original" " value (%r)!" % (self.__class__.__name__, self._init_name)) warnings.warn(warn_msg, RequestWarning, stacklevel=2) @property def single_call(self): """ bool: Whether :meth:`~call_model` can/should be supplied with a single evaluation sample. At least one of :attr:`~single_call` and :attr:`~multi_call` must be *True*. By default, single model calls are requested (True). """ return(bool(self._single_call)) @property def multi_call(self): """ bool: Whether :meth:`~call_model` can/should be supplied with a set of evaluation samples. At least one of :attr:`~single_call` and :attr:`~multi_call` must be *True*. By default, single model calls are requested (False). """ return(bool(self._multi_call)) @property def call_type(self): """ str: String indicating whether :meth:`call_model` should be supplied with a single evaluation sample ('single') or a set of samples ('multi'), or can be supplied with both ('hybrid'). By default, single model calls are requested ('single'). """ return(self._call_type) @call_type.setter def call_type(self, call_type): # If call_type is set outside of __init__, save current value outer_frame = e13.get_outer_frame(self.__init__) if outer_frame is None and not hasattr(self, '_init_call_type'): self._init_call_type = str(self._call_type) # Check if call_type is a string call_type = check_vals(call_type, 'call_type', 'str') # Set single_call and multi_call appropriately if call_type.lower() in ('single', 'one', '1d'): self._single_call = 1 self._multi_call = 0 self._call_type = 'single' elif call_type.lower() in ('multi', 'many', '2d'): self._single_call = 0 self._multi_call = 1 self._call_type = 'multi' elif call_type.lower() in ('hybrid', 'both', 'nd'): self._single_call = 1 self._multi_call = 1 self._call_type = 'hybrid' else: raise ValueError("Input argument 'call_type' is invalid (%r)!" % (call_type)) # If call_type is set outside of __init__, raise warning if outer_frame is None and (self._call_type != self._init_call_type): warn_msg = ("The 'call_type' property of this %s instance is being" " set outside its constructor. This may have " "unexpected effects. It is advised to set it back to " "its original value (%r)!" % (self.__class__.__name__, self._init_call_type)) warnings.warn(warn_msg, RequestWarning, stacklevel=2) @property def MPI_call(self): """ bool: Whether :meth:`~call_model` can/should be called by all MPI ranks simultaneously instead of by the controller. By default, only the controller rank calls the model (False). """ return(bool(self._MPI_call)) @MPI_call.setter def MPI_call(self, MPI_call): # If MPI_call is set outside of __init__, save current value outer_frame = e13.get_outer_frame(self.__init__) if outer_frame is None and not hasattr(self, '_init_MPI_call'): self._init_MPI_call = bool(self._MPI_call) # Save new MPI_call self._MPI_call = check_vals(MPI_call, 'MPI_call', 'bool') # If MPI_call is set outside of __init__, raise warning if outer_frame is None and (self._MPI_call != self._init_MPI_call): warn_msg = ("The 'MPI_call' property of this %s instance is being " "set outside its constructor. This may have unexpected" " effects. It is advised to set it back to its " "original value (%r)!" % (self.__class__.__name__, self._init_MPI_call)) warnings.warn(warn_msg, RequestWarning, stacklevel=2) # Model Parameters @property def n_par(self): """ int: Number of model parameters. """ return(self._n_par) @property def par_name(self): """ list of str: List with model parameter names. """ return(self._par_name) @property def par_rng(self): """ dict of :obj:`~numpy.ndarray`: The lower and upper values of the model parameters. """ return(sdict(zip(self._par_name, self._par_rng))) @property def par_est(self): """ dict of {float, None}: The user-defined estimated values of the model parameters. Contains *None* in places where estimates were not provided. """ return(sdict(zip(self._par_name, self._par_est))) @property def model_parameters(self): """ dict of list: The dict of model parameters as used by this :obj:`~ModelLink` instance. This dict can be used as the `model_parameters` argument when initializing this :class:`~ModelLink` subclass. """ # Initialize empty dict of model parameters model_parameters = sdict() # Loop over all parameter properties and add them to the dict for name, rng, est in zip(self._par_name, self._par_rng, self._par_est): # If estimate was not given, only add the parameter range if est is None: model_parameters[name] = [*rng] # Else, add range and estimate else: model_parameters[name] = [*rng, est] # Return model_parameters return(model_parameters) # Model Data @property def n_data(self): """ int: Number of provided data points. """ return(self._n_data) @property def data_val(self): """ dict of float: The values of provided data points. """ return(dict(zip(self._data_idx, self._data_val))) @property def data_err(self): """ dict of float: The upper and lower :math:`1\\sigma`-confidence levels of provided data points. """ return(dict(zip(self._data_idx, self._data_err))) @property def data_spc(self): """ dict of str: The types of value space ({'lin', 'log', 'ln'}) of provided data points. """ return(dict(zip(self._data_idx, self._data_spc))) @property def data_idx(self): """ list of tuples: The user-defined data point identifiers. """ return(self._data_idx) @property def model_data(self): """ dict of list: The dict of model data points as used by this :obj:`~ModelLink` instance. This dict can be used as the `model_data` argument when initializing this :class:`~ModelLink` subclass. """ # Initialize empty dict of model data model_data = {} # Combine data points together, only adding non-default values to dict for idx, val, err, spc in zip(self._data_idx, self._data_val, self._data_err, self._data_spc): # Create data point data_point = [val] # Add data error, add only one value if error is centered if(err[0] == err[1]): data_point.append(err[0]) else: data_point.extend(err) # Add data space if it is not 'lin' if(spc != 'lin'): data_point.append(spc) # Add data_point to model_data dict model_data[idx] = data_point # Return model_data return(model_data) # %% GENERAL CLASS METHODS # This function returns non-default string representations of input args def get_str_repr(self): """ Returns a list of string representations of all additional input arguments with which this :class:`~ModelLink` subclass was initialized. """ return([]) # This function converts values in unit space to parameter space def _to_par_space(self, sam_set): """ Converts provided `sam_set` from unit space ([0, 1]) to parameter space ([lower_bnd, upper_bnd]). """ return(self._par_rng[:, 0]+sam_set*(self._par_rng[:, 1] - self._par_rng[:, 0])) # This function converts values in parameter space to unit space def _to_unit_space(self, sam_set): """ Converts provided `sam_set` from parameter space ([lower_bnd, upper_bnd]) to unit space ([0, 1]). """ return((sam_set-self._par_rng[:, 0]) / (self._par_rng[:, 1]-self._par_rng[:, 0])) # This function converts a sequence of model parameter names/indices def _get_model_par_seq(self, par_seq, name): """ Converts a provided sequence `par_seq` of model parameter names and indices to a list of indices, removes duplicates and checks if every provided name/index is valid. Parameters ---------- par_seq : 1D array_like of {int, str} A sequence of integers and strings determining which model parameters need to be used for a certain operation. name : str A string stating the name of the variable the result of this method will be stored in. Used for error messages. Returns ------- par_seq_conv : list of int The provided sequence `par_seq` converted to a sorted list of model parameter indices. """ # Do some logging logger = getCLogger('INIT') logger.info("Converting sequence of model parameter names/indices.") # Remove all unwanted characters from the string and split it up par_seq = e13.split_seq(par_seq) # Check elements if they are ints or strings, and if they are valid for i, par_idx in enumerate(par_seq): try: # If par_idx is a string, try to use it as a parameter name if isinstance(par_idx, str): par_seq[i] = self._par_name.index(par_idx) # If not, try to use it as a parameter index else: self._par_name[par_idx] par_seq[i] = par_idx % self._n_par # If any operation above fails, raise error except Exception as error: err_msg = ("Input argument %r[%i] is invalid! (%s)" % (name, i, error)) e13.raise_error(err_msg, e13.InputError, logger) # If everything went without exceptions, check if list is not empty and # remove duplicates if par_seq: par_seq = list(sset(par_seq)) else: err_msg = "Input argument %r is empty!" % (name) e13.raise_error(err_msg, ValueError, logger) # Log end logger.info("Finished converting sequence of model parameter " "names/indices.") # Return it return(par_seq) # Returns the hypercube that encloses provided sam_set def _get_sam_space(self, sam_set): """ Returns the boundaries of the hypercube that encloses the parameter space in which the provided `sam_set` is defined. The main use for this function is to determine what part of model parameter space was likely sampled from in order to obtain the provided `sam_set`. Because of this, extra spacing is added to the boundaries to reduce the effect of the used sampling method. Parameters ---------- sam_set : 1D or 2D array_like or dict Parameter/sample set for which an enclosing hypercube is requested. Returns ------- sam_space : 2D :obj:`~numpy.ndarray` object The requested hypercube boundaries. """ # If sam_set is a dict, convert it to a NumPy array if isinstance(sam_set, dict): sam_set = np_array(sdict(sam_set).values()).T # Make sure that sam_set is a 2D NumPy array sam_set = np_array(sam_set, ndmin=2) # Determine the maximum difference between consecutive samples sam_diff = np.apply_along_axis( lambda x: np.max(np.diff(np.sort(x))), axis=0, arr=sam_set) # Determine the min/max values of all samples sam_min = np.min(sam_set, axis=0) sam_max = np.max(sam_set, axis=0) # Add 3*sam_diff as extra spacing to sam_min and sam_max # This reduces the effect of the used sampling method and randomness sam_min -= 3*sam_diff sam_max += 3*sam_diff # Combine sam_min and sam_max to form sam_space sam_space = np.stack([sam_min, sam_max], axis=1) # Make sure that sam_space is within par_space sam_space = np.apply_along_axis( lambda x: np.clip(x, *self._par_rng.T), axis=0, arr=sam_space) # Return sam_space return(sam_space) # This function checks if a provided mod_set is valid def _check_mod_set(self, mod_set, name): """ Checks validity of provided set of model outputs `mod_set` in this :obj:`~ModelLink` instance. Parameters ---------- mod_set : 1D or 2D array_like or dict Model output (set) to validate in this :obj:`~ModelLink` instance. name : str The name of the model output (set), which is used in the error message if the validation fails. Returns ------- mod_set : 1D or 2D :obj:`~numpy.ndarray` object The provided `mod_set` if the validation was successful. If `mod_set` was a dict, it will be converted to a :obj:`~numpy.ndarray` object (sorted on :attr:`~data_idx`). """ # Make logger logger = getCLogger('CHECK') logger.info("Validating provided set of model outputs %r." % (name)) # If mod_set is a dict, try to convert it to a NumPy array if isinstance(mod_set, dict): try: mod_set = np_array([mod_set[idx] for idx in self._data_idx]).T except KeyError as error: err_msg = ("Input argument %r is missing data identifier '%r'!" % (name, error.args[0])) e13.raise_error(err_msg, KeyError, logger) # Make sure that mod_set is a NumPy array mod_set = np_array(mod_set) # Raise error if mod_set is not 1D or 2D if not(mod_set.ndim == 1 or mod_set.ndim == 2): err_msg = ("Input argument %r is not one-dimensional or " "two-dimensional!" % (name)) e13.raise_error(err_msg, e13.ShapeError, logger) # Raise error if mod_set does not have n_data data values if not(mod_set.shape[-1] == self._n_data): err_msg = ("Input argument %r has incorrect number of data values " "(%i != %i)!" % (name, mod_set.shape[-1], self._n_data)) e13.raise_error(err_msg, e13.ShapeError, logger) # Check if mod_set solely consists out of floats mod_set = check_vals(mod_set, name, 'float') # Log again and return mod_set logger.info("Finished validating provided set of model outputs %r." % (name)) return(mod_set) # This function checks if a provided sam_set is valid def _check_sam_set(self, sam_set, name): """ Checks validity of provided set of model parameter samples `sam_set` in this :obj:`~ModelLink` instance. Parameters ---------- sam_set : 1D or 2D array_like or dict Parameter/sample set to validate in this :obj:`~ModelLink` instance. name : str The name of the parameter/sample set, which is used in the error message if the validation fails. Returns ------- sam_set : 1D or 2D :obj:`~numpy.ndarray` object The provided `sam_set` if the validation was successful. If `sam_set` was a dict, it will be converted to a :obj:`~numpy.ndarray` object. """ # Make logger logger = getCLogger('CHECK') logger.info("Validating provided set of model parameter samples %r." % (name)) # If sam_set is a dict, convert it to a NumPy array if isinstance(sam_set, dict): sam_set = np_array(sdict(sam_set).values()).T # Make sure that sam_set is a NumPy array sam_set = np_array(sam_set) # Raise error if sam_set is not 1D or 2D if not(sam_set.ndim == 1 or sam_set.ndim == 2): err_msg = ("Input argument %r is not one-dimensional or " "two-dimensional!" % (name)) e13.raise_error(err_msg, e13.ShapeError, logger) # Raise error if sam_set does not have n_par parameter values if not(sam_set.shape[-1] == self._n_par): err_msg = ("Input argument %r has incorrect number of parameters " "(%i != %i)!" % (name, sam_set.shape[-1], self._n_par)) e13.raise_error(err_msg, e13.ShapeError, logger) # Check if sam_set solely consists out of floats sam_set = check_vals(sam_set, name, 'float') # Check if all samples are within parameter space sam_set_2D = np_array(sam_set, ndmin=2) rng = self._par_rng check = np.apply_along_axis( lambda x: ((rng[:, 0] <= x)*(x <= rng[:, 1])).all(), 1, sam_set_2D) # If check is not empty (can be indexed), raise error try: index = np.argwhere(~check)[0] except IndexError: pass else: err_msg = ("Input argument '%s%s' is outside parameter space!" % (name, index if sam_set.ndim != 1 else '')) e13.raise_error(err_msg, ValueError, logger) # Log again and return sam_set logger.info("Finished validating provided set of model parameter " "samples %r." % (name)) return(sam_set) # This function converts a given sam_set to a sam_dict def _get_sam_dict(self, sam_set): """ Converts a provided set of model parameter samples `sam_set` to a dict for use in this :obj:`~ModelLink` instance. This dict can be used as the `par_set` argument in the :meth:`~call_model` and :meth:`~get_md_var` methods. Parameters ---------- sam_set : 1D or 2D array_like Parameter/sample set to convert for this :obj:`~ModelLink` instance. Returns ------- sam_dict : dict of list Dict of parameter samples. """ # Make sure that sam_set is a NumPy array sam_set = np_array(sam_set) # Check how many dimensions sam_set has and act accordingly if(sam_set.ndim == 1): sam_dict = sdict(zip(self._par_name, sam_set)) else: sam_dict = sdict(zip(self._par_name, sam_set.T)) # Return sam_dict return(sam_dict) # This function checks if a provided md_var is valid def _check_md_var(self, md_var, name): """ Checks validity of provided set of model discrepancy variances `md_var` in this :obj:`~ModelLink` instance. Parameters ---------- md_var : 1D or 2D array_like or dict Model discrepancy variance set to validate in this :obj:`~ModelLink` instance. name : str The name of the model discrepancy set, which is used in the error message if the validation fails. Returns ------- md_var : 2D :obj:`~numpy.ndarray` object The (converted) provided `md_var` if the validation was successful. If `md_var` was a dict, it will be converted to a :obj:`~numpy.ndarray` object. """ # Make logger logger = getCLogger('CHECK') logger.info("Validating provided set of model discrepancy variances " "%r." % (name)) # If md_var is a dict, convert it to a NumPy array if isinstance(md_var, dict): md_var = np_array([md_var[idx] for idx in md_var.keys()]) # Make sure that md_var is a NumPy array md_var = np_array(md_var) # Raise error if md_var is not 1D or 2D if not(md_var.ndim == 1 or md_var.ndim == 2): err_msg = ("Input argument %r is not one-dimensional or " "two-dimensional!" % (name)) e13.raise_error(err_msg, e13.ShapeError, logger) # Check if md_var contains n_data values if not(md_var.shape[0] == self._n_data): err_msg = ("Received array of model discrepancy variances %r has " "incorrect number of data points (%i != %i)!" % (name, md_var.shape[0], self._n_data)) raise e13.ShapeError(err_msg) # Check if single or dual values were given if(md_var.ndim == 1): md_var = np_array([md_var]*2).T elif(md_var.shape[1] == 2): pass else: err_msg = ("Received array of model discrepancy variances %r has " "incorrect number of values (%i != 2)!" % (name, md_var.shape[1])) raise e13.ShapeError(err_msg) # Check if all values are non-negative floats md_var = check_vals(md_var, 'md_var', 'nneg', 'float') # Log again and return md_var logger.info("Finished validating provided set of model discrepancy " "variances %r." % (name)) return(md_var) # This function returns the path to a backup file # TODO: Should backup file be saved in emulator working directory of PRISM? def _get_backup_path(self, emul_i, suffix): """ Returns the absolute path to a backup file made by this :obj:`~ModelLink` instance, using the provided `emul_i` and `suffix`. This method is used by the :meth:`~_make_backup` and :meth:`~_read_backup` methods, and should not be called directly. Parameters ---------- emul_i : int The emulator iteration for which a backup filepath is needed. suffix : str or None If str, determine path to associated backup file using provided `suffix`. If `suffix` is empty, obtain last created backup file. If *None*, create a new path to a backup file. Returns ------- filepath : str Absolute path to requested backup file. """ # Determine the prefix of the backup hdf5-file prefix = "backup_%i_%s(" % (emul_i, self._name) # If suffix is None, generate new backup filepath if suffix is None: # Determine the path of the backup hdf5-file filepath = path.abspath(mktemp(').hdf5', prefix, '.')) # Return determined filepath return(filepath) # If suffix is a string, determine the path elif isinstance(suffix, str): # If the string is empty, find the last created backup file if not suffix: # Make list of all valid backup files in current directory files = glob("%s/%s*" % (path.abspath('.'), prefix)) # If files is not empty, return last one created if files: return(max(files, key=path.getctime)) # Else, raise error else: err_msg = ("No backup files can be found in the current " "directory for input argument 'emul_i'!") raise OSError(err_msg) # If the string is not empty, check if provided suffix is valid else: # Obtain full filepath filepath = path.abspath(path.join( '.', ''.join([prefix, suffix, ').hdf5']))) # If filepath exists, return it if path.exists(filepath): return(filepath) # If not, raise error else: err_msg = ("Input argument 'suffix' does not yield an " "existing path to a backup file (%r)!" % (filepath)) raise OSError(err_msg) # This function makes a backup of args/kwargs to be used during call_model def _make_backup(self, *args, **kwargs): """ WARNING: This is an advanced utility method and probably will not work unless used properly. Use with caution! Creates an HDF5-file backup of the provided `args` and `kwargs` when called by the :meth:`~call_model` method or any of its inner functions. Additionally, the backup will contain the `emul_i`, `par_set` and `data_idx` values that were passed to the :meth:`~call_model` method. It also contains the version of *PRISM* that made the backup. The backup can be restored using the :meth:`~_read_backup` method. If it is detected that this method is used incorrectly, a :class:`~prism._internal.RequestWarning` is raised (and the method returns) rather than a :class:`~prism._internal.RequestError`, in order to not disrupt the call to :meth:`~call_model`. Parameters ---------- args : positional arguments All positional arguments that must be stored in the backup file. kwargs : keyword arguments All keyword arguments that must be stored in the backup file. Notes ----- The name of the created backup file contains the value of `emul_i`, :attr:`~name` and a random string to avoid replacing an already existing backup file. The saved `emul_i`, `par_set` and `data_idx` are the values these variables have locally in the :meth:`~call_model` method at the point this method is called. Because of this, making any changes to them may cause problems and is therefore heavily discouraged. If changes are necessary, it is advised to copy them to a different variable first. """ # Raise warning about this feature being experimental warn_msg = ("The 'call_model' backup system is still experimental and " "it may see significant changes or be (re)moved in the " "future!") warnings.warn(warn_msg, FeatureWarning, stacklevel=2) # Check if any args or kwargs have been provided if not args and not kwargs: # If not, issue a warning about that and return warn_msg = ("No positional or keyword arguments have been " "provided. Backup creation will be skipped!") warnings.warn(warn_msg, RequestWarning, stacklevel=2) return # Obtain the call_model frame caller_frame = e13.get_outer_frame(self.call_model) # If caller_frame is None, the call_model frame was not found if caller_frame is None: # Issue a warning about it and return warn_msg = ("This method has been called from outside the " "'call_model' method. Backup creation will be " "skipped!") warnings.warn(warn_msg, RequestWarning, stacklevel=2) return # Obtain the locals of the call_model frame loc = caller_frame.f_locals # Extract local emul_i, par_set and data_idx # Unless call_model was called using args, below will extract correctly # These one-liners are the equivalent of # try: # emul_i = loc['emul_i'] # except KeyError: # try: # emul_i = loc['kwargs']['emul_i'] # except KeyError: # emul_i = None emul_i = loc.get('emul_i', loc.get('kwargs', {}).get('emul_i')) par_set = loc.get('par_set', loc.get('kwargs', {}).get('par_set')) data_idx = loc.get('data_idx', loc.get('kwargs', {}).get('data_idx')) # If one of these is None, then it is not correctly locally available # This can happen if args are used instead of kwargs for call_model # PRISM code always uses kwargs and never causes this problem if None in (emul_i, par_set, data_idx): warn_msg = ("Required local variables 'emul_i', 'par_set' and " "'data_idx' are not correctly available. Backup " "creation will be skipped!") warnings.warn(warn_msg, RequestWarning, stacklevel=2) return # Obtain path to backup file filepath = self._get_backup_path(emul_i, None) # Save emul_i, par_set, data_idx, args and kwargs to hdf5 with h5py.File(filepath, 'w') as file: file.attrs['emul_i'] = emul_i file.attrs['prism_version'] = __version__ hickle.dump(dict(par_set), file, path='/par_set') hickle.dump(data_idx, file, path='/data_idx') hickle.dump(args, file, path='/args') hickle.dump(kwargs, file, path='/kwargs') # This function reads in a backup made by _make_backup # TODO: Allow for absolute path to backup file to be given? # TODO: Convert to static method to read backups without subclass object? def _read_backup(self, emul_i, *, suffix=None): """ Reads in a backup HDF5-file created by the :meth:`~_make_backup` method, using the provided `emul_i` and the value of :attr:`~name`. Parameters ---------- emul_i : int The emulator iteration that was provided to the :meth:`~call_model` method when the backup was made. Optional -------- suffix : str or None. Default: None The suffix of the backup file (everything between parentheses) that needs to be read. If *None* or empty, the last created backup will be read. Returns ------- filename : str The absolute path to the backup file that has been read. data : dict with keys `('emul_i', 'prism_version', 'par_set',` \ `'data_idx', 'args', 'kwargs')` A dict containing the data that was provided to the :meth:`~_make_backup` method. """ # Raise warning about this feature being experimental warn_msg = ("The 'call_model' backup system is still experimental and " "it may see significant changes or be (re)moved in the " "future!") warnings.warn(warn_msg, FeatureWarning, stacklevel=2) # Check if provided emul_i is an integer emul_i = check_vals(emul_i, 'emul_i', 'int', 'nneg') # Check if provided suffix is None or a string if suffix is None: suffix = '' else: suffix = check_vals(suffix, 'suffix', 'str') # Obtain name of backup file filepath = self._get_backup_path(emul_i, suffix) # Initialize empty data dict data = sdict() # Read emul_i, par_set, data_idx, args and kwargs from hdf5 with h5py.File(filepath, 'r') as file: data['emul_i'] = file.attrs['emul_i'] data['prism_version'] = file.attrs['prism_version'] data['par_set'] = sdict(hickle.load(file, path='/par_set')) data['data_idx'] = hickle.load(file, path='/data_idx') data['args'] = hickle.load(file, path='/args') data['kwargs'] = hickle.load(file, path='/kwargs') # Return data return(filepath, data) @property def _default_model_parameters(self): """ dict: The default model parameters to use for every instance of this :class:`~ModelLink` subclass. """ return(sdict()) def get_default_model_parameters(self): """ Returns the default model parameters to use for every instance of this :class:`~ModelLink` subclass. By default, returns :attr:`~ModelLink._default_model_parameters`. """ return(self._default_model_parameters) def __set_model_parameters(self, add_model_parameters): """ Generates the model parameter properties from the default model parameters and the additional input argument `add_model_parameters`. Parameters ---------- add_model_parameters : array_like, dict, str or None Anything that can be converted to a dict that provides non-default model parameters information or *None* if only default information is used from :meth:`~ModelLink.get_default_model_parameters`. Generates --------- n_par : int Number of model parameters. par_name : list List with model parameter names. par_rng : :obj:`~numpy.ndarray` object Array containing the lower and upper values of the model parameters. par_est : list List containing user-defined estimated values of the model parameters. Contains *None* in places where estimates were not provided. """ # Obtain default model parameters model_parameters =\ convert_parameters(self.get_default_model_parameters()) # If additional model parameters information is given, add it if add_model_parameters is not None: model_parameters.update(convert_parameters(add_model_parameters)) # Save number of model parameters n_par = len(model_parameters.keys()) if(n_par == 1): raise e13.InputError("Number of model parameters must be at least " "2!") else: self._n_par = check_vals(n_par, 'n_par', 'pos') # Create empty parameter name, ranges and estimate lists/arrays self._par_name = [] self._par_rng = np.zeros([self._n_par, 2]) self._par_rng[:, 1] = 1 self._par_est = [] # Save model parameters as class properties for i, (name, (*rng, est)) in enumerate(model_parameters.items()): # Save parameter name, range and est self._par_name.append(name) self._par_rng[i] = rng self._par_est.append(est) @property def _default_model_data(self): """ dict: The default model data to use for every instance of this :class:`~ModelLink` subclass. """ return(dict()) def get_default_model_data(self): """ Returns the default model data to use for every instance of this :class:`~ModelLink` subclass. By default, returns :attr:`~ModelLink._default_model_data`. """ return(self._default_model_data) def __set_model_data(self, add_model_data): """ Generates the model data properties from the default model data and the additional input argument `add_model_data`. Parameters --------- add_model_data : array_like, dict, str or None Anything that can be converted to a dict that provides non-default model data information or *None* if only default data is used from :meth:`~ModelLink.get_default_model_data`. Generates --------- n_data : int Number of provided data points. data_val : list List with values of provided data points. data_err : list of lists List with upper and lower :math:`1\\sigma`-confidence levels of provided data points. data_spc : list List with types of value space ({'lin', 'log', 'ln'}) of provided data points. data_idx : list of tuples List with user-defined data point identifiers. """ # Obtain default model data model_data = convert_data(self.get_default_model_data()) # If additional model data information is given, add it if add_model_data is not None: model_data.update(convert_data(add_model_data)) # Determine the number of data points self._n_data = check_vals(len(model_data), 'n_data', 'pos') # Create empty data value, error, space and identifier lists self._data_val = [] self._data_err = [] self._data_spc = [] self._data_idx = [] # Save model data as class properties for idx, (val, *err, spc) in model_data.items(): # Save data value, errors, space and identifier self._data_val.append(val) self._data_err.append(err) self._data_spc.append(spc) self._data_idx.append(idx) # %% ABSTRACT USER METHODS @abc.abstractmethod @e13.docstring_substitute(emul_i=std_emul_i_doc) def call_model(self, emul_i, par_set, data_idx): """ Calls the model wrapped in this :class:`~ModelLink` subclass at emulator iteration `emul_i` for model parameter values `par_set` and returns the data points corresponding to `data_idx`. This method is called with solely keyword arguments. This is an abstract method and must be overridden by the :class:`~ModelLink` subclass. Parameters ---------- %(emul_i)s par_set : dict of :class:`~numpy.float64` Dict containing the values for all model parameters corresponding to the requested model realization(s). If model is single-called, dict item is formatted as ``{par_name: par_val}``. If multi-called, it is formatted as ``{par_name: [par_val_1, par_val_2, ..., par_val_n]}``. data_idx : list of tuples List containing the user-defined data point identifiers corresponding to the requested data points. Returns ------- data_val : 1D or 2D array_like or dict Array containing the data values corresponding to the requested data points generated by the requested model realization(s). If model is multi-called, `data_val` is of shape ``(n_sam, n_data)``. If dict, it has the identifiers in `data_idx` as its keys with either scalars or 1D array_likes as its values. Note ---- If this model is multi-called, then the parameter sets in the provided `par_set` dict will be sorted in order of parameter name (e.g., sort on first parameter first, then on second parameter, etc.). """ # Raise NotImplementedError if only super() was called raise NotImplementedError("This method must be user-written in the " "ModelLink subclass!") @abc.abstractmethod @e13.docstring_substitute(emul_i=std_emul_i_doc) def get_md_var(self, emul_i, par_set, data_idx): """ Calculates the linear model discrepancy variance at a given emulator iteration `emul_i` for model parameter values `par_set` and given data points `data_idx` for the model wrapped in this :class:`~ModelLink` subclass. This method is always single-called by one MPI rank with solely keyword arguments. This is an abstract method and must be overridden by the :class:`~ModelLink` subclass. Parameters ---------- %(emul_i)s par_set : dict of :class:`~numpy.float64` Dict containing the values for all model parameters corresponding to the requested model realization. data_idx : list of tuples List containing the user-defined data point identifiers corresponding to the requested data points. Returns ------- md_var : 1D or 2D array_like Array containing the linear model discrepancy variance values corresponding to the requested data points. If 1D array_like, data is assumed to have a centered one sigma confidence interval. If 2D array_like, the values determine the upper and lower variances and the array is of shape ``(n_data, 2)``. If dict, it has the identifiers in `data_idx` as its keys with either scalars or 1D array_likes of length 2 as its values. Notes ----- The returned model discrepancy variance values must be of linear form, even for those data values that are returned in logarithmic form by the :meth:`~call_model` method. If not, the possibility exists that the emulation process will not converge properly. """ # Raise NotImplementedError if only super() was called raise NotImplementedError("This method must be user-written in the " "ModelLink subclass!")
3,875
0
104
4681fbef1b8fcab07c0091fcd2c08fb6ff7a6db8
738
py
Python
tests/hagan_2002_normal_sabr/test_normal_fit.py
v-tsepelev/pysabr
be22436625f4c0b605f362444b7aafeecda15959
[ "MIT" ]
2
2017-12-11T04:07:15.000Z
2018-02-12T03:32:43.000Z
tests/hagan_2002_normal_sabr/test_normal_fit.py
v-tsepelev/pysabr
be22436625f4c0b605f362444b7aafeecda15959
[ "MIT" ]
4
2017-07-07T20:21:12.000Z
2017-07-07T20:30:27.000Z
tests/hagan_2002_normal_sabr/test_normal_fit.py
v-tsepelev/pysabr
be22436625f4c0b605f362444b7aafeecda15959
[ "MIT" ]
null
null
null
import numpy as np from pysabr import Hagan2002NormalSABR import logging
41
104
0.616531
import numpy as np from pysabr import Hagan2002NormalSABR import logging def test_normal_calibration_beta_05(): k = np.array([0.05, 0.055, 0.06, 0.065, 0.07, 0.075, 0.08, 0.085, 0.09, 0.095, 0.10]) v = np.array([116.63, 111.66, 109.96, 113.97, 124.7, 140.04, 157.3, 175.07, 192.78, 210.26, 227.42]) [t, f, s, beta] = np.array([0.5, 0.07520, 0.0000, 0.5000]) sabr = Hagan2002NormalSABR(f, s, t, beta=beta) sabr_test = sabr.fit(k, v) [alpha, rho, volvol] = sabr_test logging.debug('\nalpha={:.6f}, rho={:.6f}, volvol={:.6f}' .format(alpha, rho, volvol)) sabr_target = np.array([0.050394, 0.64125, 0.875235]) error_max = max(abs(sabr_test - sabr_target)) assert (error_max < 1e-5)
641
0
23
ff233f1aef994ec9fe93ccee4df8ac416b2a6937
972
py
Python
newsapi/commands/search.py
aziezahmed/newsapi-cli
2a7329a3b954d900eec001fe5b968259f0391789
[ "MIT" ]
4
2017-11-15T19:21:00.000Z
2021-06-15T18:42:15.000Z
newsapi/commands/search.py
aziezahmed/newsapi-cli
2a7329a3b954d900eec001fe5b968259f0391789
[ "MIT" ]
1
2019-02-24T09:08:27.000Z
2019-03-13T14:21:31.000Z
newsapi/commands/search.py
aziezahmed/newsapi-cli
2a7329a3b954d900eec001fe5b968259f0391789
[ "MIT" ]
2
2019-02-26T09:18:59.000Z
2020-07-09T16:41:49.000Z
"""The search command.""" import requests, json from termcolor import colored from unidecode import unidecode from newsapi.user_settings import UserSettings from .base import Base
28.588235
88
0.576132
"""The search command.""" import requests, json from termcolor import colored from unidecode import unidecode from newsapi.user_settings import UserSettings from .base import Base class Search(Base): def run(self): user_settings = UserSettings() api_key = user_settings.get_api_key() keyword = self.options["<keyword>"] url = "https://newsapi.org/v2/top-headlines?apiKey=" + api_key + "&q=" + keyword response = requests.get(url) data = response.json() if data["status"] != "error": articles = data["articles"] for article in articles: print(colored(unidecode(article["title"]),'green')) if article["description"] is not None: print(unidecode(article["description"])) print(colored(article["url"],'yellow')) print(" ") else: print("Invalid news source.")
731
-2
50
d7f2167b4c2fe2a7ed7759e3272af2d352bef88c
8,561
py
Python
metatron/tests.py
harel/metatron
e8d82aa3e000c0682d215396112900ede54a96d6
[ "MIT" ]
4
2018-02-16T10:54:45.000Z
2021-07-12T20:41:48.000Z
metatron/tests.py
harel/metatron
e8d82aa3e000c0682d215396112900ede54a96d6
[ "MIT" ]
1
2020-10-03T15:23:37.000Z
2020-10-03T15:23:37.000Z
metatron/tests.py
harel/metatron
e8d82aa3e000c0682d215396112900ede54a96d6
[ "MIT" ]
null
null
null
import unittest from metatron import Metatron, add_schema_spec from metatron.schemas import SCHEMAS if __name__ == '__main__': unittest.main()
54.183544
301
0.604836
import unittest from metatron import Metatron, add_schema_spec from metatron.schemas import SCHEMAS class TestMetatron(unittest.TestCase): def test_opengraph_nested(self): """ { 'image': { 'value': 'http://example.com/ogp.jpg', 'secure_url: 'https://secure.example.com/ogp.jpg', } } """ content = """ <meta name="description" content="Test Meta" /> <meta property="someprop" content="Test Prop Value" /> <meta property="og:title" content="The Two Image Shop" /> <meta property="og:description" content="Its a shop with two images" /> <meta property="og:image" content="http://example.com/ogp.jpg" /> <meta property="og:image:secure_url" content="https://secure.example.com/ogp.jpg" /> <meta property="og:image:type" content="image/jpeg" /> <meta property="og:image:width" content="400" /> <meta property="og:image:height" content="300" /> <meta property="og:image:alt" content="A shiny red apple with a bite taken out" /> """ mt = Metatron(content=content, schemas=['og']) mt.traverse() assert mt['og']['image']['image'] == 'http://example.com/ogp.jpg' assert mt['og']['image']['secure_url'] == 'https://secure.example.com/ogp.jpg' def test_opengraph_nested_array(self): content = """ <meta name="description" content="Test Meta" /> <meta property="someprop" content="Test Prop Value" /> <meta property="og:title" content="The Two Image Shop" /> <meta property="og:title" content="The Two Image Store" /> <meta property="og:description" content="Its a shop with two images" /> <meta property="og:image" content="http://example.com/ogp.jpg" /> <meta property="og:image:secure_url" content="https://secure.example.com/ogp.jpg" /> <meta property="og:image:type" content="image/jpeg" /> <meta property="og:image:width" content="400" /> <meta property="og:image:height" content="300" /> <meta property="og:image:alt" content="A shiny g apple with a bite taken out" /> <meta property="og:image" content="http://example.com/ogp222.jpg" /> <meta property="og:image:secure_url" content="https://secure.example.com/ogp.jpg" /> <meta property="og:image:type" content="image/jpeg" /> <meta property="og:image:width" content="500" /> <meta property="og:image:height" content="600" /> <meta property="og:image:alt" content="A shiny green apple with a bite taken out" /> """ mt = Metatron(content=content, schemas=['og']) mt.traverse() assert len(mt['og']['image']) == 2 assert mt['og']['image'][0]['image'] == 'http://example.com/ogp.jpg' assert mt['og']['image'][0]['secure_url'] == 'https://secure.example.com/ogp.jpg' assert len(mt['og']['title']) == 2 assert mt['og']['title'][1] == 'The Two Image Store' assert mt['og']['image'][1]['width'] == '500' def test_opengraph_array(self): content = """ <meta name="description" content="Test Meta" /> <meta property="someprop" content="Test Prop Value" /> <meta property="og:image" content="http://example.com/ogp1.jpg" /> <meta property="og:image:secure_url" content="https://secure.example.com/ogp1.jpg" /> <meta property="og:image" content="http://example.com/ogp2.jpg" /> <meta property="og:image:secure_url" content="https://secure.example.com/ogp2.jpg" /> """ mt = Metatron(content=content, schemas=['og']) mt.traverse() assert len(mt['og']['image']) == 2 assert mt['og']['image'][0]['image'] == 'http://example.com/ogp1.jpg' def test_twitter_card_and_opengraph(self): """ Collect both opengraph and twitter card schemas """ content = """ <meta property="og:title" content="Home - BBC News"> <meta property="og:type" content="website"> <meta property="og:description" content="Visit BBC News for up-to-the-minute news, breaking news, video, audio and feature stories. BBC News provides trusted World and UK news as well as local and regional perspectives. Also entertainment, business, science, technology and health news."> <meta property="og:site_name" content="BBC News"> <meta property="og:locale" content="en_GB"> <meta property="og:article:author" content="https://www.facebook.com/bbcnews"> <meta property="og:article:section" content="Home"> <meta property="og:url" content="http://www.bbc.co.uk/news"> <meta property="og:image" content="//m.files.bbci.co.uk/modules/bbc-morph-news-waf-page-meta/2.1.0/bbc_news_logo.png"> <meta name="twitter:card" content="summary_large_image"> <meta name="twitter:site" content="@BBCNews"> <meta name="twitter:title" content="Home - BBC News"> <meta name="twitter:description" content="Visit BBC News for up-to-the-minute news, breaking news, video, audio and feature stories. BBC News provides trusted World and UK news as well as local and regional perspectives. Also entertainment, business, science, technology and health news."> <meta name="twitter:creator" content="@BBCNews"> <meta name="twitter:image:src" content="//m.files.bbci.co.uk/modules/bbc-morph-news-waf-page-meta/2.1.0/bbc_news_logo.png"> <meta name="twitter:image:alt" content="BBC News"> <meta name="twitter:domain" content="www.bbc.co.uk"> <link rel="apple-touch-icon-precomposed" sizes="57x57" href="//m.files.bbci.co.uk/modules/bbc-morph-news-waf-page-meta/2.1.0/apple-touch-icon-57x57-precomposed.png"> <link rel="apple-touch-icon-precomposed" sizes="72x72" href="//m.files.bbci.co.uk/modules/bbc-morph-news-waf-page-meta/2.1.0/apple-touch-icon-72x72-precomposed.png"> <link rel="apple-touch-icon-precomposed" sizes="114x114" href="//m.files.bbci.co.uk/modules/bbc-morph-news-waf-page-meta/2.1.0/apple-touch-icon-114x114-precomposed.png"> <link rel="apple-touch-icon-precomposed" sizes="144x144" href="//m.files.bbci.co.uk/modules/bbc-morph-news-waf-page-meta/2.1.0/apple-touch-icon.png"> <link rel="apple-touch-icon" href="//m.files.bbci.co.uk/modules/bbc-morph-news-waf-page-meta/2.1.0/apple-touch-icon.png"> <meta name="msapplication-TileImage" content="//m.files.bbci.co.uk/modules/bbc-morph-news-waf-page-meta/2.1.0/windows-eight-icon-144x144.png"> <meta name="theme-color" content="#bb1919"> <meta name="msapplication-TileColor" content="#bb1919"> <meta name="x-country" content="gb"> <meta name="x-audience" content="Domestic"> <meta name="CPS_AUDIENCE" content="Domestic"> <meta name="CPS_CHANGEQUEUEID" content="115204091"> """ mt = Metatron(content=content, schemas=['og', 'twitter']) mt.traverse() assert 'twitter' in mt assert 'og' in mt assert mt['og']['image'] == '//m.files.bbci.co.uk/modules/bbc-morph-news-waf-page-meta/2.1.0/bbc_news_logo.png' assert mt['twitter']['domain'] == 'www.bbc.co.uk' assert mt['twitter']['description'].startswith('Visit BBC News') def test_simple_meta(self): """ Test that simple meta tags are collected when no schema is provided """ content = """ <meta name="theme-color" content="#bb1919"> <meta name="msapplication-TileColor" content="#bb1919"> <meta name="x-country" content="gb"> <meta name="x-audience" content="Domestic"> <meta name="CPS_AUDIENCE" content="Domestic"> <meta name="CPS_CHANGEQUEUEID" content="115204091"> """ mt = Metatron(content=content) mt.traverse() assert mt['']['CPS_CHANGEQUEUEID'] == '115204091' assert mt['']['x-country'] == 'gb' def test_add_schema(self): schema = { 'name': 'test', 'attribute': 'test', 'value': 'test' } add_schema_spec(schema) assert 'test' in SCHEMAS assert SCHEMAS['test']['name'] == 'test' if __name__ == '__main__': unittest.main()
2,732
5,655
23
bb6c8afb94c38786af03057da5d02ef747b2d9c8
963
py
Python
taskloaf/profile.py
tbenthompson/taskloaf
7c7e2fd2dee7fcaecb3f36629c0b7226f39f2a73
[ "MIT" ]
19
2015-10-10T05:21:22.000Z
2019-08-31T02:11:59.000Z
taskloaf/profile.py
tbenthompson/taskloaf
7c7e2fd2dee7fcaecb3f36629c0b7226f39f2a73
[ "MIT" ]
null
null
null
taskloaf/profile.py
tbenthompson/taskloaf
7c7e2fd2dee7fcaecb3f36629c0b7226f39f2a73
[ "MIT" ]
1
2019-02-04T14:38:02.000Z
2019-02-04T14:38:02.000Z
import taskloaf as tsk import logging logger = logging.getLogger(__name__) # An example of a taskloaf "daemon"? Could be cool!
22.395349
78
0.65109
import taskloaf as tsk import logging logger = logging.getLogger(__name__) # An example of a taskloaf "daemon"? Could be cool! def start_profiler(): import pyinstrument profiler = pyinstrument.Profiler() profiler.start() return profiler def stop_profiler(profiler): profiler.stop() logger.info(profiler.output_text(unicode=True, color=True)) class Profiler: def __init__(self, names=None): if names is None: names = tsk.ctx().get_all_names() self.names = names async def start(self): self.prof_tasks = [tsk.task(start_profiler, to=n) for n in self.names] for pt in self.prof_tasks: await pt async def stop(self): for i in range(len(self.prof_tasks)): await self.prof_tasks[i].then(stop_profiler, to=self.names[i]) async def __aenter__(self): await self.start() async def __aexit__(self, *args): await self.stop()
633
-6
203
9ed7edcd91c14fbdcad99ab876cfc66bcccc12bf
22,225
py
Python
pysnmp/BIANCA-BRICK-CAPI-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
11
2021-02-02T16:27:16.000Z
2021-08-31T06:22:49.000Z
pysnmp/BIANCA-BRICK-CAPI-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
75
2021-02-24T17:30:31.000Z
2021-12-08T00:01:18.000Z
pysnmp/BIANCA-BRICK-CAPI-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
10
2019-04-30T05:51:36.000Z
2022-02-16T03:33:41.000Z
# # PySNMP MIB module BIANCA-BRICK-CAPI-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BIANCA-BRICK-CAPI-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:21:03 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueRangeConstraint", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsIntersection") BitValue, = mibBuilder.importSymbols("BIANCA-BRICK-PPP-MIB", "BitValue") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") Unsigned32, Integer32, MibIdentifier, Bits, Counter32, Counter64, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, iso, NotificationType, ObjectIdentity, ModuleIdentity, TimeTicks = mibBuilder.importSymbols("SNMPv2-SMI", "Unsigned32", "Integer32", "MibIdentifier", "Bits", "Counter32", "Counter64", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "iso", "NotificationType", "ObjectIdentity", "ModuleIdentity", "TimeTicks") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") org = MibIdentifier((1, 3)) dod = MibIdentifier((1, 3, 6)) internet = MibIdentifier((1, 3, 6, 1)) private = MibIdentifier((1, 3, 6, 1, 4)) enterprises = MibIdentifier((1, 3, 6, 1, 4, 1)) bintec = MibIdentifier((1, 3, 6, 1, 4, 1, 272)) bibo = MibIdentifier((1, 3, 6, 1, 4, 1, 272, 4)) capi = MibIdentifier((1, 3, 6, 1, 4, 1, 272, 4, 7)) capiApplTable = MibTable((1, 3, 6, 1, 4, 1, 272, 4, 7, 1), ) if mibBuilder.loadTexts: capiApplTable.setStatus('mandatory') capiApplEntry = MibTableRow((1, 3, 6, 1, 4, 1, 272, 4, 7, 1, 1), ).setIndexNames((0, "BIANCA-BRICK-CAPI-MIB", "capiApplNumber")) if mibBuilder.loadTexts: capiApplEntry.setStatus('mandatory') capiApplNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiApplNumber.setStatus('mandatory') capiApplVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("capi11", 1), ("capi20", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiApplVersion.setStatus('mandatory') capiApplByteOrder = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("little-endian", 1), ("big-endian", 2), ("undef", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiApplByteOrder.setStatus('mandatory') capiApplRegLevel3Cnt = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 1, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiApplRegLevel3Cnt.setStatus('mandatory') capiApplRegMsgCnt = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 1, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiApplRegMsgCnt.setStatus('mandatory') capiApplRegDblkCnt = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 1, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiApplRegDblkCnt.setStatus('mandatory') capiApplRegDblkSize = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 1, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiApplRegDblkSize.setStatus('mandatory') capiApplInfoStr = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 1, 1, 8), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiApplInfoStr.setStatus('mandatory') capiListenTable = MibTable((1, 3, 6, 1, 4, 1, 272, 4, 7, 2), ) if mibBuilder.loadTexts: capiListenTable.setStatus('mandatory') capiListenEntry = MibTableRow((1, 3, 6, 1, 4, 1, 272, 4, 7, 2, 1), ).setIndexNames((0, "BIANCA-BRICK-CAPI-MIB", "capiListenApplication")) if mibBuilder.loadTexts: capiListenEntry.setStatus('mandatory') capiListenApplication = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 2, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiListenApplication.setStatus('mandatory') capiListenController = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 2, 1, 2), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiListenController.setStatus('mandatory') capiListenServiceMask = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 2, 1, 3), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiListenServiceMask.setStatus('mandatory') capiListenEazMask = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 2, 1, 4), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiListenEazMask.setStatus('mandatory') capiListenInfoMask = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 2, 1, 5), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiListenInfoMask.setStatus('mandatory') capiListenCipMask = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 2, 1, 6), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiListenCipMask.setStatus('mandatory') capiListenCipMask2 = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 2, 1, 7), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiListenCipMask2.setStatus('mandatory') capiPlciTable = MibTable((1, 3, 6, 1, 4, 1, 272, 4, 7, 3), ) if mibBuilder.loadTexts: capiPlciTable.setStatus('mandatory') capiPlciEntry = MibTableRow((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1), ).setIndexNames((0, "BIANCA-BRICK-CAPI-MIB", "capiPlciNumber")) if mibBuilder.loadTexts: capiPlciEntry.setStatus('mandatory') capiPlciNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 1), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciNumber.setStatus('mandatory') capiPlciApplication = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciApplication.setStatus('mandatory') capiPlciController = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 3), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciController.setStatus('mandatory') capiPlciState = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("p-0", 1), ("p-1", 2), ("p-2", 3), ("p-3", 4), ("p-4", 5), ("p-5", 6), ("p-6", 7), ("p-7", 8), ("p-act", 9)))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciState.setStatus('mandatory') capiPlciSelectB2Proto = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 241, 242))).clone(namedValues=NamedValues(("undef", 1), ("x75", 2), ("hdlccrc", 3), ("trans", 4), ("sdlc", 5), ("x75btx", 6), ("fax", 7), ("lapd", 8), ("v110trans", 9), ("v110sdlc", 10), ("v110x75", 11), ("txonly", 12), ("modem", 241), ("v110sync", 242)))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciSelectB2Proto.setStatus('mandatory') capiPlciSelectB2Dlpd = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 6), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciSelectB2Dlpd.setStatus('mandatory') capiPlciSelectB3Proto = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("undef", 1), ("t70nl", 2), ("iso8208", 3), ("t90", 4), ("trans", 5), ("t30", 6)))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciSelectB3Proto.setStatus('mandatory') capiPlciSelectB3Ncpd = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 8), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciSelectB3Ncpd.setStatus('mandatory') capiPlciB1Proto = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11))).clone(namedValues=NamedValues(("undef", 1), ("hdlc", 2), ("trans", 3), ("v110trans", 4), ("v110hdlc", 5), ("faxg3", 6), ("hdlcinv", 7), ("hdlc56", 8), ("modemneg", 9), ("modemasync", 10), ("modemsync", 11)))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciB1Proto.setStatus('mandatory') capiPlciB1Config = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 10), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciB1Config.setStatus('mandatory') capiPlciB2Proto = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("undef", 1), ("x75", 2), ("trans", 3), ("sdlc", 4), ("lapd", 5), ("t30", 6), ("ppp", 7), ("transerr", 8), ("modem", 9)))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciB2Proto.setStatus('mandatory') capiPlciB2Config = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 12), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciB2Config.setStatus('mandatory') capiPlciB3Proto = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 9))).clone(namedValues=NamedValues(("undef", 1), ("trans", 2), ("t90", 3), ("iso8208", 4), ("x25dce", 5), ("t30", 6), ("t30ext", 7), ("modem", 9)))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciB3Proto.setStatus('mandatory') capiPlciB3Config = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 14), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciB3Config.setStatus('mandatory') capiPlciCipValue = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 15), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciCipValue.setStatus('mandatory') capiPlciInfoMask = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 16), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciInfoMask.setStatus('mandatory') capiNcciTable = MibTable((1, 3, 6, 1, 4, 1, 272, 4, 7, 4), ) if mibBuilder.loadTexts: capiNcciTable.setStatus('mandatory') capiNcciEntry = MibTableRow((1, 3, 6, 1, 4, 1, 272, 4, 7, 4, 1), ).setIndexNames((0, "BIANCA-BRICK-CAPI-MIB", "capiNcciNumber")) if mibBuilder.loadTexts: capiNcciEntry.setStatus('mandatory') capiNcciNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 4, 1, 1), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiNcciNumber.setStatus('mandatory') capiNcciApplication = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 4, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiNcciApplication.setStatus('mandatory') capiNcciPlci = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 4, 1, 3), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiNcciPlci.setStatus('mandatory') capiNcciState = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 4, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("n-0", 1), ("n-1", 2), ("n-2", 3), ("n-3", 4), ("n-4", 5), ("n-5", 6), ("n-act", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiNcciState.setStatus('mandatory') capiInfoTable = MibTable((1, 3, 6, 1, 4, 1, 272, 4, 7, 5), ) if mibBuilder.loadTexts: capiInfoTable.setStatus('mandatory') capiInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 272, 4, 7, 5, 1), ).setIndexNames((0, "BIANCA-BRICK-CAPI-MIB", "capiInfoApplication")) if mibBuilder.loadTexts: capiInfoEntry.setStatus('mandatory') capiInfoApplication = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 5, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiInfoApplication.setStatus('mandatory') capiInfoPlci = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 5, 1, 2), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiInfoPlci.setStatus('mandatory') capiInfoNcci = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 5, 1, 3), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiInfoNcci.setStatus('mandatory') capiInfoC1Command = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 5, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 64, 128, 129, 130, 131, 132, 133, 134, 135))).clone(namedValues=NamedValues(("resetb3", 1), ("connect", 2), ("conact", 3), ("disc", 4), ("listen", 5), ("param", 6), ("info", 7), ("data", 8), ("conninfo", 9), ("dtmf", 10), ("selb2", 64), ("selb3", 128), ("listenb3", 129), ("conb3", 130), ("conb3act", 131), ("discb3", 132), ("b3param", 133), ("datab3", 134), ("handset", 135)))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiInfoC1Command.setStatus('mandatory') capiInfoC2Command = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 5, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 8, 65, 128, 130, 131, 132, 134, 135, 136, 255))).clone(namedValues=NamedValues(("alert", 1), ("connect", 2), ("conact", 3), ("disc", 4), ("listen", 5), ("info", 8), ("selectb", 65), ("facility", 128), ("conb3", 130), ("conb3act", 131), ("discb3", 132), ("datab3", 134), ("resetb3", 135), ("conb3t90", 136), ("manufact", 255)))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiInfoC2Command.setStatus('mandatory') capiInfoSubCommand = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 5, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("req", 1), ("conf", 2), ("ind", 3), ("resp", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiInfoSubCommand.setStatus('mandatory') capiInfoNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 5, 1, 7), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiInfoNumber.setStatus('mandatory') capiConfigTable = MibTable((1, 3, 6, 1, 4, 1, 272, 4, 7, 6), ) if mibBuilder.loadTexts: capiConfigTable.setStatus('mandatory') capiConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 272, 4, 7, 6, 1), ).setIndexNames((0, "BIANCA-BRICK-CAPI-MIB", "capiConfigStkNumber")) if mibBuilder.loadTexts: capiConfigEntry.setStatus('mandatory') capiConfigStkNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 6, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 31))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiConfigStkNumber.setStatus('mandatory') capiConfigFaxG3RcvSpeed = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 6, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("r4800", 1), ("r7200", 2), ("r9600", 3), ("r14400", 4), ("maximum", 5), ("not-available", 6), ("delete", 7)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiConfigFaxG3RcvSpeed.setStatus('mandatory') capiConfigFaxG3ECM = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 6, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("on", 1), ("off", 2), ("not-available", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiConfigFaxG3ECM.setStatus('mandatory') capiConfigFaxG3Header = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 6, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("logo-header", 1), ("no-logo", 2), ("no-header", 3), ("not-available", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiConfigFaxG3Header.setStatus('mandatory') capiConfigVoiceCoding = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 6, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("normal", 1), ("reverse", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiConfigVoiceCoding.setStatus('mandatory') capiConfigSendAlerting = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 6, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("never", 1), ("ever", 2), ("voice-only", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiConfigSendAlerting.setStatus('mandatory') capiConfigV42bis = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 6, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("on", 1), ("off", 2), ("not-available", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiConfigV42bis.setStatus('mandatory') capiConfigModemDefault = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 6, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("modem-profile-1", 1), ("modem-profile-2", 2), ("modem-profile-3", 3), ("modem-profile-4", 4), ("modem-profile-5", 5), ("modem-profile-6", 6), ("modem-profile-7", 7), ("modem-profile-8", 8)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiConfigModemDefault.setStatus('mandatory') capiConfigFaxModulation = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 6, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 5, 6))).clone(namedValues=NamedValues(("v17", 1), ("v33", 2), ("v29", 3), ("v17s", 5), ("v33s", 6)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiConfigFaxModulation.setStatus('mandatory') capiConfigFax12000 = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 6, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("on", 1), ("off", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiConfigFax12000.setStatus('mandatory') capiConfigFaxTXLevel = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 6, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("db0", 1), ("db3", 2), ("db6", 3), ("db9", 4), ("db12", 5), ("db15", 6)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiConfigFaxTXLevel.setStatus('mandatory') capiMultiControllerTable = MibTable((1, 3, 6, 1, 4, 1, 272, 4, 7, 7), ) if mibBuilder.loadTexts: capiMultiControllerTable.setStatus('mandatory') capiMultiControllerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 272, 4, 7, 7, 1), ).setIndexNames((0, "BIANCA-BRICK-CAPI-MIB", "capiControllerNumber")) if mibBuilder.loadTexts: capiMultiControllerEntry.setStatus('mandatory') capiControllerNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 7, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 31))).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiControllerNumber.setStatus('mandatory') capiControllerStkMask = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 7, 1, 2), BitValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiControllerStkMask.setStatus('mandatory') capiControllerVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 7, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("capi11", 1), ("capi20", 2), ("delete", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiControllerVersion.setStatus('mandatory') mibBuilder.exportSymbols("BIANCA-BRICK-CAPI-MIB", capiListenInfoMask=capiListenInfoMask, capiNcciEntry=capiNcciEntry, enterprises=enterprises, capiPlciB3Proto=capiPlciB3Proto, dod=dod, capiListenApplication=capiListenApplication, capiPlciInfoMask=capiPlciInfoMask, capiInfoC2Command=capiInfoC2Command, capiMultiControllerTable=capiMultiControllerTable, capiInfoTable=capiInfoTable, capiListenCipMask=capiListenCipMask, capiControllerStkMask=capiControllerStkMask, capiMultiControllerEntry=capiMultiControllerEntry, capiListenCipMask2=capiListenCipMask2, capiPlciNumber=capiPlciNumber, capiListenServiceMask=capiListenServiceMask, capiPlciB1Proto=capiPlciB1Proto, capiNcciPlci=capiNcciPlci, bintec=bintec, capiPlciApplication=capiPlciApplication, capiApplTable=capiApplTable, capiNcciNumber=capiNcciNumber, capiApplInfoStr=capiApplInfoStr, capiInfoC1Command=capiInfoC1Command, capiInfoApplication=capiInfoApplication, capiConfigEntry=capiConfigEntry, capiControllerNumber=capiControllerNumber, capiApplRegDblkSize=capiApplRegDblkSize, capiApplEntry=capiApplEntry, capiInfoNcci=capiInfoNcci, capiInfoSubCommand=capiInfoSubCommand, capiListenEntry=capiListenEntry, capiConfigVoiceCoding=capiConfigVoiceCoding, capiInfoNumber=capiInfoNumber, HexValue=HexValue, capiConfigTable=capiConfigTable, capiApplRegMsgCnt=capiApplRegMsgCnt, capiApplRegLevel3Cnt=capiApplRegLevel3Cnt, capiConfigFaxModulation=capiConfigFaxModulation, capiListenController=capiListenController, capiApplVersion=capiApplVersion, capiInfoEntry=capiInfoEntry, capiPlciState=capiPlciState, capiNcciTable=capiNcciTable, capiPlciTable=capiPlciTable, capiPlciSelectB3Ncpd=capiPlciSelectB3Ncpd, internet=internet, capiInfoPlci=capiInfoPlci, capiApplByteOrder=capiApplByteOrder, bibo=bibo, capiConfigFaxG3Header=capiConfigFaxG3Header, capiApplRegDblkCnt=capiApplRegDblkCnt, capiConfigStkNumber=capiConfigStkNumber, capiListenEazMask=capiListenEazMask, capiListenTable=capiListenTable, capiPlciEntry=capiPlciEntry, capiPlciB3Config=capiPlciB3Config, capiPlciSelectB2Proto=capiPlciSelectB2Proto, capiConfigModemDefault=capiConfigModemDefault, capiControllerVersion=capiControllerVersion, capiPlciSelectB2Dlpd=capiPlciSelectB2Dlpd, capiConfigSendAlerting=capiConfigSendAlerting, capiNcciApplication=capiNcciApplication, capi=capi, capiPlciB2Proto=capiPlciB2Proto, capiPlciSelectB3Proto=capiPlciSelectB3Proto, capiPlciB1Config=capiPlciB1Config, capiApplNumber=capiApplNumber, capiConfigFaxG3RcvSpeed=capiConfigFaxG3RcvSpeed, capiPlciB2Config=capiPlciB2Config, capiNcciState=capiNcciState, private=private, capiConfigFaxTXLevel=capiConfigFaxTXLevel, capiPlciCipValue=capiPlciCipValue, capiConfigV42bis=capiConfigV42bis, capiConfigFax12000=capiConfigFax12000, capiPlciController=capiPlciController, org=org, capiConfigFaxG3ECM=capiConfigFaxG3ECM)
133.083832
2,798
0.732238
# # PySNMP MIB module BIANCA-BRICK-CAPI-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BIANCA-BRICK-CAPI-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:21:03 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueRangeConstraint", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsIntersection") BitValue, = mibBuilder.importSymbols("BIANCA-BRICK-PPP-MIB", "BitValue") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") Unsigned32, Integer32, MibIdentifier, Bits, Counter32, Counter64, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, iso, NotificationType, ObjectIdentity, ModuleIdentity, TimeTicks = mibBuilder.importSymbols("SNMPv2-SMI", "Unsigned32", "Integer32", "MibIdentifier", "Bits", "Counter32", "Counter64", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "iso", "NotificationType", "ObjectIdentity", "ModuleIdentity", "TimeTicks") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") org = MibIdentifier((1, 3)) dod = MibIdentifier((1, 3, 6)) internet = MibIdentifier((1, 3, 6, 1)) private = MibIdentifier((1, 3, 6, 1, 4)) enterprises = MibIdentifier((1, 3, 6, 1, 4, 1)) bintec = MibIdentifier((1, 3, 6, 1, 4, 1, 272)) bibo = MibIdentifier((1, 3, 6, 1, 4, 1, 272, 4)) capi = MibIdentifier((1, 3, 6, 1, 4, 1, 272, 4, 7)) class HexValue(Integer32): pass capiApplTable = MibTable((1, 3, 6, 1, 4, 1, 272, 4, 7, 1), ) if mibBuilder.loadTexts: capiApplTable.setStatus('mandatory') capiApplEntry = MibTableRow((1, 3, 6, 1, 4, 1, 272, 4, 7, 1, 1), ).setIndexNames((0, "BIANCA-BRICK-CAPI-MIB", "capiApplNumber")) if mibBuilder.loadTexts: capiApplEntry.setStatus('mandatory') capiApplNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiApplNumber.setStatus('mandatory') capiApplVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("capi11", 1), ("capi20", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiApplVersion.setStatus('mandatory') capiApplByteOrder = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("little-endian", 1), ("big-endian", 2), ("undef", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiApplByteOrder.setStatus('mandatory') capiApplRegLevel3Cnt = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 1, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiApplRegLevel3Cnt.setStatus('mandatory') capiApplRegMsgCnt = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 1, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiApplRegMsgCnt.setStatus('mandatory') capiApplRegDblkCnt = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 1, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiApplRegDblkCnt.setStatus('mandatory') capiApplRegDblkSize = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 1, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiApplRegDblkSize.setStatus('mandatory') capiApplInfoStr = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 1, 1, 8), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiApplInfoStr.setStatus('mandatory') capiListenTable = MibTable((1, 3, 6, 1, 4, 1, 272, 4, 7, 2), ) if mibBuilder.loadTexts: capiListenTable.setStatus('mandatory') capiListenEntry = MibTableRow((1, 3, 6, 1, 4, 1, 272, 4, 7, 2, 1), ).setIndexNames((0, "BIANCA-BRICK-CAPI-MIB", "capiListenApplication")) if mibBuilder.loadTexts: capiListenEntry.setStatus('mandatory') capiListenApplication = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 2, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiListenApplication.setStatus('mandatory') capiListenController = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 2, 1, 2), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiListenController.setStatus('mandatory') capiListenServiceMask = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 2, 1, 3), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiListenServiceMask.setStatus('mandatory') capiListenEazMask = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 2, 1, 4), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiListenEazMask.setStatus('mandatory') capiListenInfoMask = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 2, 1, 5), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiListenInfoMask.setStatus('mandatory') capiListenCipMask = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 2, 1, 6), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiListenCipMask.setStatus('mandatory') capiListenCipMask2 = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 2, 1, 7), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiListenCipMask2.setStatus('mandatory') capiPlciTable = MibTable((1, 3, 6, 1, 4, 1, 272, 4, 7, 3), ) if mibBuilder.loadTexts: capiPlciTable.setStatus('mandatory') capiPlciEntry = MibTableRow((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1), ).setIndexNames((0, "BIANCA-BRICK-CAPI-MIB", "capiPlciNumber")) if mibBuilder.loadTexts: capiPlciEntry.setStatus('mandatory') capiPlciNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 1), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciNumber.setStatus('mandatory') capiPlciApplication = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciApplication.setStatus('mandatory') capiPlciController = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 3), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciController.setStatus('mandatory') capiPlciState = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("p-0", 1), ("p-1", 2), ("p-2", 3), ("p-3", 4), ("p-4", 5), ("p-5", 6), ("p-6", 7), ("p-7", 8), ("p-act", 9)))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciState.setStatus('mandatory') capiPlciSelectB2Proto = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 241, 242))).clone(namedValues=NamedValues(("undef", 1), ("x75", 2), ("hdlccrc", 3), ("trans", 4), ("sdlc", 5), ("x75btx", 6), ("fax", 7), ("lapd", 8), ("v110trans", 9), ("v110sdlc", 10), ("v110x75", 11), ("txonly", 12), ("modem", 241), ("v110sync", 242)))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciSelectB2Proto.setStatus('mandatory') capiPlciSelectB2Dlpd = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 6), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciSelectB2Dlpd.setStatus('mandatory') capiPlciSelectB3Proto = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("undef", 1), ("t70nl", 2), ("iso8208", 3), ("t90", 4), ("trans", 5), ("t30", 6)))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciSelectB3Proto.setStatus('mandatory') capiPlciSelectB3Ncpd = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 8), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciSelectB3Ncpd.setStatus('mandatory') capiPlciB1Proto = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11))).clone(namedValues=NamedValues(("undef", 1), ("hdlc", 2), ("trans", 3), ("v110trans", 4), ("v110hdlc", 5), ("faxg3", 6), ("hdlcinv", 7), ("hdlc56", 8), ("modemneg", 9), ("modemasync", 10), ("modemsync", 11)))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciB1Proto.setStatus('mandatory') capiPlciB1Config = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 10), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciB1Config.setStatus('mandatory') capiPlciB2Proto = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("undef", 1), ("x75", 2), ("trans", 3), ("sdlc", 4), ("lapd", 5), ("t30", 6), ("ppp", 7), ("transerr", 8), ("modem", 9)))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciB2Proto.setStatus('mandatory') capiPlciB2Config = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 12), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciB2Config.setStatus('mandatory') capiPlciB3Proto = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 9))).clone(namedValues=NamedValues(("undef", 1), ("trans", 2), ("t90", 3), ("iso8208", 4), ("x25dce", 5), ("t30", 6), ("t30ext", 7), ("modem", 9)))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciB3Proto.setStatus('mandatory') capiPlciB3Config = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 14), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciB3Config.setStatus('mandatory') capiPlciCipValue = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 15), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciCipValue.setStatus('mandatory') capiPlciInfoMask = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 3, 1, 16), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiPlciInfoMask.setStatus('mandatory') capiNcciTable = MibTable((1, 3, 6, 1, 4, 1, 272, 4, 7, 4), ) if mibBuilder.loadTexts: capiNcciTable.setStatus('mandatory') capiNcciEntry = MibTableRow((1, 3, 6, 1, 4, 1, 272, 4, 7, 4, 1), ).setIndexNames((0, "BIANCA-BRICK-CAPI-MIB", "capiNcciNumber")) if mibBuilder.loadTexts: capiNcciEntry.setStatus('mandatory') capiNcciNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 4, 1, 1), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiNcciNumber.setStatus('mandatory') capiNcciApplication = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 4, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiNcciApplication.setStatus('mandatory') capiNcciPlci = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 4, 1, 3), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiNcciPlci.setStatus('mandatory') capiNcciState = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 4, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("n-0", 1), ("n-1", 2), ("n-2", 3), ("n-3", 4), ("n-4", 5), ("n-5", 6), ("n-act", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiNcciState.setStatus('mandatory') capiInfoTable = MibTable((1, 3, 6, 1, 4, 1, 272, 4, 7, 5), ) if mibBuilder.loadTexts: capiInfoTable.setStatus('mandatory') capiInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 272, 4, 7, 5, 1), ).setIndexNames((0, "BIANCA-BRICK-CAPI-MIB", "capiInfoApplication")) if mibBuilder.loadTexts: capiInfoEntry.setStatus('mandatory') capiInfoApplication = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 5, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiInfoApplication.setStatus('mandatory') capiInfoPlci = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 5, 1, 2), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiInfoPlci.setStatus('mandatory') capiInfoNcci = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 5, 1, 3), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiInfoNcci.setStatus('mandatory') capiInfoC1Command = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 5, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 64, 128, 129, 130, 131, 132, 133, 134, 135))).clone(namedValues=NamedValues(("resetb3", 1), ("connect", 2), ("conact", 3), ("disc", 4), ("listen", 5), ("param", 6), ("info", 7), ("data", 8), ("conninfo", 9), ("dtmf", 10), ("selb2", 64), ("selb3", 128), ("listenb3", 129), ("conb3", 130), ("conb3act", 131), ("discb3", 132), ("b3param", 133), ("datab3", 134), ("handset", 135)))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiInfoC1Command.setStatus('mandatory') capiInfoC2Command = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 5, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 8, 65, 128, 130, 131, 132, 134, 135, 136, 255))).clone(namedValues=NamedValues(("alert", 1), ("connect", 2), ("conact", 3), ("disc", 4), ("listen", 5), ("info", 8), ("selectb", 65), ("facility", 128), ("conb3", 130), ("conb3act", 131), ("discb3", 132), ("datab3", 134), ("resetb3", 135), ("conb3t90", 136), ("manufact", 255)))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiInfoC2Command.setStatus('mandatory') capiInfoSubCommand = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 5, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("req", 1), ("conf", 2), ("ind", 3), ("resp", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiInfoSubCommand.setStatus('mandatory') capiInfoNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 5, 1, 7), HexValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: capiInfoNumber.setStatus('mandatory') capiConfigTable = MibTable((1, 3, 6, 1, 4, 1, 272, 4, 7, 6), ) if mibBuilder.loadTexts: capiConfigTable.setStatus('mandatory') capiConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 272, 4, 7, 6, 1), ).setIndexNames((0, "BIANCA-BRICK-CAPI-MIB", "capiConfigStkNumber")) if mibBuilder.loadTexts: capiConfigEntry.setStatus('mandatory') capiConfigStkNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 6, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 31))).setMaxAccess("readonly") if mibBuilder.loadTexts: capiConfigStkNumber.setStatus('mandatory') capiConfigFaxG3RcvSpeed = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 6, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("r4800", 1), ("r7200", 2), ("r9600", 3), ("r14400", 4), ("maximum", 5), ("not-available", 6), ("delete", 7)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiConfigFaxG3RcvSpeed.setStatus('mandatory') capiConfigFaxG3ECM = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 6, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("on", 1), ("off", 2), ("not-available", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiConfigFaxG3ECM.setStatus('mandatory') capiConfigFaxG3Header = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 6, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("logo-header", 1), ("no-logo", 2), ("no-header", 3), ("not-available", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiConfigFaxG3Header.setStatus('mandatory') capiConfigVoiceCoding = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 6, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("normal", 1), ("reverse", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiConfigVoiceCoding.setStatus('mandatory') capiConfigSendAlerting = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 6, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("never", 1), ("ever", 2), ("voice-only", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiConfigSendAlerting.setStatus('mandatory') capiConfigV42bis = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 6, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("on", 1), ("off", 2), ("not-available", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiConfigV42bis.setStatus('mandatory') capiConfigModemDefault = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 6, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("modem-profile-1", 1), ("modem-profile-2", 2), ("modem-profile-3", 3), ("modem-profile-4", 4), ("modem-profile-5", 5), ("modem-profile-6", 6), ("modem-profile-7", 7), ("modem-profile-8", 8)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiConfigModemDefault.setStatus('mandatory') capiConfigFaxModulation = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 6, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 5, 6))).clone(namedValues=NamedValues(("v17", 1), ("v33", 2), ("v29", 3), ("v17s", 5), ("v33s", 6)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiConfigFaxModulation.setStatus('mandatory') capiConfigFax12000 = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 6, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("on", 1), ("off", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiConfigFax12000.setStatus('mandatory') capiConfigFaxTXLevel = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 6, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("db0", 1), ("db3", 2), ("db6", 3), ("db9", 4), ("db12", 5), ("db15", 6)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiConfigFaxTXLevel.setStatus('mandatory') capiMultiControllerTable = MibTable((1, 3, 6, 1, 4, 1, 272, 4, 7, 7), ) if mibBuilder.loadTexts: capiMultiControllerTable.setStatus('mandatory') capiMultiControllerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 272, 4, 7, 7, 1), ).setIndexNames((0, "BIANCA-BRICK-CAPI-MIB", "capiControllerNumber")) if mibBuilder.loadTexts: capiMultiControllerEntry.setStatus('mandatory') capiControllerNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 7, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 31))).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiControllerNumber.setStatus('mandatory') capiControllerStkMask = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 7, 1, 2), BitValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiControllerStkMask.setStatus('mandatory') capiControllerVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 272, 4, 7, 7, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("capi11", 1), ("capi20", 2), ("delete", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: capiControllerVersion.setStatus('mandatory') mibBuilder.exportSymbols("BIANCA-BRICK-CAPI-MIB", capiListenInfoMask=capiListenInfoMask, capiNcciEntry=capiNcciEntry, enterprises=enterprises, capiPlciB3Proto=capiPlciB3Proto, dod=dod, capiListenApplication=capiListenApplication, capiPlciInfoMask=capiPlciInfoMask, capiInfoC2Command=capiInfoC2Command, capiMultiControllerTable=capiMultiControllerTable, capiInfoTable=capiInfoTable, capiListenCipMask=capiListenCipMask, capiControllerStkMask=capiControllerStkMask, capiMultiControllerEntry=capiMultiControllerEntry, capiListenCipMask2=capiListenCipMask2, capiPlciNumber=capiPlciNumber, capiListenServiceMask=capiListenServiceMask, capiPlciB1Proto=capiPlciB1Proto, capiNcciPlci=capiNcciPlci, bintec=bintec, capiPlciApplication=capiPlciApplication, capiApplTable=capiApplTable, capiNcciNumber=capiNcciNumber, capiApplInfoStr=capiApplInfoStr, capiInfoC1Command=capiInfoC1Command, capiInfoApplication=capiInfoApplication, capiConfigEntry=capiConfigEntry, capiControllerNumber=capiControllerNumber, capiApplRegDblkSize=capiApplRegDblkSize, capiApplEntry=capiApplEntry, capiInfoNcci=capiInfoNcci, capiInfoSubCommand=capiInfoSubCommand, capiListenEntry=capiListenEntry, capiConfigVoiceCoding=capiConfigVoiceCoding, capiInfoNumber=capiInfoNumber, HexValue=HexValue, capiConfigTable=capiConfigTable, capiApplRegMsgCnt=capiApplRegMsgCnt, capiApplRegLevel3Cnt=capiApplRegLevel3Cnt, capiConfigFaxModulation=capiConfigFaxModulation, capiListenController=capiListenController, capiApplVersion=capiApplVersion, capiInfoEntry=capiInfoEntry, capiPlciState=capiPlciState, capiNcciTable=capiNcciTable, capiPlciTable=capiPlciTable, capiPlciSelectB3Ncpd=capiPlciSelectB3Ncpd, internet=internet, capiInfoPlci=capiInfoPlci, capiApplByteOrder=capiApplByteOrder, bibo=bibo, capiConfigFaxG3Header=capiConfigFaxG3Header, capiApplRegDblkCnt=capiApplRegDblkCnt, capiConfigStkNumber=capiConfigStkNumber, capiListenEazMask=capiListenEazMask, capiListenTable=capiListenTable, capiPlciEntry=capiPlciEntry, capiPlciB3Config=capiPlciB3Config, capiPlciSelectB2Proto=capiPlciSelectB2Proto, capiConfigModemDefault=capiConfigModemDefault, capiControllerVersion=capiControllerVersion, capiPlciSelectB2Dlpd=capiPlciSelectB2Dlpd, capiConfigSendAlerting=capiConfigSendAlerting, capiNcciApplication=capiNcciApplication, capi=capi, capiPlciB2Proto=capiPlciB2Proto, capiPlciSelectB3Proto=capiPlciSelectB3Proto, capiPlciB1Config=capiPlciB1Config, capiApplNumber=capiApplNumber, capiConfigFaxG3RcvSpeed=capiConfigFaxG3RcvSpeed, capiPlciB2Config=capiPlciB2Config, capiNcciState=capiNcciState, private=private, capiConfigFaxTXLevel=capiConfigFaxTXLevel, capiPlciCipValue=capiPlciCipValue, capiConfigV42bis=capiConfigV42bis, capiConfigFax12000=capiConfigFax12000, capiPlciController=capiPlciController, org=org, capiConfigFaxG3ECM=capiConfigFaxG3ECM)
0
14
22
0753229d4d006d5001701b18157bb61db483ec60
11,843
py
Python
networkx/algorithms/centrality/current_flow_betweenness.py
SultanOrazbayev/networkx
5be9755636fa4da71da2e28f8467336d3c0164a7
[ "BSD-3-Clause" ]
2
2020-02-25T14:07:05.000Z
2020-11-21T20:29:37.000Z
networkx/algorithms/centrality/current_flow_betweenness.py
SultanOrazbayev/networkx
5be9755636fa4da71da2e28f8467336d3c0164a7
[ "BSD-3-Clause" ]
2
2020-10-16T04:18:16.000Z
2021-11-19T20:00:15.000Z
networkx/algorithms/centrality/current_flow_betweenness.py
SultanOrazbayev/networkx
5be9755636fa4da71da2e28f8467336d3c0164a7
[ "BSD-3-Clause" ]
1
2022-02-03T09:38:16.000Z
2022-02-03T09:38:16.000Z
"""Current-flow betweenness centrality measures.""" import networkx as nx from networkx.algorithms.centrality.flow_matrix import ( CGInverseLaplacian, flow_matrix_row, FullInverseLaplacian, SuperLUInverseLaplacian, ) from networkx.utils import ( not_implemented_for, reverse_cuthill_mckee_ordering, py_random_state, ) __all__ = [ "current_flow_betweenness_centrality", "approximate_current_flow_betweenness_centrality", "edge_current_flow_betweenness_centrality", ] @py_random_state(7) @not_implemented_for("directed") def approximate_current_flow_betweenness_centrality( G, normalized=True, weight=None, dtype=float, solver="full", epsilon=0.5, kmax=10000, seed=None, ): r"""Compute the approximate current-flow betweenness centrality for nodes. Approximates the current-flow betweenness centrality within absolute error of epsilon with high probability [1]_. Parameters ---------- G : graph A NetworkX graph normalized : bool, optional (default=True) If True the betweenness values are normalized by 2/[(n-1)(n-2)] where n is the number of nodes in G. weight : string or None, optional (default=None) Key for edge data used as the edge weight. If None, then use 1 as each edge weight. The weight reflects the capacity or the strength of the edge. dtype : data type (float) Default data type for internal matrices. Set to np.float32 for lower memory consumption. solver : string (default='full') Type of linear solver to use for computing the flow matrix. Options are "full" (uses most memory), "lu" (recommended), and "cg" (uses least memory). epsilon: float Absolute error tolerance. kmax: int Maximum number of sample node pairs to use for approximation. seed : integer, random_state, or None (default) Indicator of random number generation state. See :ref:`Randomness<randomness>`. Returns ------- nodes : dictionary Dictionary of nodes with betweenness centrality as the value. See Also -------- current_flow_betweenness_centrality Notes ----- The running time is $O((1/\epsilon^2)m{\sqrt k} \log n)$ and the space required is $O(m)$ for $n$ nodes and $m$ edges. If the edges have a 'weight' attribute they will be used as weights in this algorithm. Unspecified weights are set to 1. References ---------- .. [1] Ulrik Brandes and Daniel Fleischer: Centrality Measures Based on Current Flow. Proc. 22nd Symp. Theoretical Aspects of Computer Science (STACS '05). LNCS 3404, pp. 533-544. Springer-Verlag, 2005. https://doi.org/10.1007/978-3-540-31856-9_44 """ import numpy as np if not nx.is_connected(G): raise nx.NetworkXError("Graph not connected.") solvername = { "full": FullInverseLaplacian, "lu": SuperLUInverseLaplacian, "cg": CGInverseLaplacian, } n = G.number_of_nodes() ordering = list(reverse_cuthill_mckee_ordering(G)) # make a copy with integer labels according to rcm ordering # this could be done without a copy if we really wanted to H = nx.relabel_nodes(G, dict(zip(ordering, range(n)))) L = nx.laplacian_matrix(H, nodelist=range(n), weight=weight).asformat("csc") L = L.astype(dtype) C = solvername[solver](L, dtype=dtype) # initialize solver betweenness = dict.fromkeys(H, 0.0) nb = (n - 1.0) * (n - 2.0) # normalization factor cstar = n * (n - 1) / nb l = 1 # parameter in approximation, adjustable k = l * int(np.ceil((cstar / epsilon) ** 2 * np.log(n))) if k > kmax: msg = f"Number random pairs k>kmax ({k}>{kmax}) " raise nx.NetworkXError(msg, "Increase kmax or epsilon") cstar2k = cstar / (2 * k) for i in range(k): s, t = seed.sample(range(n), 2) b = np.zeros(n, dtype=dtype) b[s] = 1 b[t] = -1 p = C.solve(b) for v in H: if v == s or v == t: continue for nbr in H[v]: w = H[v][nbr].get(weight, 1.0) betweenness[v] += w * np.abs(p[v] - p[nbr]) * cstar2k if normalized: factor = 1.0 else: factor = nb / 2.0 # remap to original node names and "unnormalize" if required return {ordering[k]: float(v * factor) for k, v in betweenness.items()} @not_implemented_for("directed") def current_flow_betweenness_centrality( G, normalized=True, weight=None, dtype=float, solver="full" ): r"""Compute current-flow betweenness centrality for nodes. Current-flow betweenness centrality uses an electrical current model for information spreading in contrast to betweenness centrality which uses shortest paths. Current-flow betweenness centrality is also known as random-walk betweenness centrality [2]_. Parameters ---------- G : graph A NetworkX graph normalized : bool, optional (default=True) If True the betweenness values are normalized by 2/[(n-1)(n-2)] where n is the number of nodes in G. weight : string or None, optional (default=None) Key for edge data used as the edge weight. If None, then use 1 as each edge weight. The weight reflects the capacity or the strength of the edge. dtype : data type (float) Default data type for internal matrices. Set to np.float32 for lower memory consumption. solver : string (default='full') Type of linear solver to use for computing the flow matrix. Options are "full" (uses most memory), "lu" (recommended), and "cg" (uses least memory). Returns ------- nodes : dictionary Dictionary of nodes with betweenness centrality as the value. See Also -------- approximate_current_flow_betweenness_centrality betweenness_centrality edge_betweenness_centrality edge_current_flow_betweenness_centrality Notes ----- Current-flow betweenness can be computed in $O(I(n-1)+mn \log n)$ time [1]_, where $I(n-1)$ is the time needed to compute the inverse Laplacian. For a full matrix this is $O(n^3)$ but using sparse methods you can achieve $O(nm{\sqrt k})$ where $k$ is the Laplacian matrix condition number. The space required is $O(nw)$ where $w$ is the width of the sparse Laplacian matrix. Worse case is $w=n$ for $O(n^2)$. If the edges have a 'weight' attribute they will be used as weights in this algorithm. Unspecified weights are set to 1. References ---------- .. [1] Centrality Measures Based on Current Flow. Ulrik Brandes and Daniel Fleischer, Proc. 22nd Symp. Theoretical Aspects of Computer Science (STACS '05). LNCS 3404, pp. 533-544. Springer-Verlag, 2005. https://doi.org/10.1007/978-3-540-31856-9_44 .. [2] A measure of betweenness centrality based on random walks, M. E. J. Newman, Social Networks 27, 39-54 (2005). """ if not nx.is_connected(G): raise nx.NetworkXError("Graph not connected.") n = G.number_of_nodes() ordering = list(reverse_cuthill_mckee_ordering(G)) # make a copy with integer labels according to rcm ordering # this could be done without a copy if we really wanted to H = nx.relabel_nodes(G, dict(zip(ordering, range(n)))) betweenness = dict.fromkeys(H, 0.0) # b[v]=0 for v in H for row, (s, t) in flow_matrix_row(H, weight=weight, dtype=dtype, solver=solver): pos = dict(zip(row.argsort()[::-1], range(n))) for i in range(n): betweenness[s] += (i - pos[i]) * row[i] betweenness[t] += (n - i - 1 - pos[i]) * row[i] if normalized: nb = (n - 1.0) * (n - 2.0) # normalization factor else: nb = 2.0 for v in H: betweenness[v] = float((betweenness[v] - v) * 2.0 / nb) return {ordering[k]: v for k, v in betweenness.items()} @not_implemented_for("directed") def edge_current_flow_betweenness_centrality( G, normalized=True, weight=None, dtype=float, solver="full" ): r"""Compute current-flow betweenness centrality for edges. Current-flow betweenness centrality uses an electrical current model for information spreading in contrast to betweenness centrality which uses shortest paths. Current-flow betweenness centrality is also known as random-walk betweenness centrality [2]_. Parameters ---------- G : graph A NetworkX graph normalized : bool, optional (default=True) If True the betweenness values are normalized by 2/[(n-1)(n-2)] where n is the number of nodes in G. weight : string or None, optional (default=None) Key for edge data used as the edge weight. If None, then use 1 as each edge weight. The weight reflects the capacity or the strength of the edge. dtype : data type (default=float) Default data type for internal matrices. Set to np.float32 for lower memory consumption. solver : string (default='full') Type of linear solver to use for computing the flow matrix. Options are "full" (uses most memory), "lu" (recommended), and "cg" (uses least memory). Returns ------- nodes : dictionary Dictionary of edge tuples with betweenness centrality as the value. Raises ------ NetworkXError The algorithm does not support DiGraphs. If the input graph is an instance of DiGraph class, NetworkXError is raised. See Also -------- betweenness_centrality edge_betweenness_centrality current_flow_betweenness_centrality Notes ----- Current-flow betweenness can be computed in $O(I(n-1)+mn \log n)$ time [1]_, where $I(n-1)$ is the time needed to compute the inverse Laplacian. For a full matrix this is $O(n^3)$ but using sparse methods you can achieve $O(nm{\sqrt k})$ where $k$ is the Laplacian matrix condition number. The space required is $O(nw)$ where $w$ is the width of the sparse Laplacian matrix. Worse case is $w=n$ for $O(n^2)$. If the edges have a 'weight' attribute they will be used as weights in this algorithm. Unspecified weights are set to 1. References ---------- .. [1] Centrality Measures Based on Current Flow. Ulrik Brandes and Daniel Fleischer, Proc. 22nd Symp. Theoretical Aspects of Computer Science (STACS '05). LNCS 3404, pp. 533-544. Springer-Verlag, 2005. https://doi.org/10.1007/978-3-540-31856-9_44 .. [2] A measure of betweenness centrality based on random walks, M. E. J. Newman, Social Networks 27, 39-54 (2005). """ from networkx.utils import reverse_cuthill_mckee_ordering if not nx.is_connected(G): raise nx.NetworkXError("Graph not connected.") n = G.number_of_nodes() ordering = list(reverse_cuthill_mckee_ordering(G)) # make a copy with integer labels according to rcm ordering # this could be done without a copy if we really wanted to H = nx.relabel_nodes(G, dict(zip(ordering, range(n)))) edges = (tuple(sorted((u, v))) for u, v in H.edges()) betweenness = dict.fromkeys(edges, 0.0) if normalized: nb = (n - 1.0) * (n - 2.0) # normalization factor else: nb = 2.0 for row, (e) in flow_matrix_row(H, weight=weight, dtype=dtype, solver=solver): pos = dict(zip(row.argsort()[::-1], range(1, n + 1))) for i in range(n): betweenness[e] += (i + 1 - pos[i]) * row[i] betweenness[e] += (n - i - pos[i]) * row[i] betweenness[e] /= nb return {(ordering[s], ordering[t]): float(v) for (s, t), v in betweenness.items()}
34.527697
86
0.647809
"""Current-flow betweenness centrality measures.""" import networkx as nx from networkx.algorithms.centrality.flow_matrix import ( CGInverseLaplacian, flow_matrix_row, FullInverseLaplacian, SuperLUInverseLaplacian, ) from networkx.utils import ( not_implemented_for, reverse_cuthill_mckee_ordering, py_random_state, ) __all__ = [ "current_flow_betweenness_centrality", "approximate_current_flow_betweenness_centrality", "edge_current_flow_betweenness_centrality", ] @py_random_state(7) @not_implemented_for("directed") def approximate_current_flow_betweenness_centrality( G, normalized=True, weight=None, dtype=float, solver="full", epsilon=0.5, kmax=10000, seed=None, ): r"""Compute the approximate current-flow betweenness centrality for nodes. Approximates the current-flow betweenness centrality within absolute error of epsilon with high probability [1]_. Parameters ---------- G : graph A NetworkX graph normalized : bool, optional (default=True) If True the betweenness values are normalized by 2/[(n-1)(n-2)] where n is the number of nodes in G. weight : string or None, optional (default=None) Key for edge data used as the edge weight. If None, then use 1 as each edge weight. The weight reflects the capacity or the strength of the edge. dtype : data type (float) Default data type for internal matrices. Set to np.float32 for lower memory consumption. solver : string (default='full') Type of linear solver to use for computing the flow matrix. Options are "full" (uses most memory), "lu" (recommended), and "cg" (uses least memory). epsilon: float Absolute error tolerance. kmax: int Maximum number of sample node pairs to use for approximation. seed : integer, random_state, or None (default) Indicator of random number generation state. See :ref:`Randomness<randomness>`. Returns ------- nodes : dictionary Dictionary of nodes with betweenness centrality as the value. See Also -------- current_flow_betweenness_centrality Notes ----- The running time is $O((1/\epsilon^2)m{\sqrt k} \log n)$ and the space required is $O(m)$ for $n$ nodes and $m$ edges. If the edges have a 'weight' attribute they will be used as weights in this algorithm. Unspecified weights are set to 1. References ---------- .. [1] Ulrik Brandes and Daniel Fleischer: Centrality Measures Based on Current Flow. Proc. 22nd Symp. Theoretical Aspects of Computer Science (STACS '05). LNCS 3404, pp. 533-544. Springer-Verlag, 2005. https://doi.org/10.1007/978-3-540-31856-9_44 """ import numpy as np if not nx.is_connected(G): raise nx.NetworkXError("Graph not connected.") solvername = { "full": FullInverseLaplacian, "lu": SuperLUInverseLaplacian, "cg": CGInverseLaplacian, } n = G.number_of_nodes() ordering = list(reverse_cuthill_mckee_ordering(G)) # make a copy with integer labels according to rcm ordering # this could be done without a copy if we really wanted to H = nx.relabel_nodes(G, dict(zip(ordering, range(n)))) L = nx.laplacian_matrix(H, nodelist=range(n), weight=weight).asformat("csc") L = L.astype(dtype) C = solvername[solver](L, dtype=dtype) # initialize solver betweenness = dict.fromkeys(H, 0.0) nb = (n - 1.0) * (n - 2.0) # normalization factor cstar = n * (n - 1) / nb l = 1 # parameter in approximation, adjustable k = l * int(np.ceil((cstar / epsilon) ** 2 * np.log(n))) if k > kmax: msg = f"Number random pairs k>kmax ({k}>{kmax}) " raise nx.NetworkXError(msg, "Increase kmax or epsilon") cstar2k = cstar / (2 * k) for i in range(k): s, t = seed.sample(range(n), 2) b = np.zeros(n, dtype=dtype) b[s] = 1 b[t] = -1 p = C.solve(b) for v in H: if v == s or v == t: continue for nbr in H[v]: w = H[v][nbr].get(weight, 1.0) betweenness[v] += w * np.abs(p[v] - p[nbr]) * cstar2k if normalized: factor = 1.0 else: factor = nb / 2.0 # remap to original node names and "unnormalize" if required return {ordering[k]: float(v * factor) for k, v in betweenness.items()} @not_implemented_for("directed") def current_flow_betweenness_centrality( G, normalized=True, weight=None, dtype=float, solver="full" ): r"""Compute current-flow betweenness centrality for nodes. Current-flow betweenness centrality uses an electrical current model for information spreading in contrast to betweenness centrality which uses shortest paths. Current-flow betweenness centrality is also known as random-walk betweenness centrality [2]_. Parameters ---------- G : graph A NetworkX graph normalized : bool, optional (default=True) If True the betweenness values are normalized by 2/[(n-1)(n-2)] where n is the number of nodes in G. weight : string or None, optional (default=None) Key for edge data used as the edge weight. If None, then use 1 as each edge weight. The weight reflects the capacity or the strength of the edge. dtype : data type (float) Default data type for internal matrices. Set to np.float32 for lower memory consumption. solver : string (default='full') Type of linear solver to use for computing the flow matrix. Options are "full" (uses most memory), "lu" (recommended), and "cg" (uses least memory). Returns ------- nodes : dictionary Dictionary of nodes with betweenness centrality as the value. See Also -------- approximate_current_flow_betweenness_centrality betweenness_centrality edge_betweenness_centrality edge_current_flow_betweenness_centrality Notes ----- Current-flow betweenness can be computed in $O(I(n-1)+mn \log n)$ time [1]_, where $I(n-1)$ is the time needed to compute the inverse Laplacian. For a full matrix this is $O(n^3)$ but using sparse methods you can achieve $O(nm{\sqrt k})$ where $k$ is the Laplacian matrix condition number. The space required is $O(nw)$ where $w$ is the width of the sparse Laplacian matrix. Worse case is $w=n$ for $O(n^2)$. If the edges have a 'weight' attribute they will be used as weights in this algorithm. Unspecified weights are set to 1. References ---------- .. [1] Centrality Measures Based on Current Flow. Ulrik Brandes and Daniel Fleischer, Proc. 22nd Symp. Theoretical Aspects of Computer Science (STACS '05). LNCS 3404, pp. 533-544. Springer-Verlag, 2005. https://doi.org/10.1007/978-3-540-31856-9_44 .. [2] A measure of betweenness centrality based on random walks, M. E. J. Newman, Social Networks 27, 39-54 (2005). """ if not nx.is_connected(G): raise nx.NetworkXError("Graph not connected.") n = G.number_of_nodes() ordering = list(reverse_cuthill_mckee_ordering(G)) # make a copy with integer labels according to rcm ordering # this could be done without a copy if we really wanted to H = nx.relabel_nodes(G, dict(zip(ordering, range(n)))) betweenness = dict.fromkeys(H, 0.0) # b[v]=0 for v in H for row, (s, t) in flow_matrix_row(H, weight=weight, dtype=dtype, solver=solver): pos = dict(zip(row.argsort()[::-1], range(n))) for i in range(n): betweenness[s] += (i - pos[i]) * row[i] betweenness[t] += (n - i - 1 - pos[i]) * row[i] if normalized: nb = (n - 1.0) * (n - 2.0) # normalization factor else: nb = 2.0 for v in H: betweenness[v] = float((betweenness[v] - v) * 2.0 / nb) return {ordering[k]: v for k, v in betweenness.items()} @not_implemented_for("directed") def edge_current_flow_betweenness_centrality( G, normalized=True, weight=None, dtype=float, solver="full" ): r"""Compute current-flow betweenness centrality for edges. Current-flow betweenness centrality uses an electrical current model for information spreading in contrast to betweenness centrality which uses shortest paths. Current-flow betweenness centrality is also known as random-walk betweenness centrality [2]_. Parameters ---------- G : graph A NetworkX graph normalized : bool, optional (default=True) If True the betweenness values are normalized by 2/[(n-1)(n-2)] where n is the number of nodes in G. weight : string or None, optional (default=None) Key for edge data used as the edge weight. If None, then use 1 as each edge weight. The weight reflects the capacity or the strength of the edge. dtype : data type (default=float) Default data type for internal matrices. Set to np.float32 for lower memory consumption. solver : string (default='full') Type of linear solver to use for computing the flow matrix. Options are "full" (uses most memory), "lu" (recommended), and "cg" (uses least memory). Returns ------- nodes : dictionary Dictionary of edge tuples with betweenness centrality as the value. Raises ------ NetworkXError The algorithm does not support DiGraphs. If the input graph is an instance of DiGraph class, NetworkXError is raised. See Also -------- betweenness_centrality edge_betweenness_centrality current_flow_betweenness_centrality Notes ----- Current-flow betweenness can be computed in $O(I(n-1)+mn \log n)$ time [1]_, where $I(n-1)$ is the time needed to compute the inverse Laplacian. For a full matrix this is $O(n^3)$ but using sparse methods you can achieve $O(nm{\sqrt k})$ where $k$ is the Laplacian matrix condition number. The space required is $O(nw)$ where $w$ is the width of the sparse Laplacian matrix. Worse case is $w=n$ for $O(n^2)$. If the edges have a 'weight' attribute they will be used as weights in this algorithm. Unspecified weights are set to 1. References ---------- .. [1] Centrality Measures Based on Current Flow. Ulrik Brandes and Daniel Fleischer, Proc. 22nd Symp. Theoretical Aspects of Computer Science (STACS '05). LNCS 3404, pp. 533-544. Springer-Verlag, 2005. https://doi.org/10.1007/978-3-540-31856-9_44 .. [2] A measure of betweenness centrality based on random walks, M. E. J. Newman, Social Networks 27, 39-54 (2005). """ from networkx.utils import reverse_cuthill_mckee_ordering if not nx.is_connected(G): raise nx.NetworkXError("Graph not connected.") n = G.number_of_nodes() ordering = list(reverse_cuthill_mckee_ordering(G)) # make a copy with integer labels according to rcm ordering # this could be done without a copy if we really wanted to H = nx.relabel_nodes(G, dict(zip(ordering, range(n)))) edges = (tuple(sorted((u, v))) for u, v in H.edges()) betweenness = dict.fromkeys(edges, 0.0) if normalized: nb = (n - 1.0) * (n - 2.0) # normalization factor else: nb = 2.0 for row, (e) in flow_matrix_row(H, weight=weight, dtype=dtype, solver=solver): pos = dict(zip(row.argsort()[::-1], range(1, n + 1))) for i in range(n): betweenness[e] += (i + 1 - pos[i]) * row[i] betweenness[e] += (n - i - pos[i]) * row[i] betweenness[e] /= nb return {(ordering[s], ordering[t]): float(v) for (s, t), v in betweenness.items()}
0
0
0
bab1f660b94b8340f9fec39c7e740e1715a2a8a7
760
py
Python
read.py
AnnyKong/Web-Crawler
17c32723df52ed0f3ba19754fdd65e719ab94d25
[ "MIT" ]
2
2018-12-05T06:29:42.000Z
2019-01-10T01:09:00.000Z
read.py
AnnyKong/Web-Crawler
17c32723df52ed0f3ba19754fdd65e719ab94d25
[ "MIT" ]
null
null
null
read.py
AnnyKong/Web-Crawler
17c32723df52ed0f3ba19754fdd65e719ab94d25
[ "MIT" ]
null
null
null
# from requests_html import HTMLSession # import re # from multiprocessing import Pool, Manager, Process # import pandas as pd # from functools import partial import json import sys # records = {} # index -> data # count = 0 if __name__ == '__main__': if len(sys.argv) != 2: print("python3 read.py <json_filename>") file = sys.argv[1] if not sys.argv[1].endswith('.json'): file += '.json' read(file)
23.030303
52
0.556579
# from requests_html import HTMLSession # import re # from multiprocessing import Pool, Manager, Process # import pandas as pd # from functools import partial import json import sys # records = {} # index -> data # count = 0 def read(file): dict = {} # with open(argv[1] + 'json', "w") as f: # json.dump(dict, f) with open(file) as f: dict = json.load(f) print('----Read Success----') print("The file (" + file + ') has: ') print('\t' + str(len(dict)) + ' records.') print('--------------------') if __name__ == '__main__': if len(sys.argv) != 2: print("python3 read.py <json_filename>") file = sys.argv[1] if not sys.argv[1].endswith('.json'): file += '.json' read(file)
295
0
23
83c2efcebb422a77c2dfbc06940aedc96140b02f
9,968
py
Python
Jwalk/build/lib/Jwalk/SurfaceTools.py
Topf-Lab/Jwalk
72fac517b57b3724bb24101679afa8407c98666f
[ "Naumen", "Condor-1.1", "MS-PL" ]
null
null
null
Jwalk/build/lib/Jwalk/SurfaceTools.py
Topf-Lab/Jwalk
72fac517b57b3724bb24101679afa8407c98666f
[ "Naumen", "Condor-1.1", "MS-PL" ]
1
2021-10-04T20:21:39.000Z
2021-10-04T20:21:39.000Z
Jwalk/src/Jwalk/SurfaceTools.py
Topf-Lab/Jwalk
72fac517b57b3724bb24101679afa8407c98666f
[ "Naumen", "Condor-1.1", "MS-PL" ]
1
2021-01-04T11:19:07.000Z
2021-01-04T11:19:07.000Z
#=============================================================================== # This file is part of Jwalk. # # Jwalk - A tool to calculate the solvent accessible surface distance (SASD) # between crosslinked residues. # # Copyright 2016 Jwalk Inventor and Birkbeck College University of London. # The Jwalk Inventor is: Josh Bullock # # # Jwalk is available under Public Licence. # This software is made available under GPL V3 # # Please cite your use of Jwalk in published work: # # J.Bullock, J. Schwab, K. Thalassinos, M. Topf (2016) # The importance of non-accessible crosslinks and solvent accessible surface distance # in modelling proteins with restraints from crosslinking mass spectrometry. # Molecular and Cellular Proteomics (15) pp.2491-2500 # #=============================================================================== import sys from math import cos, sin import subprocess def expand_points(atom,sphere): """ Exapnd the unit sphere around specific x,y,z point and returns surface points""" points = {} atom.point_list = [] CH2 = 1.68 radius = {"N":1.43, "O":1.30, "C":1.68, "S":1.67, } r = radius[atom.atom_name[0]] + CH2 (x,y,z) = (atom.x, atom.y, atom.z) for s in sphere: x1 = x + s[0]*r y1 = y + s[1]*r z1 = z + s[2]*r points[x1,y1,z1] = 0 return points def create_unit_sphere(): """ Generates a unit sphere with 30 points on the surface """ unit_sphere = [] unit_sphere.append( [0.0, 1.0, 0.0] ) unit_sphere.append( [0.0, -1.0, 0.0] ) nstep = 5 PI = 3.1415926536 theta = PI/nstep arc = theta for istep in range(nstep): istep = istep + 1 # to change range from 0--9 to 1--10 y1 = cos(istep*theta) r2 = sin(istep*theta) ndot2= 2*PI*r2/arc # the circumference at that radius / proportion of pi if ndot2 == 0.0: continue theta2 = 2*PI/ndot2 for idot in range(int(ndot2)): idot = idot + 1 # to change range from 0-- to 1-- x2 = r2*cos(idot*theta2) z2 = r2*sin(idot*theta2) unit_sphere.append( [x2, y1, z2] ) return unit_sphere def check_solvent_accessibility(prot,aa1_CA,xl_list = False): ''' Checks solvent accessibility of residues in aa1_CA Returns aa1_CA of solvent accessible residues. Arguments *prot* Tempy structure instance *aa1_CA* residues of interest ''' # dictionary for text output string_dict = {"LYS":"lysines", "CYS":"cysteines", "ASP":"acidic residues", "GLU":"acidic residues", "VAL":"valines", "ILE":"isoleucines", "LEU":"leucines", "ARG":"arginines", "PRO":"prolines", "GLY":"glycines", "ALA":"alanines", "TRP":"tryptophans", "PHE":"phenylalanines", "SER":"serines", "GLN":"glutamines", "HIS":"histidines", "MET":"methionines", "THR":"threonines", "ASN":"asparagines", "TYR":"tyrosines" } radius = {"N":1.43, "O":1.30, "C":1.68, "S":1.67, } sd_res = False # create sphere of 30 points to expand around atoms sphere = create_unit_sphere() SA_res = {} CH2 = 1.68 # this is not very efficient ... freesasa implementation to come for atom in prot.atomList: atom.clash = 1 if (atom.res_no,atom.chain,atom.res) in aa1_CA: sd_res = atom.res # generate 30 points in unit spehere around atom points = expand_points(atom,sphere) for p in points: (x,y,z) = (p[0],p[1],p[2]) # for every other atom check if points intersects with it for atom2 in prot.atomList: if atom2.res != atom.res or (atom2.res == atom.res and atom2.atom_name != atom.atom_name): r = radius[atom2.atom_name[0]] + CH2 # need to transpose x,y,z (tx,ty,tz) = (x-atom2.x,y-atom2.y,z-atom2.z) # if the point lies within the sphere of that atom then it clashes if tx**2 + ty**2 + tz**2 <= r**2: points[p] = 1 break # if any point on the sphere doesn't intersect with another then the atom is solvent accessible if points[p] == 0: atom.clash = 0 break # if atom doesn't clash then residue information is kept in SA_res if atom.clash == 0: SA_res[atom.res_no,atom.chain,atom.res] = aa1_CA[atom.res_no,atom.chain,atom.res] # inform user on buried resiudes if xl_list: pass elif sd_res == "LYS": print "%d %s and 1 N-terminus of which %d are on the surface" % (len(aa1_CA)-1,string_dict[sd_res], len(SA_res)) else: print "%d %s of which %d are on the surface" % (len(aa1_CA),string_dict[sd_res], len(SA_res)) return SA_res def update_crosslink_pairs(crosslink_pairs, aa1_CA, aa2_CA, remove_aa1, remove_aa2): '''Removes buried residues from crosslink_pairs''' buried_residues = [] index_to_delete = [] for i in xrange(len(crosslink_pairs)): # for each residue pair, check both are solvent accessible x1, x2 = crosslink_pairs[i] if x1 not in aa1_CA: index_to_delete.append(i) if x1 not in buried_residues: buried_residues.append(x1) if x2 not in aa2_CA and x2 not in buried_residues: buried_residues.append(x2) elif x2 not in aa2_CA: index_to_delete.append(i) if x2 not in buried_residues: buried_residues.append(x2) if [x1[0],x1[1]] in remove_aa1: index_to_delete.append(i) if x1 not in buried_residues: buried_residues.append(x1) if x2 in remove_aa2 and not x2 in buried_residues: buried_residues.append(x2) elif [x2[0],x2[1]] in remove_aa2: index_to_delete.append(i) if x2 not in buried_residues: buried_residues.append(x2) no_sasd_possible = [] crosslink_pairs_final = [] for i in xrange(len(crosslink_pairs)): if i not in index_to_delete: crosslink_pairs_final.append(crosslink_pairs[i]) else: no_sasd_possible.append(crosslink_pairs[i]) if len(no_sasd_possible) > 0: print "the following crosslinks cannot be calculated:" for s in no_sasd_possible: print "%s-%s-%s - %s-%s-%s" % (s[0][2],s[0][0],s[0][1],s[1][2],s[1][0],s[1][1]) return crosslink_pairs_final
34.491349
141
0.501705
#=============================================================================== # This file is part of Jwalk. # # Jwalk - A tool to calculate the solvent accessible surface distance (SASD) # between crosslinked residues. # # Copyright 2016 Jwalk Inventor and Birkbeck College University of London. # The Jwalk Inventor is: Josh Bullock # # # Jwalk is available under Public Licence. # This software is made available under GPL V3 # # Please cite your use of Jwalk in published work: # # J.Bullock, J. Schwab, K. Thalassinos, M. Topf (2016) # The importance of non-accessible crosslinks and solvent accessible surface distance # in modelling proteins with restraints from crosslinking mass spectrometry. # Molecular and Cellular Proteomics (15) pp.2491-2500 # #=============================================================================== import sys from math import cos, sin import subprocess def expand_points(atom,sphere): """ Exapnd the unit sphere around specific x,y,z point and returns surface points""" points = {} atom.point_list = [] CH2 = 1.68 radius = {"N":1.43, "O":1.30, "C":1.68, "S":1.67, } r = radius[atom.atom_name[0]] + CH2 (x,y,z) = (atom.x, atom.y, atom.z) for s in sphere: x1 = x + s[0]*r y1 = y + s[1]*r z1 = z + s[2]*r points[x1,y1,z1] = 0 return points def create_unit_sphere(): """ Generates a unit sphere with 30 points on the surface """ unit_sphere = [] unit_sphere.append( [0.0, 1.0, 0.0] ) unit_sphere.append( [0.0, -1.0, 0.0] ) nstep = 5 PI = 3.1415926536 theta = PI/nstep arc = theta for istep in range(nstep): istep = istep + 1 # to change range from 0--9 to 1--10 y1 = cos(istep*theta) r2 = sin(istep*theta) ndot2= 2*PI*r2/arc # the circumference at that radius / proportion of pi if ndot2 == 0.0: continue theta2 = 2*PI/ndot2 for idot in range(int(ndot2)): idot = idot + 1 # to change range from 0-- to 1-- x2 = r2*cos(idot*theta2) z2 = r2*sin(idot*theta2) unit_sphere.append( [x2, y1, z2] ) return unit_sphere def check_solvent_accessibility(prot,aa1_CA,xl_list = False): ''' Checks solvent accessibility of residues in aa1_CA Returns aa1_CA of solvent accessible residues. Arguments *prot* Tempy structure instance *aa1_CA* residues of interest ''' # dictionary for text output string_dict = {"LYS":"lysines", "CYS":"cysteines", "ASP":"acidic residues", "GLU":"acidic residues", "VAL":"valines", "ILE":"isoleucines", "LEU":"leucines", "ARG":"arginines", "PRO":"prolines", "GLY":"glycines", "ALA":"alanines", "TRP":"tryptophans", "PHE":"phenylalanines", "SER":"serines", "GLN":"glutamines", "HIS":"histidines", "MET":"methionines", "THR":"threonines", "ASN":"asparagines", "TYR":"tyrosines" } radius = {"N":1.43, "O":1.30, "C":1.68, "S":1.67, } sd_res = False # create sphere of 30 points to expand around atoms sphere = create_unit_sphere() SA_res = {} CH2 = 1.68 # this is not very efficient ... freesasa implementation to come for atom in prot.atomList: atom.clash = 1 if (atom.res_no,atom.chain,atom.res) in aa1_CA: sd_res = atom.res # generate 30 points in unit spehere around atom points = expand_points(atom,sphere) for p in points: (x,y,z) = (p[0],p[1],p[2]) # for every other atom check if points intersects with it for atom2 in prot.atomList: if atom2.res != atom.res or (atom2.res == atom.res and atom2.atom_name != atom.atom_name): r = radius[atom2.atom_name[0]] + CH2 # need to transpose x,y,z (tx,ty,tz) = (x-atom2.x,y-atom2.y,z-atom2.z) # if the point lies within the sphere of that atom then it clashes if tx**2 + ty**2 + tz**2 <= r**2: points[p] = 1 break # if any point on the sphere doesn't intersect with another then the atom is solvent accessible if points[p] == 0: atom.clash = 0 break # if atom doesn't clash then residue information is kept in SA_res if atom.clash == 0: SA_res[atom.res_no,atom.chain,atom.res] = aa1_CA[atom.res_no,atom.chain,atom.res] # inform user on buried resiudes if xl_list: pass elif sd_res == "LYS": print "%d %s and 1 N-terminus of which %d are on the surface" % (len(aa1_CA)-1,string_dict[sd_res], len(SA_res)) else: print "%d %s of which %d are on the surface" % (len(aa1_CA),string_dict[sd_res], len(SA_res)) return SA_res def update_crosslink_pairs(crosslink_pairs, aa1_CA, aa2_CA, remove_aa1, remove_aa2): '''Removes buried residues from crosslink_pairs''' buried_residues = [] index_to_delete = [] for i in xrange(len(crosslink_pairs)): # for each residue pair, check both are solvent accessible x1, x2 = crosslink_pairs[i] if x1 not in aa1_CA: index_to_delete.append(i) if x1 not in buried_residues: buried_residues.append(x1) if x2 not in aa2_CA and x2 not in buried_residues: buried_residues.append(x2) elif x2 not in aa2_CA: index_to_delete.append(i) if x2 not in buried_residues: buried_residues.append(x2) if [x1[0],x1[1]] in remove_aa1: index_to_delete.append(i) if x1 not in buried_residues: buried_residues.append(x1) if x2 in remove_aa2 and not x2 in buried_residues: buried_residues.append(x2) elif [x2[0],x2[1]] in remove_aa2: index_to_delete.append(i) if x2 not in buried_residues: buried_residues.append(x2) no_sasd_possible = [] crosslink_pairs_final = [] for i in xrange(len(crosslink_pairs)): if i not in index_to_delete: crosslink_pairs_final.append(crosslink_pairs[i]) else: no_sasd_possible.append(crosslink_pairs[i]) if len(no_sasd_possible) > 0: print "the following crosslinks cannot be calculated:" for s in no_sasd_possible: print "%s-%s-%s - %s-%s-%s" % (s[0][2],s[0][0],s[0][1],s[1][2],s[1][0],s[1][1]) return crosslink_pairs_final def check_solvent_accessibility_freesasa(prot,aa1_CA,freesasa_source = "freesasa", xl_list = False): # dictionary for text output string_dict = {"LYS":"lysines", "CYS":"cysteines", "ASP":"aspartates", "GLU":"glutamates", "VAL":"valines", "ILE":"isoleucines", "LEU":"leucines", "ARG":"arginines", "PRO":"prolines", "GLY":"glycines", "ALA":"alanines", "TRP":"tryptophans", "PHE":"phenylalanines", "SER":"serines", "GLN":"glutamines", "HIS":"histidines", "MET":"methionines", "THR":"threonines", "ASN":"asparagines", "TYR":"tyrosines" } cmd = [freesasa_source,"--format=rsa","--output=%s.rsa" % prot[:-4],"--radii=naccess",prot] ext_freesasa = subprocess.Popen(cmd) ext_freesasa.communicate() try: test_open = open(prot[:-4]+".rsa") test_open.close except: print "No .rsa file created. Please check you have Freesasa installed. Go to 'http://freesasa.github.io/' " exit(1) #try: SA_res = {} with open(prot[:-4]+".rsa") as rsa: for line in rsa: if line.startswith("RES"): col = line.split() RES = line[4:8].strip() CHAIN = line[8:9].strip() if len(CHAIN) == 0: CHAIN = " " NUM = line[9:13].strip() REL = line[23:29].strip() if float(REL) > 7.0: res = RES + CHAIN + NUM SA_res[(int(NUM),CHAIN,RES)] = True #except: # print "error" SA_res_dict = {} for s in aa1_CA: if (s[0],s[1],s[2]) in SA_res: SA_res_dict[(s[0],s[1],s[2])] = aa1_CA[(s[0],s[1],s[2])] sd_res = s[2] else: print "Residue %d-%s-%s is buried" % (s[0],s[1],s[2]) sd_res = s[2] # inform user on buried resiudes if xl_list: pass elif sd_res == "LYS": print "%d %s and 1 N-terminus of which %d are on the surface" % (len(aa1_CA)-1,string_dict[sd_res], len(SA_res_dict)) else: print "%d %s of which %d are on the surface" % (len(aa1_CA),string_dict[sd_res], len(SA_res_dict)) return SA_res_dict
2,537
0
27
a58b8a635f84880b1282425d692f30cff3a142ff
45,162
py
Python
riemann/tx/tx.py
sturmianseq/riemann
9e6dbaaf1b339594c0c0d55b2db6e96d7e3f12c4
[ "Apache-2.0", "MIT" ]
118
2018-05-07T18:49:15.000Z
2022-01-15T17:32:43.000Z
riemann/tx/tx.py
sturmianseq/riemann
9e6dbaaf1b339594c0c0d55b2db6e96d7e3f12c4
[ "Apache-2.0", "MIT" ]
46
2018-05-03T21:53:11.000Z
2020-03-18T22:55:11.000Z
riemann/tx/tx.py
sturmianseq/riemann
9e6dbaaf1b339594c0c0d55b2db6e96d7e3f12c4
[ "Apache-2.0", "MIT" ]
19
2018-05-06T23:05:43.000Z
2021-11-24T14:27:45.000Z
import riemann from riemann import utils from riemann.tx import shared from riemann.script import serialization from riemann.tx.shared import ByteData, VarInt from typing import List, Optional, overload, Sequence, Tuple class Outpoint(ByteData): ''' An outpoint. A pointer to the previous output being consumed by the associated input. It specifies the prevout by transaction id and index within that transaction's output vector NB: Args must be little-endian Args: tx_id: the 32-byte LE hash of the previous transaction index: the 4-byte LE encoded index of the prevout in its transaction Attributes: tx_id: the 32-byte LE hash of the previous transaction index: the 4-byte LE encoded index of the prevout in its transaction ''' tx_id: bytes index: bytes def copy(self, tx_id: Optional[bytes] = None, index: Optional[bytes] = None) -> 'Outpoint': ''' Make a new copy of the object with optional modifications. ''' return Outpoint( tx_id=tx_id if tx_id is not None else self.tx_id, index=index if index is not None else self.index) @classmethod def null(Outpoint) -> 'Outpoint': '''Make a null outpoint, as found in coinbase transactions''' return Outpoint(b'\x00' * 32, b'\xff' * 4) @classmethod def from_bytes(Outpoint, byte_string: bytes) -> 'Outpoint': ''' Parse an Outpoint from a bytestring. Also available as from_hex ''' return Outpoint( tx_id=byte_string[:32], index=byte_string[32:36]) class TxIn(ByteData): ''' A transaction input, composed of an outpoint, a script_sig and a sequence number. Legacy TxIn script sigs contain spend authorization information for the referenced UTXO. Compatibility TxIn script sigs contain the witness program only. Segwit Txin script sigs are empty. The sequence number is used to set relative timelocks. See `this blog post <https://prestwi.ch/bitcoin-time-locks/>`_ for details. Args: outpoint: The `Outpoint` object pointing to the prevout being consumed by this input stack_script: The Script program that sets the initial stack, if any. Legacy inputs are unsigned without this. Segwit inputs never have this. redeem_script: The Script program that controls spending, if any. Only present when spending a Legacy or Compatibility SH UTXO. Segwit inputs never have this. sequence: The 4-byte LE encoded sequence number of the input. Can be used to set relative timelocks. Attributes: outpoint: The `Outpoint` object pointing to the prevout being consumed by this input stack_script: The Script program that sets the initial stack, if any. Legacy inputs are unsigned without this. Segwit inputs never have this. redeem_script: The Script program that controls spending, if any. Only present when spending a Legacy or Compatibility SH UTXO. Segwit inputs never have this. script_sig: The combined stack_script and redeem_script. For Legacy and Compatibility PKH transactions this will be equal to the stack script. sequence: The 4-byte LE encoded sequence number of the input. Can be used to set relative timelocks. ''' outpoint: Outpoint stack_script: bytes redeem_script: bytes sequence: bytes def copy(self, outpoint: Optional[Outpoint] = None, stack_script: Optional[bytes] = None, redeem_script: Optional[bytes] = None, sequence: Optional[bytes] = None) -> 'TxIn': ''' Make a new copy of the object with optional modifications. ''' return TxIn( outpoint=outpoint if outpoint is not None else self.outpoint, stack_script=(stack_script if stack_script is not None else self.stack_script), redeem_script=(redeem_script if redeem_script is not None else self.redeem_script), sequence=sequence if sequence is not None else self.sequence) def is_p2sh(self) -> bool: ''' Return True if the TxIn has a non-empty `redeem_script` ''' return self.redeem_script != b'' @staticmethod def _parse_script_sig(script_sig: bytes) -> Tuple[bytes, bytes]: ''' Parse the scriptsig into a stack script and a redeem_script byte_string -> (byte_string, byte_string) ''' # Is there a better way to do this? stack_script = script_sig redeem_script = b'' try: # If the last entry deserializes, it's a p2sh input # There is a vanishingly small edge case where the pubkey # forms a deserializable script. # Edge case: serialization errors on CODESEPARATOR deserialized = serialization.deserialize(script_sig) items = deserialized.split() serialization.hex_deserialize(items[-1]) stack_script = serialization.serialize(' '.join(items[:-1])) redeem_script = serialization.serialize(items[-1]) except (IndexError, ValueError, NotImplementedError): pass return stack_script, redeem_script @classmethod def from_bytes(TxIn, byte_string: bytes) -> 'TxIn': ''' Parse a TxIn from a bytestring. Also available as from_hex ''' outpoint = Outpoint.from_bytes(byte_string[:36]) # Extract the script sig length script_sig_len = VarInt.from_bytes(byte_string[36:45]) # Extract the script sig script_start = 36 + len(script_sig_len) script_end = script_start + script_sig_len.number script_sig = byte_string[script_start:script_end] sequence = byte_string[script_end:script_end + 4] # If the script-sig is blank, both stack and redeem are blank if script_sig == b'': stack_script = b'' redeem_script = b'' # If the outpoint is null (coinbase), don't try parsing the script sig elif outpoint == Outpoint.null(): stack_script = script_sig redeem_script = b'' # Parse the script sig into stack and redeem else: stack_script, redeem_script = TxIn._parse_script_sig(script_sig) return TxIn( outpoint=outpoint, stack_script=stack_script, redeem_script=redeem_script, sequence=sequence) class TxOut(ByteData): ''' A transaction output, composed of a value (in satoshi) and an output script describing the spend conditions on the new UTXO. Value is serialized as an 8-byte LE integer, measured in satoshi. Use the `i2le_padded` function in :ref:`utils` to serialize integers. TxOut accepts un-prepended output scripts, and adds their length for you. Args: value: the 8-byte LE encoded value of the output (in satoshi) output_script: the non-length-prepended output script as a bytestring Attributes: value: the 8-byte LE encoded value of the output (in satoshi) output_script: the non-length-prepended output script as a bytestring ''' value: bytes output_script: bytes def copy(self, value: Optional[bytes] = None, output_script: Optional[bytes] = None) -> 'TxOut': ''' Make a new copy of the object with optional modifications. ''' return TxOut( value=value if value is not None else self.value, output_script=(output_script if output_script is not None else self.output_script)) @classmethod def from_bytes(TxOut, byte_string: bytes) -> 'TxOut': ''' Parse a TxOut from a bytestring. Also available as from_hex ''' n = VarInt.from_bytes(byte_string[8:]) script_start = 8 + len(n) script_end = script_start + n.number if n.number < 0xfc: return TxOut( value=byte_string[:8], output_script=byte_string[script_start:script_end]) else: raise NotImplementedError( 'No support for abnormally long pk_scripts.') class WitnessStackItem(ByteData): ''' A witness stack item. Each input witness is composed of an initial stack to be evaluated by the witness program. Witnesses for P2WSH inputs have a serialized script as the last stack element. Args: item: the raw data to be placed on the stack Attributes: item: the raw data to be placed on the stack ''' @classmethod def from_bytes(WitnessStackItem, byte_string: bytes) -> 'WitnessStackItem': ''' Parse a WitnessStackItem from a bytestring. Also available as from_hex ''' n = VarInt.from_bytes(byte_string) item_start = len(n) item_end = item_start + n.number return WitnessStackItem(byte_string[item_start:item_end]) class InputWitness(ByteData): ''' The witness for a Compatibility or Segwit TxIn. It consists of a stack that will be evaluated by the witness program, represented as an ordered list of `WitnessStackItem` objects. Args: stack: the ordered sequence of WitnessStackItems Attributes: stack: the ordered sequence of WitnessStackItems ''' stack: Tuple[WitnessStackItem, ...] def __init__(self, stack: Sequence[WitnessStackItem]): ''' list(WitnessStackItem) -> InputWitness ''' super().__init__() for item in stack: if not isinstance(item, WitnessStackItem): raise ValueError( 'Invalid witness stack item. ' 'Expected WitnessStackItem. Got {}' .format(item)) self += VarInt(len(stack)) for item in stack: self += item self.stack = tuple(item for item in stack) self._make_immutable() @classmethod def from_bytes(InputWitness, byte_string: bytes) -> 'InputWitness': ''' Parse an InputWitness from a bytestring. Also available as from_hex ''' stack_items = VarInt.from_bytes(byte_string) item_start = len(stack_items) items: List[WitnessStackItem] = [] while len(items) < stack_items.number: item = WitnessStackItem.from_bytes(byte_string[item_start:]) item_start += len(item) items.append(item) return InputWitness(items) def copy(self, stack: Optional[List[WitnessStackItem]] = None) -> 'InputWitness': ''' Make a new copy of the object with optional modifications. ''' return InputWitness( stack=stack if stack is not None else self.stack) class Tx(ByteData): ''' A complete transaction. It consists of a version, a flag that indicates the presence of witnesses (and breaks legacy parsers), a length-prepended vector of `TxIn` objects, a length-prepended vector of `TxOut` objects, and a locktime number. Compatibility and Segwit transactions MUST contain the witness flag. Signed Compatibility and Segwit transactions will additionally contain a vector of `InputWitness` objects. This object provides a number of conveniences for interacting with transactions, including `tx_id` calculation, and sighash calculation. To serialize the transaction, call `to_bytes()` or `hex()`. Note: The `lock_time` field is used to set absolute timelocks. These are complex and confusing. See `this blog post <https://prestwi.ch/bitcoin-time-locks/>`_ for details. Args: version: the 4-byte LE version number. Must be 1 or 2. Setting to 1 deactivates relative lock times. tx_ins: the ordered sequence of TxIn objects representing TXOs. consumed by this transaction. Signed Legacy transaction will include spend authorization here. tx_outs: the ordered sequence of TxOut objects representing TXOs created by this transaction. tx_witnesses: the ordered sequence of InputWitness objects associated with this transaction. Always empty in Legacy transactions. In Compatibility and Segwit transactions there must be one witness per input. lock_time: the 4-byte LE locktime number. Setting this invokes the absolute time lock system. If it is below 500,000,000 it is interpreted as a blockheight before which the transaction is invalid. If set above that, it is interpreted as a Unix timestamp before which the transaction is invalid. Attributes: version: the 4-byte LE version number. Must be 1 or 2. Setting to 1 deactivates relative lock times. flag: the 2-byte witness transaction flag. Always empty for Legacy transaction, or '0001' for Compatibility and Witness transactions tx_ins: the ordered sequence of TxIn objects representing TXOs. consumed by this transaction. Signed Legacy transaction will include spend authorization here. tx_outs: the ordered sequence of TxOut objects representing TXOs created by this transaction. tx_witnesses: the ordered sequence of InputWitness objects associated with this transaction. Always empty in Legacy transactions. In Compatibility and Segwit transactions there must be one witness per input. lock_time: the 4-byte LE locktime number. Setting this invokes the absolute time lock system. If it is below 500,000,000 it is interpreted as a blockheight before which the transaction is invalid. If set above that, it is interpreted as a Unix timestamp before which the transaction is invalid. tx_id_le: the LE (in-protocol) hash committed to by the block header transaction merkle tree. wtx_id_le: the LE (in-protocol) hash committed to by the coinbase transaction witness merkle tree. Not present in Legacy transactions. tx_id: the BE (block explorer or human-facing) tx_id. wtx_id: the BE (block explorer or human-facing) wtx_id. Not present in Legacy transactions. ''' version: bytes flag: Optional[bytes] tx_ins: Tuple[TxIn, ...] tx_outs: Tuple[TxOut, ...] tx_witnesses: Optional[Tuple[InputWitness, ...]] lock_time: bytes tx_id_le: bytes wtx_id_le: Optional[bytes] tx_id: bytes wtx_id: Optional[bytes] @classmethod def from_hex(Tx, hex_string: str) -> 'Tx': '''Instantiate a Tx object from a hex string''' return Tx.from_bytes(bytes.fromhex(hex_string)) @classmethod def from_bytes(Tx, byte_string: bytes) -> 'Tx': '''Instantiate a Tx object from a bytestring''' # Get the version number version = byte_string[0:4] # Check if this is a witness tx if byte_string[4:6] == riemann.network.SEGWIT_TX_FLAG: tx_ins_num_loc = 6 flag = riemann.network.SEGWIT_TX_FLAG else: tx_ins_num_loc = 4 flag = None # Get the length of the tx_in vector tx_ins = [] tx_ins_num = VarInt.from_bytes(byte_string[tx_ins_num_loc:]) # `current` is the index of next read current = tx_ins_num_loc + len(tx_ins_num) # Deserialize all tx_ins for _ in range(tx_ins_num.number): tx_in = TxIn.from_bytes(byte_string[current:]) current += len(tx_in) tx_ins.append(tx_in) # Get the length of the tx_out vector tx_outs = [] tx_outs_num = VarInt.from_bytes(byte_string[current:]) # Deserialize all outputs current += len(tx_outs_num) for _ in range(tx_outs_num.number): tx_out = TxOut.from_bytes(byte_string[current:]) current += len(tx_out) tx_outs.append(tx_out) # Deserialize all witnesses if necessary tx_witnesses: List[InputWitness] = [] if flag and len(byte_string[current:]) > 4: tx_witnesses_num = tx_ins_num for _ in range(tx_witnesses_num.number): tx_witness = InputWitness.from_bytes(byte_string[current:]) current += len(tx_witness) tx_witnesses.append(tx_witness) # Get the lock time and return a complete tx lock_time = byte_string[current:current + 4] return Tx( version=version, flag=flag, tx_ins=tx_ins, tx_outs=tx_outs, tx_witnesses=tx_witnesses, lock_time=lock_time) def no_witness(self) -> bytes: ''' Return the Tx as a bytestring stripped of witnesses. This is the preimage of `tx_id` and `tx_id_le`. ''' tx = bytes() tx += self.version tx += VarInt(len(self.tx_ins)).to_bytes() for tx_in in self.tx_ins: tx += tx_in.to_bytes() tx += VarInt(len(self.tx_outs)).to_bytes() for tx_out in self.tx_outs: tx += tx_out.to_bytes() tx += self.lock_time return tx def is_witness(self) -> bool: '''Return True if the transaction witness flag is set''' return self.flag is not None or self.tx_witnesses is not None def calculate_fee(self, input_values: Sequence[int]) -> int: ''' Calculate the fee associated with a transaction. Caller must provide a sequence representing the value (in satoshi) of each input. Args: input_values: The value of each input in order. Returns: The total fee paid to miners by this transaction. ''' return \ sum(input_values) \ - sum([utils.le2i(o.value) for o in self.tx_outs]) def sighash_none(self) -> bytes: '''SIGHASH_NONE is a bad idea.''' raise NotImplementedError('SIGHASH_NONE is a bad idea.') def copy(self, version: Optional[bytes] = None, flag: Optional[bytes] = None, tx_ins: Optional[Sequence[TxIn]] = None, tx_outs: Optional[Sequence[TxOut]] = None, tx_witnesses: Optional[Sequence[InputWitness]] = None, lock_time: Optional[bytes] = None) -> 'Tx': ''' Make a new copy of the object with optional modifications. ''' return Tx(version=version if version is not None else self.version, flag=flag if flag is not None else self.flag, tx_ins=tx_ins if tx_ins is not None else self.tx_ins, tx_outs=tx_outs if tx_outs is not None else self.tx_outs, tx_witnesses=(tx_witnesses if tx_witnesses is not None else self.tx_witnesses), lock_time=(lock_time if lock_time is not None else self.lock_time)) def _sighash_prep(self, index: int, script: bytes) -> 'Tx': ''' Sighashes suck Performs the sighash setup described here: https://en.bitcoin.it/wiki/OP_CHECKSIG#How_it_works https://bitcoin.stackexchange.com/questions/3374/how-to-redeem-a-basic-tx We save on complexity by refusing to support OP_CODESEPARATOR ''' # 0 out scripts in tx_ins copy_tx_ins = [tx_in.copy(stack_script=b'', redeem_script=b'') for tx_in in self.tx_ins] # NB: The script for the current transaction input in txCopy is set to # subScript (lead in by its length as a var-integer encoded!) to_strip = VarInt.from_bytes(script) copy_tx_ins[index] = \ copy_tx_ins[index].copy(redeem_script=script[len(to_strip):]) return self.copy(tx_ins=copy_tx_ins) @overload @overload # noqa: F811 @overload # noqa: F811 @overload # noqa: F811 def sighash_all(self, # noqa: F811 index, script, prevout_value=None, anyone_can_pay=False) -> bytes: ''' Calculate the hash to be signed when adding authorization information (a script sig or a witness) to an input using SIGHASH_ALL. SIGHASH_ALL commits to ALL inputs, and ALL outputs. It indicates that no further modification of the transaction is allowed without invalidating the signature. SIGHASH_ALL + ANYONECANPAY commits to ONE input and ALL outputs. It indicates that anyone may add additional value to the transaction, but that no one may modify the payments made. Any extra value added above the sum of output values will be given to miners as part of the tx fee. We must specify the index of the input in the `tx_ins` sequence, the script controlling the TXO being spent by the input, and whether to use the ANYONECANPAY sighash modifier. Compatibility and Witness inputs must additionally supply the value of the TXO being consumed. This function automatically selects between Legacy, Witness, and Bcash SIGHASH_FORKID based on the network selected, and whether the witness flag is present in the transaction. For Legacy sighash documentation, see here: - https://en.bitcoin.it/wiki/OP_CHECKSIG#Hashtype_SIGHASH_ALL_.28default.29 For BIP143 (Witness and Compatibility) documentation, see here: - https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki For the BitcoinCash specific rip-off of BIP143 documentation, see here: - https://github.com/bitcoincashorg/spec/blob/master/replay-protected-sighash.md Note: After signing the digest, you MUST append the sighash indicator byte to the resulting signature. This will be 0x01 (SIGHASH_ALL) or 0x81 (SIGHASH_ALL + SIGHASH_ANYONECANPAY). Args: index: The index of the input being authorized script: The length-prepended script associated with the TXO being spent. For PKH outputs this will be a pkh spend script ( i.e. '1976a914....88ac'). For SH outputs this will be the redeem_script (Legacy) or Witness Script (Compatibility and Segwit). If the TXO being spent has a non-standard output script, use that here. prevout_value: The 8-byte LE integer-encoded value of the prevout anyone_can_pay: True if using the ANYONECANPAY sighash modifier Returns: The 32-byte digest to be signed. ''' # noqa: E501 if riemann.network.FORKID is not None: return self._sighash_forkid(index=index, script=script, prevout_value=prevout_value, sighash_type=shared.SIGHASH_ALL, anyone_can_pay=anyone_can_pay) if self.is_witness(): return self.segwit_sighash( index=index, script=script, prevout_value=prevout_value, sighash_type=shared.SIGHASH_ALL, anyone_can_pay=anyone_can_pay) copy_tx = self._sighash_prep(index=index, script=script) if anyone_can_pay: return self._sighash_anyone_can_pay( index=index, copy_tx=copy_tx, sighash_type=shared.SIGHASH_ALL) return self._sighash_final_hashing(copy_tx, shared.SIGHASH_ALL) @overload @overload # noqa: F811 @overload # noqa: F811 @overload # noqa: F811 def sighash_single(self, # noqa: F811 index, script, prevout_value=None, anyone_can_pay=False): ''' Calculate the hash to be signed when adding authorization information (a script sig or a witness) to an input using SIGHASH_SINGLE. SIGHASH_SINGLE commits to ALL inputs, and ONE output. It indicates that/ anyone may append additional outputs to the transaction to reroute funds from the inputs. Additional inputs cannot be added without invalidating the signature. It is logically difficult to use securely, as it consents to funds being moved, without specifying their destination. SIGHASH_SINGLE commits specifically the the output at the same index as the input being signed. If there is no output at that index, (because, e.g. the input vector is longer than the output vector) it behaves insecurely, and we do not implement that protocol bug. SIGHASH_SINGLE + ANYONECANPAY commits to ONE input and ONE output. It indicates that anyone may add additional value to the transaction, and route value to any other location. The signed input and output must be included in the fully-formed transaction at the same index in their respective vectors. When the input is larger than the output, a partial transaction signed this way cedes the difference to whoever cares to construct a complete transaction. However, when the output is larger than the input, it functions as a one-time-use payment invoice. Anyone may consume the input by adding value. This is useful for addressing race conditions in certain cross-chain protocols that the author of this documentation invented. :) We must specify the index of the input in the `tx_ins` sequence, the script controlling the TXO being spent by the input, and whether to use the ANYONECANPAY sighash modifier. Compatibility and Witness inputs must additionally supply the value of the TXO being consumed. This function automatically selects between Legacy, Witness, and Bcash SIGHASH_FORKID based on the network selected, and whether the witness flag is present in the transaction. For Legacy sighash documentation, see here: - https://en.bitcoin.it/wiki/OP_CHECKSIG#Procedure_for_Hashtype_SIGHASH_SINGLE - https://bitcoin.stackexchange.com/questions/3890/for-sighash-single-do-the-outputs-other-than-at-the-input-index-have-8-bytes-or - https://github.com/petertodd/python-bitcoinlib/blob/051ec4e28c1f6404fd46713c2810d4ebbed38de4/bitcoin/core/script.py#L913-L965 For BIP143 (Witness and Compatibility) documentation, see here: - https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki For the BitcoinCash specific rip-off of BIP143 documentation, see here: - https://github.com/bitcoincashorg/spec/blob/master/replay-protected-sighash.md Note: After signing the digest, you MUST append the sighash indicator byte to the resulting signature. This will be 0x03 (SIGHASH_SINGLE) or 0x83 (SIGHASH_SINGLE + SIGHASH_ANYONECANPAY). Args: index: The index of the input being authorized script: The length-prepended script associated with the TXO being spent. For PKH outputs this will be a pkh spend script ( i.e. '1976a914....88ac'). For SH outputs this will be the redeem_script (Legacy) or Witness Script (Compatibility and Segwit). If the TXO being spent has a non-standard output script, use that here. prevout_value: The 8-byte LE integer-encoded value of the prevout anyone_can_pay: True if using the ANYONECANPAY sighash modifier Returns: The 32-byte digest to be signed. ''' # noqa: E501 if index >= len(self.tx_outs): raise NotImplementedError( 'I refuse to implement the SIGHASH_SINGLE bug.') if riemann.network.FORKID is not None: return self._sighash_forkid(index=index, script=script, prevout_value=prevout_value, sighash_type=shared.SIGHASH_SINGLE, anyone_can_pay=anyone_can_pay) if self.is_witness(): return self.segwit_sighash( index=index, script=script, prevout_value=prevout_value, sighash_type=shared.SIGHASH_SINGLE, anyone_can_pay=anyone_can_pay) copy_tx = self._sighash_prep(index=index, script=script) # Remove outputs after the one we're signing # Other tx_outs are set to -1 value and null scripts copy_tx_outs = list(copy_tx.tx_outs[:index + 1]) copy_tx_outs = [TxOut(value=b'\xff' * 8, output_script=b'') for _ in copy_tx.tx_ins] # Null them all copy_tx_outs[index] = copy_tx.tx_outs[index] # Fix the current one # Other tx_ins sequence numbers are set to 0 copy_tx_ins = [tx_in.copy(sequence=b'\x00\x00\x00\x00') for tx_in in copy_tx.tx_ins] # Set all to 0 copy_tx_ins[index] = copy_tx.tx_ins[index] # Fix the current one copy_tx = copy_tx.copy( tx_ins=copy_tx_ins, tx_outs=copy_tx_outs) if anyone_can_pay: # Forward onwards return self._sighash_anyone_can_pay( index, copy_tx, shared.SIGHASH_SINGLE) return self._sighash_final_hashing(copy_tx, shared.SIGHASH_SINGLE) def segwit_sighash(self, index: int, sighash_type: int, prevout_value: bytes, script: bytes, anyone_can_pay: bool = False) -> bytes: ''' Implements bip143 (witness) sighash. Prefer calling `sighash_all` or `sighash_single`. For documentation see here: https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki For an excellent pasta dinner, see here: https://ricette.giallozafferano.it/Spaghetti-alla-Norma.html ''' data = ByteData() # 1. nVersion of the transaction (4-byte little endian) data += self.version # 2. hashPrevouts (32-byte hash) data += self._hash_prevouts(anyone_can_pay=anyone_can_pay) # 3. hashSequence (32-byte hash) data += self._hash_sequence(sighash_type=sighash_type, anyone_can_pay=anyone_can_pay) # 4. outpoint (32-byte hash + 4-byte little endian) data += self.tx_ins[index].outpoint # 5. scriptCode of the input (serialized as scripts inside CTxOuts) data += script # 6. value of the output spent by this input (8-byte little endian) data += prevout_value # 7. nSequence of the input (4-byte little endian) data += self.tx_ins[index].sequence # 8. hashOutputs (32-byte hash) data += self._hash_outputs(index=index, sighash_type=sighash_type) # 9. nLocktime of the transaction (4-byte little endian) data += self.lock_time # 10. sighash type of the signature (4-byte little endian) data += self._segwit_sighash_adjustment(sighash_type=sighash_type, anyone_can_pay=anyone_can_pay) return utils.hash256(data.to_bytes()) def _sighash_anyone_can_pay( self, index: int, copy_tx: 'Tx', sighash_type: int) -> bytes: ''' int, byte-like, Tx, int -> bytes Applies SIGHASH_ANYONECANPAY procedure. Should be called by another SIGHASH procedure. Not on its own. https://en.bitcoin.it/wiki/OP_CHECKSIG#Procedure_for_Hashtype_SIGHASH_ANYONECANPAY ''' # The txCopy input vector is resized to a length of one. copy_tx_ins = [copy_tx.tx_ins[index]] copy_tx = copy_tx.copy(tx_ins=copy_tx_ins) return self._sighash_final_hashing( copy_tx, sighash_type | shared.SIGHASH_ANYONECANPAY) def _sighash_final_hashing( self, copy_tx: 'Tx', sighash_type: int) -> bytes: ''' Tx, int -> bytes Returns the hash that should be signed https://en.bitcoin.it/wiki/OP_CHECKSIG#Procedure_for_Hashtype_SIGHASH_ANYONECANPAY ''' sighash = ByteData() sighash += copy_tx.to_bytes() sighash += utils.i2le_padded(sighash_type, 4) return utils.hash256(sighash.to_bytes()) def _hash_sequence(self, sighash_type: int, anyone_can_pay: bool) -> bytes: '''BIP143 hashSequence implementation Args: sighash_type (int): SIGHASH_SINGLE or SIGHASH_ALL anyone_can_pay (bool): true if ANYONECANPAY should be set Returns: (bytes): the hashSequence, a 32 byte hash ''' if anyone_can_pay or sighash_type == shared.SIGHASH_SINGLE: # If any of ANYONECANPAY, SINGLE sighash type is set, # hashSequence is a uint256 of 0x0000......0000. return b'\x00' * 32 else: # hashSequence is the double SHA256 of nSequence of all inputs; sequences = ByteData() for tx_in in self.tx_ins: sequences += tx_in.sequence return utils.hash256(sequences.to_bytes()) def _hash_outputs(self, index: int, sighash_type: int) -> bytes: '''BIP143 hashOutputs implementation Args: index (int): index of input being signed sighash_type (int): SIGHASH_SINGLE or SIGHASH_ALL Returns: (bytes): the hashOutputs, a 32 byte hash ''' if sighash_type == shared.SIGHASH_ALL: # If the sighash type is ALL, # hashOutputs is the double SHA256 of all output amounts # paired up with their scriptPubKey; outputs = ByteData() for tx_out in self.tx_outs: outputs += tx_out.to_bytes() return utils.hash256(outputs.to_bytes()) elif (sighash_type == shared.SIGHASH_SINGLE and index < len(self.tx_outs)): # if sighash type is SINGLE # and the input index is smaller than the number of outputs, # hashOutputs is the double SHA256 of the output at the same index return utils.hash256(self.tx_outs[index].to_bytes()) else: # Otherwise, hashOutputs is a uint256 of 0x0000......0000 raise NotImplementedError( 'I refuse to implement the SIGHASH_SINGLE bug.') def _sighash_forkid( self, index: int, script: bytes, prevout_value: bytes, sighash_type: int, anyone_can_pay: bool = False): ''' https://github.com/bitcoincashorg/spec/blob/master/replay-protected-sighash.md ''' self.validate_bytes(prevout_value, 8) data = ByteData() # 1. nVersion of the transaction (4-byte little endian) data += self.version # 2. hashPrevouts (32-byte hash) data += self._hash_prevouts(anyone_can_pay=anyone_can_pay) # 3. hashSequence (32-byte hash) data += self._hash_sequence(sighash_type=sighash_type, anyone_can_pay=anyone_can_pay) # 4. outpoint (32-byte hash + 4-byte little endian) data += self.tx_ins[index].outpoint # 5. scriptCode of the input (serialized as scripts inside CTxOuts) data += script # 6. value of the output spent by this input (8-byte little endian) data += prevout_value # 7. nSequence of the input (4-byte little endian) data += self.tx_ins[index].sequence # 8. hashOutputs (32-byte hash) data += self._hash_outputs(index=index, sighash_type=sighash_type) # 9. nLocktime of the transaction (4-byte little endian) data += self.lock_time # 10. sighash type of the signature (4-byte little endian) data += self._forkid_sighash_adjustment(sighash_type=sighash_type, anyone_can_pay=anyone_can_pay) return utils.hash256(data.to_bytes())
39
138
0.605332
import riemann from riemann import utils from riemann.tx import shared from riemann.script import serialization from riemann.tx.shared import ByteData, VarInt from typing import List, Optional, overload, Sequence, Tuple class Outpoint(ByteData): ''' An outpoint. A pointer to the previous output being consumed by the associated input. It specifies the prevout by transaction id and index within that transaction's output vector NB: Args must be little-endian Args: tx_id: the 32-byte LE hash of the previous transaction index: the 4-byte LE encoded index of the prevout in its transaction Attributes: tx_id: the 32-byte LE hash of the previous transaction index: the 4-byte LE encoded index of the prevout in its transaction ''' tx_id: bytes index: bytes def __init__(self, tx_id: bytes, index: bytes): super().__init__() self.validate_bytes(tx_id, 32) self.validate_bytes(index, 4) self += tx_id self += index self.tx_id = tx_id self.index = index self._make_immutable() def copy(self, tx_id: Optional[bytes] = None, index: Optional[bytes] = None) -> 'Outpoint': ''' Make a new copy of the object with optional modifications. ''' return Outpoint( tx_id=tx_id if tx_id is not None else self.tx_id, index=index if index is not None else self.index) @classmethod def null(Outpoint) -> 'Outpoint': '''Make a null outpoint, as found in coinbase transactions''' return Outpoint(b'\x00' * 32, b'\xff' * 4) @classmethod def from_bytes(Outpoint, byte_string: bytes) -> 'Outpoint': ''' Parse an Outpoint from a bytestring. Also available as from_hex ''' return Outpoint( tx_id=byte_string[:32], index=byte_string[32:36]) class TxIn(ByteData): ''' A transaction input, composed of an outpoint, a script_sig and a sequence number. Legacy TxIn script sigs contain spend authorization information for the referenced UTXO. Compatibility TxIn script sigs contain the witness program only. Segwit Txin script sigs are empty. The sequence number is used to set relative timelocks. See `this blog post <https://prestwi.ch/bitcoin-time-locks/>`_ for details. Args: outpoint: The `Outpoint` object pointing to the prevout being consumed by this input stack_script: The Script program that sets the initial stack, if any. Legacy inputs are unsigned without this. Segwit inputs never have this. redeem_script: The Script program that controls spending, if any. Only present when spending a Legacy or Compatibility SH UTXO. Segwit inputs never have this. sequence: The 4-byte LE encoded sequence number of the input. Can be used to set relative timelocks. Attributes: outpoint: The `Outpoint` object pointing to the prevout being consumed by this input stack_script: The Script program that sets the initial stack, if any. Legacy inputs are unsigned without this. Segwit inputs never have this. redeem_script: The Script program that controls spending, if any. Only present when spending a Legacy or Compatibility SH UTXO. Segwit inputs never have this. script_sig: The combined stack_script and redeem_script. For Legacy and Compatibility PKH transactions this will be equal to the stack script. sequence: The 4-byte LE encoded sequence number of the input. Can be used to set relative timelocks. ''' outpoint: Outpoint stack_script: bytes redeem_script: bytes sequence: bytes def __init__(self, outpoint: Outpoint, stack_script: bytes, redeem_script: bytes, sequence: bytes): super().__init__() self.validate_bytes(outpoint, 36) self.validate_bytes(stack_script, None) self.validate_bytes(redeem_script, None) self.validate_bytes(sequence, 4) if len(stack_script) + len(redeem_script) > 1650: raise ValueError('Input script_sig is too long. ' 'Expected <= 1650 bytes. Got {} bytes.' .format(len(stack_script) + len(redeem_script))) self += outpoint self += VarInt(len(stack_script) + len(redeem_script)) self += stack_script self += redeem_script self += sequence self.outpoint = outpoint self.stack_script = stack_script self.redeem_script = redeem_script self.script_sig = self.stack_script + self.redeem_script self.sequence = sequence self._make_immutable() def copy(self, outpoint: Optional[Outpoint] = None, stack_script: Optional[bytes] = None, redeem_script: Optional[bytes] = None, sequence: Optional[bytes] = None) -> 'TxIn': ''' Make a new copy of the object with optional modifications. ''' return TxIn( outpoint=outpoint if outpoint is not None else self.outpoint, stack_script=(stack_script if stack_script is not None else self.stack_script), redeem_script=(redeem_script if redeem_script is not None else self.redeem_script), sequence=sequence if sequence is not None else self.sequence) def is_p2sh(self) -> bool: ''' Return True if the TxIn has a non-empty `redeem_script` ''' return self.redeem_script != b'' @staticmethod def _parse_script_sig(script_sig: bytes) -> Tuple[bytes, bytes]: ''' Parse the scriptsig into a stack script and a redeem_script byte_string -> (byte_string, byte_string) ''' # Is there a better way to do this? stack_script = script_sig redeem_script = b'' try: # If the last entry deserializes, it's a p2sh input # There is a vanishingly small edge case where the pubkey # forms a deserializable script. # Edge case: serialization errors on CODESEPARATOR deserialized = serialization.deserialize(script_sig) items = deserialized.split() serialization.hex_deserialize(items[-1]) stack_script = serialization.serialize(' '.join(items[:-1])) redeem_script = serialization.serialize(items[-1]) except (IndexError, ValueError, NotImplementedError): pass return stack_script, redeem_script @classmethod def from_bytes(TxIn, byte_string: bytes) -> 'TxIn': ''' Parse a TxIn from a bytestring. Also available as from_hex ''' outpoint = Outpoint.from_bytes(byte_string[:36]) # Extract the script sig length script_sig_len = VarInt.from_bytes(byte_string[36:45]) # Extract the script sig script_start = 36 + len(script_sig_len) script_end = script_start + script_sig_len.number script_sig = byte_string[script_start:script_end] sequence = byte_string[script_end:script_end + 4] # If the script-sig is blank, both stack and redeem are blank if script_sig == b'': stack_script = b'' redeem_script = b'' # If the outpoint is null (coinbase), don't try parsing the script sig elif outpoint == Outpoint.null(): stack_script = script_sig redeem_script = b'' # Parse the script sig into stack and redeem else: stack_script, redeem_script = TxIn._parse_script_sig(script_sig) return TxIn( outpoint=outpoint, stack_script=stack_script, redeem_script=redeem_script, sequence=sequence) class TxOut(ByteData): ''' A transaction output, composed of a value (in satoshi) and an output script describing the spend conditions on the new UTXO. Value is serialized as an 8-byte LE integer, measured in satoshi. Use the `i2le_padded` function in :ref:`utils` to serialize integers. TxOut accepts un-prepended output scripts, and adds their length for you. Args: value: the 8-byte LE encoded value of the output (in satoshi) output_script: the non-length-prepended output script as a bytestring Attributes: value: the 8-byte LE encoded value of the output (in satoshi) output_script: the non-length-prepended output script as a bytestring ''' value: bytes output_script: bytes def __init__(self, value: bytes, output_script: bytes): super().__init__() self.validate_bytes(value, 8) self.validate_bytes(output_script, None) self += value self += VarInt(len(output_script)) self += output_script self.value = value self.output_script = output_script self._make_immutable() def copy(self, value: Optional[bytes] = None, output_script: Optional[bytes] = None) -> 'TxOut': ''' Make a new copy of the object with optional modifications. ''' return TxOut( value=value if value is not None else self.value, output_script=(output_script if output_script is not None else self.output_script)) @classmethod def from_bytes(TxOut, byte_string: bytes) -> 'TxOut': ''' Parse a TxOut from a bytestring. Also available as from_hex ''' n = VarInt.from_bytes(byte_string[8:]) script_start = 8 + len(n) script_end = script_start + n.number if n.number < 0xfc: return TxOut( value=byte_string[:8], output_script=byte_string[script_start:script_end]) else: raise NotImplementedError( 'No support for abnormally long pk_scripts.') class WitnessStackItem(ByteData): ''' A witness stack item. Each input witness is composed of an initial stack to be evaluated by the witness program. Witnesses for P2WSH inputs have a serialized script as the last stack element. Args: item: the raw data to be placed on the stack Attributes: item: the raw data to be placed on the stack ''' def __init__(self, item: bytes): super().__init__() self.validate_bytes(item, None) self += VarInt(len(item)) self += item self.item = item self._make_immutable() @classmethod def from_bytes(WitnessStackItem, byte_string: bytes) -> 'WitnessStackItem': ''' Parse a WitnessStackItem from a bytestring. Also available as from_hex ''' n = VarInt.from_bytes(byte_string) item_start = len(n) item_end = item_start + n.number return WitnessStackItem(byte_string[item_start:item_end]) class InputWitness(ByteData): ''' The witness for a Compatibility or Segwit TxIn. It consists of a stack that will be evaluated by the witness program, represented as an ordered list of `WitnessStackItem` objects. Args: stack: the ordered sequence of WitnessStackItems Attributes: stack: the ordered sequence of WitnessStackItems ''' stack: Tuple[WitnessStackItem, ...] def __init__(self, stack: Sequence[WitnessStackItem]): ''' list(WitnessStackItem) -> InputWitness ''' super().__init__() for item in stack: if not isinstance(item, WitnessStackItem): raise ValueError( 'Invalid witness stack item. ' 'Expected WitnessStackItem. Got {}' .format(item)) self += VarInt(len(stack)) for item in stack: self += item self.stack = tuple(item for item in stack) self._make_immutable() @classmethod def from_bytes(InputWitness, byte_string: bytes) -> 'InputWitness': ''' Parse an InputWitness from a bytestring. Also available as from_hex ''' stack_items = VarInt.from_bytes(byte_string) item_start = len(stack_items) items: List[WitnessStackItem] = [] while len(items) < stack_items.number: item = WitnessStackItem.from_bytes(byte_string[item_start:]) item_start += len(item) items.append(item) return InputWitness(items) def copy(self, stack: Optional[List[WitnessStackItem]] = None) -> 'InputWitness': ''' Make a new copy of the object with optional modifications. ''' return InputWitness( stack=stack if stack is not None else self.stack) class Tx(ByteData): ''' A complete transaction. It consists of a version, a flag that indicates the presence of witnesses (and breaks legacy parsers), a length-prepended vector of `TxIn` objects, a length-prepended vector of `TxOut` objects, and a locktime number. Compatibility and Segwit transactions MUST contain the witness flag. Signed Compatibility and Segwit transactions will additionally contain a vector of `InputWitness` objects. This object provides a number of conveniences for interacting with transactions, including `tx_id` calculation, and sighash calculation. To serialize the transaction, call `to_bytes()` or `hex()`. Note: The `lock_time` field is used to set absolute timelocks. These are complex and confusing. See `this blog post <https://prestwi.ch/bitcoin-time-locks/>`_ for details. Args: version: the 4-byte LE version number. Must be 1 or 2. Setting to 1 deactivates relative lock times. tx_ins: the ordered sequence of TxIn objects representing TXOs. consumed by this transaction. Signed Legacy transaction will include spend authorization here. tx_outs: the ordered sequence of TxOut objects representing TXOs created by this transaction. tx_witnesses: the ordered sequence of InputWitness objects associated with this transaction. Always empty in Legacy transactions. In Compatibility and Segwit transactions there must be one witness per input. lock_time: the 4-byte LE locktime number. Setting this invokes the absolute time lock system. If it is below 500,000,000 it is interpreted as a blockheight before which the transaction is invalid. If set above that, it is interpreted as a Unix timestamp before which the transaction is invalid. Attributes: version: the 4-byte LE version number. Must be 1 or 2. Setting to 1 deactivates relative lock times. flag: the 2-byte witness transaction flag. Always empty for Legacy transaction, or '0001' for Compatibility and Witness transactions tx_ins: the ordered sequence of TxIn objects representing TXOs. consumed by this transaction. Signed Legacy transaction will include spend authorization here. tx_outs: the ordered sequence of TxOut objects representing TXOs created by this transaction. tx_witnesses: the ordered sequence of InputWitness objects associated with this transaction. Always empty in Legacy transactions. In Compatibility and Segwit transactions there must be one witness per input. lock_time: the 4-byte LE locktime number. Setting this invokes the absolute time lock system. If it is below 500,000,000 it is interpreted as a blockheight before which the transaction is invalid. If set above that, it is interpreted as a Unix timestamp before which the transaction is invalid. tx_id_le: the LE (in-protocol) hash committed to by the block header transaction merkle tree. wtx_id_le: the LE (in-protocol) hash committed to by the coinbase transaction witness merkle tree. Not present in Legacy transactions. tx_id: the BE (block explorer or human-facing) tx_id. wtx_id: the BE (block explorer or human-facing) wtx_id. Not present in Legacy transactions. ''' version: bytes flag: Optional[bytes] tx_ins: Tuple[TxIn, ...] tx_outs: Tuple[TxOut, ...] tx_witnesses: Optional[Tuple[InputWitness, ...]] lock_time: bytes tx_id_le: bytes wtx_id_le: Optional[bytes] tx_id: bytes wtx_id: Optional[bytes] def __init__(self, version: bytes, flag: Optional[bytes], tx_ins: Sequence[TxIn], tx_outs: Sequence[TxOut], tx_witnesses: Optional[Sequence[InputWitness]], lock_time: bytes): super().__init__() self.validate_bytes(version, 4) self.validate_bytes(lock_time, 4) if flag is not None: if flag != riemann.network.SEGWIT_TX_FLAG: raise ValueError( 'Invald segwit flag. Expected None or ' f'{riemann.network.SEGWIT_TX_FLAG.hex()}. ' f'Got: {flag.hex()}') if tx_witnesses is not None and len(tx_witnesses) != 0: if flag is None: raise ValueError('Got witnesses but no segwit flag.') if len(tx_witnesses) != len(tx_ins): raise ValueError( 'Witness and TxIn lists must be same length. ' 'Got {} inputs and {} witnesses.' .format(len(tx_ins), len(tx_witnesses))) for witness in tx_witnesses: if not isinstance(witness, InputWitness): raise ValueError( 'Invalid InputWitness. ' 'Expected instance of InputWitness. Got {}' .format(type(witness))) if min(len(tx_ins), len(tx_outs)) == 0: raise ValueError('Too few inputs or outputs. Stop that.') for tx_in in tx_ins: if not isinstance(tx_in, TxIn): raise ValueError( 'Invalid TxIn. ' 'Expected instance of TxIn. Got {}' .format(type(tx_in).__name__)) for tx_out in tx_outs: if not isinstance(tx_out, TxOut): raise ValueError( 'Invalid TxOut. ' 'Expected instance of TxOut. Got {}' .format(type(tx_out).__name__)) self += version if flag is not None: self += flag self += VarInt(len(tx_ins)) for tx_in in tx_ins: self += tx_in self += VarInt(len(tx_outs)) for tx_out in tx_outs: self += tx_out if tx_witnesses is not None: for witness in tx_witnesses: self += witness self += lock_time self.version = version self.flag = flag self.tx_ins = tuple(tx_in for tx_in in tx_ins) self.tx_outs = tuple(tx_out for tx_out in tx_outs) self.tx_witnesses = \ tuple(wit for wit in tx_witnesses) if tx_witnesses is not None \ else None self.lock_time = lock_time if flag is not None: self.tx_id_le = utils.hash256(self.no_witness()) self.wtx_id_le = utils.hash256(self.to_bytes()) self.tx_id = utils.change_endianness(self.tx_id_le) self.wtx_id = utils.change_endianness(self.wtx_id_le) else: self.tx_id_le = utils.hash256(self.to_bytes()) self.tx_id = utils.change_endianness(self.tx_id_le) self.wtx_id = None self.wtx_le = None self._make_immutable() @classmethod def from_hex(Tx, hex_string: str) -> 'Tx': '''Instantiate a Tx object from a hex string''' return Tx.from_bytes(bytes.fromhex(hex_string)) @classmethod def from_bytes(Tx, byte_string: bytes) -> 'Tx': '''Instantiate a Tx object from a bytestring''' # Get the version number version = byte_string[0:4] # Check if this is a witness tx if byte_string[4:6] == riemann.network.SEGWIT_TX_FLAG: tx_ins_num_loc = 6 flag = riemann.network.SEGWIT_TX_FLAG else: tx_ins_num_loc = 4 flag = None # Get the length of the tx_in vector tx_ins = [] tx_ins_num = VarInt.from_bytes(byte_string[tx_ins_num_loc:]) # `current` is the index of next read current = tx_ins_num_loc + len(tx_ins_num) # Deserialize all tx_ins for _ in range(tx_ins_num.number): tx_in = TxIn.from_bytes(byte_string[current:]) current += len(tx_in) tx_ins.append(tx_in) # Get the length of the tx_out vector tx_outs = [] tx_outs_num = VarInt.from_bytes(byte_string[current:]) # Deserialize all outputs current += len(tx_outs_num) for _ in range(tx_outs_num.number): tx_out = TxOut.from_bytes(byte_string[current:]) current += len(tx_out) tx_outs.append(tx_out) # Deserialize all witnesses if necessary tx_witnesses: List[InputWitness] = [] if flag and len(byte_string[current:]) > 4: tx_witnesses_num = tx_ins_num for _ in range(tx_witnesses_num.number): tx_witness = InputWitness.from_bytes(byte_string[current:]) current += len(tx_witness) tx_witnesses.append(tx_witness) # Get the lock time and return a complete tx lock_time = byte_string[current:current + 4] return Tx( version=version, flag=flag, tx_ins=tx_ins, tx_outs=tx_outs, tx_witnesses=tx_witnesses, lock_time=lock_time) def no_witness(self) -> bytes: ''' Return the Tx as a bytestring stripped of witnesses. This is the preimage of `tx_id` and `tx_id_le`. ''' tx = bytes() tx += self.version tx += VarInt(len(self.tx_ins)).to_bytes() for tx_in in self.tx_ins: tx += tx_in.to_bytes() tx += VarInt(len(self.tx_outs)).to_bytes() for tx_out in self.tx_outs: tx += tx_out.to_bytes() tx += self.lock_time return tx def is_witness(self) -> bool: '''Return True if the transaction witness flag is set''' return self.flag is not None or self.tx_witnesses is not None def calculate_fee(self, input_values: Sequence[int]) -> int: ''' Calculate the fee associated with a transaction. Caller must provide a sequence representing the value (in satoshi) of each input. Args: input_values: The value of each input in order. Returns: The total fee paid to miners by this transaction. ''' return \ sum(input_values) \ - sum([utils.le2i(o.value) for o in self.tx_outs]) def sighash_none(self) -> bytes: '''SIGHASH_NONE is a bad idea.''' raise NotImplementedError('SIGHASH_NONE is a bad idea.') def copy(self, version: Optional[bytes] = None, flag: Optional[bytes] = None, tx_ins: Optional[Sequence[TxIn]] = None, tx_outs: Optional[Sequence[TxOut]] = None, tx_witnesses: Optional[Sequence[InputWitness]] = None, lock_time: Optional[bytes] = None) -> 'Tx': ''' Make a new copy of the object with optional modifications. ''' return Tx(version=version if version is not None else self.version, flag=flag if flag is not None else self.flag, tx_ins=tx_ins if tx_ins is not None else self.tx_ins, tx_outs=tx_outs if tx_outs is not None else self.tx_outs, tx_witnesses=(tx_witnesses if tx_witnesses is not None else self.tx_witnesses), lock_time=(lock_time if lock_time is not None else self.lock_time)) def _sighash_prep(self, index: int, script: bytes) -> 'Tx': ''' Sighashes suck Performs the sighash setup described here: https://en.bitcoin.it/wiki/OP_CHECKSIG#How_it_works https://bitcoin.stackexchange.com/questions/3374/how-to-redeem-a-basic-tx We save on complexity by refusing to support OP_CODESEPARATOR ''' # 0 out scripts in tx_ins copy_tx_ins = [tx_in.copy(stack_script=b'', redeem_script=b'') for tx_in in self.tx_ins] # NB: The script for the current transaction input in txCopy is set to # subScript (lead in by its length as a var-integer encoded!) to_strip = VarInt.from_bytes(script) copy_tx_ins[index] = \ copy_tx_ins[index].copy(redeem_script=script[len(to_strip):]) return self.copy(tx_ins=copy_tx_ins) @overload def sighash_all(self, index: int, script: bytes, prevout_value: bytes, anyone_can_pay: bool) -> bytes: ... @overload # noqa: F811 def sighash_all(self, index: int, script: bytes, anyone_can_pay: bool) -> bytes: ... @overload # noqa: F811 def sighash_all(self, index: int, script: bytes, prevout_value: bytes) -> bytes: ... @overload # noqa: F811 def sighash_all(self, index: int, script: bytes) -> bytes: ... def sighash_all(self, # noqa: F811 index, script, prevout_value=None, anyone_can_pay=False) -> bytes: ''' Calculate the hash to be signed when adding authorization information (a script sig or a witness) to an input using SIGHASH_ALL. SIGHASH_ALL commits to ALL inputs, and ALL outputs. It indicates that no further modification of the transaction is allowed without invalidating the signature. SIGHASH_ALL + ANYONECANPAY commits to ONE input and ALL outputs. It indicates that anyone may add additional value to the transaction, but that no one may modify the payments made. Any extra value added above the sum of output values will be given to miners as part of the tx fee. We must specify the index of the input in the `tx_ins` sequence, the script controlling the TXO being spent by the input, and whether to use the ANYONECANPAY sighash modifier. Compatibility and Witness inputs must additionally supply the value of the TXO being consumed. This function automatically selects between Legacy, Witness, and Bcash SIGHASH_FORKID based on the network selected, and whether the witness flag is present in the transaction. For Legacy sighash documentation, see here: - https://en.bitcoin.it/wiki/OP_CHECKSIG#Hashtype_SIGHASH_ALL_.28default.29 For BIP143 (Witness and Compatibility) documentation, see here: - https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki For the BitcoinCash specific rip-off of BIP143 documentation, see here: - https://github.com/bitcoincashorg/spec/blob/master/replay-protected-sighash.md Note: After signing the digest, you MUST append the sighash indicator byte to the resulting signature. This will be 0x01 (SIGHASH_ALL) or 0x81 (SIGHASH_ALL + SIGHASH_ANYONECANPAY). Args: index: The index of the input being authorized script: The length-prepended script associated with the TXO being spent. For PKH outputs this will be a pkh spend script ( i.e. '1976a914....88ac'). For SH outputs this will be the redeem_script (Legacy) or Witness Script (Compatibility and Segwit). If the TXO being spent has a non-standard output script, use that here. prevout_value: The 8-byte LE integer-encoded value of the prevout anyone_can_pay: True if using the ANYONECANPAY sighash modifier Returns: The 32-byte digest to be signed. ''' # noqa: E501 if riemann.network.FORKID is not None: return self._sighash_forkid(index=index, script=script, prevout_value=prevout_value, sighash_type=shared.SIGHASH_ALL, anyone_can_pay=anyone_can_pay) if self.is_witness(): return self.segwit_sighash( index=index, script=script, prevout_value=prevout_value, sighash_type=shared.SIGHASH_ALL, anyone_can_pay=anyone_can_pay) copy_tx = self._sighash_prep(index=index, script=script) if anyone_can_pay: return self._sighash_anyone_can_pay( index=index, copy_tx=copy_tx, sighash_type=shared.SIGHASH_ALL) return self._sighash_final_hashing(copy_tx, shared.SIGHASH_ALL) @overload def sighash_single(self, index: int, script: bytes, prevout_value: bytes, anyone_can_pay: bool) -> bytes: ... @overload # noqa: F811 def sighash_single(self, index: int, script: bytes, anyone_can_pay: bool) -> bytes: ... @overload # noqa: F811 def sighash_single(self, index: int, script: bytes, prevout_value: bytes) -> bytes: ... @overload # noqa: F811 def sighash_single(self, index: int, script: bytes) -> bytes: ... def sighash_single(self, # noqa: F811 index, script, prevout_value=None, anyone_can_pay=False): ''' Calculate the hash to be signed when adding authorization information (a script sig or a witness) to an input using SIGHASH_SINGLE. SIGHASH_SINGLE commits to ALL inputs, and ONE output. It indicates that/ anyone may append additional outputs to the transaction to reroute funds from the inputs. Additional inputs cannot be added without invalidating the signature. It is logically difficult to use securely, as it consents to funds being moved, without specifying their destination. SIGHASH_SINGLE commits specifically the the output at the same index as the input being signed. If there is no output at that index, (because, e.g. the input vector is longer than the output vector) it behaves insecurely, and we do not implement that protocol bug. SIGHASH_SINGLE + ANYONECANPAY commits to ONE input and ONE output. It indicates that anyone may add additional value to the transaction, and route value to any other location. The signed input and output must be included in the fully-formed transaction at the same index in their respective vectors. When the input is larger than the output, a partial transaction signed this way cedes the difference to whoever cares to construct a complete transaction. However, when the output is larger than the input, it functions as a one-time-use payment invoice. Anyone may consume the input by adding value. This is useful for addressing race conditions in certain cross-chain protocols that the author of this documentation invented. :) We must specify the index of the input in the `tx_ins` sequence, the script controlling the TXO being spent by the input, and whether to use the ANYONECANPAY sighash modifier. Compatibility and Witness inputs must additionally supply the value of the TXO being consumed. This function automatically selects between Legacy, Witness, and Bcash SIGHASH_FORKID based on the network selected, and whether the witness flag is present in the transaction. For Legacy sighash documentation, see here: - https://en.bitcoin.it/wiki/OP_CHECKSIG#Procedure_for_Hashtype_SIGHASH_SINGLE - https://bitcoin.stackexchange.com/questions/3890/for-sighash-single-do-the-outputs-other-than-at-the-input-index-have-8-bytes-or - https://github.com/petertodd/python-bitcoinlib/blob/051ec4e28c1f6404fd46713c2810d4ebbed38de4/bitcoin/core/script.py#L913-L965 For BIP143 (Witness and Compatibility) documentation, see here: - https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki For the BitcoinCash specific rip-off of BIP143 documentation, see here: - https://github.com/bitcoincashorg/spec/blob/master/replay-protected-sighash.md Note: After signing the digest, you MUST append the sighash indicator byte to the resulting signature. This will be 0x03 (SIGHASH_SINGLE) or 0x83 (SIGHASH_SINGLE + SIGHASH_ANYONECANPAY). Args: index: The index of the input being authorized script: The length-prepended script associated with the TXO being spent. For PKH outputs this will be a pkh spend script ( i.e. '1976a914....88ac'). For SH outputs this will be the redeem_script (Legacy) or Witness Script (Compatibility and Segwit). If the TXO being spent has a non-standard output script, use that here. prevout_value: The 8-byte LE integer-encoded value of the prevout anyone_can_pay: True if using the ANYONECANPAY sighash modifier Returns: The 32-byte digest to be signed. ''' # noqa: E501 if index >= len(self.tx_outs): raise NotImplementedError( 'I refuse to implement the SIGHASH_SINGLE bug.') if riemann.network.FORKID is not None: return self._sighash_forkid(index=index, script=script, prevout_value=prevout_value, sighash_type=shared.SIGHASH_SINGLE, anyone_can_pay=anyone_can_pay) if self.is_witness(): return self.segwit_sighash( index=index, script=script, prevout_value=prevout_value, sighash_type=shared.SIGHASH_SINGLE, anyone_can_pay=anyone_can_pay) copy_tx = self._sighash_prep(index=index, script=script) # Remove outputs after the one we're signing # Other tx_outs are set to -1 value and null scripts copy_tx_outs = list(copy_tx.tx_outs[:index + 1]) copy_tx_outs = [TxOut(value=b'\xff' * 8, output_script=b'') for _ in copy_tx.tx_ins] # Null them all copy_tx_outs[index] = copy_tx.tx_outs[index] # Fix the current one # Other tx_ins sequence numbers are set to 0 copy_tx_ins = [tx_in.copy(sequence=b'\x00\x00\x00\x00') for tx_in in copy_tx.tx_ins] # Set all to 0 copy_tx_ins[index] = copy_tx.tx_ins[index] # Fix the current one copy_tx = copy_tx.copy( tx_ins=copy_tx_ins, tx_outs=copy_tx_outs) if anyone_can_pay: # Forward onwards return self._sighash_anyone_can_pay( index, copy_tx, shared.SIGHASH_SINGLE) return self._sighash_final_hashing(copy_tx, shared.SIGHASH_SINGLE) def segwit_sighash(self, index: int, sighash_type: int, prevout_value: bytes, script: bytes, anyone_can_pay: bool = False) -> bytes: ''' Implements bip143 (witness) sighash. Prefer calling `sighash_all` or `sighash_single`. For documentation see here: https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki For an excellent pasta dinner, see here: https://ricette.giallozafferano.it/Spaghetti-alla-Norma.html ''' data = ByteData() # 1. nVersion of the transaction (4-byte little endian) data += self.version # 2. hashPrevouts (32-byte hash) data += self._hash_prevouts(anyone_can_pay=anyone_can_pay) # 3. hashSequence (32-byte hash) data += self._hash_sequence(sighash_type=sighash_type, anyone_can_pay=anyone_can_pay) # 4. outpoint (32-byte hash + 4-byte little endian) data += self.tx_ins[index].outpoint # 5. scriptCode of the input (serialized as scripts inside CTxOuts) data += script # 6. value of the output spent by this input (8-byte little endian) data += prevout_value # 7. nSequence of the input (4-byte little endian) data += self.tx_ins[index].sequence # 8. hashOutputs (32-byte hash) data += self._hash_outputs(index=index, sighash_type=sighash_type) # 9. nLocktime of the transaction (4-byte little endian) data += self.lock_time # 10. sighash type of the signature (4-byte little endian) data += self._segwit_sighash_adjustment(sighash_type=sighash_type, anyone_can_pay=anyone_can_pay) return utils.hash256(data.to_bytes()) def _sighash_anyone_can_pay( self, index: int, copy_tx: 'Tx', sighash_type: int) -> bytes: ''' int, byte-like, Tx, int -> bytes Applies SIGHASH_ANYONECANPAY procedure. Should be called by another SIGHASH procedure. Not on its own. https://en.bitcoin.it/wiki/OP_CHECKSIG#Procedure_for_Hashtype_SIGHASH_ANYONECANPAY ''' # The txCopy input vector is resized to a length of one. copy_tx_ins = [copy_tx.tx_ins[index]] copy_tx = copy_tx.copy(tx_ins=copy_tx_ins) return self._sighash_final_hashing( copy_tx, sighash_type | shared.SIGHASH_ANYONECANPAY) def _sighash_final_hashing( self, copy_tx: 'Tx', sighash_type: int) -> bytes: ''' Tx, int -> bytes Returns the hash that should be signed https://en.bitcoin.it/wiki/OP_CHECKSIG#Procedure_for_Hashtype_SIGHASH_ANYONECANPAY ''' sighash = ByteData() sighash += copy_tx.to_bytes() sighash += utils.i2le_padded(sighash_type, 4) return utils.hash256(sighash.to_bytes()) def _hash_prevouts(self, anyone_can_pay: bool) -> bytes: if anyone_can_pay: # If the ANYONECANPAY flag is set, # hashPrevouts is a uint256 of 0x0000......0000. hash_prevouts = b'\x00' * 32 else: # hashPrevouts is the double SHA256 of all outpoints; outpoints = ByteData() for tx_in in self.tx_ins: outpoints += tx_in.outpoint hash_prevouts = utils.hash256(outpoints.to_bytes()) return hash_prevouts def _hash_sequence(self, sighash_type: int, anyone_can_pay: bool) -> bytes: '''BIP143 hashSequence implementation Args: sighash_type (int): SIGHASH_SINGLE or SIGHASH_ALL anyone_can_pay (bool): true if ANYONECANPAY should be set Returns: (bytes): the hashSequence, a 32 byte hash ''' if anyone_can_pay or sighash_type == shared.SIGHASH_SINGLE: # If any of ANYONECANPAY, SINGLE sighash type is set, # hashSequence is a uint256 of 0x0000......0000. return b'\x00' * 32 else: # hashSequence is the double SHA256 of nSequence of all inputs; sequences = ByteData() for tx_in in self.tx_ins: sequences += tx_in.sequence return utils.hash256(sequences.to_bytes()) def _hash_outputs(self, index: int, sighash_type: int) -> bytes: '''BIP143 hashOutputs implementation Args: index (int): index of input being signed sighash_type (int): SIGHASH_SINGLE or SIGHASH_ALL Returns: (bytes): the hashOutputs, a 32 byte hash ''' if sighash_type == shared.SIGHASH_ALL: # If the sighash type is ALL, # hashOutputs is the double SHA256 of all output amounts # paired up with their scriptPubKey; outputs = ByteData() for tx_out in self.tx_outs: outputs += tx_out.to_bytes() return utils.hash256(outputs.to_bytes()) elif (sighash_type == shared.SIGHASH_SINGLE and index < len(self.tx_outs)): # if sighash type is SINGLE # and the input index is smaller than the number of outputs, # hashOutputs is the double SHA256 of the output at the same index return utils.hash256(self.tx_outs[index].to_bytes()) else: # Otherwise, hashOutputs is a uint256 of 0x0000......0000 raise NotImplementedError( 'I refuse to implement the SIGHASH_SINGLE bug.') def _forkid_sighash_adjustment( self, sighash_type: int, anyone_can_pay: bool) -> bytes: # The sighash type is altered to include a 24-bit fork id # ss << ((GetForkID() << 8) | nHashType) forkid = riemann.network.FORKID << 8 sighash = forkid | sighash_type | shared.SIGHASH_FORKID if anyone_can_pay: sighash = sighash | shared.SIGHASH_ANYONECANPAY return utils.i2le_padded(sighash, 4) def _segwit_sighash_adjustment( self, sighash_type: int, anyone_can_pay: bool) -> bytes: # sighash type altered to include ANYONECANPAY if anyone_can_pay: sighash_type = sighash_type | shared.SIGHASH_ANYONECANPAY return utils.i2le_padded(sighash_type, 4) def _sighash_forkid( self, index: int, script: bytes, prevout_value: bytes, sighash_type: int, anyone_can_pay: bool = False): ''' https://github.com/bitcoincashorg/spec/blob/master/replay-protected-sighash.md ''' self.validate_bytes(prevout_value, 8) data = ByteData() # 1. nVersion of the transaction (4-byte little endian) data += self.version # 2. hashPrevouts (32-byte hash) data += self._hash_prevouts(anyone_can_pay=anyone_can_pay) # 3. hashSequence (32-byte hash) data += self._hash_sequence(sighash_type=sighash_type, anyone_can_pay=anyone_can_pay) # 4. outpoint (32-byte hash + 4-byte little endian) data += self.tx_ins[index].outpoint # 5. scriptCode of the input (serialized as scripts inside CTxOuts) data += script # 6. value of the output spent by this input (8-byte little endian) data += prevout_value # 7. nSequence of the input (4-byte little endian) data += self.tx_ins[index].sequence # 8. hashOutputs (32-byte hash) data += self._hash_outputs(index=index, sighash_type=sighash_type) # 9. nLocktime of the transaction (4-byte little endian) data += self.lock_time # 10. sighash type of the signature (4-byte little endian) data += self._forkid_sighash_adjustment(sighash_type=sighash_type, anyone_can_pay=anyone_can_pay) return utils.hash256(data.to_bytes())
7,445
0
423
183e9f48dd4707f5c170ec7b0d584f7689c30cff
15,229
py
Python
openhab_gw.py
HalliHalloSchatz/comfoconnect_openhab_gw
71d7f5155a6387dfab16ed9965da7c646e483545
[ "MIT" ]
null
null
null
openhab_gw.py
HalliHalloSchatz/comfoconnect_openhab_gw
71d7f5155a6387dfab16ed9965da7c646e483545
[ "MIT" ]
null
null
null
openhab_gw.py
HalliHalloSchatz/comfoconnect_openhab_gw
71d7f5155a6387dfab16ed9965da7c646e483545
[ "MIT" ]
null
null
null
#!/usr/bin/python3 import argparse import paho.mqtt.client as mqtt import datetime from time import sleep from binascii import unhexlify from random import randint from pycomfoconnect import * import getopt ## Configuration ####################################################################################################### local_name = 'OpenHAB2 ComfoConnect Gateway' # Name of the service local_uuid = bytes.fromhex('00000000000000000000000000000005') # Can be what you want, used to differentiate devices (as only 1 simultaneously connected device is allowed) device_ip = "192.168.1.7" # Look in your router administration and get the ip of the comfoconnect device and set it as static lease device_uuid = bytes.fromhex('00000000001710138001144fd71e1a11') # Get this from using discovery first by running the script with flag: -d <ip-address> and then configure it here pin = 1234 # Set PIN of vent unit ! mqtt_broker = "192.168.1.50" # Set your MQTT broker here mqtt_user = "my_user" # Set the MQTT user login mqtt_passw = "my_pw" # Set the MQTT user password mqtt_topic = "Zehnder/ComfoAirQ350/" # Set the MQTT root topic ## Start logger ######################################################################################################## ## Connect to Comfocontrol device ##################################################################################### bridge = Bridge(device_ip, device_uuid) #bridge.debug = True comfoconnect = ComfoConnect(bridge, local_uuid, local_name, pin) previousreply = b'\x01' prevspeed = 0 prevmode = 0 prevalt = 0 prevvalue = {81 : 0, 213 : 0, 122 : 0, 121 : 0 } #client = mqtt.Client(client_id="S1_%s" % randint(1, 10000), clean_session=False) #client.on_connect = sub_on_connect #client.on_disconnect = sub_on_disconnect #client.username_pw_set(mqtt_user,mqtt_passw) #client.connect(mqtt_broker) #client.subscribe("Zehnder/ComfoAirQ450/ExecuteFunction",qos=1) #client.on_message=on_message #attach function to callback #client.loop_start() #clientpub = mqtt.Client(client_id="P1_%s" % randint(1, 10000), clean_session=False) #clientpub.on_connect = pub_on_connect #clientpub.on_disconnect = pub_on_disconnect #clientpub.username_pw_set(mqtt_user,mqtt_passw) #clientpub.connect(mqtt_broker) #clientpub.loop_start() if __name__ == "__main__": main()
43.387464
202
0.624795
#!/usr/bin/python3 import argparse import paho.mqtt.client as mqtt import datetime from time import sleep from binascii import unhexlify from random import randint from pycomfoconnect import * import getopt ## Configuration ####################################################################################################### local_name = 'OpenHAB2 ComfoConnect Gateway' # Name of the service local_uuid = bytes.fromhex('00000000000000000000000000000005') # Can be what you want, used to differentiate devices (as only 1 simultaneously connected device is allowed) device_ip = "192.168.1.7" # Look in your router administration and get the ip of the comfoconnect device and set it as static lease device_uuid = bytes.fromhex('00000000001710138001144fd71e1a11') # Get this from using discovery first by running the script with flag: -d <ip-address> and then configure it here pin = 1234 # Set PIN of vent unit ! mqtt_broker = "192.168.1.50" # Set your MQTT broker here mqtt_user = "my_user" # Set the MQTT user login mqtt_passw = "my_pw" # Set the MQTT user password mqtt_topic = "Zehnder/ComfoAirQ350/" # Set the MQTT root topic ## Start logger ######################################################################################################## ## Connect to Comfocontrol device ##################################################################################### bridge = Bridge(device_ip, device_uuid) #bridge.debug = True comfoconnect = ComfoConnect(bridge, local_uuid, local_name, pin) previousreply = b'\x01' prevspeed = 0 prevmode = 0 prevalt = 0 prevvalue = {81 : 0, 213 : 0, 122 : 0, 121 : 0 } def pub_on_connect(client, userdata, flags, rc): print("publisher connected") def pub_on_disconnect(client, userdata, rc): print("publisher disconnected, reconnecting...") #clientpub.reconnect() def sub_on_connect(client, userdata, flags, rc): print("subscriber connected") def sub_on_disconnect(client, userdata, rc): print("subscriber disconnected, reconnecting...") #client.reconnect() def on_message(client, userdata, message): global prevalt print("message received " ,str(message.payload.decode("utf-8"))) setting = str(message.payload.decode("utf-8")) # comfoconnect.cmd_rmi_request(CMD_FAN_MODE_AWAY) # Go to away mode # comfoconnect.cmd_rmi_request(CMD_FAN_MODE_LOW) # Set fan speed to 1 # comfoconnect.cmd_rmi_request(CMD_FAN_MODE_MEDIUM) # Set fan speed to 2 # comfoconnect.cmd_rmi_request(CMD_FAN_MODE_HIGH) # Set fan speed to 3 if setting == '0': comfoconnect.cmd_rmi_request(CMD_FAN_MODE_AWAY) print("SETTING FANSPEED LOW") get_status_msg() elif setting == '1': comfoconnect.cmd_rmi_request(CMD_FAN_MODE_LOW) print("SETTING FANSPEED NORMAL") get_status_msg() elif setting == '2': comfoconnect.cmd_rmi_request(CMD_FAN_MODE_MEDIUM) print("SETTING FANSPEED HIGH") get_status_msg() elif setting == '3': comfoconnect.cmd_rmi_request(CMD_FAN_MODE_HIGH) print("SETTING FANSPEED MAX") get_status_msg() elif setting == '4': comfoconnect.cmd_rmi_request(CMD_MODE_AUTO) print("SETTING TO AUTO") prevalt=0 get_status_msg() elif setting == '5': comfoconnect.cmd_rmi_request(CMD_MODE_MANUAL) print("SETTING TO MANUAL") prevalt=0 get_status_msg() elif setting == '6': get_status_msg() elif setting == '7': comfoconnect.cmd_rmi_request(CMD_VENTMODE_SUPPLY) print("NOW IN SUPPLY MODE ONLY") elif setting == '8': comfoconnect.cmd_rmi_request(CMD_VENTMODE_BALANCE) print("NOW IN BALANCE MODE") elif setting == '9': comfoconnect.cmd_rmi_request(CMD_TEMPPROF_NORMAL) print("CONFIG: TEMP PROFILE NORMAL") elif setting == '10': comfoconnect.cmd_rmi_request(CMD_TEMPPROF_COOL) print("CONFIG: TEMP PROFILE COOL") elif setting == '11': comfoconnect.cmd_rmi_request(CMD_TEMPROF_WARM) print("CONFIG: TEMP PROFILE WARM") elif setting == '12': comfoconnect.cmd_rmi_request(CMD_BYPASS_ON) print("CONFIG: BYPASS ACTIVATED") elif setting == '13': comfoconnect.cmd_rmi_request(CMD_BYPASS_OFF) print("CONFIG: BYPASS DEACTIVATED") elif setting == '14': comfoconnect.cmd_rmi_request(CMD_BYPASS_AUTO) print("CONFIG: BYPASS IN AUTO MODE") elif setting == '15': comfoconnect.cmd_rmi_request(CMD_SENS_TEMP_OFF) print("CONFIG: TEMPERATURE PASSIVE DEACTIVATED") elif setting == '16': comfoconnect.cmd_rmi_request(CMD_SENS_TEMP_AUTO) print("CONFIG: TEMPERATURE PASSIVE IN AUTO MODE") elif setting == '17': comfoconnect.cmd_rmi_request(CMD_SENS_TEMP_ON) print("CONFIG: TEMPERATURE PASSIVE ACTIVATED") elif setting == '18': comfoconnect.cmd_rmi_request(CMD_SENS_HUMC_OFF) print("CONFIG: HUMIDITY COMFORT DEACTIVATED") elif setting == '19': comfoconnect.cmd_rmi_request(CMD_SENS_HUMC_AUTO) print("CONFIG: HUMIDITY COMFORT IN AUTO MODE") elif setting == '20': comfoconnect.cmd_rmi_request(CMD_SENS_HUMC_ON) print("CONFIG: HUMIDITY COMFORT ACTIVATED") elif setting == '21': comfoconnect.cmd_rmi_request(CMD_SENS_HUMP_OFF) print("CONFIG: HUMIDITY PROTECTION DEACTIVATED") elif setting == '22': comfoconnect.cmd_rmi_request(CMD_SENS_HUMP_AUTO) print("CONFIG: HUMIDITY PROTECTION IN AUTO MODE") elif setting == '23': comfoconnect.cmd_rmi_request(CMD_SENS_HUMP_ON) print("CONFIG: HUMIDITY PROTECTION ACTIVATED") elif setting == '24': comfoconnect.cmd_rmi_request(CMD_VENTMODE_EXTRACT) print("VENT MODE EXTRACT ONLY ACTIVATED") elif int(setting) >= 50: comfoconnect.cmd_rmi_request(eval("CMD_UNKNOWN%s" %setting)) print("UNKNOWN%s" % setting) def get_status_msg(): global previousreply, prevspeed, prevmode, prevalt reply = comfoconnect.cmd_rmi_request(CMD_READ_CONFIG) if previousreply != reply.msg.message[11:58]: print("READ CONFIG %s" % reply.msg) print("READ CONFIG %s" % reply.msg.message) previousreply = reply.msg.message[11:58] if b'\x00' == reply.msg.message[10:11]: alt = 0 else: alt = 1 if b'\x01' == reply.msg.message[57:58]: print("IS MANUAL") mode="5" else: print("IS AUTOMATIC") if (alt==0): mode=4 else: mode=41 if b'\x00' == reply.msg.message[14:15]: print("SPEED 0") speed=0 elif b'\x01' == reply.msg.message[14:15]: print("SPEED 1") speed=1 elif b'\x02' == reply.msg.message[14:15]: print("SPEED 2") speed=2 elif b'\x03' == reply.msg.message[14:15]: print("SPEED 3") speed=3 if b'\x00' == reply.msg.message[10:11]: alt = 0 else: alt = 1 if (speed != prevspeed) or (mode!= prevmode) or (alt != prevalt): print("mode:%s speed:%s alt:%s" % (mode, speed, alt)) #clientpub.publish(("%sconfig/mode" % mqtt_topic), ("%s" % mode)) #clientpub.publish(("%sconfig/speed" % mqtt_topic), ("%s" % speed)) prevspeed = speed prevmode = mode prevalt = alt #clientpub.publish(("%sconfig/mode" % mqtt_topic), ("%s" % mode)) #clientpub.publish(("%sconfig/speed" % mqtt_topic), ("%s" % speed)) #client = mqtt.Client(client_id="S1_%s" % randint(1, 10000), clean_session=False) #client.on_connect = sub_on_connect #client.on_disconnect = sub_on_disconnect #client.username_pw_set(mqtt_user,mqtt_passw) #client.connect(mqtt_broker) #client.subscribe("Zehnder/ComfoAirQ450/ExecuteFunction",qos=1) #client.on_message=on_message #attach function to callback #client.loop_start() #clientpub = mqtt.Client(client_id="P1_%s" % randint(1, 10000), clean_session=False) #clientpub.on_connect = pub_on_connect #clientpub.on_disconnect = pub_on_disconnect #clientpub.username_pw_set(mqtt_user,mqtt_passw) #clientpub.connect(mqtt_broker) #clientpub.loop_start() def bridge_discovery(ip): ## Bridge discovery ################################################################################################ # Method 1: Use discovery to initialise Bridge #bridges = Bridge.discover(timeout=1) #if bridges: # bridge = bridges[0] #else: # bridge = None # Method 2: Use direct discovery to initialise Bridge bridges = Bridge.discover(ip) if bridges: bridge = bridges[0] else: bridge = None # Method 3: Setup bridge manually # bridge = Bridge(args.ip, bytes.fromhex('0000000000251010800170b3d54264b4')) if bridge is None: print("No bridges found!") exit(1) print("Bridge found: %s (%s)" % (bridge.uuid.hex(), bridge.host)) bridge.debug = True return bridge def callback_sensor(var, value): ## Callback sensors ################################################################################################ if (var == 81): num = struct.unpack('<i', bytes.fromhex(value)) print("%d" % num) value = ("%d" % num) now = datetime.datetime.now() end = b = now + datetime.timedelta(0,int(value)) print(end.strftime("%d-%m-%Y %H:%M")) value = end.strftime("%d-%m-%Y %H:%M") if(var in[221,274,275,276]): value=value/10 #if(var not in [213, 81, 121, 122, 117, 118, 119, 120, 128]): #clientpub.publish("%s%s" % (mqtt_topic,var) ,"%s" % value, 0, 1) print("Sent to MQTT Broker : %s%s = %s" % (mqtt_topic, SENSOR(var), value)) def main(): opts, args = getopt.getopt(sys.argv[1:],"d:",["discovery"]) for opt, args in opts: if opt in ("-d", "--discovery"): print("discover!") bridge = bridge_discovery(args) exit(0) comfoconnect.callback_sensor = callback_sensor try: # Connect to the bridge # comfoconnect.connect(False) # Don't disconnect existing clients. comfoconnect.connect(True) # Disconnect existing clients. except Exception as e: print('ERROR: %s' % e) exit(1) ## Register sensors ################################################################################################ comfoconnect.register_sensor(SENSOR.FAN_NEXT_CHANGE) # General: Countdown until next fan speed change comfoconnect.register_sensor(SENSOR.FAN_SUPPLY_SPEED) # Fans: Supply fan speed comfoconnect.register_sensor(SENSOR.FAN_EXHAUST_SPEED) # Fans: Exhaust fan speed comfoconnect.register_sensor(SENSOR.POWER_TOTAL_YEAR) # Power Consumption: Total year-to-date comfoconnect.register_sensor(SENSOR.AVOIDED_HEATING_TOTAL_YEAR) # Avoided Heating: Avoided year-to-date comfoconnect.register_sensor(SENSOR.FAN_SPEED_MODE) # Fans: Fan speed setting comfoconnect.register_sensor(SENSOR.FAN_SUPPLY_DUTY) # Fans: Supply fan duty comfoconnect.register_sensor(SENSOR.FAN_EXHAUST_DUTY) # Fans: Exhaust fan duty comfoconnect.register_sensor(SENSOR.FAN_SUPPLY_FLOW) # Fans: Supply fan flow comfoconnect.register_sensor(SENSOR.FAN_EXHAUST_FLOW) # Fans: Exhaust fan flow comfoconnect.register_sensor(SENSOR.POWER_CURRENT) # Power Consumption: Current Ventilation comfoconnect.register_sensor(SENSOR.POWER_TOTAL) # Power Consumption: Total from start comfoconnect.register_sensor(SENSOR.DAYS_TO_REPLACE_FILTER) # Days left before filters must be replaced comfoconnect.register_sensor(SENSOR.AVOIDED_HEATING_CURRENT) # Avoided Heating: Avoided actual comfoconnect.register_sensor(SENSOR.AVOIDED_HEATING_TOTAL) # Avoided Heating: Avoided total comfoconnect.register_sensor(SENSOR.TEMPERATURE_SUPPLY) # Temperature & Humidity: Supply Air (temperature) comfoconnect.register_sensor(SENSOR.TEMPERATURE_EXTRACT) # Temperature & Humidity: Extract Air (temperature) comfoconnect.register_sensor(SENSOR.TEMPERATURE_EXHAUST) # Temperature & Humidity: Exhaust Air (temperature) comfoconnect.register_sensor(SENSOR.TEMPERATURE_OUTDOOR) # Temperature & Humidity: Outdoor Air (temperature) comfoconnect.register_sensor(SENSOR.HUMIDITY_SUPPLY) # Temperature & Humidity: Supply Air (temperature) comfoconnect.register_sensor(SENSOR.HUMIDITY_EXTRACT) # Temperature & Humidity: Extract Air (temperature) comfoconnect.register_sensor(SENSOR.HUMIDITY_EXHAUST) # Temperature & Humidity: Exhaust Air (temperature) comfoconnect.register_sensor(SENSOR.HUMIDITY_OUTDOOR) # Temperature & Humidity: Outdoor Air (temperature) comfoconnect.register_sensor(SENSOR.BYPASS_STATE) # Bypass state comfoconnect.register_sensor(SENSOR.RUNMODE_SUPPLY_BALANCE) comfoconnect.register_sensor(SENSOR.AUTO_STATE) # comfoconnect.register_sensor(SENSOR.AWAY_STATE) # comfoconnect.register_sensor(SENSOR.TEMP_PROFILE) # comfoconnect.register_sensor(SETTING_BYPASS) # comfoconnect.register_sensor(SETTING_HEATING_SEASON) # comfoconnect.register_sensor(SETTING_RF_PAIRING) #unknown types investigation # unknown = [33, 37, 53, 71, 82, 85, 86, 87, 144, 145, 146, 208, 211, 212, 216, 217, 218, 219, 224, 226, 228, 321, 325, 337, 338, 341, 369, 370, 371, 372, 384, 386, 400, 401, 402, 416, 417, 418, 419] # for x in unknown: # comfoconnect.register_sensor(x) # print ("%d" % x) ## Execute functions ############################################################################################### # TimeRequest timeinfo = comfoconnect.cmd_time_request() #print(timeinfo) ## Executing functions ############################################################################################# # comfoconnect.cmd_rmi_request(CMD_FAN_MODE_AWAY) # Go to away mode # comfoconnect.cmd_rmi_request(CMD_FAN_MODE_LOW) # Set fan speed to 1 # comfoconnect.cmd_rmi_request(CMD_FAN_MODE_MEDIUM) # Set fan speed to 2 # comfoconnect.cmd_rmi_request(CMD_FAN_MODE_HIGH) # Set fan speed to 3 ## Example interaction ############################################################################################# try: print('Waiting... Stop with CTRL+C') while True: # Callback messages will arrive in the callback method. if comfoconnect.is_connected(): get_status_msg() else: print('%s > We are not connected anymore...' % datetime.datetime.now()) sleep(5) except KeyboardInterrupt: pass ## Closing the session ############################################################################################# #client.loop_stop() #clientpub.loop_stop() comfoconnect.disconnect() if __name__ == "__main__": main()
12,681
0
204
c67563654c2bde4026564fdf88c498ee31796fe5
1,089
py
Python
src/telliot_core/utils/timestamp.py
QuintusTheFifth/telliot-core
e22bc3b98d368fa91528f4a273ef26eddfefacaf
[ "MIT" ]
9
2021-12-15T07:03:34.000Z
2022-03-30T20:16:45.000Z
src/telliot_core/utils/timestamp.py
QuintusTheFifth/telliot-core
e22bc3b98d368fa91528f4a273ef26eddfefacaf
[ "MIT" ]
77
2021-09-03T04:01:20.000Z
2021-11-09T14:45:52.000Z
src/telliot_core/utils/timestamp.py
QuintusTheFifth/telliot-core
e22bc3b98d368fa91528f4a273ef26eddfefacaf
[ "MIT" ]
7
2021-12-17T03:39:23.000Z
2022-03-29T08:53:43.000Z
from datetime import datetime from datetime import timedelta from datetime import timezone from typing import Union def now() -> datetime: """Return now as a UTC timestamp""" return datetime.now(timezone.utc) class TimeStamp: """Representation of a timestamp with an integer number of seconds""" # Access the underlying unix timestamp ts = property(lambda self: self._ts) _ts: int def __init__(self, ts: [int, float]): """Create from unix timestamp""" self._ts = round(ts) @classmethod @property def dt(self) -> datetime: """Timestamp as a datetime object""" return datetime.fromtimestamp(self._ts) @property
25.325581
73
0.646465
from datetime import datetime from datetime import timedelta from datetime import timezone from typing import Union def now() -> datetime: """Return now as a UTC timestamp""" return datetime.now(timezone.utc) class TimeStamp: """Representation of a timestamp with an integer number of seconds""" # Access the underlying unix timestamp ts = property(lambda self: self._ts) _ts: int def __init__(self, ts: [int, float]): """Create from unix timestamp""" self._ts = round(ts) @classmethod def now(cls) -> "TimeStamp": return cls(datetime.now().timestamp()) def __repr__(self) -> str: return f"TimeStamp({self._ts})" def __str__(self) -> str: return str(self.dt) @property def dt(self) -> datetime: """Timestamp as a datetime object""" return datetime.fromtimestamp(self._ts) @property def age(self) -> Union[timedelta, datetime]: age = datetime.now() - self.dt rounded_age = age - timedelta(microseconds=age.microseconds) return rounded_age
289
0
106
50e6f3ced2cb90c17a2cdc4cf78126f568074c3a
28,904
py
Python
troposphere_mate/opsworks.py
tsuttsu305/troposphere_mate-project
15ee94cc913efb32bc991979efcad943c992074c
[ "MIT" ]
null
null
null
troposphere_mate/opsworks.py
tsuttsu305/troposphere_mate-project
15ee94cc913efb32bc991979efcad943c992074c
[ "MIT" ]
null
null
null
troposphere_mate/opsworks.py
tsuttsu305/troposphere_mate-project
15ee94cc913efb32bc991979efcad943c992074c
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ This code is auto generated from troposphere_mate.code_generator.__init__.py scripts. """ import sys if sys.version_info.major >= 3 and sys.version_info.minor >= 5: # pragma: no cover from typing import Union, List, Any import troposphere.opsworks from troposphere.opsworks import ( AutoScalingThresholds as _AutoScalingThresholds, BlockDeviceMapping as _BlockDeviceMapping, ChefConfiguration as _ChefConfiguration, DataSource as _DataSource, EbsBlockDevice as _EbsBlockDevice, ElasticIp as _ElasticIp, EngineAttribute as _EngineAttribute, Environment as _Environment, LifeCycleConfiguration as _LifeCycleConfiguration, LoadBasedAutoScaling as _LoadBasedAutoScaling, RdsDbInstance as _RdsDbInstance, Recipes as _Recipes, ShutdownEventConfiguration as _ShutdownEventConfiguration, Source as _Source, SslConfiguration as _SslConfiguration, StackConfigurationManager as _StackConfigurationManager, Tags as _Tags, TimeBasedAutoScaling as _TimeBasedAutoScaling, VolumeConfiguration as _VolumeConfiguration, ) from troposphere import Template, AWSHelperFn from troposphere_mate.core.mate import preprocess_init_kwargs, Mixin from troposphere_mate.core.sentiel import REQUIRED, NOTHING
41.056818
95
0.59279
# -*- coding: utf-8 -*- """ This code is auto generated from troposphere_mate.code_generator.__init__.py scripts. """ import sys if sys.version_info.major >= 3 and sys.version_info.minor >= 5: # pragma: no cover from typing import Union, List, Any import troposphere.opsworks from troposphere.opsworks import ( AutoScalingThresholds as _AutoScalingThresholds, BlockDeviceMapping as _BlockDeviceMapping, ChefConfiguration as _ChefConfiguration, DataSource as _DataSource, EbsBlockDevice as _EbsBlockDevice, ElasticIp as _ElasticIp, EngineAttribute as _EngineAttribute, Environment as _Environment, LifeCycleConfiguration as _LifeCycleConfiguration, LoadBasedAutoScaling as _LoadBasedAutoScaling, RdsDbInstance as _RdsDbInstance, Recipes as _Recipes, ShutdownEventConfiguration as _ShutdownEventConfiguration, Source as _Source, SslConfiguration as _SslConfiguration, StackConfigurationManager as _StackConfigurationManager, Tags as _Tags, TimeBasedAutoScaling as _TimeBasedAutoScaling, VolumeConfiguration as _VolumeConfiguration, ) from troposphere import Template, AWSHelperFn from troposphere_mate.core.mate import preprocess_init_kwargs, Mixin from troposphere_mate.core.sentiel import REQUIRED, NOTHING class Source(troposphere.opsworks.Source, Mixin): def __init__(self, title=None, Password=NOTHING, # type: Union[str, AWSHelperFn] Revision=NOTHING, # type: Union[str, AWSHelperFn] SshKey=NOTHING, # type: Union[str, AWSHelperFn] Type=NOTHING, # type: Union[str, AWSHelperFn] Url=NOTHING, # type: Union[str, AWSHelperFn] Username=NOTHING, # type: Union[str, AWSHelperFn] **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, Password=Password, Revision=Revision, SshKey=SshKey, Type=Type, Url=Url, Username=Username, **kwargs ) super(Source, self).__init__(**processed_kwargs) class SslConfiguration(troposphere.opsworks.SslConfiguration, Mixin): def __init__(self, title=None, Certificate=REQUIRED, # type: Union[str, AWSHelperFn] PrivateKey=REQUIRED, # type: Union[str, AWSHelperFn] Chain=NOTHING, # type: Union[str, AWSHelperFn] **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, Certificate=Certificate, PrivateKey=PrivateKey, Chain=Chain, **kwargs ) super(SslConfiguration, self).__init__(**processed_kwargs) class ChefConfiguration(troposphere.opsworks.ChefConfiguration, Mixin): def __init__(self, title=None, BerkshelfVersion=NOTHING, # type: Union[str, AWSHelperFn] ManageBerkshelf=NOTHING, # type: bool **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, BerkshelfVersion=BerkshelfVersion, ManageBerkshelf=ManageBerkshelf, **kwargs ) super(ChefConfiguration, self).__init__(**processed_kwargs) class Recipes(troposphere.opsworks.Recipes, Mixin): def __init__(self, title=None, Configure=NOTHING, # type: List[Union[str, AWSHelperFn]] Deploy=NOTHING, # type: List[Union[str, AWSHelperFn]] Setup=NOTHING, # type: List[Union[str, AWSHelperFn]] Shutdown=NOTHING, # type: List[Union[str, AWSHelperFn]] Undeploy=NOTHING, # type: List[Union[str, AWSHelperFn]] **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, Configure=Configure, Deploy=Deploy, Setup=Setup, Shutdown=Shutdown, Undeploy=Undeploy, **kwargs ) super(Recipes, self).__init__(**processed_kwargs) class VolumeConfiguration(troposphere.opsworks.VolumeConfiguration, Mixin): def __init__(self, title=None, MountPoint=REQUIRED, # type: Union[str, AWSHelperFn] NumberOfDisks=REQUIRED, # type: int Size=REQUIRED, # type: int Encrypted=NOTHING, # type: bool Iops=NOTHING, # type: int RaidLevel=NOTHING, # type: int VolumeType=NOTHING, # type: Any **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, MountPoint=MountPoint, NumberOfDisks=NumberOfDisks, Size=Size, Encrypted=Encrypted, Iops=Iops, RaidLevel=RaidLevel, VolumeType=VolumeType, **kwargs ) super(VolumeConfiguration, self).__init__(**processed_kwargs) class StackConfigurationManager(troposphere.opsworks.StackConfigurationManager, Mixin): def __init__(self, title=None, Name=NOTHING, # type: Union[str, AWSHelperFn] Version=NOTHING, # type: Union[str, AWSHelperFn] **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, Name=Name, Version=Version, **kwargs ) super(StackConfigurationManager, self).__init__(**processed_kwargs) class TimeBasedAutoScaling(troposphere.opsworks.TimeBasedAutoScaling, Mixin): def __init__(self, title=None, Monday=NOTHING, # type: dict Tuesday=NOTHING, # type: dict Wednesday=NOTHING, # type: dict Thursday=NOTHING, # type: dict Friday=NOTHING, # type: dict Saturday=NOTHING, # type: dict Sunday=NOTHING, # type: dict **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, Monday=Monday, Tuesday=Tuesday, Wednesday=Wednesday, Thursday=Thursday, Friday=Friday, Saturday=Saturday, Sunday=Sunday, **kwargs ) super(TimeBasedAutoScaling, self).__init__(**processed_kwargs) class AutoScalingThresholds(troposphere.opsworks.AutoScalingThresholds, Mixin): def __init__(self, title=None, CpuThreshold=NOTHING, # type: float IgnoreMetricsTime=NOTHING, # type: int InstanceCount=NOTHING, # type: int LoadThreshold=NOTHING, # type: float MemoryThreshold=NOTHING, # type: float ThresholdsWaitTime=NOTHING, # type: int **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, CpuThreshold=CpuThreshold, IgnoreMetricsTime=IgnoreMetricsTime, InstanceCount=InstanceCount, LoadThreshold=LoadThreshold, MemoryThreshold=MemoryThreshold, ThresholdsWaitTime=ThresholdsWaitTime, **kwargs ) super(AutoScalingThresholds, self).__init__(**processed_kwargs) class Environment(troposphere.opsworks.Environment, Mixin): def __init__(self, title=None, Key=REQUIRED, # type: Union[str, AWSHelperFn] Value=REQUIRED, # type: Union[str, AWSHelperFn] Secure=NOTHING, # type: bool **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, Key=Key, Value=Value, Secure=Secure, **kwargs ) super(Environment, self).__init__(**processed_kwargs) class LoadBasedAutoScaling(troposphere.opsworks.LoadBasedAutoScaling, Mixin): def __init__(self, title=None, DownScaling=NOTHING, # type: _AutoScalingThresholds Enable=NOTHING, # type: bool UpScaling=NOTHING, # type: _AutoScalingThresholds **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, DownScaling=DownScaling, Enable=Enable, UpScaling=UpScaling, **kwargs ) super(LoadBasedAutoScaling, self).__init__(**processed_kwargs) class DataSource(troposphere.opsworks.DataSource, Mixin): def __init__(self, title=None, Arn=NOTHING, # type: Union[str, AWSHelperFn] DatabaseName=NOTHING, # type: Union[str, AWSHelperFn] Type=NOTHING, # type: Any **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, Arn=Arn, DatabaseName=DatabaseName, Type=Type, **kwargs ) super(DataSource, self).__init__(**processed_kwargs) class App(troposphere.opsworks.App, Mixin): def __init__(self, title, # type: str template=None, # type: Template validation=True, # type: bool Name=REQUIRED, # type: Union[str, AWSHelperFn] StackId=REQUIRED, # type: Union[str, AWSHelperFn] Type=REQUIRED, # type: Union[str, AWSHelperFn] AppSource=NOTHING, # type: _Source Attributes=NOTHING, # type: dict DataSources=NOTHING, # type: List[_DataSource] Description=NOTHING, # type: Union[str, AWSHelperFn] Domains=NOTHING, # type: List[Union[str, AWSHelperFn]] EnableSsl=NOTHING, # type: bool Environment=NOTHING, # type: List[_Environment] Shortname=NOTHING, # type: Union[str, AWSHelperFn] SslConfiguration=NOTHING, # type: _SslConfiguration **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, template=template, validation=validation, Name=Name, StackId=StackId, Type=Type, AppSource=AppSource, Attributes=Attributes, DataSources=DataSources, Description=Description, Domains=Domains, EnableSsl=EnableSsl, Environment=Environment, Shortname=Shortname, SslConfiguration=SslConfiguration, **kwargs ) super(App, self).__init__(**processed_kwargs) class ElasticLoadBalancerAttachment(troposphere.opsworks.ElasticLoadBalancerAttachment, Mixin): def __init__(self, title, # type: str template=None, # type: Template validation=True, # type: bool ElasticLoadBalancerName=REQUIRED, # type: Union[str, AWSHelperFn] LayerId=REQUIRED, # type: Union[str, AWSHelperFn] Tags=NOTHING, # type: Union[_Tags, list] **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, template=template, validation=validation, ElasticLoadBalancerName=ElasticLoadBalancerName, LayerId=LayerId, Tags=Tags, **kwargs ) super(ElasticLoadBalancerAttachment, self).__init__(**processed_kwargs) class EbsBlockDevice(troposphere.opsworks.EbsBlockDevice, Mixin): def __init__(self, title=None, DeleteOnTermination=NOTHING, # type: bool Iops=NOTHING, # type: int SnapshotId=NOTHING, # type: Union[str, AWSHelperFn] VolumeSize=NOTHING, # type: int VolumeType=NOTHING, # type: Union[str, AWSHelperFn] **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, DeleteOnTermination=DeleteOnTermination, Iops=Iops, SnapshotId=SnapshotId, VolumeSize=VolumeSize, VolumeType=VolumeType, **kwargs ) super(EbsBlockDevice, self).__init__(**processed_kwargs) class BlockDeviceMapping(troposphere.opsworks.BlockDeviceMapping, Mixin): def __init__(self, title=None, DeviceName=NOTHING, # type: Union[str, AWSHelperFn] Ebs=NOTHING, # type: _EbsBlockDevice NoDevice=NOTHING, # type: Union[str, AWSHelperFn] VirtualName=NOTHING, # type: Union[str, AWSHelperFn] **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, DeviceName=DeviceName, Ebs=Ebs, NoDevice=NoDevice, VirtualName=VirtualName, **kwargs ) super(BlockDeviceMapping, self).__init__(**processed_kwargs) class Instance(troposphere.opsworks.Instance, Mixin): def __init__(self, title, # type: str template=None, # type: Template validation=True, # type: bool InstanceType=REQUIRED, # type: Union[str, AWSHelperFn] LayerIds=REQUIRED, # type: List[Union[str, AWSHelperFn]] StackId=REQUIRED, # type: Union[str, AWSHelperFn] AgentVersion=NOTHING, # type: Union[str, AWSHelperFn] AmiId=NOTHING, # type: Union[str, AWSHelperFn] Architecture=NOTHING, # type: Union[str, AWSHelperFn] AutoScalingType=NOTHING, # type: Union[str, AWSHelperFn] AvailabilityZone=NOTHING, # type: Union[str, AWSHelperFn] BlockDeviceMappings=NOTHING, # type: List[_BlockDeviceMapping] EbsOptimized=NOTHING, # type: bool ElasticIps=NOTHING, # type: List[Union[str, AWSHelperFn]] Hostname=NOTHING, # type: Union[str, AWSHelperFn] InstallUpdatesOnBoot=NOTHING, # type: bool Os=NOTHING, # type: Union[str, AWSHelperFn] RootDeviceType=NOTHING, # type: Union[str, AWSHelperFn] SshKeyName=NOTHING, # type: Union[str, AWSHelperFn] SubnetId=NOTHING, # type: Union[str, AWSHelperFn] Tenancy=NOTHING, # type: Union[str, AWSHelperFn] TimeBasedAutoScaling=NOTHING, # type: _TimeBasedAutoScaling VirtualizationType=NOTHING, # type: Union[str, AWSHelperFn] Volumes=NOTHING, # type: List[Union[str, AWSHelperFn]] **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, template=template, validation=validation, InstanceType=InstanceType, LayerIds=LayerIds, StackId=StackId, AgentVersion=AgentVersion, AmiId=AmiId, Architecture=Architecture, AutoScalingType=AutoScalingType, AvailabilityZone=AvailabilityZone, BlockDeviceMappings=BlockDeviceMappings, EbsOptimized=EbsOptimized, ElasticIps=ElasticIps, Hostname=Hostname, InstallUpdatesOnBoot=InstallUpdatesOnBoot, Os=Os, RootDeviceType=RootDeviceType, SshKeyName=SshKeyName, SubnetId=SubnetId, Tenancy=Tenancy, TimeBasedAutoScaling=TimeBasedAutoScaling, VirtualizationType=VirtualizationType, Volumes=Volumes, **kwargs ) super(Instance, self).__init__(**processed_kwargs) class ShutdownEventConfiguration(troposphere.opsworks.ShutdownEventConfiguration, Mixin): def __init__(self, title=None, DelayUntilElbConnectionsDrained=NOTHING, # type: bool ExecutionTimeout=NOTHING, # type: int **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, DelayUntilElbConnectionsDrained=DelayUntilElbConnectionsDrained, ExecutionTimeout=ExecutionTimeout, **kwargs ) super(ShutdownEventConfiguration, self).__init__(**processed_kwargs) class LifeCycleConfiguration(troposphere.opsworks.LifeCycleConfiguration, Mixin): def __init__(self, title=None, ShutdownEventConfiguration=NOTHING, # type: _ShutdownEventConfiguration **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, ShutdownEventConfiguration=ShutdownEventConfiguration, **kwargs ) super(LifeCycleConfiguration, self).__init__(**processed_kwargs) class Layer(troposphere.opsworks.Layer, Mixin): def __init__(self, title, # type: str template=None, # type: Template validation=True, # type: bool AutoAssignElasticIps=REQUIRED, # type: bool AutoAssignPublicIps=REQUIRED, # type: bool EnableAutoHealing=REQUIRED, # type: bool Name=REQUIRED, # type: Union[str, AWSHelperFn] Shortname=REQUIRED, # type: Union[str, AWSHelperFn] StackId=REQUIRED, # type: Union[str, AWSHelperFn] Type=REQUIRED, # type: Union[str, AWSHelperFn] Attributes=NOTHING, # type: dict CustomInstanceProfileArn=NOTHING, # type: Union[str, AWSHelperFn] CustomJson=NOTHING, # type: Union[Union[str, AWSHelperFn], dict] CustomRecipes=NOTHING, # type: _Recipes CustomSecurityGroupIds=NOTHING, # type: List[Union[str, AWSHelperFn]] InstallUpdatesOnBoot=NOTHING, # type: bool LifecycleEventConfiguration=NOTHING, # type: _LifeCycleConfiguration LoadBasedAutoScaling=NOTHING, # type: _LoadBasedAutoScaling Packages=NOTHING, # type: List[Union[str, AWSHelperFn]] VolumeConfigurations=NOTHING, # type: List[_VolumeConfiguration] **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, template=template, validation=validation, AutoAssignElasticIps=AutoAssignElasticIps, AutoAssignPublicIps=AutoAssignPublicIps, EnableAutoHealing=EnableAutoHealing, Name=Name, Shortname=Shortname, StackId=StackId, Type=Type, Attributes=Attributes, CustomInstanceProfileArn=CustomInstanceProfileArn, CustomJson=CustomJson, CustomRecipes=CustomRecipes, CustomSecurityGroupIds=CustomSecurityGroupIds, InstallUpdatesOnBoot=InstallUpdatesOnBoot, LifecycleEventConfiguration=LifecycleEventConfiguration, LoadBasedAutoScaling=LoadBasedAutoScaling, Packages=Packages, VolumeConfigurations=VolumeConfigurations, **kwargs ) super(Layer, self).__init__(**processed_kwargs) class RdsDbInstance(troposphere.opsworks.RdsDbInstance, Mixin): def __init__(self, title=None, DbPassword=REQUIRED, # type: Union[str, AWSHelperFn] DbUser=REQUIRED, # type: Union[str, AWSHelperFn] RdsDbInstanceArn=REQUIRED, # type: Union[str, AWSHelperFn] **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, DbPassword=DbPassword, DbUser=DbUser, RdsDbInstanceArn=RdsDbInstanceArn, **kwargs ) super(RdsDbInstance, self).__init__(**processed_kwargs) class ElasticIp(troposphere.opsworks.ElasticIp, Mixin): def __init__(self, title=None, Ip=REQUIRED, # type: Union[str, AWSHelperFn] Name=NOTHING, # type: Union[str, AWSHelperFn] **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, Ip=Ip, Name=Name, **kwargs ) super(ElasticIp, self).__init__(**processed_kwargs) class Stack(troposphere.opsworks.Stack, Mixin): def __init__(self, title, # type: str template=None, # type: Template validation=True, # type: bool DefaultInstanceProfileArn=REQUIRED, # type: Union[str, AWSHelperFn] Name=REQUIRED, # type: Union[str, AWSHelperFn] ServiceRoleArn=REQUIRED, # type: Union[str, AWSHelperFn] AgentVersion=NOTHING, # type: Union[str, AWSHelperFn] Attributes=NOTHING, # type: dict ChefConfiguration=NOTHING, # type: _ChefConfiguration CloneAppIds=NOTHING, # type: List[Union[str, AWSHelperFn]] ClonePermissions=NOTHING, # type: bool ConfigurationManager=NOTHING, # type: _StackConfigurationManager CustomCookbooksSource=NOTHING, # type: _Source CustomJson=NOTHING, # type: Union[Union[str, AWSHelperFn], dict] DefaultAvailabilityZone=NOTHING, # type: Union[str, AWSHelperFn] DefaultOs=NOTHING, # type: Union[str, AWSHelperFn] DefaultRootDeviceType=NOTHING, # type: Union[str, AWSHelperFn] DefaultSshKeyName=NOTHING, # type: Union[str, AWSHelperFn] DefaultSubnetId=NOTHING, # type: Union[str, AWSHelperFn] EcsClusterArn=NOTHING, # type: Union[str, AWSHelperFn] ElasticIps=NOTHING, # type: List[_ElasticIp] HostnameTheme=NOTHING, # type: Union[str, AWSHelperFn] RdsDbInstances=NOTHING, # type: List[_RdsDbInstance] SourceStackId=NOTHING, # type: Union[str, AWSHelperFn] Tags=NOTHING, # type: Union[_Tags, list] UseCustomCookbooks=NOTHING, # type: bool UseOpsworksSecurityGroups=NOTHING, # type: bool VpcId=NOTHING, # type: Union[str, AWSHelperFn] **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, template=template, validation=validation, DefaultInstanceProfileArn=DefaultInstanceProfileArn, Name=Name, ServiceRoleArn=ServiceRoleArn, AgentVersion=AgentVersion, Attributes=Attributes, ChefConfiguration=ChefConfiguration, CloneAppIds=CloneAppIds, ClonePermissions=ClonePermissions, ConfigurationManager=ConfigurationManager, CustomCookbooksSource=CustomCookbooksSource, CustomJson=CustomJson, DefaultAvailabilityZone=DefaultAvailabilityZone, DefaultOs=DefaultOs, DefaultRootDeviceType=DefaultRootDeviceType, DefaultSshKeyName=DefaultSshKeyName, DefaultSubnetId=DefaultSubnetId, EcsClusterArn=EcsClusterArn, ElasticIps=ElasticIps, HostnameTheme=HostnameTheme, RdsDbInstances=RdsDbInstances, SourceStackId=SourceStackId, Tags=Tags, UseCustomCookbooks=UseCustomCookbooks, UseOpsworksSecurityGroups=UseOpsworksSecurityGroups, VpcId=VpcId, **kwargs ) super(Stack, self).__init__(**processed_kwargs) class UserProfile(troposphere.opsworks.UserProfile, Mixin): def __init__(self, title, # type: str template=None, # type: Template validation=True, # type: bool IamUserArn=REQUIRED, # type: Union[str, AWSHelperFn] AllowSelfManagement=NOTHING, # type: bool SshPublicKey=NOTHING, # type: Union[str, AWSHelperFn] SshUsername=NOTHING, # type: Union[str, AWSHelperFn] **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, template=template, validation=validation, IamUserArn=IamUserArn, AllowSelfManagement=AllowSelfManagement, SshPublicKey=SshPublicKey, SshUsername=SshUsername, **kwargs ) super(UserProfile, self).__init__(**processed_kwargs) class Volume(troposphere.opsworks.Volume, Mixin): def __init__(self, title, # type: str template=None, # type: Template validation=True, # type: bool Ec2VolumeId=REQUIRED, # type: Union[str, AWSHelperFn] StackId=REQUIRED, # type: Union[str, AWSHelperFn] MountPoint=NOTHING, # type: Union[str, AWSHelperFn] Name=NOTHING, # type: Union[str, AWSHelperFn] **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, template=template, validation=validation, Ec2VolumeId=Ec2VolumeId, StackId=StackId, MountPoint=MountPoint, Name=Name, **kwargs ) super(Volume, self).__init__(**processed_kwargs) class EngineAttribute(troposphere.opsworks.EngineAttribute, Mixin): def __init__(self, title=None, Name=NOTHING, # type: Union[str, AWSHelperFn] Value=NOTHING, # type: Union[str, AWSHelperFn] **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, Name=Name, Value=Value, **kwargs ) super(EngineAttribute, self).__init__(**processed_kwargs) class Server(troposphere.opsworks.Server, Mixin): def __init__(self, title, # type: str template=None, # type: Template validation=True, # type: bool InstanceProfileArn=REQUIRED, # type: Union[str, AWSHelperFn] InstanceType=REQUIRED, # type: Union[str, AWSHelperFn] ServiceRoleArn=REQUIRED, # type: Union[str, AWSHelperFn] AssociatePublicIpAddress=NOTHING, # type: bool BackupId=NOTHING, # type: Union[str, AWSHelperFn] BackupRetentionCount=NOTHING, # type: int CustomCertificate=NOTHING, # type: Union[str, AWSHelperFn] CustomDomain=NOTHING, # type: Union[str, AWSHelperFn] CustomPrivateKey=NOTHING, # type: Union[str, AWSHelperFn] DisableAutomatedBackup=NOTHING, # type: bool Engine=NOTHING, # type: Union[str, AWSHelperFn] EngineAttributes=NOTHING, # type: List[_EngineAttribute] EngineModel=NOTHING, # type: Union[str, AWSHelperFn] EngineVersion=NOTHING, # type: Union[str, AWSHelperFn] KeyPair=NOTHING, # type: Union[str, AWSHelperFn] PreferredBackupWindow=NOTHING, # type: Union[str, AWSHelperFn] PreferredMaintenanceWindow=NOTHING, # type: Union[str, AWSHelperFn] SecurityGroupIds=NOTHING, # type: List[Union[str, AWSHelperFn]] ServerName=NOTHING, # type: Union[str, AWSHelperFn] SubnetIds=NOTHING, # type: List[Union[str, AWSHelperFn]] Tags=NOTHING, # type: Union[_Tags, list] **kwargs): processed_kwargs = preprocess_init_kwargs( title=title, template=template, validation=validation, InstanceProfileArn=InstanceProfileArn, InstanceType=InstanceType, ServiceRoleArn=ServiceRoleArn, AssociatePublicIpAddress=AssociatePublicIpAddress, BackupId=BackupId, BackupRetentionCount=BackupRetentionCount, CustomCertificate=CustomCertificate, CustomDomain=CustomDomain, CustomPrivateKey=CustomPrivateKey, DisableAutomatedBackup=DisableAutomatedBackup, Engine=Engine, EngineAttributes=EngineAttributes, EngineModel=EngineModel, EngineVersion=EngineVersion, KeyPair=KeyPair, PreferredBackupWindow=PreferredBackupWindow, PreferredMaintenanceWindow=PreferredMaintenanceWindow, SecurityGroupIds=SecurityGroupIds, ServerName=ServerName, SubnetIds=SubnetIds, Tags=Tags, **kwargs ) super(Server, self).__init__(**processed_kwargs)
25,169
1,140
1,274
de7a71dc5c7c3bd09cbf3c294b1c4845e7ee26ca
967
py
Python
telegram_notifier/__main__.py
dpint/py-telegram-notifier
780eee0453559eb9212bef03eeb5569a55ddbcc7
[ "MIT" ]
17
2021-01-08T07:26:26.000Z
2021-07-31T07:56:37.000Z
telegram_notifier/__main__.py
dpint/py-telegram-notifier
780eee0453559eb9212bef03eeb5569a55ddbcc7
[ "MIT" ]
null
null
null
telegram_notifier/__main__.py
dpint/py-telegram-notifier
780eee0453559eb9212bef03eeb5569a55ddbcc7
[ "MIT" ]
1
2021-09-25T16:43:24.000Z
2021-09-25T16:43:24.000Z
#!/usr/bin/python import argparse from . import * if __name__ == "__main__": arg_parser = argparse.ArgumentParser( description="A simple usage of the Telegram Bot API.", allow_abbrev=True ) arg_parser.add_argument("--chat_id", type=str, help="sets the chat_id in settings") arg_parser.add_argument("--token", type=str, help="sets the bot token in settings") arg_parser.add_argument( "--message", type=str, help="specifies the message to send to chat" ) args = arg_parser.parse_args() set_config_options(chat_id=args.chat_id, token=args.token) if args.message: if not validate_config(get_config()): raise InvalidConfigError( "Settings not valid. Use --token and --chat_id options to set settings entries." ) print(send_message(args.message)) elif args.message == "": raise EmptyMessageError("Cannot use an empty string with --message option.")
35.814815
96
0.66908
#!/usr/bin/python import argparse from . import * if __name__ == "__main__": arg_parser = argparse.ArgumentParser( description="A simple usage of the Telegram Bot API.", allow_abbrev=True ) arg_parser.add_argument("--chat_id", type=str, help="sets the chat_id in settings") arg_parser.add_argument("--token", type=str, help="sets the bot token in settings") arg_parser.add_argument( "--message", type=str, help="specifies the message to send to chat" ) args = arg_parser.parse_args() set_config_options(chat_id=args.chat_id, token=args.token) if args.message: if not validate_config(get_config()): raise InvalidConfigError( "Settings not valid. Use --token and --chat_id options to set settings entries." ) print(send_message(args.message)) elif args.message == "": raise EmptyMessageError("Cannot use an empty string with --message option.")
0
0
0
b4dc2cf29030f1b8f45c9bf57928e1e8896ac401
5,599
py
Python
karborclient/common/utils.py
thuylt2/karborclient
884d685c3cd1c1075e895791d7027b56c30dd328
[ "Apache-2.0" ]
null
null
null
karborclient/common/utils.py
thuylt2/karborclient
884d685c3cd1c1075e895791d7027b56c30dd328
[ "Apache-2.0" ]
null
null
null
karborclient/common/utils.py
thuylt2/karborclient
884d685c3cd1c1075e895791d7027b56c30dd328
[ "Apache-2.0" ]
null
null
null
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from __future__ import print_function import os import sys import six import uuid from oslo_serialization import jsonutils from oslo_utils import encodeutils import prettytable from karborclient.common.apiclient import exceptions # Decorator for cli-args def env(*vars, **kwargs): """Search for the first defined of possibly many env vars Returns the first environment variable defined in vars, or returns the default defined in kwargs. """ for v in vars: value = os.environ.get(v) if value: return value return kwargs.get('default', '') def print_list(objs, fields, exclude_unavailable=False, formatters=None, sortby_index=0): '''Prints a list of objects. @param objs: Objects to print @param fields: Fields on each object to be printed @param exclude_unavailable: Boolean to decide if unavailable fields are removed @param formatters: Custom field formatters @param sortby_index: Results sorted against the key in the fields list at this index; if None then the object order is not altered ''' formatters = formatters or {} mixed_case_fields = ['serverId'] removed_fields = [] rows = [] for o in objs: row = [] for field in fields: if field in removed_fields: continue if field in formatters: row.append(formatters[field](o)) else: if field in mixed_case_fields: field_name = field.replace(' ', '_') else: field_name = field.lower().replace(' ', '_') if type(o) == dict and field in o: data = o[field] else: if not hasattr(o, field_name) and exclude_unavailable: removed_fields.append(field) continue else: data = getattr(o, field_name, '') if data is None: data = '-' if isinstance(data, six.string_types) and "\r" in data: data = data.replace("\r", " ") row.append(data) rows.append(row) for f in removed_fields: fields.remove(f) pt = prettytable.PrettyTable((f for f in fields), caching=False) pt.align = 'l' for row in rows: pt.add_row(row) if sortby_index is None: order_by = None else: order_by = fields[sortby_index] _print(pt, order_by) def dict_prettyprint(val): """dict pretty print formatter. :param val: dict. :return: formatted json string. """ return jsonutils.dumps(val, indent=2, sort_keys=True) def json_prettyprint(val): """json pretty print formatter. :param val: json string. :return: formatted json string. """ return val and jsonutils.dumps(jsonutils.loads(val), indent=2, sort_keys=True) def find_resource(manager, name_or_id, *args, **kwargs): """Helper for the _find_* methods.""" # first try to get entity as integer id try: if isinstance(name_or_id, int) or name_or_id.isdigit(): return manager.get(int(name_or_id), *args, **kwargs) except exceptions.NotFound: pass # now try to get entity as uuid try: uuid.UUID(str(name_or_id)) return manager.get(name_or_id, *args, **kwargs) except (ValueError, exceptions.NotFound): pass # finally try to find entity by name try: return manager.find(name=name_or_id) except exceptions.NotFound: msg = "No %s with a name or ID of '%s' exists." % \ (manager.resource_class.__name__.lower(), name_or_id) raise exceptions.CommandError(msg)
31.632768
78
0.606001
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from __future__ import print_function import os import sys import six import uuid from oslo_serialization import jsonutils from oslo_utils import encodeutils import prettytable from karborclient.common.apiclient import exceptions # Decorator for cli-args def arg(*args, **kwargs): def _decorator(func): # Because of the sematics of decorator composition if we just append # to the options list positional options will appear to be backwards. func.__dict__.setdefault('arguments', []).insert(0, (args, kwargs)) return func return _decorator def env(*vars, **kwargs): """Search for the first defined of possibly many env vars Returns the first environment variable defined in vars, or returns the default defined in kwargs. """ for v in vars: value = os.environ.get(v) if value: return value return kwargs.get('default', '') def _print(pt, order): if sys.version_info >= (3, 0): print(pt.get_string(sortby=order)) else: print(encodeutils.safe_encode(pt.get_string(sortby=order))) def print_list(objs, fields, exclude_unavailable=False, formatters=None, sortby_index=0): '''Prints a list of objects. @param objs: Objects to print @param fields: Fields on each object to be printed @param exclude_unavailable: Boolean to decide if unavailable fields are removed @param formatters: Custom field formatters @param sortby_index: Results sorted against the key in the fields list at this index; if None then the object order is not altered ''' formatters = formatters or {} mixed_case_fields = ['serverId'] removed_fields = [] rows = [] for o in objs: row = [] for field in fields: if field in removed_fields: continue if field in formatters: row.append(formatters[field](o)) else: if field in mixed_case_fields: field_name = field.replace(' ', '_') else: field_name = field.lower().replace(' ', '_') if type(o) == dict and field in o: data = o[field] else: if not hasattr(o, field_name) and exclude_unavailable: removed_fields.append(field) continue else: data = getattr(o, field_name, '') if data is None: data = '-' if isinstance(data, six.string_types) and "\r" in data: data = data.replace("\r", " ") row.append(data) rows.append(row) for f in removed_fields: fields.remove(f) pt = prettytable.PrettyTable((f for f in fields), caching=False) pt.align = 'l' for row in rows: pt.add_row(row) if sortby_index is None: order_by = None else: order_by = fields[sortby_index] _print(pt, order_by) def print_dict(d, property="Property", dict_format_list=None, json_format_list=None): pt = prettytable.PrettyTable([property, 'Value'], caching=False) pt.align = 'l' for r in d.items(): r = list(r) if isinstance(r[1], six.string_types) and "\r" in r[1]: r[1] = r[1].replace("\r", " ") if dict_format_list is not None and r[0] in dict_format_list: r[1] = dict_prettyprint(r[1]) if json_format_list is not None and r[0] in json_format_list: r[1] = json_prettyprint(r[1]) pt.add_row(r) _print(pt, property) def dict_prettyprint(val): """dict pretty print formatter. :param val: dict. :return: formatted json string. """ return jsonutils.dumps(val, indent=2, sort_keys=True) def json_prettyprint(val): """json pretty print formatter. :param val: json string. :return: formatted json string. """ return val and jsonutils.dumps(jsonutils.loads(val), indent=2, sort_keys=True) def find_resource(manager, name_or_id, *args, **kwargs): """Helper for the _find_* methods.""" # first try to get entity as integer id try: if isinstance(name_or_id, int) or name_or_id.isdigit(): return manager.get(int(name_or_id), *args, **kwargs) except exceptions.NotFound: pass # now try to get entity as uuid try: uuid.UUID(str(name_or_id)) return manager.get(name_or_id, *args, **kwargs) except (ValueError, exceptions.NotFound): pass # finally try to find entity by name try: return manager.find(name=name_or_id) except exceptions.NotFound: msg = "No %s with a name or ID of '%s' exists." % \ (manager.resource_class.__name__.lower(), name_or_id) raise exceptions.CommandError(msg)
1,049
0
68
d54f82981520d2f5c67a7b99944807f127f13803
5,178
py
Python
datasets/cuhk_sysu.py
ZhengPeng7/PSxMVN
a8787946bdb2c97643041d24f7be53ae128f8494
[ "MIT" ]
null
null
null
datasets/cuhk_sysu.py
ZhengPeng7/PSxMVN
a8787946bdb2c97643041d24f7be53ae128f8494
[ "MIT" ]
null
null
null
datasets/cuhk_sysu.py
ZhengPeng7/PSxMVN
a8787946bdb2c97643041d24f7be53ae128f8494
[ "MIT" ]
null
null
null
import os.path as osp import numpy as np from scipy.io import loadmat from .base import BaseDataset
42.793388
97
0.523368
import os.path as osp import numpy as np from scipy.io import loadmat from .base import BaseDataset class CUHKSYSU(BaseDataset): def __init__(self, root, transforms, split): self.name = "CUHK-SYSU" self.img_prefix = osp.join(root, "Image", "SSM") super(CUHKSYSU, self).__init__(root, transforms, split) def _load_queries(self): # TestG100: a test protocol, 100 gallery images per query protoc = loadmat(osp.join(self.root, "annotation/test/train_test/TestG100.mat")) protoc = protoc["TestG100"].squeeze() queries = [] for item in protoc["Query"]: img_name = str(item["imname"][0, 0][0]) roi = item["idlocate"][0, 0][0].astype(np.int32) roi[2:] += roi[:2] queries.append( { "img_name": img_name, "img_path": osp.join(self.img_prefix, img_name), "boxes": roi[np.newaxis, :], "pids": np.array([-100]), # dummy pid } ) return queries def _load_split_img_names(self): """ Load the image names for the specific split. """ assert self.split in ("train", "gallery") # gallery images gallery_imgs = loadmat(osp.join(self.root, "annotation", "pool.mat")) gallery_imgs = gallery_imgs["pool"].squeeze() gallery_imgs = [str(a.squeeze()) for a in gallery_imgs] if self.split == "gallery": return gallery_imgs # all images all_imgs = loadmat(osp.join(self.root, "annotation", "Images.mat")) all_imgs = all_imgs["Img"].squeeze() all_imgs = [str(a[0].squeeze()) for a in all_imgs] # training images = all images - gallery images training_imgs = sorted(list(set(all_imgs) - set(gallery_imgs))) return training_imgs def _load_annotations(self): if self.split == "query": return self._load_queries() # load all images and build a dict from image to boxes all_imgs = loadmat(osp.join(self.root, "annotation", "Images.mat")) all_imgs = all_imgs["Img"].squeeze() name_to_boxes = {} name_to_pids = {} unlabeled_pid = 5555 # default pid for unlabeled people for img_name, _, boxes in all_imgs: img_name = str(img_name[0]) boxes = np.asarray([b[0] for b in boxes[0]]) boxes = boxes.reshape(boxes.shape[0], 4) # (x1, y1, w, h) valid_index = np.where((boxes[:, 2] > 0) & (boxes[:, 3] > 0))[0] assert valid_index.size > 0, "Warning: {} has no valid boxes.".format(img_name) boxes = boxes[valid_index] name_to_boxes[img_name] = boxes.astype(np.int32) name_to_pids[img_name] = unlabeled_pid * np.ones(boxes.shape[0], dtype=np.int32) def set_box_pid(boxes, box, pids, pid): for i in range(boxes.shape[0]): if np.all(boxes[i] == box): pids[i] = pid return # assign a unique pid from 1 to N for each identity if self.split == "train": train = loadmat(osp.join(self.root, "annotation/test/train_test/Train.mat")) train = train["Train"].squeeze() for index, item in enumerate(train): scenes = item[0, 0][2].squeeze() for img_name, box, _ in scenes: img_name = str(img_name[0]) box = box.squeeze().astype(np.int32) set_box_pid(name_to_boxes[img_name], box, name_to_pids[img_name], index + 1) else: protoc = loadmat(osp.join(self.root, "annotation/test/train_test/TestG100.mat")) protoc = protoc["TestG100"].squeeze() for index, item in enumerate(protoc): # query im_name = str(item["Query"][0, 0][0][0]) box = item["Query"][0, 0][1].squeeze().astype(np.int32) set_box_pid(name_to_boxes[im_name], box, name_to_pids[im_name], index + 1) # gallery gallery = item["Gallery"].squeeze() for im_name, box, _ in gallery: im_name = str(im_name[0]) if box.size == 0: break box = box.squeeze().astype(np.int32) set_box_pid(name_to_boxes[im_name], box, name_to_pids[im_name], index + 1) annotations = [] imgs = self._load_split_img_names() for img_name in imgs: boxes = name_to_boxes[img_name] boxes[:, 2:] += boxes[:, :2] # (x1, y1, w, h) -> (x1, y1, x2, y2) pids = name_to_pids[img_name] annotations.append( { "img_name": img_name, "img_path": osp.join(self.img_prefix, img_name), "boxes": boxes, "pids": pids, } ) return annotations
4,120
924
24
1327aebdfe208122c6fd75e1adde7135c6eff61f
783
py
Python
test_DeckofCards.py
mrkruoff/BlackJack
6326b9e4025d996b9e53df890ea659f45614a732
[ "MIT" ]
null
null
null
test_DeckofCards.py
mrkruoff/BlackJack
6326b9e4025d996b9e53df890ea659f45614a732
[ "MIT" ]
null
null
null
test_DeckofCards.py
mrkruoff/BlackJack
6326b9e4025d996b9e53df890ea659f45614a732
[ "MIT" ]
null
null
null
from unittest import TestCase from DeckofCards import Deck
34.043478
59
0.670498
from unittest import TestCase from DeckofCards import Deck class TestDeck(TestCase): def test_create_deck(self): testing_deck = Deck(1) self.assertEqual(testing_deck.cards_left(), 52) testing_deck = Deck(2) self.assertEqual(testing_deck.cards_left(), 52 * 2) testing_deck = Deck(3) self.assertEqual(testing_deck.cards_left(), 52 * 3) testing_deck = Deck(4) self.assertEqual(testing_deck.cards_left(), 52 * 4) def test_draw_card(self): testing_deck = Deck(1) self.assertEqual(testing_deck.cards_left(), 52) card = testing_deck.draw_card() self.assertIsNotNone(card) self.assertEqual(testing_deck.cards_left(), 51) self.assertTrue(card not in testing_deck.deck)
643
4
76
69611b7416b1f66583db22f14a89377fd60cc1de
2,836
py
Python
src/zope/app/renderer/stx.py
zopefoundation/zope.app.renderer
2238c5821229b67bbe3242c11c483ea12446fb83
[ "ZPL-2.1" ]
null
null
null
src/zope/app/renderer/stx.py
zopefoundation/zope.app.renderer
2238c5821229b67bbe3242c11c483ea12446fb83
[ "ZPL-2.1" ]
2
2017-05-17T08:44:00.000Z
2017-05-25T11:21:58.000Z
src/zope/app/renderer/stx.py
zopefoundation/zope.app.renderer
2238c5821229b67bbe3242c11c483ea12446fb83
[ "ZPL-2.1" ]
null
null
null
############################################################################## # # Copyright (c) 2003 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Structured Text Renderer Classes """ __docformat__ = 'restructuredtext' import re from zope.component import adapter from zope.interface import implementer from zope.structuredtext.document import Document from zope.structuredtext.html import HTML from zope.publisher.browser import BrowserView from zope.publisher.interfaces.browser import IBrowserRequest from zope.app.renderer.i18n import ZopeMessageFactory as _ from zope.app.renderer.interfaces import ISource, IHTMLRenderer from zope.app.renderer import SourceFactory class IStructuredTextSource(ISource): """Marker interface for a structured text source. Note that an implementation of this interface should always derive from unicode or behave like a unicode class.""" StructuredTextSourceFactory = SourceFactory( IStructuredTextSource, _("Structured Text (STX)"), _("Structured Text (STX) Source")) @implementer(IHTMLRenderer) @adapter(IStructuredTextSource, IBrowserRequest) class StructuredTextToHTMLRenderer(BrowserView): r"""A view to convert from Plain Text to HTML. Example:: >>> from zope.app.renderer import text_type >>> from zope.publisher.browser import TestRequest >>> source = StructuredTextSourceFactory(u'This is source.') >>> renderer = StructuredTextToHTMLRenderer(source, TestRequest()) >>> rendered = renderer.render() >>> isinstance(rendered, text_type) True >>> print(rendered) <p>This is source.</p> <BLANKLINE> Make sure that unicode works as well:: >>> source = StructuredTextSourceFactory(u'This is \xc3\x9c.') >>> renderer = StructuredTextToHTMLRenderer(source, TestRequest()) >>> rendered = renderer.render() >>> isinstance(rendered, text_type) True >>> print(rendered) <p>This is ...</p> <BLANKLINE> """ def render(self): "See zope.app.interfaces.renderer.IHTMLRenderer" doc = Document()(self.context) html = HTML()(doc) # strip html & body added by some zope versions html = re.sub( r'(?sm)^<html.*<body.*?>\n(.*)</body>\n</html>\n', r'\1', html) return html
32.597701
78
0.663258
############################################################################## # # Copyright (c) 2003 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Structured Text Renderer Classes """ __docformat__ = 'restructuredtext' import re from zope.component import adapter from zope.interface import implementer from zope.structuredtext.document import Document from zope.structuredtext.html import HTML from zope.publisher.browser import BrowserView from zope.publisher.interfaces.browser import IBrowserRequest from zope.app.renderer.i18n import ZopeMessageFactory as _ from zope.app.renderer.interfaces import ISource, IHTMLRenderer from zope.app.renderer import SourceFactory class IStructuredTextSource(ISource): """Marker interface for a structured text source. Note that an implementation of this interface should always derive from unicode or behave like a unicode class.""" StructuredTextSourceFactory = SourceFactory( IStructuredTextSource, _("Structured Text (STX)"), _("Structured Text (STX) Source")) @implementer(IHTMLRenderer) @adapter(IStructuredTextSource, IBrowserRequest) class StructuredTextToHTMLRenderer(BrowserView): r"""A view to convert from Plain Text to HTML. Example:: >>> from zope.app.renderer import text_type >>> from zope.publisher.browser import TestRequest >>> source = StructuredTextSourceFactory(u'This is source.') >>> renderer = StructuredTextToHTMLRenderer(source, TestRequest()) >>> rendered = renderer.render() >>> isinstance(rendered, text_type) True >>> print(rendered) <p>This is source.</p> <BLANKLINE> Make sure that unicode works as well:: >>> source = StructuredTextSourceFactory(u'This is \xc3\x9c.') >>> renderer = StructuredTextToHTMLRenderer(source, TestRequest()) >>> rendered = renderer.render() >>> isinstance(rendered, text_type) True >>> print(rendered) <p>This is ...</p> <BLANKLINE> """ def render(self): "See zope.app.interfaces.renderer.IHTMLRenderer" doc = Document()(self.context) html = HTML()(doc) # strip html & body added by some zope versions html = re.sub( r'(?sm)^<html.*<body.*?>\n(.*)</body>\n</html>\n', r'\1', html) return html
0
0
0
039abc2574b6382d06a028cc387789922bc48e1d
3,436
py
Python
ML Model/src/serializer_test.py
jimdowling/Names-To-Nationality-Predicter
4ab6570d65232d15c6eadf3fe4842e8ef2e888f4
[ "MIT" ]
5
2021-01-20T11:15:17.000Z
2022-03-26T06:16:37.000Z
ML Model/src/serializer_test.py
EKarton/Names-To-Nationality-Predictor
49715aa267d48d92358f11401632e0ab22bc5f97
[ "MIT" ]
null
null
null
ML Model/src/serializer_test.py
EKarton/Names-To-Nationality-Predictor
49715aa267d48d92358f11401632e0ab22bc5f97
[ "MIT" ]
1
2021-03-17T22:17:33.000Z
2021-03-17T22:17:33.000Z
import unittest import math import numpy as np from serializer import Serializer if __name__ == '__main__': unittest.main()
49.085714
103
0.73312
import unittest import math import numpy as np from serializer import Serializer class SerializerTest(unittest.TestCase): def test_serialize_example_given_name_should_return_correct_val_1(self): self.check_serialized_name("Bob Smith", [2, 15, 2, 0, 19, 13, 9, 20, 8]) def test_serialize_example_given_name_with_random_spaces_should_return_correct_val_2(self): self.check_serialized_name("Bob Smith ", [2, 15, 2, 0, 19, 13, 9, 20, 8]) def test_serialize_example_given_name_with_unique_chars_should_return_correct_val_3(self): self.check_serialized_name("Bob Smáith ", [2, 15, 2, 0, 19, 13, 27, 9, 20, 8]) def test_serialize_example_given_name_with_random_chars_should_return_correct_val_4(self): self.check_serialized_name("$$B)ob Sm#áith *", [2, 15, 2, 0, 19, 13, 27, 9, 20, 8]) def test_serialize_example_given_name_with_pronoun_should_return_correct_val_4(self): self.check_serialized_name("Dr. Bob Smith", [2, 15, 2, 0, 19, 13, 9, 20, 8]) def test_serialize_example_given_single_letter_should_return_correct_val_4(self): self.check_serialized_name("Bob C Smith", [2, 15, 2, 0, 19, 13, 9, 20, 8]) def test_serialize_example_given_single_letter_as_first_name_should_return_none(self): self.check_serialized_name("C Bob Smith", None) def test_serialize_example_given_single_letter_as_first_name_with_pronoun_should_return_none(self): self.check_serialized_name("Mr. C Bob Smith", None) def test_serialize_example_given_single_letter_as_last_name_should_return_none(self): self.check_serialized_name("Bob Joe S", None) def test_serialize_example_given_middle_name_should_return_encoding_without_middle_name(self): self.check_serialized_name("Bob Joe Smith", [2, 15, 2, 0, 19, 13, 9, 20, 8]) def test_serialize_label_given_second_label_should_return_correct_val(self): self.check_serialized_label(["Germany", "France"], "France", [0, 1]) def test_serialize_label_given_nth_label_should_return_correct_val(self): self.check_serialized_label(["a", "b", "c", "d"], "c", [0, 0, 1, 0]) def test_serialize_label_given_unknown_label_should_throw_exception(self): with self.assertRaises(Exception): self.check_serialized_label(["a", "b", "c", "d"], "e", [0, 0, 0, 0]) def check_serialized_name(self, name, expected_indexes_with_ones): serializer = Serializer(['Germany', 'France']) serialized_example = serializer.serialize_example(name) if expected_indexes_with_ones is None: self.assertIsNone(serialized_example) else: self.assertEqual(len(expected_indexes_with_ones), len(serialized_example)) for i in range(len(expected_indexes_with_ones)): serialized_char = serialized_example[i] self.assertEqual(sum(serialized_char), 1.0) self.assertEqual(serialized_char[expected_indexes_with_ones[i]], 1) def check_serialized_label(self, possible_labels, unserialized_label, expected_serialized_label): serializer = Serializer(possible_labels) serialized_label = serializer.serialize_label(unserialized_label) self.assertEqual(len(serialized_label), len(expected_serialized_label)) self.assertTrue(np.all(serialized_label == expected_serialized_label)) if __name__ == '__main__': unittest.main()
2,856
19
435
61e7dde5a425068da9b7519f19c2a9bf5b6d509f
449
py
Python
pytest_tornado/test/test_async_await.py
mikebohdan/pytest-tornado
20898c29aa6ee23244e3f705ccf21555c78a61a1
[ "Apache-2.0" ]
3
2018-03-16T01:17:18.000Z
2019-02-07T04:15:33.000Z
pytest_tornado/test/test_async_await.py
mikebohdan/pytest-tornado
20898c29aa6ee23244e3f705ccf21555c78a61a1
[ "Apache-2.0" ]
null
null
null
pytest_tornado/test/test_async_await.py
mikebohdan/pytest-tornado
20898c29aa6ee23244e3f705ccf21555c78a61a1
[ "Apache-2.0" ]
1
2018-03-16T01:26:48.000Z
2018-03-16T01:26:48.000Z
import pytest from tornado import gen @pytest.mark.gen_test @pytest.mark.gen_test(run_sync=False)
23.631579
56
0.799555
import pytest from tornado import gen async def dummy_native_coroutine(io_loop): await gen.Task(io_loop.add_callback) return True @pytest.mark.gen_test async def test_native_coroutine_gen_test(io_loop): result = await dummy_native_coroutine(io_loop) assert result @pytest.mark.gen_test(run_sync=False) async def test_native_coroutine_run_sync_false(io_loop): result = await dummy_native_coroutine(io_loop) assert result
280
0
67
b48e89514d78f616a92e0a8ea8fab4c75b079caf
1,117
py
Python
otwstest/tree_of_life/node_info/__init__.py
OpenTreeOfLife/test-ot-ws
eee0eeb4150e942bea32e9131d20c01ad9666757
[ "BSD-2-Clause" ]
null
null
null
otwstest/tree_of_life/node_info/__init__.py
OpenTreeOfLife/test-ot-ws
eee0eeb4150e942bea32e9131d20c01ad9666757
[ "BSD-2-Clause" ]
4
2019-04-10T19:44:00.000Z
2020-04-21T19:50:29.000Z
otwstest/tree_of_life/node_info/__init__.py
OpenTreeOfLife/test-ot-ws
eee0eeb4150e942bea32e9131d20c01ad9666757
[ "BSD-2-Clause" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- from otwstest.schema.tree_of_life.node_info import validate from otwstest import all_api_versions, not_v2_version @all_api_versions @all_api_versions @not_v2_version
29.394737
65
0.666965
#!/usr/bin/env python # -*- coding: utf-8 -*- from otwstest.schema.tree_of_life.node_info import validate from otwstest import all_api_versions, not_v2_version @all_api_versions def test_simple(outcome): o = 396446 if outcome.api_version == 'v2': url = outcome.make_url('graph/node_info') d = {'ott_id': o} else: url = outcome.make_url('tree_of_life/node_info') d = {'node_id': 'ott{}'.format(o)} outcome.do_http_json(url, 'POST', data=d, validator=validate) @all_api_versions def test_include_lineage(outcome): o = 396446 if outcome.api_version == 'v2': url = outcome.make_url('graph/node_info') d = {'ott_id': o} else: url = outcome.make_url('tree_of_life/node_info') d = {'node_id': 'ott{}'.format(o)} d['include_lineage'] = True outcome.do_http_json(url, 'POST', data=d, validator=validate) @not_v2_version def test_mrca_designation(outcome): url = outcome.make_url('tree_of_life/node_info') d = {'node_id': 'mrcaott3504ott396446'} outcome.do_http_json(url, 'POST', data=d, validator=validate)
832
0
66
1459df657b26343d4e5b81ebd3d18c6e44cf2786
1,135
py
Python
config.py
Zappaman/GPT2Ro
c1b0843c4e22d7b27cb0538dc2a8d5b81851fff3
[ "MIT" ]
1
2021-05-19T13:33:54.000Z
2021-05-19T13:33:54.000Z
config.py
Zappaman/GPT2Ro
c1b0843c4e22d7b27cb0538dc2a8d5b81851fff3
[ "MIT" ]
null
null
null
config.py
Zappaman/GPT2Ro
c1b0843c4e22d7b27cb0538dc2a8d5b81851fff3
[ "MIT" ]
1
2021-05-19T13:33:55.000Z
2021-05-19T13:33:55.000Z
""" Defaults for config object which is used as a singleton object in project """ from yacs.config import CfgNode as CN _C = CN() _C.EXPERIMENT = CN() _C.EXPERIMENT.OUTPUT_FOLDER = "./outputs" _C.EXPERIMENT.TENSORBOARD_FOLDER = "./runs" _C.EXPERIMENT.RESUME_TRAINING_ON_RESTART = True _C.EXPERIMENT.NUM_DATALOADER_WORKERS = 0 _C.DATASET = CN() _C.DATASET.TRAIN_FILE = "" _C.DATASET.VALID_FILE = "" _C.DATASET.TOKENIZER_PREFIX_PATH = "" _C.TRAIN = CN() _C.TRAIN.LAST_PRETRAINED_MODEL = '' _C.TRAIN.SAVE_STEPS = 1000 _C.TRAIN.WEIGHT_DECAY = 0.0 _C.TRAIN.NUM_TRAIN_EPOCHS = 3 _C.TRAIN.LOG_EVERY = 100 _C.TRAIN.LEARNING_RATE = 5e-5 _C.TRAIN.NUM_WARMUP_STEPS = 0 _C.TRAIN.BATCH_SIZE = 32 _C.TRAIN.USE_FP_16 = False _C.TRAIN.MAX_TRAIN_STEPS = 1000000000000 _C.TRAIN.EVAL_STEPS = 1000 _C.TRAIN.GRADIENT_ACCUMULATION_STEPS = 1 _C.TRAIN.LR_SCHEDULER_TYPE = "linear" _C.TRAIN.USE_GRADUAL_UNFREEZING = False _C.TRAIN.UNFREEZING = CN() _C.TRAIN.UNFREEZING.UNFREEZE_GROUPS = None _C.TRAIN.UNFREEZING.TRAIN_STEPS_LIST = [] _C.TRAIN.UNFREEZING.LEARNING_RATE_LIST = [] _C.TRAIN.GPT2_PRETRAINED_MODEL = 'gpt2' cfg = _C # global singleton object
27.02381
73
0.772687
""" Defaults for config object which is used as a singleton object in project """ from yacs.config import CfgNode as CN _C = CN() _C.EXPERIMENT = CN() _C.EXPERIMENT.OUTPUT_FOLDER = "./outputs" _C.EXPERIMENT.TENSORBOARD_FOLDER = "./runs" _C.EXPERIMENT.RESUME_TRAINING_ON_RESTART = True _C.EXPERIMENT.NUM_DATALOADER_WORKERS = 0 _C.DATASET = CN() _C.DATASET.TRAIN_FILE = "" _C.DATASET.VALID_FILE = "" _C.DATASET.TOKENIZER_PREFIX_PATH = "" _C.TRAIN = CN() _C.TRAIN.LAST_PRETRAINED_MODEL = '' _C.TRAIN.SAVE_STEPS = 1000 _C.TRAIN.WEIGHT_DECAY = 0.0 _C.TRAIN.NUM_TRAIN_EPOCHS = 3 _C.TRAIN.LOG_EVERY = 100 _C.TRAIN.LEARNING_RATE = 5e-5 _C.TRAIN.NUM_WARMUP_STEPS = 0 _C.TRAIN.BATCH_SIZE = 32 _C.TRAIN.USE_FP_16 = False _C.TRAIN.MAX_TRAIN_STEPS = 1000000000000 _C.TRAIN.EVAL_STEPS = 1000 _C.TRAIN.GRADIENT_ACCUMULATION_STEPS = 1 _C.TRAIN.LR_SCHEDULER_TYPE = "linear" _C.TRAIN.USE_GRADUAL_UNFREEZING = False _C.TRAIN.UNFREEZING = CN() _C.TRAIN.UNFREEZING.UNFREEZE_GROUPS = None _C.TRAIN.UNFREEZING.TRAIN_STEPS_LIST = [] _C.TRAIN.UNFREEZING.LEARNING_RATE_LIST = [] _C.TRAIN.GPT2_PRETRAINED_MODEL = 'gpt2' cfg = _C # global singleton object
0
0
0
085932cf674cd32537e1fa97004cc1c2b4bbc5e0
14,894
py
Python
seafilefuse.py
dongsupark/seafile-fuse-client
202108d476e53a9d2962e5a97229cc71455731cd
[ "Apache-2.0" ]
5
2017-11-04T14:14:20.000Z
2021-02-15T22:03:26.000Z
seafilefuse.py
dongsupark/seafile-fuse-client
202108d476e53a9d2962e5a97229cc71455731cd
[ "Apache-2.0" ]
null
null
null
seafilefuse.py
dongsupark/seafile-fuse-client
202108d476e53a9d2962e5a97229cc71455731cd
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python """ FUSE-based client for Seafile - written by Dongsu Park <dpark@posteo.net> (inspired by copy-fuse <https://github.com/copy-app/copy-fuse>) A simple client for seafile.com, implemented via FUSE. This tool allows a Linux/MacOSX client to mount a seafile cloud drive on a local filesystem. Quickstart usage: $ mkdir -p /mnt/seafile $ ./seafilefuse.py "http://127.0.0.1:8000" test@seafiletest.com "testtest" /mnt/seafile (where server URL is "http://127.0.0.1:8000", username is test@seafiletest.com, and password is "testtest".) To unmount it: $ fusermount -u /mnt/seafile """ from errno import ENOENT, EIO from stat import S_IFDIR, S_IFREG from sys import argv, exit, stderr import os import argparse import tempfile import time import hashlib from fuse import FUSE, FuseOSError, Operations, LoggingMixIn from seafileapi.client import SeafileApiClient from seafileapi.exceptions import ClientHttpError, DoesNotExist from seafileapi.files import SeafDir, SeafFile from seafileapi.repo import Repo from seafileapi.repos import Repos # global configurable variables to be connected to a Seafile server. sf_server_url="http://127.0.0.1:8000" sf_username="test@seafiletest.com" sf_password="testtest" sf_mount_point="/mnt/seafile" repo_id_len=36 cache_ttl=10 class SeafileCache: """class for handling caches of file attributes as well as expiration time. SeafileCache instances must be initialized by SeafileFUSE. """ def add_attrcache(self, pdirpath, filename, isdir=False, size=0): """adds a new cache entry to self.attrcache, no matter if the entry for the path already exists. """ if isdir: ftype = 'dir' else: ftype = 'file' self.attrcache[pdirpath][filename] = \ {'name': filename, 'type': ftype, 'size': size, 'ctime': time.time(), 'mtime': time.time()} def update_attrcache(self, pdirpath, filename, isdir=False, size=0): """update an existing cache entry in self.attrcache, only if it already exists for the path as a key. """ if pdirpath in self.attrcache: self.add_attrcache(pdirpath, filename, isdir, size) class SeafileFUSE(LoggingMixIn, Operations): """Main class of the seafile client filesystem based on FUSE. On initialization, basic connections are established via SeafileApiClient. Only one seafile repository is to be selected for further operations. SeafileCache instance must be initialized from the init method as well. """ # Disable unused operations: access = None chmod = None chown = None getxattr = None listxattr = None opendir = None releasedir = None statfs = None if __name__ == "__main__": main()
31.488372
108
0.612931
#!/usr/bin/env python """ FUSE-based client for Seafile - written by Dongsu Park <dpark@posteo.net> (inspired by copy-fuse <https://github.com/copy-app/copy-fuse>) A simple client for seafile.com, implemented via FUSE. This tool allows a Linux/MacOSX client to mount a seafile cloud drive on a local filesystem. Quickstart usage: $ mkdir -p /mnt/seafile $ ./seafilefuse.py "http://127.0.0.1:8000" test@seafiletest.com "testtest" /mnt/seafile (where server URL is "http://127.0.0.1:8000", username is test@seafiletest.com, and password is "testtest".) To unmount it: $ fusermount -u /mnt/seafile """ from errno import ENOENT, EIO from stat import S_IFDIR, S_IFREG from sys import argv, exit, stderr import os import argparse import tempfile import time import hashlib from fuse import FUSE, FuseOSError, Operations, LoggingMixIn from seafileapi.client import SeafileApiClient from seafileapi.exceptions import ClientHttpError, DoesNotExist from seafileapi.files import SeafDir, SeafFile from seafileapi.repo import Repo from seafileapi.repos import Repos # global configurable variables to be connected to a Seafile server. sf_server_url="http://127.0.0.1:8000" sf_username="test@seafiletest.com" sf_password="testtest" sf_mount_point="/mnt/seafile" repo_id_len=36 cache_ttl=10 def seafile_read_envs(): global sf_server_url, sf_username, sf_password, sf_mount_point if os.environ.get('SEAFILE_TEST_SERVER_ADDRESS') is not None: sf_server_url = os.environ['SEAFILE_TEST_SERVER_ADDRESS'] if os.environ.get('SEAFILE_TEST_USERNAME') is not None: sf_username = os.environ['SEAFILE_TEST_USERNAME'] if os.environ.get('SEAFILE_TEST_PASSWORD') is not None: sf_password = os.environ['SEAFILE_TEST_PASSWORD'] if os.environ.get('SEAFILE_TEST_MOUNT_POINT') is not None: sf_mount_point = os.environ['SEAFILE_TEST_MOUNT_POINT'] def seafile_list_repos(client): global repo_id_len repos = client.repos.list_repos() for repo in repos: assert len(repo.id) == repo_id_len return repos def seafile_find_repo(repos, repoid=None): if repoid is None: # just return the first repo if no repo is matched return repos[0] for tmprepo in repos: if tmprepo.id == repoid: return tmprepo # not found, raise exception raise FuseOSError(ENOENT) class SeafileCache: """class for handling caches of file attributes as well as expiration time. SeafileCache instances must be initialized by SeafileFUSE. """ def __init__(self, repo): self.attrcache = {} self.expirecache = {} self.currepo = repo def __str__(self, msg): print 'SeafileCache: %s' % msg def list_objects(self, path, ttl=cache_ttl): global cache_ttl # check expiration time cache if path in self.expirecache: if self.expirecache[path] >= time.time(): return self.attrcache[path] self.attrcache[path] = {} try: parentdir = self.currepo.get_dir(path) entries = parentdir.ls(force_refresh=True) except ClientHttpError as err: print "list_objects: err: " + str(err) return self.attrcache[path] except IOError as err: print "list_objects: err: " + str(err) return self.attrcache[path] for entry in entries: #name = os.path.basename(entry.path).encode('utf8') name = os.path.basename(entry.path) self.add_attrcache(path, name, entry.isdir, entry.size) # update expiration time cache self.expirecache[path] = time.time() + ttl return self.attrcache[path] def add_attrcache(self, pdirpath, filename, isdir=False, size=0): """adds a new cache entry to self.attrcache, no matter if the entry for the path already exists. """ if isdir: ftype = 'dir' else: ftype = 'file' self.attrcache[pdirpath][filename] = \ {'name': filename, 'type': ftype, 'size': size, 'ctime': time.time(), 'mtime': time.time()} def update_attrcache(self, pdirpath, filename, isdir=False, size=0): """update an existing cache entry in self.attrcache, only if it already exists for the path as a key. """ if pdirpath in self.attrcache: self.add_attrcache(pdirpath, filename, isdir, size) class SeafileFUSE(LoggingMixIn, Operations): """Main class of the seafile client filesystem based on FUSE. On initialization, basic connections are established via SeafileApiClient. Only one seafile repository is to be selected for further operations. SeafileCache instance must be initialized from the init method as well. """ def __init__(self, server=sf_server_url, username=sf_username, \ password=sf_password, repoid=None, logfile=None): try: self.seafileapi_client = SeafileApiClient(server, username, password) except ClientHttpError as err: print __str__(err) except DoesNotExist as err: print __str__(err) self.logfile = logfile self.fobjdict = {} self.repos = seafile_list_repos(self.seafileapi_client) self.currepo = seafile_find_repo(self.repos, repoid) print "Current repo's ID: " + self.currepo.id self.seafile_cache = SeafileCache(self.currepo) def __str__(self, msg): print 'SeafileFUSE: %s' % msg def file_close(self, path): if path in self.fobjdict: if self.fobjdict[path]['modified'] == True: self.file_upload(path) self.fobjdict[path]['object'].close() del self.fobjdict[path] def file_get(self, path, download=True): # print "file_get: " + path if path in self.fobjdict: return self.fobjdict[path] if download == True: sfileobj = self.currepo.get_file(path) fcontent = sfileobj.get_content() else: fcontent = '' f = tempfile.NamedTemporaryFile(delete=False) f.write(fcontent) self.fobjdict[path] = {'object': f, 'modified': False} # print "written to tmpfile " + f.name # print "fcontent: " + fcontent return self.fobjdict[path] def file_rename(self, old, new): if old in self.fobjdict: self.fobjdict[new] = self.fobjdict[old] del self.fobjdict[old] def file_upload(self, path): if path not in self.fobjdict: print "file_upload: path(" + path + ") not found in cache" raise FuseOSError(EIO) fileobj = self.file_get(path) if fileobj['modified'] == False: # print "not doing upload. return true" return True fp = fileobj['object'] fp.seek(0) if path == '/': pdirpath = '/' else: pdirpath = os.path.dirname(path) targetdir = self.currepo.get_dir(pdirpath) nfilename = os.path.basename(path) try: targetfile = targetdir.upload(fp, nfilename) except ClientHttpError as err: print __str__("err: " + str(err)) return 0 except IOError as err: print __str__("err: " + str(err)) return 0 except DoesNotExist as err: print __str__("err: " + str(err)) return 0 # print "uploaded " + nfilename fileobj['modified'] = False def getattr(self, path, fh=None): # print "getattr: " + path if path == '/': st = dict(st_mode=(S_IFDIR | 0755), st_nlink=2) st['st_ctime'] = st['st_atime'] = st['st_mtime'] = time.time() else: name = str(os.path.basename(path)) objects = self.seafile_cache.list_objects(os.path.dirname(path)) if name not in objects: raise FuseOSError(ENOENT) elif objects[name]['type'] == 'file': st = dict(st_mode=(S_IFREG | 0644), st_size=int(objects[name]['size'])) else: st = dict(st_mode=(S_IFDIR | 0755), st_nlink=2) st['st_ctime'] = st['st_atime'] = objects[name]['ctime'] st['st_mtime'] = objects[name]['mtime'] st['st_uid'] = os.getuid() st['st_gid'] = os.getgid() return st def open(self, path, flags): # print "open: " + path self.file_get(path) return 0 def flush(self, path, fh): # print "flush: " + path try: if path in self.fobjdict: if self.fobjdict[path]['modified'] == True: self.file_upload(path) except DoesNotExist as err: print __str__("flush: err: " + str(err)) def fsync(self, path, datasync, fh): # print "fsync: " + path try: if path in self.fobjdict: if self.fobjdict[path]['modified'] == True: self.file_upload(path) except DoesNotExist as err: print __str__("fsync: err: " + str(err)) def read(self, path, size, offset, fh): f = self.file_get(path)['object'] f.seek(offset) return f.read(size) def write(self, path, data, offset, fh): # print "write: " + path fileobj = self.file_get(path) f = fileobj['object'] f.seek(offset) f.write(data) fileobj['modified'] = True return len(data) def readdir(self, path, fh): # print "readdir: " + path objsdict = self.seafile_cache.list_objects(path); outlist = ['.', '..'] for obj in objsdict: outlist.append(obj) return outlist def rename(self, oldname, newname): # print "rename: " + oldname + " to " + newname self.file_rename(oldname, newname) ofilename = os.path.basename(oldname) podirname = os.path.dirname(oldname) pndirname = os.path.dirname(newname) targetfile = self.currepo.get_file(oldname) if podirname != pndirname: # use moveTo operation for moving it to a different directory targetfile.moveTo(pndirname, dst_repo=None) tmpname = os.path.join(pndirname, ofilename) targetfile = self.currepo.get_file(tmpname) # simply call a rename method targetfile.rename(newname.strip("/")) return 0 def create(self, path, mode): # print "create: " + path nfilename = os.path.basename(path) pdirpath = os.path.dirname(path) parentdir = self.currepo.get_dir(pdirpath) parentdir.ls() self.seafile_cache.update_attrcache(pdirpath, nfilename, isdir=False) self.file_get(path, download=False) self.file_upload(path) return 0 def unlink(self, path): # print "unlink: " + path if path == '/': raise FuseOSError(EFAULT) targetfile = self.currepo.get_file(path) targetfile.delete() tfilename = os.path.basename(path) pdirpath = os.path.dirname(path) self.seafile_cache.update_attrcache(pdirpath, tfilename, isdir=False) return 0 def mkdir(self, path, mode): # print "mkdir: " + path ndirname = os.path.basename(path) pdirpath = os.path.dirname(path) parentdir = self.currepo.get_dir(pdirpath) parentdir.ls() self.seafile_cache.update_attrcache(pdirpath, ndirname, isdir=True) newdir = parentdir.mkdir(ndirname) return 0 def rmdir(self, path): # print "rmdir: " + path if path == '/': raise FuseOSError(EFAULT) targetdir = self.currepo.get_dir(path) targetdir.delete() tdirname = os.path.basename(path) pdirpath = os.path.dirname(path) self.seafile_cache.update_attrcache(pdirpath, tdirname, isdir=True) return 0 def release(self, path, fh): # print "release: " + path try: if self.fobjdict[path]['modified'] == True: self.file_close(path) except DoesNotExist as err: print __str__("release, err: " + str(err)) def truncate(self, path, length, fh=None): # print "truncate: " + path f = self.file_get(path)['object'] f.truncate(length) # Disable unused operations: access = None chmod = None chown = None getxattr = None listxattr = None opendir = None releasedir = None statfs = None def main(): parser = argparse.ArgumentParser( description='Fuse filesystem for seafile clients') parser.add_argument( '-d', '--debug', default=False, action='store_true', help='turn on debug output (implies -f)') parser.add_argument( '-f', '--foreground', default=False, action='store_true', help='run in foreground') repoid = None parser.add_argument( '-r', '--repoid', type=str, help='specify ID of the remote repository (if not set, auto-choose the 1st repo)') parser.add_argument( '-o', '--options', help='add extra fuse options (see "man fuse")') parser.add_argument( 'server_url', metavar='SERVERURL', help='server_url') parser.add_argument( 'username', metavar='EMAIL', help='username/email') parser.add_argument( 'password', metavar='PASS', help='password') parser.add_argument( 'mount_point', metavar='MNTDIR', help='directory to mount filesystem at') args = parser.parse_args(argv[1:]) seafile_read_envs() u_server_url = args.__dict__.pop('server_url') if u_server_url is not None: sf_server_url = u_server_url u_username = args.__dict__.pop('username') if u_username is not None: sf_username = u_username u_password = args.__dict__.pop('password') if u_password is not None: sf_password = u_password u_mount_point = args.__dict__.pop('mount_point') if u_mount_point is not None: sf_mount_point = u_mount_point u_repoid = args.__dict__.pop('repoid') # parse options options_str = args.__dict__.pop('options') options = dict([(kv.split('=', 1)+[True])[:2] for kv in (options_str and options_str.split(',')) or []]) fuse_args = args.__dict__.copy() fuse_args.update(options) logfile = None if fuse_args.get('debug', False) == True: # send to stderr same as where fuse lib sends debug messages logfile = stderr fuse = FUSE(SeafileFUSE(server=sf_server_url, username=sf_username, \ password=sf_password, repoid=u_repoid, logfile=logfile), \ sf_mount_point, **fuse_args) if __name__ == "__main__": main()
11,382
0
711
4cd6418c9ad0f4ee4345c53eb1d24afd4b6d0579
2,885
py
Python
pwncat/modules/linux/enumerate/creds/private_key.py
Mitul16/pwncat
b8d7876a9779c2c7796a9a29110d3f1cda721dff
[ "MIT" ]
1,454
2020-05-07T02:20:52.000Z
2022-03-31T21:32:22.000Z
pwncat/modules/linux/enumerate/creds/private_key.py
akr3ch/pwncat
d67865bdaac60dd0761d0698062e7b443a62c6db
[ "MIT" ]
187
2020-05-08T06:26:01.000Z
2022-03-07T21:15:29.000Z
pwncat/modules/linux/enumerate/creds/private_key.py
akr3ch/pwncat
d67865bdaac60dd0761d0698062e7b443a62c6db
[ "MIT" ]
184
2020-05-07T02:31:58.000Z
2022-03-31T09:11:59.000Z
#!/usr/bin/env python3 import rich.markup from Crypto.PublicKey import RSA import pwncat from pwncat.facts import PrivateKey from pwncat.modules import Status from pwncat.platform.linux import Linux from pwncat.modules.enumerate import Schedule, EnumerateModule class Module(EnumerateModule): """ Search the victim file system for configuration files which may contain private keys. This uses a regular expression based search to find files whose contents look like a SSH private key. """ PROVIDES = ["creds.private_key"] PLATFORM = [Linux] SCHEDULE = Schedule.PER_USER
37.960526
130
0.569151
#!/usr/bin/env python3 import rich.markup from Crypto.PublicKey import RSA import pwncat from pwncat.facts import PrivateKey from pwncat.modules import Status from pwncat.platform.linux import Linux from pwncat.modules.enumerate import Schedule, EnumerateModule class Module(EnumerateModule): """ Search the victim file system for configuration files which may contain private keys. This uses a regular expression based search to find files whose contents look like a SSH private key. """ PROVIDES = ["creds.private_key"] PLATFORM = [Linux] SCHEDULE = Schedule.PER_USER def enumerate(self, session: "pwncat.manager.Session"): # This uses a list because it does multiple things # 1. It _finds_ the private key locations # 2. It tries to _read_ the private keys # This needs to happen in two loops because it has to happen one at # at a time (you can't have two processes running at the same time) # ..... (right now ;) facts = [] # Search for private keys in common locations proc = session.platform.Popen( "grep -l -I -D skip -rE '^-+BEGIN .* PRIVATE KEY-+$' /home /etc /opt 2>/dev/null | xargs stat -c '%u %n' 2>/dev/null", shell=True, text=True, stdout=pwncat.subprocess.PIPE, ) with proc.stdout as pipe: yield Status("searching for private keys") for line in pipe: line = line.strip().split(" ") uid, path = int(line[0]), " ".join(line[1:]) yield Status(f"found [cyan]{rich.markup.escape(path)}[/cyan]") facts.append(PrivateKey(self.name, path, uid, None, False)) # Ensure proc is cleaned up proc.wait() for fact in facts: try: yield Status(f"reading [cyan]{rich.markup.escape(fact.path)}[/cyan]") with session.platform.open(fact.path, "r") as filp: fact.content = filp.read().strip().replace("\r\n", "\n") try: # Try to import the key to test if it's valid and if there's # a passphrase on the key. An "incorrect checksum" ValueError # is raised if there's a key. Not sure what other errors may # be raised, to be honest... RSA.importKey(fact.content) except ValueError as exc: if "incorrect checksum" in str(exc).lower(): # There's a passphrase on this key fact.encrypted = True else: # Some other error happened, probably not a key continue yield fact except (PermissionError, FileNotFoundError): continue
2,251
0
27
5172445aab46af96b17068466590ef3c930c6060
2,462
py
Python
base/views/data.py
amitava-bhattacharyya/CeNDR
e5300b249c5cbce000637951bdbc8a802cf93ee3
[ "MIT" ]
null
null
null
base/views/data.py
amitava-bhattacharyya/CeNDR
e5300b249c5cbce000637951bdbc8a802cf93ee3
[ "MIT" ]
null
null
null
base/views/data.py
amitava-bhattacharyya/CeNDR
e5300b249c5cbce000637951bdbc8a802cf93ee3
[ "MIT" ]
null
null
null
import requests from flask import make_response from flask import render_template from flask import Blueprint from base.views.api.api_strain import get_isotypes, query_strains from base.constants import DATASET_RELEASE, RELEASES from base.models2 import strain_m from base.utils.gcloud import list_release_files from logzero import logger data_bp = Blueprint('data', __name__, template_folder='data') # # Data Page # @data_bp.route('/release/latest') @data_bp.route('/release/<string:selected_release>') @data_bp.route('/release/<string:selected_release>') def data(selected_release=DATASET_RELEASE): """ Default data page - lists available releases. """ title = "Releases" strain_listing = query_strains(release=selected_release) # Fetch variant data url = "https://storage.googleapis.com/elegansvariation.org/releases/{selected_release}/multiqc_bcftools_stats.json".format(selected_release=selected_release) vcf_summary = requests.get(url).json() release_summary = strain_m.release_summary(selected_release) try: phylo_url = list_release_files(f"releases/{DATASET_RELEASE}/popgen/trees/genome.pdf")[0] except IndexError: pass VARS = {'title': title, 'strain_listing': strain_listing, 'vcf_summary': vcf_summary, 'phylo_url': phylo_url, 'RELEASES': RELEASES, 'release_summary': release_summary, 'selected_release': selected_release, 'wormbase_genome_version': dict(RELEASES)[selected_release]} return render_template('data.html', **VARS) # # Download Script # @data_bp.route('/download/download_bams.sh') # # Browser # @data_bp.route('/browser/') @data_bp.route('/browser/<region>') @data_bp.route('/browser/<region>/<query>')
32.394737
161
0.69537
import requests from flask import make_response from flask import render_template from flask import Blueprint from base.views.api.api_strain import get_isotypes, query_strains from base.constants import DATASET_RELEASE, RELEASES from base.models2 import strain_m from base.utils.gcloud import list_release_files from logzero import logger data_bp = Blueprint('data', __name__, template_folder='data') # # Data Page # @data_bp.route('/release/latest') @data_bp.route('/release/<string:selected_release>') @data_bp.route('/release/<string:selected_release>') def data(selected_release=DATASET_RELEASE): """ Default data page - lists available releases. """ title = "Releases" strain_listing = query_strains(release=selected_release) # Fetch variant data url = "https://storage.googleapis.com/elegansvariation.org/releases/{selected_release}/multiqc_bcftools_stats.json".format(selected_release=selected_release) vcf_summary = requests.get(url).json() release_summary = strain_m.release_summary(selected_release) try: phylo_url = list_release_files(f"releases/{DATASET_RELEASE}/popgen/trees/genome.pdf")[0] except IndexError: pass VARS = {'title': title, 'strain_listing': strain_listing, 'vcf_summary': vcf_summary, 'phylo_url': phylo_url, 'RELEASES': RELEASES, 'release_summary': release_summary, 'selected_release': selected_release, 'wormbase_genome_version': dict(RELEASES)[selected_release]} return render_template('data.html', **VARS) # # Download Script # @data_bp.route('/download/download_bams.sh') def download_script(): strain_listing = query_strains(release=DATASET_RELEASE) download_page = render_template('download_script.sh', **locals()) response = make_response(download_page) response.headers["Content-Type"] = "text/plain" return response # # Browser # @data_bp.route('/browser/') @data_bp.route('/browser/<region>') @data_bp.route('/browser/<region>/<query>') def browser(region="III:11746923-11750250", query=None): VARS = {'title': "Variant Browser", 'DATASET_RELEASE': DATASET_RELEASE, 'isotype_listing': get_isotypes(list_only=True), 'region': region, 'query': query, 'fluid_container': True} return render_template('browser.html', **VARS)
577
0
44
cc23a331da631b7d85fe1eea4f49e5f810cdd495
678
py
Python
__init__.py
kant/qgis-earthengine-plugin
561dd98855c9c0dc3bd29a34fa07b60b63908c94
[ "MIT" ]
1
2020-05-27T15:01:53.000Z
2020-05-27T15:01:53.000Z
__init__.py
kevinmel2000/qgis-earthengine-plugin
65196d9b8462a161e7e7741c2bcf9cb8d9684a5f
[ "MIT" ]
null
null
null
__init__.py
kevinmel2000/qgis-earthengine-plugin
65196d9b8462a161e7e7741c2bcf9cb8d9684a5f
[ "MIT" ]
1
2020-05-27T15:02:11.000Z
2020-05-27T15:02:11.000Z
# -*- coding: utf-8 -*- import os import platform import site if platform.system() == "Windows": extlib_path = 'extlibs_windows' if platform.system() == "Darwin": extlib_path = 'extlibs_darwin' if platform.system() == "Linux": extlib_path = 'extlibs_linux' site.addsitedir(os.path.abspath(os.path.join(os.path.dirname(__file__), extlib_path))) # noinspection PyPep8Naming def classFactory(iface): # pylint: disable=invalid-name """Instantiates Google Earth Engine Plugin. :param iface: A QGIS interface instance. :type iface: QgsInterface """ # from .ee_plugin import GoogleEarthEnginePlugin return GoogleEarthEnginePlugin(iface)
24.214286
86
0.713864
# -*- coding: utf-8 -*- import os import platform import site if platform.system() == "Windows": extlib_path = 'extlibs_windows' if platform.system() == "Darwin": extlib_path = 'extlibs_darwin' if platform.system() == "Linux": extlib_path = 'extlibs_linux' site.addsitedir(os.path.abspath(os.path.join(os.path.dirname(__file__), extlib_path))) # noinspection PyPep8Naming def classFactory(iface): # pylint: disable=invalid-name """Instantiates Google Earth Engine Plugin. :param iface: A QGIS interface instance. :type iface: QgsInterface """ # from .ee_plugin import GoogleEarthEnginePlugin return GoogleEarthEnginePlugin(iface)
0
0
0
cf9adae50f4f81f3f9b305981e2e7f275ecf5aa9
6,109
py
Python
intro-guestshell/mission01/mission.py
cobeam/DevNetRepo
d824bb6ad7d21bcae03485b571e97fc2b6b61df9
[ "MIT" ]
90
2018-04-07T00:39:23.000Z
2020-06-09T02:44:02.000Z
intro-guestshell/mission01/mission.py
cobeam/DevNetRepo
d824bb6ad7d21bcae03485b571e97fc2b6b61df9
[ "MIT" ]
38
2018-04-06T18:11:36.000Z
2020-05-11T23:36:24.000Z
intro-guestshell/mission01/mission.py
cobeam/DevNetRepo
d824bb6ad7d21bcae03485b571e97fc2b6b61df9
[ "MIT" ]
143
2018-04-20T00:17:24.000Z
2020-06-12T15:07:42.000Z
#!/usr/bin/env python """Sends configuration difference to Webex Teams, formerly Spark. Compares the current running configuration and the saved running configuration, creates diff and sends it to a Webex Teams room. Should be invoked after every configuration change by EEM. Copyright (c) 2018 Cisco and/or its affiliates. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import os import re from cli import cli, clip from ciscosparkapi import CiscoSparkAPI BACKUP_CONFIG_IOS_PATH = 'flash:/running-config.bak' def send_syslog(message): """Sends a syslog message to the device with severity 6 Args: message (str): message to be sent Returns: None """ cli( 'send log facility PYTHON severity 6 mnemonics CONF_DIFF ' '{message}'.format(message=message) ) def convert_ios_path_to_linux(path): """Convert the file path valid in IOS to the correct path in Guest Shell. Example: >>> convert_ios_path_to_linux('flash:/running-config.bak') '/flash/running-config.bak' Args: path(str): the path valid in IOS. Should contain filesystem, otherwise 'flash' is assumed Returns: string, the converted path which is valid in the Guest Shell """ path_components = os.path.normpath(path).split(os.sep) file_system = path_components[0] if ':' in file_system: file_system = file_system.strip(':') path_components = path_components[1:] else: file_system = 'flash' result_path = os.path.join(os.sep, file_system, *path_components) return result_path def save_config_to_ios_file(backup_config_ios_path): """Saves the current running configuration locally to the filesystem Args: backup_config_ios_path (str): IOS path to the backup configuration Returns: None """ # MISSION TODO 3: replace with the function that runs IOS commands and # returns output instead of printing it MISSION('copy running-config {}\n'.format(backup_config_ios_path)) # END MISSION SECTION 3 message = ( 'Running configuration was saved to {}'.format(backup_config_ios_path) ) print(message) send_syslog(message) def get_config_diff(backup_config_ios_path): """Gets configuration difference using `show archive config diff` command Args: backup_config_ios_path (str): IOS path to the backup configuration Returns: list of lines containing config difference """ config_diff = cli( 'show archive config diff {} system:running-config'.format( backup_config_ios_path ) ) backup_config_linux_path = convert_ios_path_to_linux( backup_config_ios_path ) os.remove(backup_config_linux_path) save_config_to_ios_file(backup_config_ios_path) if re.search('No changes were found', config_diff): return None else: # split lines by \r\n into a list config_diff_lines = re.split(r'\r?\n', config_diff) return config_diff_lines def form_spark_message(config_diff_lines): """Creates a Spark message formatted in markdown based on config diff Args: config_diff_lines (list): list of lines containing config difference Returns: str: markdown Spark message as a string """ message = ( 'Configuration differences between ' 'the running config and the last backup:\n' '```\n' '{}\n' '```\n' 'I\'ve completed **Introduction to ' 'Guest Shell** Mission!'.format('\n'.join(config_diff_lines)) ) return message if __name__ == '__main__': main()
31.328205
78
0.688001
#!/usr/bin/env python """Sends configuration difference to Webex Teams, formerly Spark. Compares the current running configuration and the saved running configuration, creates diff and sends it to a Webex Teams room. Should be invoked after every configuration change by EEM. Copyright (c) 2018 Cisco and/or its affiliates. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import os import re from cli import cli, clip from ciscosparkapi import CiscoSparkAPI BACKUP_CONFIG_IOS_PATH = 'flash:/running-config.bak' def send_syslog(message): """Sends a syslog message to the device with severity 6 Args: message (str): message to be sent Returns: None """ cli( 'send log facility PYTHON severity 6 mnemonics CONF_DIFF ' '{message}'.format(message=message) ) def convert_ios_path_to_linux(path): """Convert the file path valid in IOS to the correct path in Guest Shell. Example: >>> convert_ios_path_to_linux('flash:/running-config.bak') '/flash/running-config.bak' Args: path(str): the path valid in IOS. Should contain filesystem, otherwise 'flash' is assumed Returns: string, the converted path which is valid in the Guest Shell """ path_components = os.path.normpath(path).split(os.sep) file_system = path_components[0] if ':' in file_system: file_system = file_system.strip(':') path_components = path_components[1:] else: file_system = 'flash' result_path = os.path.join(os.sep, file_system, *path_components) return result_path def save_config_to_ios_file(backup_config_ios_path): """Saves the current running configuration locally to the filesystem Args: backup_config_ios_path (str): IOS path to the backup configuration Returns: None """ # MISSION TODO 3: replace with the function that runs IOS commands and # returns output instead of printing it MISSION('copy running-config {}\n'.format(backup_config_ios_path)) # END MISSION SECTION 3 message = ( 'Running configuration was saved to {}'.format(backup_config_ios_path) ) print(message) send_syslog(message) def get_config_diff(backup_config_ios_path): """Gets configuration difference using `show archive config diff` command Args: backup_config_ios_path (str): IOS path to the backup configuration Returns: list of lines containing config difference """ config_diff = cli( 'show archive config diff {} system:running-config'.format( backup_config_ios_path ) ) backup_config_linux_path = convert_ios_path_to_linux( backup_config_ios_path ) os.remove(backup_config_linux_path) save_config_to_ios_file(backup_config_ios_path) if re.search('No changes were found', config_diff): return None else: # split lines by \r\n into a list config_diff_lines = re.split(r'\r?\n', config_diff) return config_diff_lines def form_spark_message(config_diff_lines): """Creates a Spark message formatted in markdown based on config diff Args: config_diff_lines (list): list of lines containing config difference Returns: str: markdown Spark message as a string """ message = ( 'Configuration differences between ' 'the running config and the last backup:\n' '```\n' '{}\n' '```\n' 'I\'ve completed **Introduction to ' 'Guest Shell** Mission!'.format('\n'.join(config_diff_lines)) ) return message def main(): spark_api = CiscoSparkAPI() # MISSION TODO 4: use the function that converts IOS path to # linux, which is defined in this file backup_config_linux_path = MISSION( BACKUP_CONFIG_IOS_PATH ) # END MISSION SECTION 4 # MISSION TODO 5: check if the running config backup # under the linux path exists in the filesystem if not os.path.isfile(MISSION): # END MISSION SECTION 5 # if not, save it and exit save_config_to_ios_file(BACKUP_CONFIG_IOS_PATH) message = 'Running-config file is saved for the first time, exiting.' print(message) send_syslog(message) # not running for the first time else: # MISSION TODO 6: use the function that gets configuration difference # between the current configuration and saved config_diff_lines = MISSION(BACKUP_CONFIG_IOS_PATH) # END MISSION SECTION 6 if config_diff_lines is not None: print('Changes have been found') message = form_spark_message(config_diff_lines) spark_api.messages.create( roomId=os.environ.get('SPARK_ROOM_ID'), markdown=message, ) message = 'Spark message has been sent' print(message) send_syslog(message) else: message = 'No configuration changes have been found.' send_syslog(message) if __name__ == '__main__': main()
1,422
0
23
01380fb380b4f05e69966a565e3fd073e54d18c3
2,061
py
Python
tests/utils.py
Ouranosinc/intake-esm
c39ba18acfb35e7fad1dcf5c0c9807b50800a1c0
[ "Apache-2.0" ]
20
2019-03-03T22:05:19.000Z
2020-04-20T23:47:13.000Z
tests/utils.py
Ouranosinc/intake-esm
c39ba18acfb35e7fad1dcf5c0c9807b50800a1c0
[ "Apache-2.0" ]
145
2019-02-15T04:07:49.000Z
2020-06-25T19:03:18.000Z
tests/utils.py
Ouranosinc/intake-esm
c39ba18acfb35e7fad1dcf5c0c9807b50800a1c0
[ "Apache-2.0" ]
18
2019-03-10T15:25:59.000Z
2020-06-08T09:56:03.000Z
import os import pandas as pd here = os.path.abspath(os.path.dirname(__file__)) zarr_cat_pangeo_cmip6 = 'https://storage.googleapis.com/cmip6/pangeo-cmip6.json' cdf_cat_sample_cmip6 = os.path.join(here, 'sample-catalogs/cmip6-netcdf.json') multi_variable_cat = os.path.join(here, 'sample-catalogs/multi-variable-catalog.json') cdf_cat_sample_cmip5 = os.path.join(here, 'sample-catalogs/cmip5-netcdf.json') cdf_cat_sample_cesmle = os.path.join(here, 'sample-catalogs/cesm1-lens-netcdf.json') catalog_dict_records = os.path.join(here, 'sample-catalogs/catalog-dict-records.json') zarr_cat_aws_cesm = ( 'https://raw.githubusercontent.com/NCAR/cesm-lens-aws/master/intake-catalogs/aws-cesm1-le.json' ) mixed_cat_sample_cmip6 = os.path.join(here, 'sample-catalogs/cmip6-bcc-mixed-formats.json') sample_df = pd.DataFrame( [ { 'component': 'atm', 'frequency': 'daily', 'experiment': '20C', 'variable': 'FLNS', 'path': 's3://ncar-cesm-lens/atm/daily/cesmLE-20C-FLNS.zarr', 'format': 'zarr', }, { 'component': 'atm', 'frequency': 'daily', 'experiment': '20C', 'variable': 'FLNSC', 'path': 's3://ncar-cesm-lens/atm/daily/cesmLE-20C-FLNSC.zarr', 'format': 'zarr', }, ] ) sample_esmcat_data = { 'esmcat_version': '0.1.0', 'id': 'aws-cesm1-le', 'description': '', 'catalog_file': '', 'attributes': [], 'assets': {'column_name': 'path', 'format': 'zarr'}, 'aggregation_control': { 'variable_column_name': 'variable', 'groupby_attrs': ['component', 'experiment', 'frequency'], 'aggregations': [ {'type': 'union', 'attribute_name': 'variable', 'options': {'compat': 'override'}} ], }, } sample_esmcat_data_without_agg = { 'esmcat_version': '0.1.0', 'id': 'aws-cesm1-le', 'description': '', 'catalog_file': '', 'attributes': [], 'assets': {'column_name': 'path', 'format': 'zarr'}, }
32.714286
99
0.604561
import os import pandas as pd here = os.path.abspath(os.path.dirname(__file__)) zarr_cat_pangeo_cmip6 = 'https://storage.googleapis.com/cmip6/pangeo-cmip6.json' cdf_cat_sample_cmip6 = os.path.join(here, 'sample-catalogs/cmip6-netcdf.json') multi_variable_cat = os.path.join(here, 'sample-catalogs/multi-variable-catalog.json') cdf_cat_sample_cmip5 = os.path.join(here, 'sample-catalogs/cmip5-netcdf.json') cdf_cat_sample_cesmle = os.path.join(here, 'sample-catalogs/cesm1-lens-netcdf.json') catalog_dict_records = os.path.join(here, 'sample-catalogs/catalog-dict-records.json') zarr_cat_aws_cesm = ( 'https://raw.githubusercontent.com/NCAR/cesm-lens-aws/master/intake-catalogs/aws-cesm1-le.json' ) mixed_cat_sample_cmip6 = os.path.join(here, 'sample-catalogs/cmip6-bcc-mixed-formats.json') sample_df = pd.DataFrame( [ { 'component': 'atm', 'frequency': 'daily', 'experiment': '20C', 'variable': 'FLNS', 'path': 's3://ncar-cesm-lens/atm/daily/cesmLE-20C-FLNS.zarr', 'format': 'zarr', }, { 'component': 'atm', 'frequency': 'daily', 'experiment': '20C', 'variable': 'FLNSC', 'path': 's3://ncar-cesm-lens/atm/daily/cesmLE-20C-FLNSC.zarr', 'format': 'zarr', }, ] ) sample_esmcat_data = { 'esmcat_version': '0.1.0', 'id': 'aws-cesm1-le', 'description': '', 'catalog_file': '', 'attributes': [], 'assets': {'column_name': 'path', 'format': 'zarr'}, 'aggregation_control': { 'variable_column_name': 'variable', 'groupby_attrs': ['component', 'experiment', 'frequency'], 'aggregations': [ {'type': 'union', 'attribute_name': 'variable', 'options': {'compat': 'override'}} ], }, } sample_esmcat_data_without_agg = { 'esmcat_version': '0.1.0', 'id': 'aws-cesm1-le', 'description': '', 'catalog_file': '', 'attributes': [], 'assets': {'column_name': 'path', 'format': 'zarr'}, }
0
0
0
9c8d73a16d474beccfcd4957adb9d6ffb14b93ca
4,388
py
Python
segment trees/Tree33_update(add lr)_query(weighted sum)_v2.py
DreamShaded/flykiller.github.io
37b7abc44544613f56ec994452ddd8d2a4ac8df2
[ "MIT" ]
5
2021-08-10T18:07:39.000Z
2022-03-26T08:16:24.000Z
segment trees/Tree33_update(add lr)_query(weighted sum)_v2.py
DreamShaded/flykiller.github.io
37b7abc44544613f56ec994452ddd8d2a4ac8df2
[ "MIT" ]
null
null
null
segment trees/Tree33_update(add lr)_query(weighted sum)_v2.py
DreamShaded/flykiller.github.io
37b7abc44544613f56ec994452ddd8d2a4ac8df2
[ "MIT" ]
2
2021-03-31T18:14:06.000Z
2021-08-23T04:15:30.000Z
# we can use Segment Tree 24 and Segment Tree 31 and combine them. if __name__ == '__main__': n, m = [int(i) for i in input().split()] STree1 = SegmentTree1(n) STree2 = SegmentTree2(n, lambda a, b, x: a + b*x, lambda a, b: a+b, 0) arr = [int(i) for i in input().split()] for i in range(n): STree1.update(i, i+1, arr[i]*(i+1), 0) # not optimal way STree2.update(i, i+1, arr[i]) print(STree1.T) print(STree2.T) for i in range(m): t = [int(i) for i in input().split()] if t[0] == 1: STree1.update(t[1] - 1, t[2], t[3]*t[1], t[3]) STree2.update(t[1] - 1, t[2], t[3]) #print(STree1.T) #print(STree2.T) else: m1 = STree1.query(t[1] - 1, t[2]) m2 = STree2.query(t[1] - 1, t[2]) print(m1 - m2*(t[1]-1)) #print(m1, m2)
34.551181
103
0.459435
# we can use Segment Tree 24 and Segment Tree 31 and combine them. class SegmentTree1: # add arithmetic progressions def __init__(self, n): self.size = 1 while self.size < n: self.size *= 2 self.NO_OPERATION = (0, 0) # it should be neutral with respect to op_modify self.ZERO = 0 self.T = [0] * (2 * self.size - 1) self.L = [self.NO_OPERATION] * (2 * self.size - 1) def op_sum(self, a, b): return a + b def propagate(self, x, lx, rx): if self.L[x] == self.NO_OPERATION or rx - lx == 1: return mx = (lx + rx)//2 a, d = self.L[x] a1, d1 = self.L[2 * x + 1] a2, d2 = self.L[2 * x + 2] self.L[2 * x + 1] = a + a1, d + d1 self.L[2 * x + 2] = a + d * (mx - lx) + a2, d + d2 self.T[2 * x + 1] += (2 * a + d*(mx - lx - 1)) * (mx - lx)//2 self.T[2 * x + 2] += (2 * a + d*(mx + rx - 2*lx - 1)) * (rx - mx)//2 self.L[x] = self.NO_OPERATION def _update(self, l, r, a, d, x, lx, rx): self.propagate(x, lx, rx) if l >= rx or lx >= r: return if lx >= l and rx <= r: # print("!!!!", lx, rx, l, r) a1, d1 = self.L[x] a2, d2 = a + (lx - l) * d, d self.L[x] = a1 + a2, d1 + d2 self.T[x] += (2 * a2 + d2 * (rx - lx - 1)) * (rx - lx)//2 return mx = (lx + rx)//2 self._update(l, r, a, d, 2*x+1, lx, mx) self._update(l, r, a, d, 2*x+2, mx, rx) self.T[x] = self.op_sum(self.T[2*x+1], self.T[2*x+2]) def update(self, l, r, a, d): return self._update(l, r, a, d, 0, 0, self.size) def _query(self, l, r, x, lx, rx): self.propagate(x, lx, rx) if l >= rx or lx >= r: return self.ZERO if lx >= l and rx <= r: return self.T[x] mx = (lx + rx) // 2 m1 = self._query(l, r, 2 * x + 1, lx, mx) m2 = self._query(l, r, 2 * x + 2, mx, rx) return self.op_sum(m1, m2) def query(self, l, r): return self._query(l, r, 0, 0, self.size) class SegmentTree2: # add to range, find sum on range def __init__(self, n, op_modify, op_sum, ZERO): self.size = 1 while self.size < n: self.size *= 2 self.T = [0] * (2 * self.size - 1) # to multiply self.L = [0] * (2 * self.size - 1) # current sum self.op_modify = op_modify self.op_sum = op_sum self.ZERO = ZERO def _update(self, l, r, v, x, lx, rx): if l >= rx or lx >= r: return if lx >= l and rx <= r: self.L[x] = self.op_modify(self.L[x], v, 1) # why 1? self.T[x] = self.op_modify(self.T[x], v, rx - lx) return mx = (lx + rx)//2 self._update(l, r, v, 2*x+1, lx, mx) self._update(l, r, v, 2*x+2, mx, rx) self.T[x] = self.op_modify(self.op_sum(self.T[2*x+1], self.T[2*x+2]), self.L[x], rx - lx) def update(self, l, r, v): return self._update(l, r, v, 0, 0, self.size) def _query(self, l, r, x, lx, rx): if l >= rx or lx >= r: return self.ZERO if lx >= l and rx <= r: return self.T[x] mx = (lx + rx) // 2 m1 = self._query(l, r, 2 * x + 1, lx, mx) m2 = self._query(l, r, 2 * x + 2, mx, rx) return self.op_modify(self.op_sum(m1, m2), self.L[x], min(rx, r) - max(lx, l)) # careful here! def query(self, l, r): return self._query(l, r, 0, 0, self.size) if __name__ == '__main__': n, m = [int(i) for i in input().split()] STree1 = SegmentTree1(n) STree2 = SegmentTree2(n, lambda a, b, x: a + b*x, lambda a, b: a+b, 0) arr = [int(i) for i in input().split()] for i in range(n): STree1.update(i, i+1, arr[i]*(i+1), 0) # not optimal way STree2.update(i, i+1, arr[i]) print(STree1.T) print(STree2.T) for i in range(m): t = [int(i) for i in input().split()] if t[0] == 1: STree1.update(t[1] - 1, t[2], t[3]*t[1], t[3]) STree2.update(t[1] - 1, t[2], t[3]) #print(STree1.T) #print(STree2.T) else: m1 = STree1.query(t[1] - 1, t[2]) m2 = STree2.query(t[1] - 1, t[2]) print(m1 - m2*(t[1]-1)) #print(m1, m2)
3,072
65
368
b76e4afd6eed35fdb3ca6b28fb4c67bf8d83a2ae
129,561
py
Python
Workspace/validate_be_tryp/etc/ligand_dict.py
alexjli/addcov19
839b6a5fdb117d6dbfedd3e2a2aaf722a722f7c8
[ "MIT" ]
1
2020-04-25T01:33:40.000Z
2020-04-25T01:33:40.000Z
validate_be_tryp/etc/ligand_dict.py
alexjli/addcov19
839b6a5fdb117d6dbfedd3e2a2aaf722a722f7c8
[ "MIT" ]
null
null
null
validate_be_tryp/etc/ligand_dict.py
alexjli/addcov19
839b6a5fdb117d6dbfedd3e2a2aaf722a722f7c8
[ "MIT" ]
null
null
null
summary = d = {} d['lig0'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig10'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig11'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig12'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig13'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig14'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig15'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig16'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig17'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig18'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig19'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig1'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig20'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig21'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig22'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig23'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig24'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig25'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig26'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig27'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig28'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig29'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig2'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig30'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig31'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig32'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig33'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig34'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig35'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig36'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig37'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig38'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig39'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig3'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig40'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig41'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig42'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig43'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig44'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig45'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig46'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig0'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig10'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig11'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig12'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig13'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig14'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig15'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig16'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig17'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig18'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig19'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig1'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig20'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig21'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig22'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig23'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig24'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig25'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig26'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig27'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig28'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig29'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig2'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig30'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig31'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig32'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig33'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig34'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig35'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig36'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig37'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig38'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig39'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig3'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig40'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig41'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig42'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig43'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig44'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig45'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig46'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig47'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig48'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig49'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig4'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig5'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig6'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig7'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig8'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig9'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig0'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig100'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig101'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig102'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig103'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig104'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig105'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig106'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig107'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig108'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig109'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig10'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig110'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig111'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig112'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig113'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig114'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig115'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig116'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig117'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig118'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig119'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig11'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig120'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig121'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig122'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig123'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig124'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig125'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig126'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig127'] = {'atom_types': ['A', 'Br', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig128'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig129'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':6, 'zero_charge' : [], } d['lig12'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig130'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig131'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig132'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig133'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig134'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig135'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig136'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig137'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig138'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig139'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig13'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig140'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig141'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig142'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig143'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig144'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig145'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig146'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig147'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig148'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig149'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig14'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig150'] = {'atom_types': ['A', 'C', 'N', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig151'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig152'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':2, 'zero_charge' : [], } d['lig153'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig154'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig155'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig156'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig157'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig158'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig159'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig15'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig160'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig161'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig162'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig163'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig164'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig165'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig166'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig167'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig168'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig169'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig16'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig170'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig171'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig172'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig173'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig174'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig175'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig176'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig177'] = {'atom_types': ['A', 'Br', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig178'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig179'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig17'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig180'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig181'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig182'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig183'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig184'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig185'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig186'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig187'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig188'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig189'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig18'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig190'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig191'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig192'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig193'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig194'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig195'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig196'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig197'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig198'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig199'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig19'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig1'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig200'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig201'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig202'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig203'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig204'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig205'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig206'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig207'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig208'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig209'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig20'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig210'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig211'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig212'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':6, 'zero_charge' : [], } d['lig213'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':7, 'zero_charge' : [], } d['lig214'] = {'atom_types': ['A', 'C', 'NA', 'OA', 'S' ], 'rbonds':6, 'zero_charge' : [], } d['lig215'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig216'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig217'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig218'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig219'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig21'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig220'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig221'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig222'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig223'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig224'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig225'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig226'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig227'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig228'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig229'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig22'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig230'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig231'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig232'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':6, 'zero_charge' : [], } d['lig233'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig234'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig235'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig236'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig237'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig238'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig239'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig23'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig240'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig241'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig242'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig243'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig244'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig245'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig246'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig247'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig248'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig249'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig24'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig250'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig251'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig252'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig253'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig254'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig255'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig256'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig257'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig258'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig259'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig25'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N' ], 'rbonds':2, 'zero_charge' : [], } d['lig260'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig261'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig262'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig263'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig264'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig265'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig266'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig267'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig268'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig269'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig26'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig270'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig271'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig272'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig273'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig274'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig275'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig276'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig277'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig278'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig279'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig27'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig280'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig281'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig282'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig283'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig284'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig285'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig286'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig287'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig288'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig289'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':6, 'zero_charge' : [], } d['lig28'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig290'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig291'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig292'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig293'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig294'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig295'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig296'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig297'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig298'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig299'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig29'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig2'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig300'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig301'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig302'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig303'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig304'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig305'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig306'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig307'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig308'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N' ], 'rbonds':2, 'zero_charge' : [], } d['lig309'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig30'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig310'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig311'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig312'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig313'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig314'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig315'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig316'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig317'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig318'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig319'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig31'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig320'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig321'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig322'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig323'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig324'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig325'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig326'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig327'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig328'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig329'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig32'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig330'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig331'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig332'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig333'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig334'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA', 'S' ], 'rbonds':4, 'zero_charge' : [], } d['lig335'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig336'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig337'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig338'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig339'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig33'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig340'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig341'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig342'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig343'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'S' ], 'rbonds':4, 'zero_charge' : [], } d['lig344'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig345'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig346'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N' ], 'rbonds':4, 'zero_charge' : [], } d['lig347'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig348'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig349'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig34'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig350'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig351'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig352'] = {'atom_types': ['A', 'C', 'HD', 'NA', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig353'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig354'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig355'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig356'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig357'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig358'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig359'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig35'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig360'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig361'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig362'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig363'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig364'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig365'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig366'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig367'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig368'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig369'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig36'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig370'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig371'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig372'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig373'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig374'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig375'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig376'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig377'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig378'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig379'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig37'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig380'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig381'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig382'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig383'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig384'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig385'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig386'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig387'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig388'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig389'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig38'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig390'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig391'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig392'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig393'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig394'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig395'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig396'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig397'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig398'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig399'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig39'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig3'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig400'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig401'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig402'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig403'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig404'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig405'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig406'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig407'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig408'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig409'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig40'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig410'] = {'atom_types': ['A', 'Br', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig411'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig412'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':6, 'zero_charge' : [], } d['lig413'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig414'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig415'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig416'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig417'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig418'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig419'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig41'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig420'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig421'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig422'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig423'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig424'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig425'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig426'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig427'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig428'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig429'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig42'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig430'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig431'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig432'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig433'] = {'atom_types': ['A', 'C', 'N', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig434'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig435'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':2, 'zero_charge' : [], } d['lig436'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig437'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig438'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig439'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig43'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig440'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig441'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig442'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig443'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig444'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig445'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig446'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig447'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig448'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig449'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig44'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig450'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig451'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig452'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig453'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig454'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig455'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig456'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig457'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig458'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig459'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig45'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig460'] = {'atom_types': ['A', 'Br', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig461'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig462'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig463'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig464'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig465'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig466'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig467'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig468'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig469'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig46'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig470'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig471'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig472'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig473'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig474'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig475'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig476'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig477'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig478'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig479'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig47'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig480'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig481'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig482'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig483'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig484'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig485'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig486'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig487'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig488'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig489'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig48'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig490'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig491'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig492'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig493'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig494'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig495'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':6, 'zero_charge' : [], } d['lig496'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':7, 'zero_charge' : [], } d['lig497'] = {'atom_types': ['A', 'C', 'NA', 'OA', 'S' ], 'rbonds':6, 'zero_charge' : [], } d['lig498'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig499'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig49'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig4'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig500'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig501'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig502'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig503'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig504'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig505'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig506'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig507'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig508'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig509'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig50'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig510'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig511'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig512'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig513'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig514'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig515'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':6, 'zero_charge' : [], } d['lig516'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig517'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig518'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig519'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig51'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA', 'S' ], 'rbonds':4, 'zero_charge' : [], } d['lig520'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig521'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig522'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig523'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig524'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig525'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig526'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig527'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig528'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig529'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig52'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig530'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig531'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig532'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig533'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig534'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig535'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig536'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig537'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig538'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig539'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig53'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig540'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig541'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig542'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig543'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig544'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig545'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig546'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig547'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig548'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig549'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig54'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig550'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig551'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig552'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig553'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig554'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig555'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig556'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig557'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig558'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig559'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig55'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig560'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig561'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig562'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig563'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig564'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig565'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig566'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig567'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig568'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig569'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig56'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig570'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig571'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig572'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':6, 'zero_charge' : [], } d['lig573'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig574'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig575'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig576'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig577'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig578'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig579'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig57'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig580'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig581'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig582'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig583'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig584'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig585'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig586'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig587'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig588'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig589'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig58'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig590'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig591'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N' ], 'rbonds':2, 'zero_charge' : [], } d['lig592'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig593'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig594'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig595'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig596'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig597'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig598'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig599'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig59'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig5'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig600'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig601'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig602'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig603'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig604'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig605'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig606'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig607'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig608'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig609'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig60'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'S' ], 'rbonds':4, 'zero_charge' : [], } d['lig610'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig611'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig612'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig613'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig614'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig615'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig616'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig617'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA', 'S' ], 'rbonds':4, 'zero_charge' : [], } d['lig618'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig619'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig61'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig620'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig621'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig622'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig623'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig624'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig625'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig626'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'S' ], 'rbonds':4, 'zero_charge' : [], } d['lig627'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig628'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig629'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N' ], 'rbonds':4, 'zero_charge' : [], } d['lig62'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig630'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig631'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig632'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig633'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig634'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig635'] = {'atom_types': ['A', 'C', 'HD', 'NA', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig636'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig637'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig638'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig639'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig63'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N' ], 'rbonds':4, 'zero_charge' : [], } d['lig640'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig641'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig642'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig643'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig644'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig645'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig646'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig647'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig648'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig649'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig64'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig650'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig651'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig652'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig653'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig654'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig655'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig656'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig657'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig658'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig659'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig65'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig660'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig661'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig662'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig663'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig664'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig665'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig666'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig667'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig668'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig669'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig66'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig670'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig671'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig672'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig673'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig674'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig675'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig676'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig677'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig678'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig679'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig67'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig680'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig681'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig682'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig683'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig684'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig685'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig686'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig687'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig688'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig689'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig68'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig690'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig691'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig692'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig693'] = {'atom_types': ['A', 'Br', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig694'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig695'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':6, 'zero_charge' : [], } d['lig696'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig697'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig698'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig699'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig69'] = {'atom_types': ['A', 'C', 'HD', 'NA', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig6'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':6, 'zero_charge' : [], } d['lig700'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig701'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig702'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig703'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig704'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig705'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig706'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig707'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig708'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig709'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig70'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig710'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig711'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig712'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig713'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig714'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig715'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig716'] = {'atom_types': ['A', 'C', 'N', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig717'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig718'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':2, 'zero_charge' : [], } d['lig719'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig71'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig720'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig721'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig722'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig723'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig724'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig725'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig726'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig727'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig728'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig729'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig72'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig730'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig731'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig732'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig733'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig734'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig735'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig736'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig737'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig738'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig739'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig73'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig740'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig741'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig742'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig743'] = {'atom_types': ['A', 'Br', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig744'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig745'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig746'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig747'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig748'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig749'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig74'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig750'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig751'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig752'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig753'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig754'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig755'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig756'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig757'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig758'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig759'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig75'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig760'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig761'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig762'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig763'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig764'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig765'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig766'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig767'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig768'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig769'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig76'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig770'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig771'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig772'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig773'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig774'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig775'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig776'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig777'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig778'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':6, 'zero_charge' : [], } d['lig779'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':7, 'zero_charge' : [], } d['lig77'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig780'] = {'atom_types': ['A', 'C', 'NA', 'OA', 'S' ], 'rbonds':6, 'zero_charge' : [], } d['lig781'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig782'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig783'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig784'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig785'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig786'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig787'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig788'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig789'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig78'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig790'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig791'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig792'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig793'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig794'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig795'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig796'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig797'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig798'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':6, 'zero_charge' : [], } d['lig799'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig79'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig7'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig800'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig801'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig802'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig803'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig804'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig805'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig806'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig807'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig808'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig809'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig80'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig810'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig811'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig812'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig813'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig814'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig815'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig816'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig817'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig818'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig819'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig81'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig820'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig821'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig822'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig823'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig824'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig825'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig826'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig827'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig828'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig829'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig82'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig830'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig831'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig832'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig833'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig834'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig835'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig836'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig837'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig838'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig839'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig83'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig840'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig841'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig842'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig843'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig844'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig845'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig846'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig847'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig848'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig84'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig85'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig86'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig87'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig88'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig89'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig8'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig90'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig91'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig92'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig93'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig94'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig95'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig96'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig97'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig98'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig99'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig9'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig0'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig100'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig101'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig102'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig103'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig104'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig105'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig106'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig107'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig108'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig109'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig10'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig110'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig111'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig112'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig113'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig114'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig115'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig116'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig117'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig118'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig119'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig11'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig120'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig121'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig122'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig123'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig124'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig125'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig126'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig127'] = {'atom_types': ['A', 'Br', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig128'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig129'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':6, 'zero_charge' : [], } d['lig12'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig130'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig131'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig132'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig133'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig134'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig135'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig136'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig137'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig138'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig139'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig13'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig140'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig141'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig142'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig143'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig144'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig145'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig146'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig147'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig148'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig149'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig14'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig150'] = {'atom_types': ['A', 'C', 'N', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig151'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig152'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':2, 'zero_charge' : [], } d['lig153'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig154'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig155'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig156'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig157'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig158'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig159'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig15'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig160'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig161'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig162'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig163'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig164'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig165'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig166'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig167'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig168'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig169'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig16'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig170'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig171'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig172'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig173'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig174'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig175'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig176'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig177'] = {'atom_types': ['A', 'Br', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig178'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig179'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig17'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig180'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig181'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig182'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig183'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig184'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig185'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig186'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig187'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig188'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig189'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig18'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig190'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig191'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig192'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig193'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig194'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig195'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig196'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig197'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig198'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig199'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig19'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig1'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig200'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig201'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig202'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig203'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig204'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig205'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig206'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig207'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig208'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig209'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig20'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig210'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig211'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig212'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':6, 'zero_charge' : [], } d['lig213'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':7, 'zero_charge' : [], } d['lig214'] = {'atom_types': ['A', 'C', 'NA', 'OA', 'S' ], 'rbonds':6, 'zero_charge' : [], } d['lig215'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig216'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig217'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig218'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig219'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig21'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig220'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig221'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig222'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig223'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig224'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig225'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig226'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig227'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig228'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig229'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig22'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig230'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig231'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig232'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':6, 'zero_charge' : [], } d['lig233'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig234'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig235'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig236'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig237'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig238'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig239'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig23'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig240'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig241'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig242'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig243'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig244'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig245'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig246'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig247'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig248'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig249'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig24'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig250'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig251'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig252'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig253'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig254'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig255'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig256'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig257'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig258'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig259'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig25'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N' ], 'rbonds':2, 'zero_charge' : [], } d['lig260'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig261'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig262'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig263'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig264'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig265'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig266'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig267'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig268'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig269'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig26'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig270'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig271'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig272'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig273'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig274'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig275'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig276'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig277'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig278'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig279'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig27'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig280'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig281'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig282'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig28'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig29'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig2'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig30'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig31'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig32'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig33'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig34'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig35'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig36'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig37'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig38'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig39'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig3'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig40'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig41'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig42'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig43'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig44'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig45'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig46'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig47'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig48'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig49'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig4'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig50'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig51'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA', 'S' ], 'rbonds':4, 'zero_charge' : [], } d['lig52'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig53'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig54'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig55'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig56'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig57'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig58'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig59'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig5'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig60'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'S' ], 'rbonds':4, 'zero_charge' : [], } d['lig61'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig62'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig63'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N' ], 'rbonds':4, 'zero_charge' : [], } d['lig64'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig65'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig66'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig67'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig68'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig69'] = {'atom_types': ['A', 'C', 'HD', 'NA', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig6'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':6, 'zero_charge' : [], } d['lig70'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig71'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig72'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig73'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig74'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig75'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig76'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig77'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig78'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig79'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig7'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig80'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig81'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig82'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig83'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig84'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig85'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig86'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig87'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig88'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig89'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig8'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig90'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig91'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig92'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig93'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig94'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig95'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig96'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig97'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig98'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig99'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig9'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], }
26.473437
75
0.404782
summary = d = {} d['lig0'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig10'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig11'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig12'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig13'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig14'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig15'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig16'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig17'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig18'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig19'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig1'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig20'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig21'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig22'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig23'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig24'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig25'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig26'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig27'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig28'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig29'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig2'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig30'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig31'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig32'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig33'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig34'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig35'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig36'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig37'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig38'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig39'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig3'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig40'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig41'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig42'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig43'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig44'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig45'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig46'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig0'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig10'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig11'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig12'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig13'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig14'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig15'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig16'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig17'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig18'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig19'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig1'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig20'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig21'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig22'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig23'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig24'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig25'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig26'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig27'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig28'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig29'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig2'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig30'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig31'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig32'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig33'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig34'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig35'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig36'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig37'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig38'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig39'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig3'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig40'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig41'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig42'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig43'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig44'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig45'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig46'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig47'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig48'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig49'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig4'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig5'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig6'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig7'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig8'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig9'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig0'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig100'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig101'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig102'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig103'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig104'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig105'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig106'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig107'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig108'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig109'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig10'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig110'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig111'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig112'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig113'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig114'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig115'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig116'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig117'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig118'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig119'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig11'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig120'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig121'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig122'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig123'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig124'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig125'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig126'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig127'] = {'atom_types': ['A', 'Br', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig128'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig129'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':6, 'zero_charge' : [], } d['lig12'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig130'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig131'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig132'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig133'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig134'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig135'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig136'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig137'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig138'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig139'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig13'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig140'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig141'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig142'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig143'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig144'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig145'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig146'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig147'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig148'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig149'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig14'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig150'] = {'atom_types': ['A', 'C', 'N', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig151'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig152'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':2, 'zero_charge' : [], } d['lig153'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig154'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig155'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig156'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig157'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig158'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig159'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig15'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig160'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig161'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig162'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig163'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig164'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig165'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig166'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig167'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig168'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig169'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig16'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig170'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig171'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig172'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig173'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig174'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig175'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig176'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig177'] = {'atom_types': ['A', 'Br', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig178'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig179'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig17'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig180'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig181'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig182'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig183'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig184'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig185'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig186'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig187'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig188'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig189'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig18'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig190'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig191'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig192'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig193'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig194'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig195'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig196'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig197'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig198'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig199'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig19'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig1'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig200'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig201'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig202'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig203'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig204'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig205'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig206'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig207'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig208'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig209'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig20'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig210'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig211'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig212'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':6, 'zero_charge' : [], } d['lig213'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':7, 'zero_charge' : [], } d['lig214'] = {'atom_types': ['A', 'C', 'NA', 'OA', 'S' ], 'rbonds':6, 'zero_charge' : [], } d['lig215'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig216'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig217'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig218'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig219'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig21'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig220'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig221'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig222'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig223'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig224'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig225'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig226'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig227'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig228'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig229'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig22'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig230'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig231'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig232'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':6, 'zero_charge' : [], } d['lig233'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig234'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig235'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig236'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig237'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig238'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig239'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig23'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig240'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig241'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig242'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig243'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig244'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig245'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig246'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig247'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig248'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig249'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig24'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig250'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig251'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig252'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig253'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig254'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig255'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig256'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig257'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig258'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig259'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig25'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N' ], 'rbonds':2, 'zero_charge' : [], } d['lig260'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig261'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig262'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig263'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig264'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig265'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig266'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig267'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig268'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig269'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig26'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig270'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig271'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig272'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig273'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig274'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig275'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig276'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig277'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig278'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig279'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig27'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig280'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig281'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig282'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig283'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig284'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig285'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig286'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig287'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig288'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig289'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':6, 'zero_charge' : [], } d['lig28'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig290'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig291'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig292'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig293'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig294'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig295'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig296'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig297'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig298'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig299'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig29'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig2'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig300'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig301'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig302'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig303'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig304'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig305'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig306'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig307'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig308'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N' ], 'rbonds':2, 'zero_charge' : [], } d['lig309'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig30'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig310'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig311'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig312'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig313'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig314'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig315'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig316'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig317'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig318'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig319'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig31'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig320'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig321'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig322'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig323'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig324'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig325'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig326'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig327'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig328'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig329'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig32'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig330'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig331'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig332'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig333'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig334'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA', 'S' ], 'rbonds':4, 'zero_charge' : [], } d['lig335'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig336'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig337'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig338'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig339'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig33'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig340'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig341'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig342'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig343'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'S' ], 'rbonds':4, 'zero_charge' : [], } d['lig344'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig345'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig346'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N' ], 'rbonds':4, 'zero_charge' : [], } d['lig347'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig348'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig349'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig34'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig350'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig351'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig352'] = {'atom_types': ['A', 'C', 'HD', 'NA', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig353'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig354'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig355'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig356'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig357'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig358'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig359'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig35'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig360'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig361'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig362'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig363'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig364'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig365'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig366'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig367'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig368'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig369'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig36'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig370'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig371'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig372'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig373'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig374'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig375'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig376'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig377'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig378'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig379'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig37'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig380'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig381'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig382'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig383'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig384'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig385'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig386'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig387'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig388'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig389'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig38'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig390'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig391'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig392'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig393'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig394'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig395'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig396'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig397'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig398'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig399'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig39'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig3'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig400'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig401'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig402'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig403'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig404'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig405'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig406'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig407'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig408'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig409'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig40'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig410'] = {'atom_types': ['A', 'Br', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig411'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig412'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':6, 'zero_charge' : [], } d['lig413'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig414'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig415'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig416'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig417'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig418'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig419'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig41'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig420'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig421'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig422'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig423'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig424'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig425'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig426'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig427'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig428'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig429'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig42'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig430'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig431'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig432'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig433'] = {'atom_types': ['A', 'C', 'N', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig434'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig435'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':2, 'zero_charge' : [], } d['lig436'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig437'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig438'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig439'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig43'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig440'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig441'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig442'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig443'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig444'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig445'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig446'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig447'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig448'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig449'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig44'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig450'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig451'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig452'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig453'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig454'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig455'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig456'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig457'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig458'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig459'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig45'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig460'] = {'atom_types': ['A', 'Br', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig461'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig462'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig463'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig464'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig465'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig466'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig467'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig468'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig469'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig46'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig470'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig471'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig472'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig473'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig474'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig475'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig476'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig477'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig478'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig479'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig47'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig480'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig481'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig482'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig483'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig484'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig485'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig486'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig487'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig488'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig489'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig48'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig490'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig491'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig492'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig493'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig494'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig495'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':6, 'zero_charge' : [], } d['lig496'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':7, 'zero_charge' : [], } d['lig497'] = {'atom_types': ['A', 'C', 'NA', 'OA', 'S' ], 'rbonds':6, 'zero_charge' : [], } d['lig498'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig499'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig49'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig4'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig500'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig501'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig502'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig503'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig504'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig505'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig506'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig507'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig508'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig509'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig50'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig510'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig511'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig512'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig513'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig514'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig515'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':6, 'zero_charge' : [], } d['lig516'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig517'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig518'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig519'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig51'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA', 'S' ], 'rbonds':4, 'zero_charge' : [], } d['lig520'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig521'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig522'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig523'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig524'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig525'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig526'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig527'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig528'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig529'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig52'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig530'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig531'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig532'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig533'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig534'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig535'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig536'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig537'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig538'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig539'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig53'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig540'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig541'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig542'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig543'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig544'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig545'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig546'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig547'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig548'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig549'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig54'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig550'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig551'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig552'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig553'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig554'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig555'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig556'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig557'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig558'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig559'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig55'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig560'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig561'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig562'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig563'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig564'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig565'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig566'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig567'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig568'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig569'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig56'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig570'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig571'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig572'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':6, 'zero_charge' : [], } d['lig573'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig574'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig575'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig576'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig577'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig578'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig579'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig57'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig580'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig581'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig582'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig583'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig584'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig585'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig586'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig587'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig588'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig589'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig58'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig590'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig591'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N' ], 'rbonds':2, 'zero_charge' : [], } d['lig592'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig593'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig594'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig595'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig596'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig597'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig598'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig599'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig59'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig5'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig600'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig601'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig602'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig603'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig604'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig605'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig606'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig607'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig608'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig609'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig60'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'S' ], 'rbonds':4, 'zero_charge' : [], } d['lig610'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig611'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig612'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig613'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig614'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig615'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig616'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig617'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA', 'S' ], 'rbonds':4, 'zero_charge' : [], } d['lig618'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig619'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig61'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig620'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig621'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig622'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig623'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig624'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig625'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig626'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'S' ], 'rbonds':4, 'zero_charge' : [], } d['lig627'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig628'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig629'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N' ], 'rbonds':4, 'zero_charge' : [], } d['lig62'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig630'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig631'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig632'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig633'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig634'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig635'] = {'atom_types': ['A', 'C', 'HD', 'NA', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig636'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig637'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig638'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig639'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig63'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N' ], 'rbonds':4, 'zero_charge' : [], } d['lig640'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig641'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig642'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig643'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig644'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig645'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig646'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig647'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig648'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig649'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig64'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig650'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig651'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig652'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig653'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig654'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig655'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig656'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig657'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig658'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig659'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig65'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig660'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig661'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig662'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig663'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig664'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig665'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig666'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig667'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig668'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig669'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig66'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig670'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig671'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig672'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig673'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig674'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig675'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig676'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig677'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig678'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig679'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig67'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig680'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig681'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig682'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig683'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig684'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig685'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig686'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig687'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig688'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig689'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig68'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig690'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig691'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig692'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig693'] = {'atom_types': ['A', 'Br', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig694'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig695'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':6, 'zero_charge' : [], } d['lig696'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig697'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig698'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig699'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig69'] = {'atom_types': ['A', 'C', 'HD', 'NA', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig6'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':6, 'zero_charge' : [], } d['lig700'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig701'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig702'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig703'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig704'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig705'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig706'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig707'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig708'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig709'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig70'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig710'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig711'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig712'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig713'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig714'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig715'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig716'] = {'atom_types': ['A', 'C', 'N', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig717'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig718'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':2, 'zero_charge' : [], } d['lig719'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig71'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig720'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig721'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig722'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig723'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig724'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig725'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig726'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig727'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig728'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig729'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig72'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig730'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig731'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig732'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig733'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig734'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig735'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig736'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig737'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig738'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig739'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig73'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig740'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig741'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig742'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig743'] = {'atom_types': ['A', 'Br', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig744'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig745'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig746'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig747'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig748'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig749'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig74'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig750'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig751'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig752'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig753'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig754'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig755'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig756'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig757'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig758'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig759'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig75'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig760'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig761'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig762'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig763'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig764'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig765'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig766'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig767'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig768'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig769'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig76'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig770'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig771'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig772'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig773'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig774'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig775'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig776'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig777'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig778'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':6, 'zero_charge' : [], } d['lig779'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':7, 'zero_charge' : [], } d['lig77'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig780'] = {'atom_types': ['A', 'C', 'NA', 'OA', 'S' ], 'rbonds':6, 'zero_charge' : [], } d['lig781'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig782'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig783'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig784'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig785'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig786'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig787'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig788'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig789'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig78'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig790'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig791'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig792'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig793'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig794'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig795'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig796'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig797'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig798'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':6, 'zero_charge' : [], } d['lig799'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig79'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig7'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig800'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig801'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig802'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig803'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig804'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig805'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig806'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig807'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig808'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig809'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig80'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig810'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig811'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig812'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig813'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig814'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig815'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig816'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig817'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig818'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig819'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig81'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig820'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig821'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig822'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig823'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig824'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig825'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig826'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig827'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig828'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig829'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig82'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig830'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig831'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig832'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig833'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig834'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig835'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig836'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig837'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig838'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig839'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig83'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig840'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig841'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig842'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig843'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig844'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig845'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig846'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig847'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig848'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig84'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig85'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig86'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig87'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig88'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig89'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig8'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig90'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig91'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig92'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig93'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig94'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig95'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig96'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig97'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig98'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig99'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig9'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig0'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig100'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig101'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig102'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig103'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig104'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig105'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig106'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig107'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig108'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig109'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig10'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig110'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig111'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig112'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig113'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig114'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig115'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig116'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig117'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig118'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig119'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig11'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig120'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig121'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig122'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig123'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig124'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig125'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig126'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig127'] = {'atom_types': ['A', 'Br', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig128'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig129'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':6, 'zero_charge' : [], } d['lig12'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig130'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig131'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig132'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig133'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig134'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig135'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig136'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig137'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig138'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig139'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig13'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig140'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig141'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig142'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig143'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig144'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig145'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig146'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig147'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig148'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig149'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig14'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig150'] = {'atom_types': ['A', 'C', 'N', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig151'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig152'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':2, 'zero_charge' : [], } d['lig153'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig154'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig155'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig156'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig157'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig158'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig159'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig15'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig160'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig161'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig162'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig163'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig164'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig165'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig166'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig167'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig168'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig169'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig16'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig170'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig171'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig172'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig173'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig174'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig175'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig176'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig177'] = {'atom_types': ['A', 'Br', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig178'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig179'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig17'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig180'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig181'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig182'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig183'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig184'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig185'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig186'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig187'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig188'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig189'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig18'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig190'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig191'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig192'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig193'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig194'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig195'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig196'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig197'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig198'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig199'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig19'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig1'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig200'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig201'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig202'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig203'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig204'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig205'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig206'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig207'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig208'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig209'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig20'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig210'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig211'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig212'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':6, 'zero_charge' : [], } d['lig213'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':7, 'zero_charge' : [], } d['lig214'] = {'atom_types': ['A', 'C', 'NA', 'OA', 'S' ], 'rbonds':6, 'zero_charge' : [], } d['lig215'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig216'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig217'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig218'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig219'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig21'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig220'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig221'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig222'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig223'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig224'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig225'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig226'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig227'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig228'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig229'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig22'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig230'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig231'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig232'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':6, 'zero_charge' : [], } d['lig233'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig234'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig235'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig236'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig237'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig238'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig239'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig23'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig240'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig241'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig242'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig243'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig244'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig245'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig246'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig247'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig248'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig249'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig24'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig250'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig251'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig252'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig253'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig254'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig255'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig256'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig257'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig258'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig259'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig25'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N' ], 'rbonds':2, 'zero_charge' : [], } d['lig260'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig261'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig262'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig263'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig264'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig265'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig266'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig267'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig268'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig269'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig26'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig270'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig271'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig272'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig273'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig274'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig275'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig276'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig277'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig278'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig279'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S' ], 'rbonds':7, 'zero_charge' : [], } d['lig27'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig280'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig281'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig282'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig28'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig29'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig2'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig30'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig31'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig32'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig33'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig34'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig35'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig36'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig37'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig38'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig39'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig3'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig40'] = {'atom_types': ['C', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig41'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig42'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig43'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig44'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig45'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig46'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig47'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig48'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig49'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig4'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig50'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig51'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA', 'S' ], 'rbonds':4, 'zero_charge' : [], } d['lig52'] = {'atom_types': ['A', 'C', 'N', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig53'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig54'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig55'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig56'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig57'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig58'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':4, 'zero_charge' : [], } d['lig59'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig5'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig60'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'S' ], 'rbonds':4, 'zero_charge' : [], } d['lig61'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig62'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig63'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N' ], 'rbonds':4, 'zero_charge' : [], } d['lig64'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig65'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig66'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig67'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig68'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig69'] = {'atom_types': ['A', 'C', 'HD', 'NA', 'OA', 'S' ], 'rbonds':5, 'zero_charge' : [], } d['lig6'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':6, 'zero_charge' : [], } d['lig70'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig71'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig72'] = {'atom_types': ['A', 'C', 'N', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig73'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig74'] = {'atom_types': ['A', 'C', 'F', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig75'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig76'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig77'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig78'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig79'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig7'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig80'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig81'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig82'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig83'] = {'atom_types': ['A', 'Br', 'C', 'HD', 'N', 'OA' ], 'rbonds':4, 'zero_charge' : [], } d['lig84'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig85'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'S', 'SA' ], 'rbonds':5, 'zero_charge' : [], } d['lig86'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig87'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig88'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig89'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':3, 'zero_charge' : [], } d['lig8'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':6, 'zero_charge' : [], } d['lig90'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig91'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':2, 'zero_charge' : [], } d['lig92'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig93'] = {'atom_types': ['C', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig94'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig95'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig96'] = {'atom_types': ['A', 'C', 'N', 'NA', 'OA' ], 'rbonds':5, 'zero_charge' : [], } d['lig97'] = {'atom_types': ['A', 'C', 'HD', 'N', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig98'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA', 'SA' ], 'rbonds':3, 'zero_charge' : [], } d['lig99'] = {'atom_types': ['A', 'C', 'HD', 'N', 'NA', 'OA' ], 'rbonds':7, 'zero_charge' : [], } d['lig9'] = {'atom_types': ['A', 'C', 'F', 'HD', 'N', 'NA', 'OA' ], 'rbonds':4, 'zero_charge' : [], }
0
0
0
1af54bd777743457a3a910bddbca3266b129a68d
12,643
py
Python
action-s710-lights.py
patrickjane/snipslightsha
3d5c43d2952271761769fac8d368d9dd6a1dd059
[ "MIT" ]
3
2019-10-18T08:19:29.000Z
2019-12-13T16:15:27.000Z
action-s710-lights.py
patrickjane/snipslightsha
3d5c43d2952271761769fac8d368d9dd6a1dd059
[ "MIT" ]
null
null
null
action-s710-lights.py
patrickjane/snipslightsha
3d5c43d2952271761769fac8d368d9dd6a1dd059
[ "MIT" ]
1
2019-08-30T22:29:14.000Z
2019-08-30T22:29:14.000Z
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Snips Lights + Homeassistant # ----------------------------------------------------------------------------- # Copyright 2019 Patrick Fial # ----------------------------------------------------------------------------- # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and # associated documentation files (the "Software"), to deal in the Software without restriction, # including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, # and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, # subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all copies or substantial # portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT # LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # ----------------------------------------------------------------------------- # Imports # ----------------------------------------------------------------------------- import io import toml import requests import logging from os import environ from snipsTools import SnipsConfigParser from hermes_python.hermes import Hermes from hermes_python.ontology import * # ----------------------------------------------------------------------------- # global definitions (home assistant service URLs) # ----------------------------------------------------------------------------- HASS_LIGHTS_ON_SVC = "/api/services/light/turn_on" HASS_LIGHTS_OFF_SVC = "/api/services/light/turn_off" HASS_GROUP_ON_SVC = "/api/services/homeassistant/turn_on" HASS_GROUP_OFF_SVC = "/api/services/homeassistant/turn_off" HASS_AUTOMATION_ON_SVC = "/api/services/automation/turn_on" HASS_AUTOMATION_OFF_SVC = "/api/services/automation/turn_off" APP_ID = "snips-skill-s710-lights" # ----------------------------------------------------------------------------- # class App # ----------------------------------------------------------------------------- # ------------------------------------------------------------------------- # ctor # ----------------------------------------------------------------------------- # read_toml # ------------------------------------------------------------------------- # start # ------------------------------------------------------------------------- # on_intent # ------------------------------------------------------------------------- # done # ------------------------------------------------------------------------- # params_of # ----------------------------------------------------------------------------- # main # ----------------------------------------------------------------------------- if __name__ == "__main__": App()
43.596552
140
0.572886
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Snips Lights + Homeassistant # ----------------------------------------------------------------------------- # Copyright 2019 Patrick Fial # ----------------------------------------------------------------------------- # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and # associated documentation files (the "Software"), to deal in the Software without restriction, # including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, # and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, # subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all copies or substantial # portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT # LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # ----------------------------------------------------------------------------- # Imports # ----------------------------------------------------------------------------- import io import toml import requests import logging from os import environ from snipsTools import SnipsConfigParser from hermes_python.hermes import Hermes from hermes_python.ontology import * # ----------------------------------------------------------------------------- # global definitions (home assistant service URLs) # ----------------------------------------------------------------------------- HASS_LIGHTS_ON_SVC = "/api/services/light/turn_on" HASS_LIGHTS_OFF_SVC = "/api/services/light/turn_off" HASS_GROUP_ON_SVC = "/api/services/homeassistant/turn_on" HASS_GROUP_OFF_SVC = "/api/services/homeassistant/turn_off" HASS_AUTOMATION_ON_SVC = "/api/services/automation/turn_on" HASS_AUTOMATION_OFF_SVC = "/api/services/automation/turn_off" APP_ID = "snips-skill-s710-lights" # ----------------------------------------------------------------------------- # class App # ----------------------------------------------------------------------------- class App(object): # ------------------------------------------------------------------------- # ctor def __init__(self, debug = False): self.logger = logging.getLogger(APP_ID) self.debug = debug self.enable_confirmation = False # parameters self.mqtt_host = "localhost:1883" self.mqtt_user = None self.mqtt_pass = None self.hass_host = None self.hass_token = None # read config.ini try: self.config = SnipsConfigParser.read_configuration_file("config.ini") except Exception as e: self.logger.error("Failed to read config.ini ({})".format(e)) self.config = None try: self.read_toml() except Exception as e: self.logger.error("Failed to read /etc/snips.toml ({})".format(e)) # try to use HASSIO token via environment variable & internal API URL in case no config.ini parameters are given if 'hass_token' in self.config['secret']: self.hass_token = self.config['secret']['hass_token'] elif 'HASSIO_TOKEN' in environ: self.hass_token = environ['HASSIO_TOKEN'] if 'hass_host' in self.config['global']: self.hass_host = self.config['global']['hass_host'] elif self.hass_token is not None and 'HASSIO_TOKEN' in environ: self.hass_host = 'http://hassio/homeassistant/api' self.hass_headers = { 'Content-Type': 'application/json', 'Authorization': "Bearer " + self.hass_token } if 'confirmation_success' in self.config['global']: self.confirmation_success = self.config['global']['confirmation_success'] else: self.confirmation_success = "Okay" if 'confirmation_failure' in self.config['global']: self.confirmation_failure = self.config['global']['confirmation_failure'] else: self.confirmation_failure = "Fehler" if 'enable_confirmation' in self.config['global'] and self.config['global']['enable_confirmation'] == "True": self.enable_confirmation = True if self.debug: self.logger.debug("Connecting to {}@{} ...".format(self.mqtt_user, self.mqtt_host)) self.start() # ----------------------------------------------------------------------------- # read_toml def read_toml(self): snips_config = toml.load('/etc/snips.toml') if 'mqtt' in snips_config['snips-common'].keys(): self.mqtt_host = snips_config['snips-common']['mqtt'] if 'mqtt_username' in snips_config['snips-common'].keys(): self.mqtt_user = snips_config['snips-common']['mqtt_username'] if 'mqtt_password' in snips_config['snips-common'].keys(): self.mqtt_pass = snips_config['snips-common']['mqtt_password'] # ------------------------------------------------------------------------- # start def start(self): with Hermes(mqtt_options = MqttOptions(broker_address = self.mqtt_host, username = self.mqtt_user, password = self.mqtt_pass)) as h: h.subscribe_intents(self.on_intent).start() # ------------------------------------------------------------------------- # on_intent def on_intent(self, hermes, intent_message): intent_name = intent_message.intent.intent_name site_id = intent_message.site_id room_id = None lamp_id = None brightness = None # extract mandatory information (lamp_id, room_id) try: if len(intent_message.slots): if len(intent_message.slots.lightType): lamp_id = intent_message.slots.lightType.first().value lamp_id = lamp_id.lower().replace('ä', 'ae').replace('ü','ue').replace('ö', 'oe') if len(intent_message.slots.roomName): room_id = intent_message.slots.roomName.first().value room_id = room_id.lower().replace('ä', 'ae').replace('ü','ue').replace('ö', 'oe') if len(intent_message.slots.brightness): brightness = int(intent_message.slots.brightness.first().value) except: pass # get corresponding home assistant service-url + payload service, data = self.params_of(room_id, lamp_id, site_id, brightness, intent_name) # fire the service using HA REST API if service is not None and data is not None: if self.debug: self.logger.debug("Intent {}: Firing service [{} -> {}] with [{}]".format(intent_name, self.hass_host, service, data)) r = requests.post(self.hass_host + service, json = data, headers = self.hass_headers) if r.status_code != 200: return self.done(hermes, intent_message, r) # second additional service? (keep light on = disable automation + turn on light) if intent_name == 's710:keepLightOn': service, data = self.params_of(room_id, lamp_id, site_id, brightness, "s710:turnOnLight") r = requests.post(self.hass_host + service, json = data, headers = self.hass_headers) elif intent_name == 's710:keepLightOff': service, data = self.params_of(room_id, lamp_id, site_id, brightness, "s710:turnOffLight") r = requests.post(self.hass_host + service, json = data, headers = self.hass_headers) elif intent_name == 's710:enableAutomatic': service, data = self.params_of(room_id, lamp_id, site_id, brightness, "s710:enableAutomaticOff") r = requests.post(self.hass_host + service, json = data, headers = self.hass_headers) self.done(hermes, intent_message, r) # ------------------------------------------------------------------------- # done def done(self, hermes, intent_message, request_object): if not self.enable_confirmation: hermes.publish_end_session(intent_message.session_id, "") elif request_object.status_code == 200: hermes.publish_end_session(intent_message.session_id, self.confirmation_success) else: hermes.publish_end_session(intent_message.session_id, self.confirmation_failure) # ------------------------------------------------------------------------- # params_of def params_of(self, room_id, lamp_id, site_id, brightness, intent_name): # turn on/off lights if intent_name == 's710:turnOnLight': if lamp_id is not None: return (HASS_LIGHTS_ON_SVC, {'entity_id': 'light.{}'.format(lamp_id) }) elif room_id is not None: return (HASS_GROUP_ON_SVC, {'entity_id': 'group.lights_{}'.format(room_id) }) else: return (HASS_GROUP_ON_SVC, {'entity_id': 'group.lights_{}'.format(site_id) }) if intent_name == 's710:turnOffLight': if lamp_id is not None: return (HASS_LIGHTS_OFF_SVC, {'entity_id': 'light.{}'.format(lamp_id) }) elif room_id is not None: return (HASS_GROUP_OFF_SVC, {'entity_id': 'group.lights_{}'.format(room_id) }) else: return (HASS_GROUP_OFF_SVC, {'entity_id': 'group.lights_{}'.format(site_id) }) # control all lights if intent_name == 's710:turnOnAllLights': return (HASS_GROUP_ON_SVC, {'entity_id': 'group.all_lights' }) if intent_name == 's710:turnOffAllLights': return (HASS_GROUP_OFF_SVC, {'entity_id': 'group.all_lights' }) # keep lights on/off (via automation enable/disable + light on/off) if intent_name == 's710:keepLightOn': if lamp_id is not None: return (HASS_AUTOMATION_OFF_SVC, {'entity_id': 'automation.lights_off_{}'.format(lamp_id) }) elif room_id is not None: return (HASS_AUTOMATION_OFF_SVC, {'entity_id': 'automation.lights_off_{}'.format(room_id) }) else: return (HASS_AUTOMATION_OFF_SVC, {'entity_id': 'automation.lights_off_{}'.format(site_id) }) if intent_name == 's710:keepLightOff': if lamp_id is not None: return (HASS_AUTOMATION_OFF_SVC, {'entity_id': 'automation.lights_on_{}'.format(lamp_id) }) elif room_id is not None: return (HASS_AUTOMATION_OFF_SVC, {'entity_id': 'automation.lights_on_{}'.format(room_id) }) else: return (HASS_AUTOMATION_OFF_SVC, {'entity_id': 'automation.lights_on_{}'.format(site_id) }) if intent_name == 's710:enableAutomatic': if lamp_id is not None: return (HASS_AUTOMATION_ON_SVC, {'entity_id': 'automation.lights_on_{}'.format(lamp_id) }) elif room_id is not None: return (HASS_AUTOMATION_ON_SVC, {'entity_id': 'automation.lights_on_{}'.format(room_id) }) else: return (HASS_AUTOMATION_ON_SVC, {'entity_id': 'automation.lights_on_{}'.format(site_id) }) if intent_name == 's710:enableAutomaticOff': if lamp_id is not None: return (HASS_AUTOMATION_ON_SVC, {'entity_id': 'automation.lights_off_{}'.format(lamp_id) }) elif room_id is not None: return (HASS_AUTOMATION_ON_SVC, {'entity_id': 'automation.lights_off_{}'.format(room_id) }) else: return (HASS_AUTOMATION_ON_SVC, {'entity_id': 'automation.lights_off_{}'.format(site_id) }) # set light brightness if intent_name == 's710:setLightBrightness': if lamp_id is not None and brightness is not None: return (HASS_LIGHTS_ON_SVC, {'entity_id': 'light.{}'.format(lamp_id), 'brightness': brightness }) return (None, None) # ----------------------------------------------------------------------------- # main # ----------------------------------------------------------------------------- if __name__ == "__main__": App()
9,150
-3
185
e3e4619c71c41ed705e6c33c24d3ddc3ba9f77b8
381
py
Python
comps/migrations/0010_auto_20200421_2132.py
dlanghorne0428/dancesport-tracker-projec
e55d91a4f03c26d6ee8c28846a809064adfdb158
[ "MIT" ]
null
null
null
comps/migrations/0010_auto_20200421_2132.py
dlanghorne0428/dancesport-tracker-projec
e55d91a4f03c26d6ee8c28846a809064adfdb158
[ "MIT" ]
87
2020-04-15T22:29:03.000Z
2022-01-02T02:21:28.000Z
comps/migrations/0010_auto_20200421_2132.py
dlanghorne0428/dancesport-tracker-projec
e55d91a4f03c26d6ee8c28846a809064adfdb158
[ "MIT" ]
null
null
null
# Generated by Django 3.0.4 on 2020-04-21 21:32 from django.db import migrations
20.052632
48
0.60105
# Generated by Django 3.0.4 on 2020-04-21 21:32 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('rankings', '0006_auto_20200414_0150'), ('comps', '0009_heatresult_heat'), ] operations = [ migrations.RenameModel( old_name='HeatResult', new_name='HeatEntry', ), ]
0
275
23
2ab163caa20d2100932f8fe234668ec04b2677bc
237
py
Python
uva_answers/621/main.py
andriisoldatenko/fan
e7ed6ea0f39bd71af4e286af8d81ebc137ae8ff4
[ "MIT" ]
6
2018-11-18T15:00:02.000Z
2022-03-23T21:32:24.000Z
uva_answers/621/main.py
andriisoldatenko/leetcode
8fef4da00234f8acbea9b71ee730b2267b70395f
[ "MIT" ]
null
null
null
uva_answers/621/main.py
andriisoldatenko/leetcode
8fef4da00234f8acbea9b71ee730b2267b70395f
[ "MIT" ]
null
null
null
for _ in range(int(input())): n = input() if n in {'1', '4', '78'}: print('+') elif n.endswith('35'): print('-') elif n.startswith('9') and n.endswith('4'): print('*') else: print('?')
21.545455
47
0.43038
for _ in range(int(input())): n = input() if n in {'1', '4', '78'}: print('+') elif n.endswith('35'): print('-') elif n.startswith('9') and n.endswith('4'): print('*') else: print('?')
0
0
0
e64a627de0a225ac92258cde53753862d013f234
2,679
py
Python
tests/test_extract_oxoq.py
MarcSaric/variant-filtration-tool
e4492e2225e87ce904e49401d8919e7f84f9de87
[ "Apache-2.0" ]
null
null
null
tests/test_extract_oxoq.py
MarcSaric/variant-filtration-tool
e4492e2225e87ce904e49401d8919e7f84f9de87
[ "Apache-2.0" ]
2
2020-07-08T13:51:37.000Z
2020-07-09T19:31:00.000Z
tests/test_extract_oxoq.py
MarcSaric/variant-filtration-tool
e4492e2225e87ce904e49401d8919e7f84f9de87
[ "Apache-2.0" ]
2
2020-08-14T08:51:08.000Z
2021-04-28T15:37:16.000Z
"""Tests the ``gdc_filtration_tools.tools.extract_oxoq`` module. """ import sqlite3 import tempfile import unittest import attr from gdc_filtration_tools.tools.extract_oxoq import extract_oxoq_from_sqlite, get_oxoq from tests.utils import captured_output, cleanup_files @attr.s def build_test_schema(conn): """ utility to set test schemas. """ sql_script = """ DROP TABLE IF EXISTS "picard_CollectOxoGMetrics"; CREATE TABLE "picard_CollectOxoGMetrics" ( TOTAL_BASES TEXT, ALT_OXO_BASES TEXT, ALT_NONOXO_BASES TEXT, OXIDATION_Q TEXT, CONTEXT TEXT, input_state TEXT ); """ csr = conn.executescript(sql_script) csr.close()
29.119565
86
0.609929
"""Tests the ``gdc_filtration_tools.tools.extract_oxoq`` module. """ import sqlite3 import tempfile import unittest import attr from gdc_filtration_tools.tools.extract_oxoq import extract_oxoq_from_sqlite, get_oxoq from tests.utils import captured_output, cleanup_files @attr.s class OxoqRecord(object): total_bases = attr.ib() alt_oxo_bases = attr.ib() alt_nonoxo_bases = attr.ib() oxidation_q = attr.ib() context = attr.ib(default="CCG") input_state = attr.ib(default="gatk_applybqsr_readgroups") table = attr.ib(default="picard_CollectOxoGMetrics", kw_only=True) def insert(self, cur): record = attr.astuple( self, filter=attr.filters.exclude(attr.fields(self.__class__).table) ) qstr = ",".join(["?" for i in range(len(record))]) cur.execute("insert into {0} values ({1})".format(self.table, qstr), record) def build_test_schema(conn): """ utility to set test schemas. """ sql_script = """ DROP TABLE IF EXISTS "picard_CollectOxoGMetrics"; CREATE TABLE "picard_CollectOxoGMetrics" ( TOTAL_BASES TEXT, ALT_OXO_BASES TEXT, ALT_NONOXO_BASES TEXT, OXIDATION_Q TEXT, CONTEXT TEXT, input_state TEXT ); """ csr = conn.executescript(sql_script) csr.close() class TestExtractOxoq(unittest.TestCase): def test_get_oxoq(self): rec = OxoqRecord("10000", "200", "100", "30.23") exp = 30.23 with sqlite3.connect(":memory:") as conn: # make schema build_test_schema(conn) cur = conn.cursor() rec.insert(cur) res = get_oxoq( cur, "CCG", "picard_CollectOxoGMetrics", "gatk_applybqsr_readgroups" ) self.assertEqual(res, exp) rec_b = OxoqRecord("20000", "400", "200", "20.23") rec_b.insert(cur) res = get_oxoq( cur, "CCG", "picard_CollectOxoGMetrics", "gatk_applybqsr_readgroups" ) self.assertEqual(res, 20.0) def test_extract_oxoq_from_sqlite(self): rec = OxoqRecord("10000", "200", "100", "30.23") exp = 30.23 (fd, fn) = tempfile.mkstemp() # Generate test db with sqlite3.connect(fn) as conn: # make schema build_test_schema(conn) cur = conn.cursor() rec.insert(cur) with captured_output() as (stdout, _): extract_oxoq_from_sqlite(fn, input_state="gatk_applybqsr_readgroups") cleanup_files(fn) sout = float(stdout.getvalue().rstrip("\r\n")) self.assertEqual(sout, 30.23)
1,525
341
98
614991bd10ea6f2b61d54371b58a5608f9dc395c
1,946
py
Python
src/ui.py
zixia/python-facenet
d86e0c49a9ce413bef6e58a19a9f723aadcef968
[ "MIT" ]
4
2018-06-11T03:02:49.000Z
2018-07-11T07:18:52.000Z
src/ui.py
zixia/python-facenet
d86e0c49a9ce413bef6e58a19a9f723aadcef968
[ "MIT" ]
null
null
null
src/ui.py
zixia/python-facenet
d86e0c49a9ce413bef6e58a19a9f723aadcef968
[ "MIT" ]
2
2017-08-31T05:35:36.000Z
2018-10-11T16:42:15.000Z
""" dialog module """ from time import sleep from typing import Tuple import matplotlib.pyplot as plt # from matplotlib.image import AxesImage from matplotlib.patches import Rectangle import numpy as np Point = Tuple[int, int] i = 3 # type: int i = '3' class Ui(object): """ dialog """ def show_photo( self, file: str ) -> None: """ show photo """ img = plt.imread(file) self.im = plt.imshow(img) def draw_rectangle( self, x: int, y: int, width: int, height: int, ) -> None: """ draw """ rgba = np.random.rand(4,) # color = color.list() rect = Rectangle( [x, y], width, height, linewidth=1, color=rgba, edgecolor='r', facecolor='none' ) self.ax.add_patch(rect) def draw(self) -> None: """ refresh plt show """ # self.ax.draw() plt.draw() def show(self): """ show """ self.ax.axis('off') # clear x- and y-axes plt.show() def pause(self, seconds: int) -> None: """ pause """ plt.pause(seconds) def sleep(self, seconds: int) -> None: """ sleep """ sleep(seconds) def interactive_mode(self, switch: bool = True) -> None: """ interactive """ if switch: plt.ion() else: plt.ioff() def wait_key(self) -> None: """ wait press """ # plt.pause(1) # <------- # raw_input("<Hit Enter To Close>") plt.waitforbuttonpress() def huan(self, n: int) -> None: """ test """ print('huan%d' % (n))
20.270833
60
0.472765
""" dialog module """ from time import sleep from typing import Tuple import matplotlib.pyplot as plt # from matplotlib.image import AxesImage from matplotlib.patches import Rectangle import numpy as np Point = Tuple[int, int] i = 3 # type: int i = '3' class Ui(object): """ dialog """ def __init__(self): self.im = None # type: AxesImage self.fig, self.ax = plt.subplots() self.interactive_mode() self.show() def show_photo( self, file: str ) -> None: """ show photo """ img = plt.imread(file) self.im = plt.imshow(img) def draw_rectangle( self, x: int, y: int, width: int, height: int, ) -> None: """ draw """ rgba = np.random.rand(4,) # color = color.list() rect = Rectangle( [x, y], width, height, linewidth=1, color=rgba, edgecolor='r', facecolor='none' ) self.ax.add_patch(rect) def draw(self) -> None: """ refresh plt show """ # self.ax.draw() plt.draw() def show(self): """ show """ self.ax.axis('off') # clear x- and y-axes plt.show() def pause(self, seconds: int) -> None: """ pause """ plt.pause(seconds) def sleep(self, seconds: int) -> None: """ sleep """ sleep(seconds) def interactive_mode(self, switch: bool = True) -> None: """ interactive """ if switch: plt.ion() else: plt.ioff() def wait_key(self) -> None: """ wait press """ # plt.pause(1) # <------- # raw_input("<Hit Enter To Close>") plt.waitforbuttonpress() def huan(self, n: int) -> None: """ test """ print('huan%d' % (n))
136
0
27
b2b18c1c03a360aec6e2bb058e46a4132de691f9
12,713
py
Python
src/plots_reaction.py
andrewtarzia/enzyme_screen
c7f9291e5e29b51dd28193f46e1a2ac377dafa9e
[ "MIT" ]
1
2020-09-11T15:29:18.000Z
2020-09-11T15:29:18.000Z
src/plots_reaction.py
andrewtarzia/enzyme_screen
c7f9291e5e29b51dd28193f46e1a2ac377dafa9e
[ "MIT" ]
null
null
null
src/plots_reaction.py
andrewtarzia/enzyme_screen
c7f9291e5e29b51dd28193f46e1a2ac377dafa9e
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Distributed under the terms of the MIT License. """ Module for plotting reaction-based functions. Author: Andrew Tarzia Date Created: 15 Sep 2018 """ import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as colors from matplotlib.ticker import MaxNLocator import plotting_fn as pfn def no_rxns_vs_size(data, params, plot_suffix): """ Plot number of possible reactions as a function of size threshold. """ fig, ax = plt.subplots(figsize=(8, 5)) # bin each of the sets of data based on X value width = 0.5 X_bins = np.arange(0, 20.5, width) hist, bin_edges = np.histogram(a=data['max_mid_diam'], bins=X_bins) ax2 = ax.twinx() ax2.bar( bin_edges[:-1], hist, align='edge', alpha=0.9, width=width, color='#2C3E50', edgecolor='k' ) # cumulative plot cumul = np.cumsum(hist) ax.plot( bin_edges[:-1], cumul, alpha=1.0, label='max component < threshold', color='r', marker='o' ) # ax.axvspan(xmin=4.0, xmax=6.6, facecolor='k', alpha=0.2, # hatch="/") ax.axvspan(xmin=4.0, xmax=6.6, facecolor='k', alpha=0.2) # ax.axvspan(xmin=5.4, xmax=6.6, facecolor='k', alpha=0.2) # plot possible region of ZIF pore limiting diameters from # Banerjee 2008 - 10.1126/science.1152516 # ax.axvspan(0.0, 13, facecolor='#2ca02c', alpha=0.2) # ax.axvline(x=13.1, c='k', lw=2, linestyle='--') pfn.define_standard_plot( ax, xtitle=r'$d$ of largest component [$\mathrm{\AA}$]', ytitle='cumulative # reactions', xlim=(0, 17), ylim=(0, int(max(cumul)+max(cumul)*0.1)) ) ax2.set_ylim(0, int(max(hist)+max(hist)*0.2)) ax2.set_ylabel('# reactions', fontsize=16) ax.yaxis.set_major_locator(MaxNLocator(integer=True)) ax2.yaxis.set_major_locator(MaxNLocator(integer=True)) # Change left y axis colours. ax.spines['left'].set_color('red') ax2.spines['left'].set_color('red') ax2.tick_params(axis='both', which='major', labelsize=16) fig.tight_layout() fig.savefig( f"{plot_suffix}/size_threshold_{plot_suffix}.pdf", dpi=720, bbox_inches='tight' ) def rxn_space(data, filename): """ Plot number of possible reactions as a function of size threshold. """ plot_prop = { 1: { 'c': '#FA7268', 'e': 'none', 'a': 0.5, 'm': 'o', 's': 50, 'label': 'class I' }, 2: { 'c': '#DAF7A6', 'e': 'none', 'a': 0.5, 'm': 'x', 's': 50, 'label': 'class II' }, 3: { 'c': '#900C3F', 'e': 'none', 'a': 1.0, 'm': 'x', 's': 50, 'label': 'class III' }, 4: { 'c': '#F6D973', 'e': 'none', 'a': 0.5, 'm': 'x', 's': 50, 'label': 'class IV' } } # bin each of the sets of data based on X value width = 0.5 X_bins = np.arange(0, 20.5, width) fig, ax = plt.subplots(figsize=(8, 5)) # bin each of the sets of data based on X value for p in plot_prop: if p != 3: continue pp = plot_prop[p] sub_data = data[data['PC_class'] == p] hist, bin_edges = np.histogram( a=sub_data['max_mid_diam'], bins=X_bins ) ax.bar( bin_edges[:-1], hist, align='edge', alpha=pp['a'], width=width, color=pp['c'], edgecolor='k', label=pp['label'] ) ax.legend(fontsize=16) ax.axvspan(xmin=4.0, xmax=6.6, facecolor='k', alpha=0.2, hatch="/") # ax.axvspan(xmin=5.4, xmax=6.6, facecolor='k', alpha=0.2) # plot possible region of ZIF pore limiting diameters from # Banerjee 2008 - 10.1126/science.1152516 # ax.axvspan(0.0, 13, facecolor='#2ca02c', alpha=0.2) # HOF. ax.axvline(x=13.1, c='k', lw=2, linestyle='--') pfn.define_standard_plot( ax, xtitle=r'$d$ of largest component [$\mathrm{\AA}$]', ytitle='# reactions', xlim=(0, 17), ylim=None ) fig.tight_layout() fig.savefig( filename, dpi=720, bbox_inches='tight' ) def rxn_value(data, filename): """ Plot the value of all reactions as violin plot. """ plot_prop = { 1: { 'c': '#900C3F', 'e': 'none', 'a': 0.5, 'm': 'o', 's': 50, 'label': 'class I' }, 2: { 'c': '#FA7268', 'e': 'none', 'a': 0.5, 'm': 'x', 's': 50, 'label': 'class II' }, 3: { 'c': '#F6D973', 'e': 'none', 'a': 1.0, 'm': 'x', 's': 50, 'label': 'class III' }, 4: { 'c': '#DAF7A6', 'e': 'none', 'a': 0.5, 'm': 'x', 's': 50, 'label': 'class IV' } } fig, ax = plt.subplots(figsize=(8, 5)) # bin each of the sets of data based on X value for p in plot_prop: pp = plot_prop[p] sub_data = data[data['PC_class'] == p] values = sub_data['max_mid_diam'] number = int(p) parts = ax.violinplot( values, [number], showmeans=False, showmedians=False, showextrema=False ) for pc in parts['bodies']: pc.set_facecolor(pp['c']) pc.set_edgecolor('black') pc.set_alpha(1.0) ax.tick_params(axis='both', which='major', labelsize=16) ax.set_xlabel('purchasability class', fontsize=16) ax.set_ylabel( r'$d$ of largest component [$\mathrm{\AA}$]', fontsize=16 ) ax.set_xlim(0.5, 4.5) ax.xaxis.set_major_locator(MaxNLocator(integer=True)) ax.axhspan(ymin=4.0, ymax=6.6, facecolor='k', alpha=0.2) fig.tight_layout() fig.savefig( filename, dpi=720, bbox_inches='tight' ) def rxn_complexity(data, filename): """ Plot the measures of complexity of each reaction. """ fig, ax = plt.subplots(figsize=(8, 5)) ylim = (-1000, 1000) xlim = (-10, 10) # CS = [(1.0, 1.0, 1.0), (44/255, 62/255, 80/255)] # cm = colors.LinearSegmentedColormap.from_list('test', CS, N=10) # fig, ax, hist = pfn.twoD_histogram( # X_data=data['deltasa'], # Y_data=data['deltabct'], # xlim=xlim, # ylim=ylim, # cmap=cm, # fig=fig, # ax=ax # ) # cbar = fig.colorbar(hist[3], ax=ax) # cbar.ax.set_ylabel('count', fontsize=16) # cbar.ax.tick_params(labelsize=16) ax.scatter( data['deltasa'], data['deltabct'], c='#CCD1D1', edgecolors='none', marker='o', alpha=1.0, s=40, label='full dataset' ) small_data = data[data['max_mid_diam'] < 6.6] ax.scatter( small_data['deltasa'], small_data['deltabct'], c='#2C3E50', edgecolors='none', marker='o', alpha=1.0, s=40, label='viable reactions' ) pfn.define_standard_plot( ax, # xtitle='number of heavy atoms', ylim=ylim, xlim=xlim, ytitle=r'$\Delta$ BertzCT', xtitle=r'$\Delta$ SAscore', ) ax.legend(fontsize=16) fig.tight_layout() fig.savefig( filename, dpi=720, bbox_inches='tight' ) def save_candidates(data, params, filename): """ Save candidates to file. """ all_fit = data.sort_values(by='max_mid_diam') all_fit.to_csv(filename, index=False) print(f'There are {len(all_fit)} candidate reactions!') print('---------------------------------------------------') def stacked_dist(data, col, xtitle, xlim, width): """ Plot histograms of data stacked by top level EC no. """ delta_data = {'total': []} for i, row in data.iterrows(): EC = row['ec'] top_EC = EC.split('.')[0] if top_EC not in list(delta_data.keys()): delta_data[top_EC] = [] delta_data[top_EC].append(row[col]) delta_data['total'].append(row[col]) fig, ax = plt.subplots(figsize=(8, 5)) if xlim is None: xlim = ( min([min(delta_data[i]) for i in delta_data])-2*width, max([max(delta_data[i]) for i in delta_data])+2*width ) X_bins = np.arange(xlim[0], xlim[1], width) for keys in delta_data: values = delta_data[keys] hist, bin_edges = np.histogram( a=values, bins=X_bins, density=True ) ax.plot( X_bins[:-1]+width/2, hist, c=pfn.EC_descriptions()[keys][1], lw='1.5', marker='o', alpha=1.0, label=pfn.EC_descriptions()[keys][0] ) ax.tick_params(axis='both', which='major', labelsize=16) ax.set_xlabel(xtitle, fontsize=16) ax.set_ylabel('frequency', fontsize=16) ax.set_xlim(xlim) # legend ax.legend(fontsize=16) return fig, ax def dist(X, xtitle, xlim, width): """ Plot histograms of data. """ fig, ax = plt.subplots(figsize=(8, 5)) if xlim is None: xlim = (min(X)-2*width, max(X)+2*width) X_bins = np.arange(xlim[0], xlim[1], width) hist, bin_edges = np.histogram(a=X, bins=X_bins) if xtitle == 'purchasability class': align = 'center' else: align = 'edge' ax.bar( bin_edges[:-1], hist, align=align, alpha=1.0, width=width, color='#2980B9', edgecolor='k' ) pfn.define_standard_plot( ax, xtitle=xtitle, ytitle='count', xlim=xlim, ylim=None ) return fig, ax def pie(X, xtitle, xlim, width): """ Plot pie chart of categorical data. """ if xtitle == 'purchasability class': labels = ['class I', 'class II', 'class III', 'class IV'] colours = ['#D2B1D1', '#3498DB', '#C0392B', '#CCD1D1'] sizes = [ len([i for i in X if i == 1]), len([i for i in X if i == 2]), len([i for i in X if i == 3]), len([i for i in X if i == 4]) ] else: raise ValueError('this type of plot is not defined.') # explode = (0.0, 0.0) fig, ax = plt.subplots(figsize=(5, 5)) wedges, _, _ = ax.pie( sizes, colors=colours, # explode=explode, labels=labels, autopct='%1.1f%%', # shadow=True, startangle=90, textprops={'fontsize': 16} ) for w in wedges: w.set_linewidth(1.5) w.set_edgecolor('k') # Equal aspect ratio ensures that pie is drawn as a circle. ax.axis('equal') return fig, ax def violinplot(data, col, ytitle, ylim): """ Plot violin plots of data separated by top level EC no. """ delta_data = {'total': []} for i, row in data.iterrows(): EC = row['ec'] top_EC = EC.split('.')[0] if top_EC not in list(delta_data.keys()): delta_data[top_EC] = [] delta_data[top_EC].append(row[col]) delta_data['total'].append(row[col]) fig, ax = plt.subplots(figsize=(8, 5)) for keys in delta_data: values = delta_data[keys] if keys == '-': number = 0 elif keys == 'total': number = -1 else: number = int(keys) parts = ax.violinplot( values, [number], showmeans=False, showmedians=False, showextrema=False ) for pc in parts['bodies']: pc.set_facecolor(pfn.EC_descriptions()[keys][1]) pc.set_edgecolor('black') pc.set_alpha(1.0) ax.tick_params(axis='both', which='major', labelsize=16) ax.set_xlabel('EC number', fontsize=16) ax.set_ylabel(ytitle, fontsize=16) ax.set_xlim(-2, 8) ax.set_xticks([-1, 0, 1, 2, 3, 4, 5, 6, 7]) ax.set_xticklabels( ['all', 'unknown', '1', '2', '3', '4', '5', '6', '7'] ) if col == 'max_mid_diam': ax.axhspan(ymin=4.0, ymax=6.6, facecolor='k', alpha=0.2) ax.set_ylim(ylim) return fig, ax
24.589942
71
0.503736
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Distributed under the terms of the MIT License. """ Module for plotting reaction-based functions. Author: Andrew Tarzia Date Created: 15 Sep 2018 """ import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as colors from matplotlib.ticker import MaxNLocator import plotting_fn as pfn def no_rxns_vs_size(data, params, plot_suffix): """ Plot number of possible reactions as a function of size threshold. """ fig, ax = plt.subplots(figsize=(8, 5)) # bin each of the sets of data based on X value width = 0.5 X_bins = np.arange(0, 20.5, width) hist, bin_edges = np.histogram(a=data['max_mid_diam'], bins=X_bins) ax2 = ax.twinx() ax2.bar( bin_edges[:-1], hist, align='edge', alpha=0.9, width=width, color='#2C3E50', edgecolor='k' ) # cumulative plot cumul = np.cumsum(hist) ax.plot( bin_edges[:-1], cumul, alpha=1.0, label='max component < threshold', color='r', marker='o' ) # ax.axvspan(xmin=4.0, xmax=6.6, facecolor='k', alpha=0.2, # hatch="/") ax.axvspan(xmin=4.0, xmax=6.6, facecolor='k', alpha=0.2) # ax.axvspan(xmin=5.4, xmax=6.6, facecolor='k', alpha=0.2) # plot possible region of ZIF pore limiting diameters from # Banerjee 2008 - 10.1126/science.1152516 # ax.axvspan(0.0, 13, facecolor='#2ca02c', alpha=0.2) # ax.axvline(x=13.1, c='k', lw=2, linestyle='--') pfn.define_standard_plot( ax, xtitle=r'$d$ of largest component [$\mathrm{\AA}$]', ytitle='cumulative # reactions', xlim=(0, 17), ylim=(0, int(max(cumul)+max(cumul)*0.1)) ) ax2.set_ylim(0, int(max(hist)+max(hist)*0.2)) ax2.set_ylabel('# reactions', fontsize=16) ax.yaxis.set_major_locator(MaxNLocator(integer=True)) ax2.yaxis.set_major_locator(MaxNLocator(integer=True)) # Change left y axis colours. ax.spines['left'].set_color('red') ax2.spines['left'].set_color('red') ax2.tick_params(axis='both', which='major', labelsize=16) fig.tight_layout() fig.savefig( f"{plot_suffix}/size_threshold_{plot_suffix}.pdf", dpi=720, bbox_inches='tight' ) def rxn_space(data, filename): """ Plot number of possible reactions as a function of size threshold. """ plot_prop = { 1: { 'c': '#FA7268', 'e': 'none', 'a': 0.5, 'm': 'o', 's': 50, 'label': 'class I' }, 2: { 'c': '#DAF7A6', 'e': 'none', 'a': 0.5, 'm': 'x', 's': 50, 'label': 'class II' }, 3: { 'c': '#900C3F', 'e': 'none', 'a': 1.0, 'm': 'x', 's': 50, 'label': 'class III' }, 4: { 'c': '#F6D973', 'e': 'none', 'a': 0.5, 'm': 'x', 's': 50, 'label': 'class IV' } } # bin each of the sets of data based on X value width = 0.5 X_bins = np.arange(0, 20.5, width) fig, ax = plt.subplots(figsize=(8, 5)) # bin each of the sets of data based on X value for p in plot_prop: if p != 3: continue pp = plot_prop[p] sub_data = data[data['PC_class'] == p] hist, bin_edges = np.histogram( a=sub_data['max_mid_diam'], bins=X_bins ) ax.bar( bin_edges[:-1], hist, align='edge', alpha=pp['a'], width=width, color=pp['c'], edgecolor='k', label=pp['label'] ) ax.legend(fontsize=16) ax.axvspan(xmin=4.0, xmax=6.6, facecolor='k', alpha=0.2, hatch="/") # ax.axvspan(xmin=5.4, xmax=6.6, facecolor='k', alpha=0.2) # plot possible region of ZIF pore limiting diameters from # Banerjee 2008 - 10.1126/science.1152516 # ax.axvspan(0.0, 13, facecolor='#2ca02c', alpha=0.2) # HOF. ax.axvline(x=13.1, c='k', lw=2, linestyle='--') pfn.define_standard_plot( ax, xtitle=r'$d$ of largest component [$\mathrm{\AA}$]', ytitle='# reactions', xlim=(0, 17), ylim=None ) fig.tight_layout() fig.savefig( filename, dpi=720, bbox_inches='tight' ) def rxn_value(data, filename): """ Plot the value of all reactions as violin plot. """ plot_prop = { 1: { 'c': '#900C3F', 'e': 'none', 'a': 0.5, 'm': 'o', 's': 50, 'label': 'class I' }, 2: { 'c': '#FA7268', 'e': 'none', 'a': 0.5, 'm': 'x', 's': 50, 'label': 'class II' }, 3: { 'c': '#F6D973', 'e': 'none', 'a': 1.0, 'm': 'x', 's': 50, 'label': 'class III' }, 4: { 'c': '#DAF7A6', 'e': 'none', 'a': 0.5, 'm': 'x', 's': 50, 'label': 'class IV' } } fig, ax = plt.subplots(figsize=(8, 5)) # bin each of the sets of data based on X value for p in plot_prop: pp = plot_prop[p] sub_data = data[data['PC_class'] == p] values = sub_data['max_mid_diam'] number = int(p) parts = ax.violinplot( values, [number], showmeans=False, showmedians=False, showextrema=False ) for pc in parts['bodies']: pc.set_facecolor(pp['c']) pc.set_edgecolor('black') pc.set_alpha(1.0) ax.tick_params(axis='both', which='major', labelsize=16) ax.set_xlabel('purchasability class', fontsize=16) ax.set_ylabel( r'$d$ of largest component [$\mathrm{\AA}$]', fontsize=16 ) ax.set_xlim(0.5, 4.5) ax.xaxis.set_major_locator(MaxNLocator(integer=True)) ax.axhspan(ymin=4.0, ymax=6.6, facecolor='k', alpha=0.2) fig.tight_layout() fig.savefig( filename, dpi=720, bbox_inches='tight' ) def rxn_complexity(data, filename): """ Plot the measures of complexity of each reaction. """ fig, ax = plt.subplots(figsize=(8, 5)) ylim = (-1000, 1000) xlim = (-10, 10) # CS = [(1.0, 1.0, 1.0), (44/255, 62/255, 80/255)] # cm = colors.LinearSegmentedColormap.from_list('test', CS, N=10) # fig, ax, hist = pfn.twoD_histogram( # X_data=data['deltasa'], # Y_data=data['deltabct'], # xlim=xlim, # ylim=ylim, # cmap=cm, # fig=fig, # ax=ax # ) # cbar = fig.colorbar(hist[3], ax=ax) # cbar.ax.set_ylabel('count', fontsize=16) # cbar.ax.tick_params(labelsize=16) ax.scatter( data['deltasa'], data['deltabct'], c='#CCD1D1', edgecolors='none', marker='o', alpha=1.0, s=40, label='full dataset' ) small_data = data[data['max_mid_diam'] < 6.6] ax.scatter( small_data['deltasa'], small_data['deltabct'], c='#2C3E50', edgecolors='none', marker='o', alpha=1.0, s=40, label='viable reactions' ) pfn.define_standard_plot( ax, # xtitle='number of heavy atoms', ylim=ylim, xlim=xlim, ytitle=r'$\Delta$ BertzCT', xtitle=r'$\Delta$ SAscore', ) ax.legend(fontsize=16) fig.tight_layout() fig.savefig( filename, dpi=720, bbox_inches='tight' ) def save_candidates(data, params, filename): """ Save candidates to file. """ all_fit = data.sort_values(by='max_mid_diam') all_fit.to_csv(filename, index=False) print(f'There are {len(all_fit)} candidate reactions!') print('---------------------------------------------------') def stacked_dist(data, col, xtitle, xlim, width): """ Plot histograms of data stacked by top level EC no. """ delta_data = {'total': []} for i, row in data.iterrows(): EC = row['ec'] top_EC = EC.split('.')[0] if top_EC not in list(delta_data.keys()): delta_data[top_EC] = [] delta_data[top_EC].append(row[col]) delta_data['total'].append(row[col]) fig, ax = plt.subplots(figsize=(8, 5)) if xlim is None: xlim = ( min([min(delta_data[i]) for i in delta_data])-2*width, max([max(delta_data[i]) for i in delta_data])+2*width ) X_bins = np.arange(xlim[0], xlim[1], width) for keys in delta_data: values = delta_data[keys] hist, bin_edges = np.histogram( a=values, bins=X_bins, density=True ) ax.plot( X_bins[:-1]+width/2, hist, c=pfn.EC_descriptions()[keys][1], lw='1.5', marker='o', alpha=1.0, label=pfn.EC_descriptions()[keys][0] ) ax.tick_params(axis='both', which='major', labelsize=16) ax.set_xlabel(xtitle, fontsize=16) ax.set_ylabel('frequency', fontsize=16) ax.set_xlim(xlim) # legend ax.legend(fontsize=16) return fig, ax def dist(X, xtitle, xlim, width): """ Plot histograms of data. """ fig, ax = plt.subplots(figsize=(8, 5)) if xlim is None: xlim = (min(X)-2*width, max(X)+2*width) X_bins = np.arange(xlim[0], xlim[1], width) hist, bin_edges = np.histogram(a=X, bins=X_bins) if xtitle == 'purchasability class': align = 'center' else: align = 'edge' ax.bar( bin_edges[:-1], hist, align=align, alpha=1.0, width=width, color='#2980B9', edgecolor='k' ) pfn.define_standard_plot( ax, xtitle=xtitle, ytitle='count', xlim=xlim, ylim=None ) return fig, ax def pie(X, xtitle, xlim, width): """ Plot pie chart of categorical data. """ if xtitle == 'purchasability class': labels = ['class I', 'class II', 'class III', 'class IV'] colours = ['#D2B1D1', '#3498DB', '#C0392B', '#CCD1D1'] sizes = [ len([i for i in X if i == 1]), len([i for i in X if i == 2]), len([i for i in X if i == 3]), len([i for i in X if i == 4]) ] else: raise ValueError('this type of plot is not defined.') # explode = (0.0, 0.0) fig, ax = plt.subplots(figsize=(5, 5)) wedges, _, _ = ax.pie( sizes, colors=colours, # explode=explode, labels=labels, autopct='%1.1f%%', # shadow=True, startangle=90, textprops={'fontsize': 16} ) for w in wedges: w.set_linewidth(1.5) w.set_edgecolor('k') # Equal aspect ratio ensures that pie is drawn as a circle. ax.axis('equal') return fig, ax def violinplot(data, col, ytitle, ylim): """ Plot violin plots of data separated by top level EC no. """ delta_data = {'total': []} for i, row in data.iterrows(): EC = row['ec'] top_EC = EC.split('.')[0] if top_EC not in list(delta_data.keys()): delta_data[top_EC] = [] delta_data[top_EC].append(row[col]) delta_data['total'].append(row[col]) fig, ax = plt.subplots(figsize=(8, 5)) for keys in delta_data: values = delta_data[keys] if keys == '-': number = 0 elif keys == 'total': number = -1 else: number = int(keys) parts = ax.violinplot( values, [number], showmeans=False, showmedians=False, showextrema=False ) for pc in parts['bodies']: pc.set_facecolor(pfn.EC_descriptions()[keys][1]) pc.set_edgecolor('black') pc.set_alpha(1.0) ax.tick_params(axis='both', which='major', labelsize=16) ax.set_xlabel('EC number', fontsize=16) ax.set_ylabel(ytitle, fontsize=16) ax.set_xlim(-2, 8) ax.set_xticks([-1, 0, 1, 2, 3, 4, 5, 6, 7]) ax.set_xticklabels( ['all', 'unknown', '1', '2', '3', '4', '5', '6', '7'] ) if col == 'max_mid_diam': ax.axhspan(ymin=4.0, ymax=6.6, facecolor='k', alpha=0.2) ax.set_ylim(ylim) return fig, ax
0
0
0
45b65903538778fcabe1da9b327d085a00bf388a
296
py
Python
Pyo_module/documentation_practice/soundfiles/read_from_disk.py
sebcampos/music
b508654f9524127bd2681628a9ec4b88dc607c8d
[ "MIT" ]
null
null
null
Pyo_module/documentation_practice/soundfiles/read_from_disk.py
sebcampos/music
b508654f9524127bd2681628a9ec4b88dc607c8d
[ "MIT" ]
null
null
null
Pyo_module/documentation_practice/soundfiles/read_from_disk.py
sebcampos/music
b508654f9524127bd2681628a9ec4b88dc607c8d
[ "MIT" ]
null
null
null
#!/usr/local/Caskroom/miniconda/base/envs/music_venv/bin/pythonw from pyo import * s = Server().boot() path = SNDS_PATH + "/transparent.aif" # stereo playback with a slight shift between the two channels. sf = SfPlayer(path, speed = [1, 0.995], loop = True, mul = 0.4).out() s.gui(locals())
22.769231
69
0.692568
#!/usr/local/Caskroom/miniconda/base/envs/music_venv/bin/pythonw from pyo import * s = Server().boot() path = SNDS_PATH + "/transparent.aif" # stereo playback with a slight shift between the two channels. sf = SfPlayer(path, speed = [1, 0.995], loop = True, mul = 0.4).out() s.gui(locals())
0
0
0
a725eb547405de5f74291f1b2d3d9454b51e7b4f
1,040
py
Python
HW/4-1/data/mark.py
houzeyu2683/IRRHW
c44298ad14c468eff36bc75ebc63abdc9ba24d55
[ "Apache-2.0" ]
null
null
null
HW/4-1/data/mark.py
houzeyu2683/IRRHW
c44298ad14c468eff36bc75ebc63abdc9ba24d55
[ "Apache-2.0" ]
null
null
null
HW/4-1/data/mark.py
houzeyu2683/IRRHW
c44298ad14c468eff36bc75ebc63abdc9ba24d55
[ "Apache-2.0" ]
1
2022-01-16T03:40:34.000Z
2022-01-16T03:40:34.000Z
import re from termcolor import colored # c = 'Objective: We investigated whether implantation of polylactic acid and epsilon-caprolactone copolymer (PLAC) cubes with or without basic fibroblast growth factor (b-FGF) released slowly from gelatin microspheres was able to induce fibrous tissue in the dead space remaining after pneumonectomy in the thoracic cavity.' # s = 'Objective: We investigated whether implantation of polylactic acid and epsilon-caprolactone copolymer (PLAC) cubes with or without basic fibroblast growth factor (b-FGF) released slowly from gelatin microspheres was able to induce fibrous tissue in the dead space remaining after pneumonectomy in the thoracic cavity.' # print(c.replace(s, "\33[33m" +s+ "\33[0m"))
41.6
325
0.728846
import re from termcolor import colored def mark(title=None, content=None, sentence=None): # title = colored(title, 'blue') title = "\33[44m" + title + '\33[0m' for s in sentence: content = content.replace(s, "\33[33m" + s + "\33[0m") pass print(title) print(content) print("-"*50) return # c = 'Objective: We investigated whether implantation of polylactic acid and epsilon-caprolactone copolymer (PLAC) cubes with or without basic fibroblast growth factor (b-FGF) released slowly from gelatin microspheres was able to induce fibrous tissue in the dead space remaining after pneumonectomy in the thoracic cavity.' # s = 'Objective: We investigated whether implantation of polylactic acid and epsilon-caprolactone copolymer (PLAC) cubes with or without basic fibroblast growth factor (b-FGF) released slowly from gelatin microspheres was able to induce fibrous tissue in the dead space remaining after pneumonectomy in the thoracic cavity.' # print(c.replace(s, "\33[33m" +s+ "\33[0m"))
274
0
23
11d2c2a073fa640934b4e572f12441d307fd4616
46
py
Python
env/lib/python3.8/site-packages/IPython/utils/_sysinfo.py
mohnjahoney/website_source
edc86a869b90ae604f32e736d9d5ecd918088e6a
[ "MIT" ]
null
null
null
env/lib/python3.8/site-packages/IPython/utils/_sysinfo.py
mohnjahoney/website_source
edc86a869b90ae604f32e736d9d5ecd918088e6a
[ "MIT" ]
null
null
null
env/lib/python3.8/site-packages/IPython/utils/_sysinfo.py
mohnjahoney/website_source
edc86a869b90ae604f32e736d9d5ecd918088e6a
[ "MIT" ]
1
2020-01-25T20:08:59.000Z
2020-01-25T20:08:59.000Z
# GENERATED BY setup.py commit = u"e508b6e4d"
15.333333
23
0.73913
# GENERATED BY setup.py commit = u"e508b6e4d"
0
0
0
afc39b63f51ff4eac5da936b6df311213eed6371
15,150
py
Python
addresslib/parser.py
EncircleInc/addresslib
00db37272f6d962ce4de6f26df46c1336057c789
[ "Apache-2.0" ]
1
2018-05-14T03:50:32.000Z
2018-05-14T03:50:32.000Z
addresslib/parser.py
EncircleInc/addresslib
00db37272f6d962ce4de6f26df46c1336057c789
[ "Apache-2.0" ]
null
null
null
addresslib/parser.py
EncircleInc/addresslib
00db37272f6d962ce4de6f26df46c1336057c789
[ "Apache-2.0" ]
null
null
null
# coding:utf-8 """ _AddressParser is an implementation of a recursive descent parser for email addresses and urls. While _AddressParser can be used directly it is not recommended, use the the parse() method which is provided in the address module for convenience. The grammar supported by the parser (as well as other limitations) are outlined below. Plugins are also supported to allow for custom more restrictive grammar that is typically seen at large Email Service Providers (ESPs). For email addresses, the grammar tries to stick to RFC 5322 as much as possible, but includes relaxed (lax) grammar as well to support for common realistic uses of email addresses on the Internet. Grammar: address-list -> address { delimiter address } mailbox -> name-addr-rfc | name-addr-lax | addr-spec | url name-addr-rfc -> [ display-name-rfc ] angle-addr-rfc display-name-rfc -> [ whitespace ] word { whitespace word } angle-addr-rfc -> [ whitespace ] < addr-spec > [ whitespace ] name-addr-lax -> [ display-name-lax ] angle-addr-lax display-name-lax -> [ whitespace ] word { whitespace word } whitespace angle-addr-lax -> addr-spec [ whitespace ] addr-spec -> [ whitespace ] local-part @ domain [ whitespace ] local-part -> dot-atom | quoted-string domain -> dot-atom word -> word-ascii | word-unicode word-ascii -> atom | quoted-string word-unicode -> unicode-atom | unicode-qstring whitespace -> whitespace-ascii | whitespace-unicode Additional limitations on email addresses: 1. local-part: * Must not be greater than 64 octets 2. domain: * No more than 127 levels * Each level no more than 63 octets * Texual representation can not exceed 253 characters * No level can begin or end with - 3. Maximum mailbox length is len(local-part) + len('@') + len(domain) which is 64 + 1 + 253 = 318 characters. Allow 194 characters for a display name and the (very generous) limit becomes 512 characters. Allow 1024 mailboxes and the total limit on a mailbox-list is 524288 characters. """ import re import addresslib.address from addresslib.tokenizer import TokenStream from addresslib.tokenizer import LBRACKET from addresslib.tokenizer import AT_SYMBOL from addresslib.tokenizer import RBRACKET from addresslib.tokenizer import DQUOTE from addresslib.tokenizer import BAD_DOMAIN from addresslib.tokenizer import DELIMITER from addresslib.tokenizer import RELAX_ATOM from addresslib.tokenizer import WHITESPACE from addresslib.tokenizer import UNI_WHITE from addresslib.tokenizer import ATOM from addresslib.tokenizer import UNI_ATOM from addresslib.tokenizer import UNI_QSTR from addresslib.tokenizer import DOT_ATOM from addresslib.tokenizer import QSTRING from addresslib.tokenizer import URL from .utils import is_pure_ascii from .utils import contains_control_chars from .utils import cleanup_display_name from .utils import cleanup_email class _AddressParser(object): """ Do not use _AddressParser directly because it heavily relies on other private classes and methods and its interface is not guaranteed. It will change in the future and possibly break your application. Instead use the parse() function in the address.py module which will always return a scalar or iterable respectively. """ def address_list(self, stream): """ Extract a mailbox and/or url list from a stream of input, operates in strict and relaxed modes. """ # sanity check if not stream: raise ParserException('No input provided to parser.') if isinstance(stream, str) and not is_pure_ascii(stream): raise ParserException('ASCII string contains non-ASCII chars.') # to avoid spinning here forever, limit address list length if len(stream) > MAX_ADDRESS_LIST_LENGTH: raise ParserException('Stream length exceeds maximum allowable ' + \ 'address list length of ' + str(MAX_ADDRESS_LIST_LENGTH) + '.') # set stream self.stream = TokenStream(stream) if self.strict is True: return self._address_list_strict() return self._address_list_relaxed() def address(self, stream): """ Extract a single address or url from a stream of input, always operates in strict mode. """ # sanity check if not stream: raise ParserException('No input provided to parser.') if isinstance(stream, str) and not is_pure_ascii(stream): raise ParserException('ASCII string contains non-ASCII chars.') # to avoid spinning here forever, limit mailbox length if len(stream) > MAX_ADDRESS_LENGTH: raise ParserException('Stream length exceeds maximum allowable ' + \ 'address length of ' + str(MAX_ADDRESS_LENGTH) + '.') self.stream = TokenStream(stream) addr = self._address() if addr: # optional whitespace self._whitespace() # if we hit the end of the stream, we have a valid inbox if self.stream.end_of_stream(): return addr return None def address_spec(self, stream): """ Extract a single address spec from a stream of input, always operates in strict mode. """ # sanity check if stream is None: raise ParserException('No input provided to parser.') if isinstance(stream, str) and not is_pure_ascii(stream): raise ParserException('ASCII string contains non-ASCII chars.') # to avoid spinning here forever, limit mailbox length if len(stream) > MAX_ADDRESS_LENGTH: raise ParserException('Stream length exceeds maximum allowable ' + \ 'address length of ' + str(MAX_ADDRESS_LENGTH) + '.') self.stream = TokenStream(stream) addr = self._addr_spec() if addr: # optional whitespace self._whitespace() # if we hit the end of the stream, we have a valid inbox if self.stream.end_of_stream(): return addr return None def _mailbox_post_processing_checks(self, address): """ Additional post processing checks to ensure mailbox is valid. """ parts = address.split('@') # check if local part is less than 1024 octets, the actual # limit is 64 octets but we allow 16x that size here because # unsubscribe links are frequently longer lpart = parts[0] if len(lpart) > 1024: return False # check if the domain is less than 255 octets domn = parts[1] if len(domn) > 253: return False # number of labels can not be over 127 labels = domn.split('.') if len(labels) > 127: return False for label in labels: # check the domain doesn't start or end with - and # the length of each label is no more than 63 octets if BAD_DOMAIN.search(label) or len(label) > 63: return False return True def _address_list_relaxed(self): """ Grammar: address-list-relaxed -> address { delimiter address } """ #addrs = [] addrs = addresslib.address.AddressList() unparsable = [] # address addr = self._address() if addr is None: # synchronize to the next delimiter (or end of line) # append the skipped over text to the unparsable list skip = self.stream.synchronize() if skip: unparsable.append(skip) # if no mailbox and end of stream, we were unable # return the unparsable stream if self.stream.end_of_stream(): return [], unparsable else: # if we found a delimiter or end of stream, we have a # valid mailbox, add it if self.stream.peek(DELIMITER) or self.stream.end_of_stream(): addrs.append(addr) else: # otherwise snychornize and add it the unparsable array skip = self.stream.synchronize() if skip: pre = self.stream.stream[:self.stream.stream.index(skip)] unparsable.append(pre + skip) # if we hit the end of the stream, return the results if self.stream.end_of_stream(): return [], [self.stream.stream] while True: # delimiter dlm = self.stream.get_token(DELIMITER) if dlm is None: skip = self.stream.synchronize() if skip: unparsable.append(skip) if self.stream.end_of_stream(): break # address start_pos = self.stream.position addr = self._address() if addr is None: skip = self.stream.synchronize() if skip: unparsable.append(skip) if self.stream.end_of_stream(): break else: # if we found a delimiter or end of stream, we have a # valid mailbox, add it if self.stream.peek(DELIMITER) or self.stream.end_of_stream(): addrs.append(addr) else: # otherwise snychornize and add it the unparsable array skip = self.stream.synchronize() if skip: sskip = self.stream.stream[start_pos:self.stream.position] unparsable.append(sskip) # if we hit the end of the stream, return the results if self.stream.end_of_stream(): return addrs, unparsable return addrs, unparsable def _address_list_strict(self): """ Grammar: address-list-strict -> address { delimiter address } """ #addrs = [] addrs = addresslib.address.AddressList() # address addr = self._address() if addr is None: return addrs if self.stream.peek(DELIMITER): addrs.append(addr) while True: # delimiter dlm = self.stream.get_token(DELIMITER) if dlm is None: break # address addr = self._address() if addr is None: break addrs.append(addr) return addrs def _address(self): """ Grammar: address -> name-addr-rfc | name-addr-lax | addr-spec | url """ start_pos = self.stream.position addr = self._addr_spec() # if email address, check that it passes post processing checks if addr and isinstance(addr, addresslib.address.EmailAddress): if self._mailbox_post_processing_checks(addr.address) is False: # roll back self.stream.position = start_pos return None return addr def _addr_spec(self, as_string=False): """ Grammar: addr-spec -> [ whitespace ] local-part @ domain [ whitespace ] """ start_pos = self.stream.position # optional whitespace self._whitespace() lpart = self._local_part() if lpart is None: # rollback self.stream.position = start_pos return None asym = self.stream.get_token(AT_SYMBOL) if asym is None: # rollback self.stream.position = start_pos return None domn = self._domain() if domn is None: # rollback self.stream.position = start_pos return None # optional whitespace self._whitespace() aspec = cleanup_email(''.join([lpart, asym, domn])) if as_string: return aspec return addresslib.address.EmailAddress(aspec) def _local_part(self): """ Grammar: local-part -> dot-atom | quoted-string """ return self.stream.get_token(DOT_ATOM) or \ self.stream.get_token(QSTRING) def _domain(self): """ Grammar: domain -> dot-atom """ return self.stream.get_token(DOT_ATOM) def _word(self): """ Grammar: word -> word-ascii | word-unicode """ start_pos = self.stream.position # ascii word ascii_wrd = self._word_ascii() if ascii_wrd and not self.stream.peek(UNI_ATOM): return ascii_wrd # didn't get an ascii word, rollback to try again self.stream.position = start_pos # unicode word return self._word_unicode() def _word_ascii(self): """ Grammar: word-ascii -> atom | qstring """ wrd = self.stream.get_token(RELAX_ATOM) or self.stream.get_token(QSTRING) if wrd and not contains_control_chars(wrd): return wrd return None def _word_unicode(self): """ Grammar: word-unicode -> unicode-atom | unicode-qstring """ start_pos = self.stream.position # unicode atom uwrd = self.stream.get_token(UNI_ATOM) if uwrd and isinstance(uwrd, str) and not contains_control_chars(uwrd): return uwrd # unicode qstr uwrd = self.stream.get_token(UNI_QSTR, 'qstr') if uwrd and isinstance(uwrd, str) and not contains_control_chars(uwrd): return '"{0}"'.format(encode_string(None, uwrd)) # rollback self.stream.position = start_pos return None def _whitespace(self): """ Grammar: whitespace -> whitespace-ascii | whitespace-unicode """ return self._whitespace_ascii() or self._whitespace_unicode() def _whitespace_ascii(self): """ Grammar: whitespace-ascii -> whitespace-ascii """ return self.stream.get_token(WHITESPACE) def _whitespace_unicode(self): """ Grammar: whitespace-unicode -> whitespace-unicode """ uwhite = self.stream.get_token(UNI_WHITE) if uwhite and not is_pure_ascii(uwhite): return uwhite return None class ParserException(Exception): """ Exception raised when the parser encounters some parsing exception. """ MAX_ADDRESS_LENGTH = 1280 MAX_ADDRESS_NUMBER = 1024 MAX_ADDRESS_LIST_LENGTH = MAX_ADDRESS_LENGTH * MAX_ADDRESS_NUMBER
32.721382
82
0.600528
# coding:utf-8 """ _AddressParser is an implementation of a recursive descent parser for email addresses and urls. While _AddressParser can be used directly it is not recommended, use the the parse() method which is provided in the address module for convenience. The grammar supported by the parser (as well as other limitations) are outlined below. Plugins are also supported to allow for custom more restrictive grammar that is typically seen at large Email Service Providers (ESPs). For email addresses, the grammar tries to stick to RFC 5322 as much as possible, but includes relaxed (lax) grammar as well to support for common realistic uses of email addresses on the Internet. Grammar: address-list -> address { delimiter address } mailbox -> name-addr-rfc | name-addr-lax | addr-spec | url name-addr-rfc -> [ display-name-rfc ] angle-addr-rfc display-name-rfc -> [ whitespace ] word { whitespace word } angle-addr-rfc -> [ whitespace ] < addr-spec > [ whitespace ] name-addr-lax -> [ display-name-lax ] angle-addr-lax display-name-lax -> [ whitespace ] word { whitespace word } whitespace angle-addr-lax -> addr-spec [ whitespace ] addr-spec -> [ whitespace ] local-part @ domain [ whitespace ] local-part -> dot-atom | quoted-string domain -> dot-atom word -> word-ascii | word-unicode word-ascii -> atom | quoted-string word-unicode -> unicode-atom | unicode-qstring whitespace -> whitespace-ascii | whitespace-unicode Additional limitations on email addresses: 1. local-part: * Must not be greater than 64 octets 2. domain: * No more than 127 levels * Each level no more than 63 octets * Texual representation can not exceed 253 characters * No level can begin or end with - 3. Maximum mailbox length is len(local-part) + len('@') + len(domain) which is 64 + 1 + 253 = 318 characters. Allow 194 characters for a display name and the (very generous) limit becomes 512 characters. Allow 1024 mailboxes and the total limit on a mailbox-list is 524288 characters. """ import re import addresslib.address from addresslib.tokenizer import TokenStream from addresslib.tokenizer import LBRACKET from addresslib.tokenizer import AT_SYMBOL from addresslib.tokenizer import RBRACKET from addresslib.tokenizer import DQUOTE from addresslib.tokenizer import BAD_DOMAIN from addresslib.tokenizer import DELIMITER from addresslib.tokenizer import RELAX_ATOM from addresslib.tokenizer import WHITESPACE from addresslib.tokenizer import UNI_WHITE from addresslib.tokenizer import ATOM from addresslib.tokenizer import UNI_ATOM from addresslib.tokenizer import UNI_QSTR from addresslib.tokenizer import DOT_ATOM from addresslib.tokenizer import QSTRING from addresslib.tokenizer import URL from .utils import is_pure_ascii from .utils import contains_control_chars from .utils import cleanup_display_name from .utils import cleanup_email class _AddressParser(object): """ Do not use _AddressParser directly because it heavily relies on other private classes and methods and its interface is not guaranteed. It will change in the future and possibly break your application. Instead use the parse() function in the address.py module which will always return a scalar or iterable respectively. """ def __init__(self, strict=False): self.stream = None self.strict = strict def address_list(self, stream): """ Extract a mailbox and/or url list from a stream of input, operates in strict and relaxed modes. """ # sanity check if not stream: raise ParserException('No input provided to parser.') if isinstance(stream, str) and not is_pure_ascii(stream): raise ParserException('ASCII string contains non-ASCII chars.') # to avoid spinning here forever, limit address list length if len(stream) > MAX_ADDRESS_LIST_LENGTH: raise ParserException('Stream length exceeds maximum allowable ' + \ 'address list length of ' + str(MAX_ADDRESS_LIST_LENGTH) + '.') # set stream self.stream = TokenStream(stream) if self.strict is True: return self._address_list_strict() return self._address_list_relaxed() def address(self, stream): """ Extract a single address or url from a stream of input, always operates in strict mode. """ # sanity check if not stream: raise ParserException('No input provided to parser.') if isinstance(stream, str) and not is_pure_ascii(stream): raise ParserException('ASCII string contains non-ASCII chars.') # to avoid spinning here forever, limit mailbox length if len(stream) > MAX_ADDRESS_LENGTH: raise ParserException('Stream length exceeds maximum allowable ' + \ 'address length of ' + str(MAX_ADDRESS_LENGTH) + '.') self.stream = TokenStream(stream) addr = self._address() if addr: # optional whitespace self._whitespace() # if we hit the end of the stream, we have a valid inbox if self.stream.end_of_stream(): return addr return None def address_spec(self, stream): """ Extract a single address spec from a stream of input, always operates in strict mode. """ # sanity check if stream is None: raise ParserException('No input provided to parser.') if isinstance(stream, str) and not is_pure_ascii(stream): raise ParserException('ASCII string contains non-ASCII chars.') # to avoid spinning here forever, limit mailbox length if len(stream) > MAX_ADDRESS_LENGTH: raise ParserException('Stream length exceeds maximum allowable ' + \ 'address length of ' + str(MAX_ADDRESS_LENGTH) + '.') self.stream = TokenStream(stream) addr = self._addr_spec() if addr: # optional whitespace self._whitespace() # if we hit the end of the stream, we have a valid inbox if self.stream.end_of_stream(): return addr return None def _mailbox_post_processing_checks(self, address): """ Additional post processing checks to ensure mailbox is valid. """ parts = address.split('@') # check if local part is less than 1024 octets, the actual # limit is 64 octets but we allow 16x that size here because # unsubscribe links are frequently longer lpart = parts[0] if len(lpart) > 1024: return False # check if the domain is less than 255 octets domn = parts[1] if len(domn) > 253: return False # number of labels can not be over 127 labels = domn.split('.') if len(labels) > 127: return False for label in labels: # check the domain doesn't start or end with - and # the length of each label is no more than 63 octets if BAD_DOMAIN.search(label) or len(label) > 63: return False return True def _address_list_relaxed(self): """ Grammar: address-list-relaxed -> address { delimiter address } """ #addrs = [] addrs = addresslib.address.AddressList() unparsable = [] # address addr = self._address() if addr is None: # synchronize to the next delimiter (or end of line) # append the skipped over text to the unparsable list skip = self.stream.synchronize() if skip: unparsable.append(skip) # if no mailbox and end of stream, we were unable # return the unparsable stream if self.stream.end_of_stream(): return [], unparsable else: # if we found a delimiter or end of stream, we have a # valid mailbox, add it if self.stream.peek(DELIMITER) or self.stream.end_of_stream(): addrs.append(addr) else: # otherwise snychornize and add it the unparsable array skip = self.stream.synchronize() if skip: pre = self.stream.stream[:self.stream.stream.index(skip)] unparsable.append(pre + skip) # if we hit the end of the stream, return the results if self.stream.end_of_stream(): return [], [self.stream.stream] while True: # delimiter dlm = self.stream.get_token(DELIMITER) if dlm is None: skip = self.stream.synchronize() if skip: unparsable.append(skip) if self.stream.end_of_stream(): break # address start_pos = self.stream.position addr = self._address() if addr is None: skip = self.stream.synchronize() if skip: unparsable.append(skip) if self.stream.end_of_stream(): break else: # if we found a delimiter or end of stream, we have a # valid mailbox, add it if self.stream.peek(DELIMITER) or self.stream.end_of_stream(): addrs.append(addr) else: # otherwise snychornize and add it the unparsable array skip = self.stream.synchronize() if skip: sskip = self.stream.stream[start_pos:self.stream.position] unparsable.append(sskip) # if we hit the end of the stream, return the results if self.stream.end_of_stream(): return addrs, unparsable return addrs, unparsable def _address_list_strict(self): """ Grammar: address-list-strict -> address { delimiter address } """ #addrs = [] addrs = addresslib.address.AddressList() # address addr = self._address() if addr is None: return addrs if self.stream.peek(DELIMITER): addrs.append(addr) while True: # delimiter dlm = self.stream.get_token(DELIMITER) if dlm is None: break # address addr = self._address() if addr is None: break addrs.append(addr) return addrs def _address(self): """ Grammar: address -> name-addr-rfc | name-addr-lax | addr-spec | url """ start_pos = self.stream.position addr = self._addr_spec() # if email address, check that it passes post processing checks if addr and isinstance(addr, addresslib.address.EmailAddress): if self._mailbox_post_processing_checks(addr.address) is False: # roll back self.stream.position = start_pos return None return addr def _addr_spec(self, as_string=False): """ Grammar: addr-spec -> [ whitespace ] local-part @ domain [ whitespace ] """ start_pos = self.stream.position # optional whitespace self._whitespace() lpart = self._local_part() if lpart is None: # rollback self.stream.position = start_pos return None asym = self.stream.get_token(AT_SYMBOL) if asym is None: # rollback self.stream.position = start_pos return None domn = self._domain() if domn is None: # rollback self.stream.position = start_pos return None # optional whitespace self._whitespace() aspec = cleanup_email(''.join([lpart, asym, domn])) if as_string: return aspec return addresslib.address.EmailAddress(aspec) def _local_part(self): """ Grammar: local-part -> dot-atom | quoted-string """ return self.stream.get_token(DOT_ATOM) or \ self.stream.get_token(QSTRING) def _domain(self): """ Grammar: domain -> dot-atom """ return self.stream.get_token(DOT_ATOM) def _word(self): """ Grammar: word -> word-ascii | word-unicode """ start_pos = self.stream.position # ascii word ascii_wrd = self._word_ascii() if ascii_wrd and not self.stream.peek(UNI_ATOM): return ascii_wrd # didn't get an ascii word, rollback to try again self.stream.position = start_pos # unicode word return self._word_unicode() def _word_ascii(self): """ Grammar: word-ascii -> atom | qstring """ wrd = self.stream.get_token(RELAX_ATOM) or self.stream.get_token(QSTRING) if wrd and not contains_control_chars(wrd): return wrd return None def _word_unicode(self): """ Grammar: word-unicode -> unicode-atom | unicode-qstring """ start_pos = self.stream.position # unicode atom uwrd = self.stream.get_token(UNI_ATOM) if uwrd and isinstance(uwrd, str) and not contains_control_chars(uwrd): return uwrd # unicode qstr uwrd = self.stream.get_token(UNI_QSTR, 'qstr') if uwrd and isinstance(uwrd, str) and not contains_control_chars(uwrd): return '"{0}"'.format(encode_string(None, uwrd)) # rollback self.stream.position = start_pos return None def _whitespace(self): """ Grammar: whitespace -> whitespace-ascii | whitespace-unicode """ return self._whitespace_ascii() or self._whitespace_unicode() def _whitespace_ascii(self): """ Grammar: whitespace-ascii -> whitespace-ascii """ return self.stream.get_token(WHITESPACE) def _whitespace_unicode(self): """ Grammar: whitespace-unicode -> whitespace-unicode """ uwhite = self.stream.get_token(UNI_WHITE) if uwhite and not is_pure_ascii(uwhite): return uwhite return None class ParserException(Exception): """ Exception raised when the parser encounters some parsing exception. """ def __init__(self, reason='Unknown parser error.'): self.reason = reason def __str__(self): return self.reason MAX_ADDRESS_LENGTH = 1280 MAX_ADDRESS_NUMBER = 1024 MAX_ADDRESS_LIST_LENGTH = MAX_ADDRESS_LENGTH * MAX_ADDRESS_NUMBER
151
0
80
349cd8224fa1f9ee9b2e9dfb2aabe387ba192b91
375
py
Python
set_pathparameters.py
tgquintela/Firms_locations
476680cbc3eb1308811633d24810049e215101a0
[ "MIT" ]
null
null
null
set_pathparameters.py
tgquintela/Firms_locations
476680cbc3eb1308811633d24810049e215101a0
[ "MIT" ]
null
null
null
set_pathparameters.py
tgquintela/Firms_locations
476680cbc3eb1308811633d24810049e215101a0
[ "MIT" ]
null
null
null
""" Path parameters --------------- Parameters to set the precomputations in order to facilitate the computation model tasks """ pathdata_in = '/home/antonio/Desktop/MSc Thesis/code/Data/raw_data/Testing' pathdata = '/home/antonio/Desktop/MSc Thesis/code/Data/Data/Cleaned/FirmsData' pathfolder = '/home/antonio/Desktop/MSc Thesis/code/Data/Data/' logfile = 'logfile.log'
26.785714
78
0.746667
""" Path parameters --------------- Parameters to set the precomputations in order to facilitate the computation model tasks """ pathdata_in = '/home/antonio/Desktop/MSc Thesis/code/Data/raw_data/Testing' pathdata = '/home/antonio/Desktop/MSc Thesis/code/Data/Data/Cleaned/FirmsData' pathfolder = '/home/antonio/Desktop/MSc Thesis/code/Data/Data/' logfile = 'logfile.log'
0
0
0
3bb00424786be9192a7ff4a675cf41b76a72a38a
85
py
Python
config.py
Victoria1807/Telegram-Bot-Translator
92d6919c31cb0b59b312e8d5554a7a90d084c776
[ "MIT" ]
null
null
null
config.py
Victoria1807/Telegram-Bot-Translator
92d6919c31cb0b59b312e8d5554a7a90d084c776
[ "MIT" ]
1
2021-06-01T22:14:29.000Z
2021-06-01T22:14:29.000Z
config.py
Victoria1807/Telegram-Bot-Translator
92d6919c31cb0b59b312e8d5554a7a90d084c776
[ "MIT" ]
2
2020-11-21T11:51:23.000Z
2020-12-02T16:13:07.000Z
telegram_token = # your telegram token yandex_token = # your yandex-translator token
28.333333
45
0.8
telegram_token = # your telegram token yandex_token = # your yandex-translator token
0
0
0
ed2b3a9088cb881cec24c1ec819b0f293b01a487
6,867
py
Python
hess/utils.py
g-benton/hessian-eff-dim
ed2431bc30d3233258bb7147b1c8fdc85c7bf1f0
[ "Apache-2.0" ]
34
2020-03-05T01:43:29.000Z
2022-03-20T04:23:00.000Z
hess/utils.py
g-benton/hessian-eff-dim
ed2431bc30d3233258bb7147b1c8fdc85c7bf1f0
[ "Apache-2.0" ]
3
2020-05-19T16:28:34.000Z
2022-01-13T14:17:02.000Z
hess/utils.py
g-benton/hessian-eff-dim
ed2431bc30d3233258bb7147b1c8fdc85c7bf1f0
[ "Apache-2.0" ]
5
2020-03-10T03:15:30.000Z
2021-09-30T17:57:56.000Z
import torch import time import numpy as np import hess from torch import nn import torch.nn.functional as F from torch.autograd import Variable from gpytorch.utils.lanczos import lanczos_tridiag, lanczos_tridiag_to_diag ################################################################################ # Supporting Functions ################################################################################ def gradtensor_to_tensor(net, include_bn=False): """ convert the grad tensors to a list """ filter = lambda p: include_bn or len(p.data.size()) > 1 return flatten([p.grad.data for p in net.parameters() if filter(p)]) ################################################################################ # For computing Hessian-vector products ################################################################################ def eval_hess_vec_prod(vec, params, net, criterion, inputs=None, targets=None, dataloader=None, use_cuda=False): """ Evaluate product of the Hessian of the loss function with a direction vector "vec". The product result is saved in the grad of net. Args: vec: a list of tensor with the same dimensions as "params". params: the parameter list of the net (ignoring biases and BN parameters). net: model with trained parameters. criterion: loss function. dataloader: dataloader for the dataset. use_cuda: use GPU. """ if use_cuda: net.cuda() vec = [v.cuda() for v in vec] net.zero_grad() # clears grad for every parameter in the net if dataloader is None: inputs, targets = Variable(inputs), Variable(targets) if use_cuda: inputs, targets = inputs.cuda(), targets.cuda() # outputs = net(inputs) loss = criterion(net(inputs), targets) grad_f = torch.autograd.grad(loss, inputs=params, create_graph=True) # Compute inner product of gradient with the direction vector # prod = Variable(torch.zeros(1)).type(type(grad_f[0].data)) prod = torch.zeros(1, dtype=grad_f[0].dtype, device=grad_f[0].device) for (g, v) in zip(grad_f, vec): print(g.shape, v.shape) prod = prod + (g * v).sum() # Compute the Hessian-vector product, H*v # prod.backward() computes dprod/dparams for every parameter in params and # accumulate the gradients into the params.grad attributes prod.backward() else: for batch_idx, (inputs, targets) in enumerate(dataloader): #inputs, targets = Variable(inputs), Variable(targets) if use_cuda: inputs, targets = inputs.cuda(), targets.cuda() loss = criterion(net(inputs), targets) grad_f = torch.autograd.grad(loss, inputs=params, create_graph=True) # Compute inner product of gradient with the direction vector prod = 0. for (g, v) in zip(grad_f, vec): prod = prod + (g * v).sum() # Compute the Hessian-vector product, H*v # prod.backward() computes dprod/dparams for every parameter in params and # accumulate the gradients into the params.grad attributes prod.backward() ############################# # Return Hessian of a model # #############################
37.52459
87
0.555556
import torch import time import numpy as np import hess from torch import nn import torch.nn.functional as F from torch.autograd import Variable from gpytorch.utils.lanczos import lanczos_tridiag, lanczos_tridiag_to_diag def unflatten_like(vector, likeTensorList): # Takes a flat torch.tensor and unflattens it to a list of torch.tensors # shaped like likeTensorList outList = [] i = 0 for tensor in likeTensorList: n = tensor.numel() outList.append(vector[:, i : i + n].view(tensor.shape)) i += n return outList ################################################################################ # Supporting Functions ################################################################################ def gradtensor_to_tensor(net, include_bn=False): """ convert the grad tensors to a list """ filter = lambda p: include_bn or len(p.data.size()) > 1 return flatten([p.grad.data for p in net.parameters() if filter(p)]) ################################################################################ # For computing Hessian-vector products ################################################################################ def eval_hess_vec_prod(vec, params, net, criterion, inputs=None, targets=None, dataloader=None, use_cuda=False): """ Evaluate product of the Hessian of the loss function with a direction vector "vec". The product result is saved in the grad of net. Args: vec: a list of tensor with the same dimensions as "params". params: the parameter list of the net (ignoring biases and BN parameters). net: model with trained parameters. criterion: loss function. dataloader: dataloader for the dataset. use_cuda: use GPU. """ if use_cuda: net.cuda() vec = [v.cuda() for v in vec] net.zero_grad() # clears grad for every parameter in the net if dataloader is None: inputs, targets = Variable(inputs), Variable(targets) if use_cuda: inputs, targets = inputs.cuda(), targets.cuda() # outputs = net(inputs) loss = criterion(net(inputs), targets) grad_f = torch.autograd.grad(loss, inputs=params, create_graph=True) # Compute inner product of gradient with the direction vector # prod = Variable(torch.zeros(1)).type(type(grad_f[0].data)) prod = torch.zeros(1, dtype=grad_f[0].dtype, device=grad_f[0].device) for (g, v) in zip(grad_f, vec): print(g.shape, v.shape) prod = prod + (g * v).sum() # Compute the Hessian-vector product, H*v # prod.backward() computes dprod/dparams for every parameter in params and # accumulate the gradients into the params.grad attributes prod.backward() else: for batch_idx, (inputs, targets) in enumerate(dataloader): #inputs, targets = Variable(inputs), Variable(targets) if use_cuda: inputs, targets = inputs.cuda(), targets.cuda() loss = criterion(net(inputs), targets) grad_f = torch.autograd.grad(loss, inputs=params, create_graph=True) # Compute inner product of gradient with the direction vector prod = 0. for (g, v) in zip(grad_f, vec): prod = prod + (g * v).sum() # Compute the Hessian-vector product, H*v # prod.backward() computes dprod/dparams for every parameter in params and # accumulate the gradients into the params.grad attributes prod.backward() def flatten(lst): tmp = [i.contiguous().view(-1, 1) for i in lst] return torch.cat(tmp).view(-1) ############################# # Return Hessian of a model # ############################# def get_hessian(train_x, train_y, loss, model, use_cuda=False): n_par = sum(torch.numel(p) for p in model.parameters()) hessian = torch.zeros(n_par, n_par) if use_cuda: model = model.cuda() else: model = model.cpu() for pp in range(n_par): base_vec = torch.zeros(n_par).unsqueeze(0) if use_cuda: base_vec = base_vec.cuda() model = model.cuda() base_vec[0, pp] = 1. base_vec = unflatten_like(base_vec, model.parameters()) eval_hess_vec_prod(base_vec, model.parameters(), net=model, criterion=loss, inputs=train_x, targets=train_y) if pp == 0: output = gradtensor_to_tensor(model, include_bn=True) hessian = torch.zeros(output.nelement(), output.nelement()) hessian[:, pp] = output hessian[:, pp] = gradtensor_to_tensor(model, include_bn=True) return hessian def get_hessian_eigs(loss, model, mask=None, use_cuda=False, n_eigs=100, train_x=None, train_y=None, loader=None, evals=False): if train_x is not None: if use_cuda: train_x = train_x.cuda() train_y = train_y.cuda() total_pars = sum(m.numel() for m in model.parameters()) if n_eigs != -1: if mask is not None: numpars = int(mask.sum().item()) else: numpars = total_pars p = next(iter(model.parameters())) mask = torch.ones(total_pars, dtype=p.dtype, device=p.device) def hvp(rhs): padded_rhs = unflatten_like(rhs.t(), model.parameters()) eval_hess_vec_prod(padded_rhs, model.parameters(), net=model, criterion=loss, inputs=train_x, targets=train_y, dataloader=loader, use_cuda=use_cuda) full_hvp = gradtensor_to_tensor(model, include_bn=True) return full_hvp if train_x is None: data = next(iter(loader))[0] if use_cuda: data = data.cuda() dtype = data.dtype device = data.device else: dtype, device = train_x.dtype, train_x.device qmat, tmat = lanczos_tridiag(hvp, n_eigs, dtype=dtype, device=device, matrix_shape=(numpars, numpars)) eigs, t_evals = lanczos_tridiag_to_diag(tmat) if evals: return eigs, qmat @ t_evals return eigs else: # form and extract sub hessian hessian = get_hessian(train_x, train_y, loss, model, use_cuda=use_cuda) keepers = np.array(np.where(mask.cpu() == 1))[0] sub_hess = hessian[np.ix_(keepers, keepers)] e_val, _ = np.linalg.eig(sub_hess.cpu().detach()) return e_val.real
3,336
0
92
db4db323175f6d5515e0d69ac5731e2c14ea3405
548
py
Python
languages/python/src/concepts/P008_ControlConstruct_Switch_Simulated.py
vikash-india/DeveloperNotes2Myself
fe277a3c52f73884863f2f72b237365b27a8c882
[ "MIT" ]
2
2019-05-25T10:09:00.000Z
2022-03-11T09:06:23.000Z
languages/python/src/concepts/P008_ControlConstruct_Switch_Simulated.py
vikash-india/DeveloperNotes2Myself
fe277a3c52f73884863f2f72b237365b27a8c882
[ "MIT" ]
2
2020-03-31T04:30:17.000Z
2020-10-30T07:54:28.000Z
languages/python/src/concepts/P008_ControlConstruct_Switch_Simulated.py
vikash-india/DeveloperNotes2Myself
fe277a3c52f73884863f2f72b237365b27a8c882
[ "MIT" ]
4
2019-07-12T13:18:56.000Z
2021-11-17T08:04:55.000Z
# Description: Switch Case (SIMULATED in Python) # Note # 1. There is NO switch statement in python. # 2. A dictionary can be used to simulate switch case in python. # 3. This style is also called loop-and-a-half. print(switch('b'))
28.842105
110
0.684307
# Description: Switch Case (SIMULATED in Python) # Note # 1. There is NO switch statement in python. # 2. A dictionary can be used to simulate switch case in python. # 3. This style is also called loop-and-a-half. def switch(argument): case = { 'a': 1, 'b': 2, } # The get() method of dictionary data type returns value of passed argument if it is present in dictionary # otherwise second argument will be assigned as default value of passed argument. return case.get(argument, "nothing") print(switch('b'))
290
0
23
89003675f027e82bbb6818df8a0c08a1fc544370
7,201
py
Python
mytexaspower/mytexaspower.py
krisfield/MyTexasPower
9d314fb1aac2335aae572da444d0e40148944d1b
[ "MIT" ]
1
2017-09-06T16:33:38.000Z
2017-09-06T16:33:38.000Z
mytexaspower/mytexaspower.py
krisfield/MyTexasPower
9d314fb1aac2335aae572da444d0e40148944d1b
[ "MIT" ]
3
2020-03-28T14:34:13.000Z
2020-03-28T14:34:21.000Z
mytexaspower/mytexaspower.py
MyTexasPower/MyTexasPower
9d314fb1aac2335aae572da444d0e40148944d1b
[ "MIT" ]
null
null
null
import csv import json import operator import os import sqlite3 import urllib.request from raven import Client from flask import Flask, request, session, g, redirect, make_response, url_for, abort, escape, render_template, flash, send_from_directory from passwords import SENTRY_DSN client = Client(SENTRY_DSN) #add debugging app = Flask(__name__, ) # create application instance app.config.from_object(__name__) # load confi from this file, app.py #default config app.config.update(dict( DATABASE=os.path.join(app.root_path, 'mypower.db'), SECRET_KEY= os.urandom(24) )) app.config.from_envvar('MYPOWER_SETTINGS', silent=True) ##loads settings if exist, doesn't complain if they don't def connect_db(): """Connects to the specific database.""" rv = sqlite3.connect(app.config['DATABASE']) rv.row_factory = sqlite3.Row return rv def get_db(): """Opens a new database connection if there is none yet for the current application context. """ if not hasattr(g, 'sqlite_db'): g.sqlite_db = connect_db() return g.sqlite_db def compare_renewable(arg): """Compares non-renewable offer to paying for a renewable plan""" user_preferences = get_saved_data('user') offer_id = arg[0] percent_renewable = int(arg[12]) top_offers = get_saved_data('offers') if percent_renewable != 100: db = get_db() t = (user_preferences["tdu"], user_preferences["contract"], 100, 'FALSE') usage = int(user_preferences["usage"]) cur = db.execute('SELECT * FROM offers WHERE TduCompanyName=? AND TermValue >=? AND Renewable >=? AND MinUsageFeesCredits = ? AND kwh500 IS NOT NULL', t) result = cur.fetchall() user_offers = {} for row in result: kwh2000 = row[6] kwh1000 = row[5] kwh500 = row[4] idkey = row[0] if usage > 1000: price = round(usage * kwh2000, 0) elif usage > 500: price = round(usage * kwh1000, 0) else: price = round(usage * kwh500, 0) user_offers.update({idkey: price}) sorted_offer = sorted(user_offers.items(), key=operator.itemgetter(1)) sorted_offer = sorted_offer[:1] sorted_offer = dict(sorted_offer) return sorted_offer else: return {} @app.teardown_appcontext def close_db(error): """Closes the database again at the end of the request.""" if hasattr(g, 'sqlite_db'): g.sqlite_db.close() def avg_price(user_preferences): """Estimates monthly electric bill""" db = get_db() t = (user_preferences["tdu"], user_preferences["contract"], user_preferences["renewable"], 'FALSE') usage = int(user_preferences["usage"]) usage_upper = usage * 1.25 cur = db.execute('SELECT * FROM offers WHERE TduCompanyName=? AND TermValue >=? AND Renewable >=? AND MinUsageFeesCredits = ? AND kwh500 IS NOT NULL', t) result = cur.fetchall() user_offers = {} for row in result: kwh2000 = row[6] kwh1000 = row[5] kwh500 = row[4] idkey = row[0] if usage > 1000: price = round(usage * kwh2000, 0) elif usage > 500: price = round(usage * kwh1000, 0) else: price = round(usage * kwh500, 0) ##compare to an upper price to heelp filter out bad offers if usage_upper > 1000: price_upper = round(usage_upper * kwh2000, 0) elif usage_upper > 500: price_upper = round(usage_upper * kwh1000, 0) else: price_upper = round(usage_upper * kwh500, 0) price_ratio = (price_upper - price)/price_upper ##if prices jump by 50% with an increase usage of 25% then don't consider them if price_ratio >= 0.50: pass else: user_offers.update({idkey: price}) sorted_offer = sorted(user_offers.items(), key=operator.itemgetter(1)) sorted_offer = sorted_offer[:10] sorted_offer = dict(sorted_offer) return sorted_offer @app.route('/offers/') @app.route('/offers/<int:idKey>/') @app.route('/save', methods=['GET', 'POST']) ##method only accesible if your post to it @app.route('/about/') @app.route('/') @app.route('/sitemap/') @app.errorhandler(404) @app.errorhandler(500) @app.route('/robots.txt') @app.route('/sitemap.xml') if __name__ == '__main__': app.run(debug=True)
33.337963
166
0.643661
import csv import json import operator import os import sqlite3 import urllib.request from raven import Client from flask import Flask, request, session, g, redirect, make_response, url_for, abort, escape, render_template, flash, send_from_directory from passwords import SENTRY_DSN client = Client(SENTRY_DSN) #add debugging app = Flask(__name__, ) # create application instance app.config.from_object(__name__) # load confi from this file, app.py #default config app.config.update(dict( DATABASE=os.path.join(app.root_path, 'mypower.db'), SECRET_KEY= os.urandom(24) )) app.config.from_envvar('MYPOWER_SETTINGS', silent=True) ##loads settings if exist, doesn't complain if they don't def get_saved_data(arg): try: data = json.loads(request.cookies.get(arg)) except TypeError: data = {} return data def connect_db(): """Connects to the specific database.""" rv = sqlite3.connect(app.config['DATABASE']) rv.row_factory = sqlite3.Row return rv def get_db(): """Opens a new database connection if there is none yet for the current application context. """ if not hasattr(g, 'sqlite_db'): g.sqlite_db = connect_db() return g.sqlite_db def compare_renewable(arg): """Compares non-renewable offer to paying for a renewable plan""" user_preferences = get_saved_data('user') offer_id = arg[0] percent_renewable = int(arg[12]) top_offers = get_saved_data('offers') if percent_renewable != 100: db = get_db() t = (user_preferences["tdu"], user_preferences["contract"], 100, 'FALSE') usage = int(user_preferences["usage"]) cur = db.execute('SELECT * FROM offers WHERE TduCompanyName=? AND TermValue >=? AND Renewable >=? AND MinUsageFeesCredits = ? AND kwh500 IS NOT NULL', t) result = cur.fetchall() user_offers = {} for row in result: kwh2000 = row[6] kwh1000 = row[5] kwh500 = row[4] idkey = row[0] if usage > 1000: price = round(usage * kwh2000, 0) elif usage > 500: price = round(usage * kwh1000, 0) else: price = round(usage * kwh500, 0) user_offers.update({idkey: price}) sorted_offer = sorted(user_offers.items(), key=operator.itemgetter(1)) sorted_offer = sorted_offer[:1] sorted_offer = dict(sorted_offer) return sorted_offer else: return {} @app.teardown_appcontext def close_db(error): """Closes the database again at the end of the request.""" if hasattr(g, 'sqlite_db'): g.sqlite_db.close() def avg_price(user_preferences): """Estimates monthly electric bill""" db = get_db() t = (user_preferences["tdu"], user_preferences["contract"], user_preferences["renewable"], 'FALSE') usage = int(user_preferences["usage"]) usage_upper = usage * 1.25 cur = db.execute('SELECT * FROM offers WHERE TduCompanyName=? AND TermValue >=? AND Renewable >=? AND MinUsageFeesCredits = ? AND kwh500 IS NOT NULL', t) result = cur.fetchall() user_offers = {} for row in result: kwh2000 = row[6] kwh1000 = row[5] kwh500 = row[4] idkey = row[0] if usage > 1000: price = round(usage * kwh2000, 0) elif usage > 500: price = round(usage * kwh1000, 0) else: price = round(usage * kwh500, 0) ##compare to an upper price to heelp filter out bad offers if usage_upper > 1000: price_upper = round(usage_upper * kwh2000, 0) elif usage_upper > 500: price_upper = round(usage_upper * kwh1000, 0) else: price_upper = round(usage_upper * kwh500, 0) price_ratio = (price_upper - price)/price_upper ##if prices jump by 50% with an increase usage of 25% then don't consider them if price_ratio >= 0.50: pass else: user_offers.update({idkey: price}) sorted_offer = sorted(user_offers.items(), key=operator.itemgetter(1)) sorted_offer = sorted_offer[:10] sorted_offer = dict(sorted_offer) return sorted_offer @app.route('/offers/') def offers(): db = get_db() saves = get_saved_data('user') top10 = get_saved_data('offers') t = list(top10.keys()) if top10: cur = db.execute('SELECT idKey, RepCompany, TermValue, Renewable, RateType, NewCustomer FROM offers WHERE idKey IN ({})'.format(', '.join('?' for _ in t)), t) offers = cur.fetchall() offer_list = [] for offer in offers: offer_data = list(offer) + [top10[str(offer[0])]] offer_list.append(offer_data) sorted_offers = sorted(offer_list, key=operator.itemgetter(6)) return render_template('offers.html', offers=sorted_offers, saves=saves) else: flash("No offers meet your search criteria. Please update your search and try again.") return redirect("/") @app.route('/offers/<int:idKey>/') def view_offer(idKey): context={'idKey': idKey} top10 = get_saved_data('offers') t = (context['idKey'], ) db = get_db() cur = db.execute('SELECT * FROM offers WHERE idKey = ? LIMIT 1', t) offer = cur.fetchone() try: offer_data = list(offer) + [top10[str(offer[0])]] except (TypeError, KeyError): flash("Electric preferences need to be input before viewing offer details") return redirect("/") else: r_offer = compare_renewable(offer) return render_template("offer_details.html", detail=offer_data, renewable=r_offer, **context) @app.route('/save', methods=['GET', 'POST']) ##method only accesible if your post to it def save(): if request.method == 'POST': data = get_saved_data('user') #Check if a cookie already exists & retrieve it user_input = dict(request.form.items()) offers = avg_price(user_input) data.update(user_input) ##If the cookie exists, only update the values that have changed response = make_response(redirect(url_for('offers'))) ##generates the response and sets it to response variable response.set_cookie('user', json.dumps(data)) ##builds dicts from tuple item pairs response.set_cookie('offers', json.dumps(offers)) return response else: print("DEBUG: save() GET method was called") @app.route('/about/') def about(): return render_template('about.html') @app.route('/') def index(): db = get_db() cur = db.execute('SELECT DISTINCT TduCompanyName from offers') tdus = cur.fetchall() return render_template('index.html', saves=get_saved_data('user'), tdus=tdus) @app.route('/sitemap/') def sitemap(): return render_template('sitemap.html') @app.errorhandler(404) def page_not_found(e): return render_template('404.html'), 404 @app.errorhandler(500) def page_not_found(e): return render_template('500.html'), 500 @app.route('/robots.txt') @app.route('/sitemap.xml') def static_from_root(): return send_from_directory(app.static_folder, request.path[1:]) if __name__ == '__main__': app.run(debug=True)
2,530
0
221
05f412458d46155f6e15b0e8f99e4f992fcf7c28
2,416
py
Python
pipeline_tools/tests/shared/submission/test_create_analysis_file.py
HumanCellAtlas/pipeline-tools
d9e22df56089a6b163901656e5ce9fa7d6420b48
[ "BSD-3-Clause" ]
5
2017-11-17T18:40:37.000Z
2021-01-20T04:06:47.000Z
pipeline_tools/tests/shared/submission/test_create_analysis_file.py
HumanCellAtlas/pipeline-tools
d9e22df56089a6b163901656e5ce9fa7d6420b48
[ "BSD-3-Clause" ]
113
2017-12-08T18:18:06.000Z
2021-10-12T15:10:07.000Z
pipeline_tools/tests/shared/submission/test_create_analysis_file.py
HumanCellAtlas/pipeline-tools
d9e22df56089a6b163901656e5ce9fa7d6420b48
[ "BSD-3-Clause" ]
3
2020-07-29T17:31:00.000Z
2021-01-18T08:18:48.000Z
import os import json import pytest import pipeline_tools.shared.submission.create_analysis_file as caf from pathlib import Path @pytest.fixture(scope='module') @pytest.fixture
36.059701
143
0.715646
import os import json import pytest import pipeline_tools.shared.submission.create_analysis_file as caf from pathlib import Path @pytest.fixture(scope='module') def test_data(): class Data: project_level_input_uuid = "project=16ed4ad8-7319-46b2-8859-6fe1c1d73a82;library=10X 3 v2 sequencing;species=Homo sapiens;organ=kidney" input_file = f'{Path(os.path.split(__file__)[0]).absolute().parents[1]}/updated-data/staging/intermediate-level/metadata.json' project_level_input_file = 'hca_adapter_testing/hca_adapter_test/hca_adapter_testing.loom' project_level_pipeline_type = 'OptimusPostProcessing' workspace_version = '2021-05-24T12:00:00.000000Z' input_uuid = 'heart_1k_test_v2_S1_L001' pipeline_type = 'optimus' project_level = True return Data @pytest.fixture def data_file(): def _data_file(file_name): return ( f'{Path(os.path.split(__file__)[0]).absolute().parents[1]}/data/{file_name}' ) return _data_file class TestCreateAnalysisFile(object): def test_build_analysis_file(self, test_data): analysis_file_json = caf.test_build_analysis_file( input_uuid=test_data.input_uuid, input_file=test_data.input_file, pipeline_type=test_data.pipeline_type, workspace_version=test_data.workspace_version ) desired_output_path = f'{Path(os.path.split(__file__)[0]).absolute().parents[1]}/updated-data/staging/intermediate-level/outputs.json' with open(desired_output_path) as f: desired_output = json.load(f) assert analysis_file_json == desired_output class TestCreateProjectLevelAnalysisFile(object): def test_build_analysis_file(self, test_data): analysis_file_json = caf.test_build_analysis_file( input_uuid=test_data.project_level_input_uuid, input_file=test_data.project_level_input_file, pipeline_type=test_data.project_level_pipeline_type, workspace_version=test_data.workspace_version, project_level=test_data.project_level ) desired_output_path = f'{Path(os.path.split(__file__)[0]).absolute().parents[1]}/updated-data/staging/project-level/outputs.json' with open(desired_output_path) as f: desired_output = json.load(f) assert analysis_file_json == desired_output
2,046
44
142
3c1a44b627984e13c8bf7e7f387b40885b041c18
2,239
py
Python
pipenv/patched/notpip/_internal/utils/egg_link.py
sthagen/pipenv
0924f75fd1004c848ea67d4272315eda4210b352
[ "MIT" ]
23
2017-01-20T01:18:31.000Z
2017-01-20T17:25:11.000Z
pipenv/patched/notpip/_internal/utils/egg_link.py
sthagen/pipenv
0924f75fd1004c848ea67d4272315eda4210b352
[ "MIT" ]
1
2017-01-20T05:13:58.000Z
2017-01-20T05:13:58.000Z
pipenv/patched/notpip/_internal/utils/egg_link.py
sthagen/pipenv
0924f75fd1004c848ea67d4272315eda4210b352
[ "MIT" ]
null
null
null
# The following comment should be removed at some point in the future. # mypy: strict-optional=False import os import re import sys from typing import Optional from pipenv.patched.notpip._internal.locations import site_packages, user_site from pipenv.patched.notpip._internal.utils.virtualenv import ( running_under_virtualenv, virtualenv_no_global, ) __all__ = [ "egg_link_path_from_sys_path", "egg_link_path_from_location", ] def _egg_link_name(raw_name: str) -> str: """ Convert a Name metadata value to a .egg-link name, by applying the same substitution as pkg_resources's safe_name function. Note: we cannot use canonicalize_name because it has a different logic. """ return re.sub("[^A-Za-z0-9.]+", "-", raw_name) + ".egg-link" def egg_link_path_from_sys_path(raw_name: str) -> Optional[str]: """ Look for a .egg-link file for project name, by walking sys.path. """ egg_link_name = _egg_link_name(raw_name) for path_item in sys.path: egg_link = os.path.join(path_item, egg_link_name) if os.path.isfile(egg_link): return egg_link return None def egg_link_path_from_location(raw_name: str) -> Optional[str]: """ Return the path for the .egg-link file if it exists, otherwise, None. There's 3 scenarios: 1) not in a virtualenv try to find in site.USER_SITE, then site_packages 2) in a no-global virtualenv try to find in site_packages 3) in a yes-global virtualenv try to find in site_packages, then site.USER_SITE (don't look in global location) For #1 and #3, there could be odd cases, where there's an egg-link in 2 locations. This method will just return the first one found. """ sites = [] if running_under_virtualenv(): sites.append(site_packages) if not virtualenv_no_global() and user_site: sites.append(user_site) else: if user_site: sites.append(user_site) sites.append(site_packages) egg_link_name = _egg_link_name(raw_name) for site in sites: egglink = os.path.join(site, egg_link_name) if os.path.isfile(egglink): return egglink return None
29.460526
78
0.684234
# The following comment should be removed at some point in the future. # mypy: strict-optional=False import os import re import sys from typing import Optional from pipenv.patched.notpip._internal.locations import site_packages, user_site from pipenv.patched.notpip._internal.utils.virtualenv import ( running_under_virtualenv, virtualenv_no_global, ) __all__ = [ "egg_link_path_from_sys_path", "egg_link_path_from_location", ] def _egg_link_name(raw_name: str) -> str: """ Convert a Name metadata value to a .egg-link name, by applying the same substitution as pkg_resources's safe_name function. Note: we cannot use canonicalize_name because it has a different logic. """ return re.sub("[^A-Za-z0-9.]+", "-", raw_name) + ".egg-link" def egg_link_path_from_sys_path(raw_name: str) -> Optional[str]: """ Look for a .egg-link file for project name, by walking sys.path. """ egg_link_name = _egg_link_name(raw_name) for path_item in sys.path: egg_link = os.path.join(path_item, egg_link_name) if os.path.isfile(egg_link): return egg_link return None def egg_link_path_from_location(raw_name: str) -> Optional[str]: """ Return the path for the .egg-link file if it exists, otherwise, None. There's 3 scenarios: 1) not in a virtualenv try to find in site.USER_SITE, then site_packages 2) in a no-global virtualenv try to find in site_packages 3) in a yes-global virtualenv try to find in site_packages, then site.USER_SITE (don't look in global location) For #1 and #3, there could be odd cases, where there's an egg-link in 2 locations. This method will just return the first one found. """ sites = [] if running_under_virtualenv(): sites.append(site_packages) if not virtualenv_no_global() and user_site: sites.append(user_site) else: if user_site: sites.append(user_site) sites.append(site_packages) egg_link_name = _egg_link_name(raw_name) for site in sites: egglink = os.path.join(site, egg_link_name) if os.path.isfile(egglink): return egglink return None
0
0
0
05e0dc5b7fe387eb5658d5587af1257bbd60429c
3,548
py
Python
auction/users/views.py
Gliger13/auction_site
0358dbdee1a41da1d68cb158bccadf54aad465dd
[ "MIT" ]
1
2020-06-16T20:02:55.000Z
2020-06-16T20:02:55.000Z
auction/users/views.py
Gliger13/auction_site
0358dbdee1a41da1d68cb158bccadf54aad465dd
[ "MIT" ]
null
null
null
auction/users/views.py
Gliger13/auction_site
0358dbdee1a41da1d68cb158bccadf54aad465dd
[ "MIT" ]
2
2020-06-03T13:12:26.000Z
2020-06-25T21:56:05.000Z
from django.contrib.auth import login, logout from django.contrib.auth.decorators import login_required from django.core.exceptions import NON_FIELD_ERRORS from django.http import HttpResponseRedirect, Http404 from django.shortcuts import render, redirect from users.forms import RegistrationForm, LoginForm, SettingsForm from users.models import User @login_required @login_required @login_required
31.678571
92
0.584273
from django.contrib.auth import login, logout from django.contrib.auth.decorators import login_required from django.core.exceptions import NON_FIELD_ERRORS from django.http import HttpResponseRedirect, Http404 from django.shortcuts import render, redirect from users.forms import RegistrationForm, LoginForm, SettingsForm from users.models import User def register(request): if request.method == 'GET': form = RegistrationForm() return render(request, 'users/register.html', context={"form": form}) if request.method == 'POST': form = RegistrationForm(request.POST) if form.is_valid(): form.save() user = form.get_user(request) user.send_verification_email() if user: login(request, user) return render(request, 'users/register_success.html') else: return render(request, 'users/register.html', context={"form": form}) else: return render(request, 'users/register.html', context={"form": form}) def verify(request): user = request.user if user.is_email_verified: return render(request, 'users/email_verified.html') data = request.GET token = data.get('token') if not token: user.send_verification_email() return render(request, 'users/email_verified.html') else: if user.is_token_correct(token): user.verify_email() return render(request, 'users/email_verified.html') else: return Http404("Not Found") def login_user(request): if request.method == 'GET': form = LoginForm() return render(request, 'users/login.html', context={'form': form}) elif request.method == 'POST': form = LoginForm(request.POST) if form.is_valid(): user = form.get_user(request) if user: login(request, user) return redirect('/lots/page/1') else: form.errors[NON_FIELD_ERRORS] = 'Cannot perform login with this credentials' return render(request, 'users/login.html', context={'form': form}) else: return render(request, 'users/login.html', context={'form': form}) @login_required def logout_user(request): logout(request) return HttpResponseRedirect('') @login_required def settings(request): user = request.user if request.method == 'GET': form = SettingsForm(instance=user) return render( request, 'users/settings.html', context={ 'form': form, 'showed_user': user, }) elif request.method == 'POST': user = request.user form = SettingsForm(request.POST, request.FILES, instance=user) form.set_user(user) if form.is_valid(): form.image = request.FILES.get('image') form.save() return redirect(f'/accounts/account/{user.username}') else: return render( request, 'users/settings.html', context={ 'form': form, 'showed_user': user, }) @login_required def show_account(request, username): user = User.objects.get(username=username) if request.method == 'GET': return render( request, 'users/account.html', context={ 'showed_user': user } )
3,003
0
135
2ae5374cea035f10ba91f826ce5f2f19ebfe491b
95
py
Python
true_house/activities/apps.py
gAmadorH/true-house-be
ffa95ffa1767f0eb8e024dd5e70ae7fe63ccdd4b
[ "MIT" ]
null
null
null
true_house/activities/apps.py
gAmadorH/true-house-be
ffa95ffa1767f0eb8e024dd5e70ae7fe63ccdd4b
[ "MIT" ]
null
null
null
true_house/activities/apps.py
gAmadorH/true-house-be
ffa95ffa1767f0eb8e024dd5e70ae7fe63ccdd4b
[ "MIT" ]
null
null
null
from django.apps import AppConfig
15.833333
34
0.768421
from django.apps import AppConfig class ActivitiesConfig(AppConfig): name = "activities"
0
37
23
81c92f7d2a70f7835fadef57226db4fb1a6e902e
11,793
py
Python
diver/reviewer/evaluate_binary_classifiers.py
ClearScore/diver
ee3640af338a64ffbad9ad4b1b1c87063b4e4e63
[ "MIT" ]
1
2020-01-03T17:08:42.000Z
2020-01-03T17:08:42.000Z
diver/reviewer/evaluate_binary_classifiers.py
DataScienceUnbound/diver
ee3640af338a64ffbad9ad4b1b1c87063b4e4e63
[ "MIT" ]
null
null
null
diver/reviewer/evaluate_binary_classifiers.py
DataScienceUnbound/diver
ee3640af338a64ffbad9ad4b1b1c87063b4e4e63
[ "MIT" ]
1
2020-10-26T15:42:35.000Z
2020-10-26T15:42:35.000Z
#################### # Import libraries # #################### # standard numerical libraries import numpy as np import pandas as pd # Plotting libraries import seaborn as sns import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap # Sklearn model evaluation from sklearn.metrics import accuracy_score, f1_score, roc_auc_score, roc_curve, confusion_matrix # For generating multi-colour confusion matrices from numpy.ma import masked_array import itertools ######################## # Individual functions # ######################## def evaluate_classifiers(trained_classifiers, X, y_true): ''' Calculates predictions and classifier statistics from a dictionary of trained sklearn classifiers Parameters ---------- trained_classifiers : dict of sklearn classifiers X : pandas.DataFrame Feature set y_true : pandas.Series Corresponding label set Returns ------- y_scores : pandas.DataFrame True labels ('LABELS') vs probability scores for all classifiers y_preds : pandas.DataFrame True labels ('LABELS') vs predicted classes for all classifiers classifier_metrics : pandas.DataFrame Summary statistics for classifier performance roc_curves : dict Dictionary of arrays for plotting ROC curves confusion_matrices : dict Dictionary of arrays for plotting confusion matrices ''' y_preds = {'LABELS': y_true.values} y_scores = {'LABELS': y_true.values} accuracies = {} f1_scores = {} roc_auc_scores = {} gini_scores = {} roc_curves = {} confusion_matrices = {} for name, clf in trained_classifiers.items(): # Store the classic accuracy score accuracies[name] = clf.score(X, y_true) # Calculate the F1 scores y_pred = clf.predict(X) f1_scores[name] = f1_score(y_true, y_pred) y_preds[name] = y_pred # Calculate and store ROC curves and AUC scores y_score = clf.predict_proba(X)[:, 1] y_scores[name] = y_score roc_curves[name] = roc_curve(y_true, y_score) roc_auc_scores[name] = roc_auc_score(y_true, y_score) gini_scores[name] = 2*roc_auc_scores[name] - 1 # Store confusion matrices confusion_matrices[name] = confusion_matrix(y_true, y_pred) # Compile results DataFrames y_scores = pd.DataFrame(y_scores) y_preds = pd.DataFrame(y_preds) classifier_metrics = pd.DataFrame({ 'accuracy': accuracies, 'f1_score': f1_scores, 'roc-auc': roc_auc_scores, 'gini': gini_scores }) return y_scores, y_preds, classifier_metrics, roc_curves, confusion_matrices def plot_roc(roc_curves, baseline=True, perfect_clf_line=True, color_palette='standard'): ''' Plots ROC curves Parameters ---------- roc_curves : dict Dict of {'model_name': sklearn ROC parameters} baseline : bool If True, plots diagonal random-guesser line perfect_clf_line : bool If True, plots perfect classifier line color_palette : str One of {'standard', 'comparison'}: - If 'standard', uses standard seaborn categorical color_palette - If 'comparison', plots one line blue, and one line red - useful for comparing new and old models back to back (has to be 2 models in `roc_curves` only) ''' plt.figure(figsize=[20, 10]) # Plot baselines if specified if baseline: baseline = plt.plot((0, 1), (0, 1), 'k--', label='baseline') if perfect_clf_line: perfect = plt.plot((0, 0, 1), (0, 1, 1), '--', color='#FF33F0', label='perfect_classifier') # Select plot palette if color_palette == 'standard': colours = sns.color_palette(n_colors=len(roc_curves)) elif color_palette == 'comparison': if len(roc_curves) == 2: colours = ['b', 'r'] else: raise ValueError('Input only 2 roc curves for "comparison" color_palette') # Plot all ROC curves for plot_line_number, (model_name, roc) in enumerate(roc_curves.items()): fpr, tpr, thresholds = roc plt.plot(fpr, tpr, '-', color=colours[plot_line_number], label=model_name) plt.title('ROC Curve', fontsize='xx-large') plt.xlabel('False Positive Rate \n (False Positives / All Negatives)', fontsize='x-large') plt.ylabel('True Positive Rate \n (True Positives / All Positives)', fontsize='x-large') plt.legend(fontsize='x-large'); def generate_label_palettes(categorical_palette, n_labels=2, plotter='mpl'): ''' Given a parent seaborn categorical palette, generates single-colour sequential palettes for each colour in the parent palette, up to n_labels colours Parameters ---------- categorical_palette : seaborn.palettes._ColorPalette Parent palette of various colours n_labels : int Number of labels (dependent variables) in the classification task plotter : str One of {'sns', 'mpl'}: - 'sns' dictates the output palettes will be in `seaborn` color_palette format - 'mpl' dictates the output palettes will be in `matplotlib` colormap format Returns ------- label_palettes : dict Dictionary of format {'label_name': single-colour map/palette} ''' label_palettes = {} for i in range(n_labels): if plotter == 'sns': label_palettes[f'label_{i}'] = sns.light_palette(categorical_palette[i], n_colors=50) elif plotter == 'mpl': label_palettes[f'label_{i}'] = ListedColormap(sns.light_palette(categorical_palette[i], n_colors=50).as_hex()) else: raise ValueError(f'plotter type {plotter} not recognised') return label_palettes def plot_confusion_matrix(cm, classes, title='Confusion Matrix', fig=None, index=111, categorical_palette=sns.color_palette()): ''' Plots confusion matrix, with class colours consistent with other plots Parameters ---------- cm : np.array Confusion matrix array classes : int Number of unique classes in the target variable normalize : bool Whether to display absolute or proportional values in the confusion matrix title : str Title of plot ''' # fig, ax = plt.subplots(figsize=[5, 5]) if fig is None: fig = plt.figure(figsize=[5, 5]) ax = fig.add_subplot(index) # Normalise confusion matrix, for color scale and, optionally, for text display cm_norm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis] # Generate varying palettes for each class from parent categorical palette label_palettes = generate_label_palettes(categorical_palette, n_labels=cm.shape[0], plotter='mpl') for i, label in enumerate(cm_norm): # Mask confusion matrix for each label, in order to apply a separate label colormap for each mask = np.zeros_like(cm_norm) # Imshow builds from bottom to top; row index for confusion matrix array is the opposite inverted_index = mask.shape[0] - 1 - i mask[inverted_index, :] = 1 cm_masked = masked_array(cm_norm, mask) # Get label color palette cmap = label_palettes[f'label_{i}'] # Plot label color intensities, based on normalised values cm_label = ax.imshow(cm_masked, interpolation='nearest', cmap=cmap, vmin=0, vmax=1) # Plot confusion matrix values for i, j in itertools.product(range(cm.shape[0]), range(cm.shape[1])): text = str(round(cm[i, j], 2)) + '\n' + str(round(100*cm_norm[i, j], 1)) + '%' ax.text(j, i+0.07, text, horizontalalignment="center", color="white" if cm_norm[i, j] > 0.5 else "black", fontsize='x-large') # Formatting tick_marks = np.arange(len(classes)) ax.set_xticks(tick_marks) ax.set_xticklabels(classes, fontsize='x-large') ax.set_yticks(tick_marks) ax.set_yticklabels(classes, fontsize='x-large') # ax.tight_layout() ax.set_title(title, fontsize='xx-large') ax.set_xlabel('Predicted Label', fontsize='x-large') ax.set_ylabel('True Label', fontsize='x-large') # plt.show() return ax def get_subplot_dims(num_plots, max_cols=3): '''Return subplot layout for a given number of plots''' if num_plots <= max_cols: num_rows = 1 num_cols = num_plots else: num_rows = num_plots // max_cols remainder = num_plots % max_cols if remainder > 0: num_rows += 1 num_cols = max_cols return num_rows, num_cols def plot_confusion_matrices(confusion_matrices, y_preds): ''' Plots a series of confusion matrices from a dictionary of CM arrays, from a set of trained models Parameters ---------- confusion_matrices : dict Dict of confusion matrix arrays ''' num_rows, num_cols = get_subplot_dims(len(confusion_matrices)) fig, ax = plt.subplots(num_rows, num_cols, figsize=[20*num_rows, 5*num_cols]) for ax_number, (clf_name, cm) in enumerate(confusion_matrices.items()): # Turn off initial axis ax[ax_number].axis('off') # Generate CM title title = f'Confusion Matrix \n {clf_name}' # Get subplot index and plot CM for given index index = int(str(num_rows) + str(num_cols) + str(ax_number + 1)) plot_confusion_matrix(cm, classes=y_preds[clf_name].unique(), fig=fig, index=index, title=title) def plot_binary_clf_histogram(y_test, y_pred, bins=50, normalize=True, fig=None, index=111, title='Model predictions (histograms of positive and negative classes)', categorical_palette=sns.color_palette()): ''' Plot histograms of model-predicted probability counts for both classes Parameters ---------- y_test : pandas.Series Test-set labels y_pred : pandas.Series Test-set model predictions bins : int Number of bins in each histogram normalize : bool Whether to display absolute or relative counts (useful for visualising when big 0/1 class imbalance) ''' if fig is None: fig = plt.figure(figsize=[20, 10]) ax = fig.add_subplot(index) negatives = y_pred[y_test == False] positives = y_pred[y_test == True] # plt.figure(figsize=[20, 10]) sns.set_palette(categorical_palette) sns.distplot(negatives, hist=True, kde=False, norm_hist=normalize, bins=bins, ax=ax) sns.distplot(positives, hist=True, kde=False, norm_hist=normalize, bins=bins, ax=ax) ax.set_xlabel('Model predicted probability of positive class', fontsize='x-large'), ax.set_ylabel('Counts (of binned probability)', fontsize='x-large') ax.set_title(title, fontsize='xx-large') def plot_binary_clf_histograms(y_test, y_scores): ''' Plots a series of histograms from a set of y predictions Parameters ---------- confusion_matrices : dict Dict of confusion matrix arrays ''' y_scores_models = y_scores.drop('LABELS', axis=1) num_rows, num_cols = get_subplot_dims(y_scores_models.shape[1], max_cols=1) fig, ax = plt.subplots(num_rows, num_cols, figsize=[20, 10*num_rows]) for ax_number, (clf_name, y_score) in enumerate(y_scores_models.iteritems()): # Turn off initial axis ax[ax_number].axis('off') # Generate CM title title = f'Model Predictions \n {clf_name}' # Get subplot index and plot CM for given index index = int(str(num_rows) + str(num_cols) + str(ax_number + 1)) plot_binary_clf_histogram(y_test, y_score, title=title, fig=fig, index=index)
34.787611
206
0.651827
#################### # Import libraries # #################### # standard numerical libraries import numpy as np import pandas as pd # Plotting libraries import seaborn as sns import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap # Sklearn model evaluation from sklearn.metrics import accuracy_score, f1_score, roc_auc_score, roc_curve, confusion_matrix # For generating multi-colour confusion matrices from numpy.ma import masked_array import itertools ######################## # Individual functions # ######################## def evaluate_classifiers(trained_classifiers, X, y_true): ''' Calculates predictions and classifier statistics from a dictionary of trained sklearn classifiers Parameters ---------- trained_classifiers : dict of sklearn classifiers X : pandas.DataFrame Feature set y_true : pandas.Series Corresponding label set Returns ------- y_scores : pandas.DataFrame True labels ('LABELS') vs probability scores for all classifiers y_preds : pandas.DataFrame True labels ('LABELS') vs predicted classes for all classifiers classifier_metrics : pandas.DataFrame Summary statistics for classifier performance roc_curves : dict Dictionary of arrays for plotting ROC curves confusion_matrices : dict Dictionary of arrays for plotting confusion matrices ''' y_preds = {'LABELS': y_true.values} y_scores = {'LABELS': y_true.values} accuracies = {} f1_scores = {} roc_auc_scores = {} gini_scores = {} roc_curves = {} confusion_matrices = {} for name, clf in trained_classifiers.items(): # Store the classic accuracy score accuracies[name] = clf.score(X, y_true) # Calculate the F1 scores y_pred = clf.predict(X) f1_scores[name] = f1_score(y_true, y_pred) y_preds[name] = y_pred # Calculate and store ROC curves and AUC scores y_score = clf.predict_proba(X)[:, 1] y_scores[name] = y_score roc_curves[name] = roc_curve(y_true, y_score) roc_auc_scores[name] = roc_auc_score(y_true, y_score) gini_scores[name] = 2*roc_auc_scores[name] - 1 # Store confusion matrices confusion_matrices[name] = confusion_matrix(y_true, y_pred) # Compile results DataFrames y_scores = pd.DataFrame(y_scores) y_preds = pd.DataFrame(y_preds) classifier_metrics = pd.DataFrame({ 'accuracy': accuracies, 'f1_score': f1_scores, 'roc-auc': roc_auc_scores, 'gini': gini_scores }) return y_scores, y_preds, classifier_metrics, roc_curves, confusion_matrices def plot_roc(roc_curves, baseline=True, perfect_clf_line=True, color_palette='standard'): ''' Plots ROC curves Parameters ---------- roc_curves : dict Dict of {'model_name': sklearn ROC parameters} baseline : bool If True, plots diagonal random-guesser line perfect_clf_line : bool If True, plots perfect classifier line color_palette : str One of {'standard', 'comparison'}: - If 'standard', uses standard seaborn categorical color_palette - If 'comparison', plots one line blue, and one line red - useful for comparing new and old models back to back (has to be 2 models in `roc_curves` only) ''' plt.figure(figsize=[20, 10]) # Plot baselines if specified if baseline: baseline = plt.plot((0, 1), (0, 1), 'k--', label='baseline') if perfect_clf_line: perfect = plt.plot((0, 0, 1), (0, 1, 1), '--', color='#FF33F0', label='perfect_classifier') # Select plot palette if color_palette == 'standard': colours = sns.color_palette(n_colors=len(roc_curves)) elif color_palette == 'comparison': if len(roc_curves) == 2: colours = ['b', 'r'] else: raise ValueError('Input only 2 roc curves for "comparison" color_palette') # Plot all ROC curves for plot_line_number, (model_name, roc) in enumerate(roc_curves.items()): fpr, tpr, thresholds = roc plt.plot(fpr, tpr, '-', color=colours[plot_line_number], label=model_name) plt.title('ROC Curve', fontsize='xx-large') plt.xlabel('False Positive Rate \n (False Positives / All Negatives)', fontsize='x-large') plt.ylabel('True Positive Rate \n (True Positives / All Positives)', fontsize='x-large') plt.legend(fontsize='x-large'); def generate_label_palettes(categorical_palette, n_labels=2, plotter='mpl'): ''' Given a parent seaborn categorical palette, generates single-colour sequential palettes for each colour in the parent palette, up to n_labels colours Parameters ---------- categorical_palette : seaborn.palettes._ColorPalette Parent palette of various colours n_labels : int Number of labels (dependent variables) in the classification task plotter : str One of {'sns', 'mpl'}: - 'sns' dictates the output palettes will be in `seaborn` color_palette format - 'mpl' dictates the output palettes will be in `matplotlib` colormap format Returns ------- label_palettes : dict Dictionary of format {'label_name': single-colour map/palette} ''' label_palettes = {} for i in range(n_labels): if plotter == 'sns': label_palettes[f'label_{i}'] = sns.light_palette(categorical_palette[i], n_colors=50) elif plotter == 'mpl': label_palettes[f'label_{i}'] = ListedColormap(sns.light_palette(categorical_palette[i], n_colors=50).as_hex()) else: raise ValueError(f'plotter type {plotter} not recognised') return label_palettes def plot_confusion_matrix(cm, classes, title='Confusion Matrix', fig=None, index=111, categorical_palette=sns.color_palette()): ''' Plots confusion matrix, with class colours consistent with other plots Parameters ---------- cm : np.array Confusion matrix array classes : int Number of unique classes in the target variable normalize : bool Whether to display absolute or proportional values in the confusion matrix title : str Title of plot ''' # fig, ax = plt.subplots(figsize=[5, 5]) if fig is None: fig = plt.figure(figsize=[5, 5]) ax = fig.add_subplot(index) # Normalise confusion matrix, for color scale and, optionally, for text display cm_norm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis] # Generate varying palettes for each class from parent categorical palette label_palettes = generate_label_palettes(categorical_palette, n_labels=cm.shape[0], plotter='mpl') for i, label in enumerate(cm_norm): # Mask confusion matrix for each label, in order to apply a separate label colormap for each mask = np.zeros_like(cm_norm) # Imshow builds from bottom to top; row index for confusion matrix array is the opposite inverted_index = mask.shape[0] - 1 - i mask[inverted_index, :] = 1 cm_masked = masked_array(cm_norm, mask) # Get label color palette cmap = label_palettes[f'label_{i}'] # Plot label color intensities, based on normalised values cm_label = ax.imshow(cm_masked, interpolation='nearest', cmap=cmap, vmin=0, vmax=1) # Plot confusion matrix values for i, j in itertools.product(range(cm.shape[0]), range(cm.shape[1])): text = str(round(cm[i, j], 2)) + '\n' + str(round(100*cm_norm[i, j], 1)) + '%' ax.text(j, i+0.07, text, horizontalalignment="center", color="white" if cm_norm[i, j] > 0.5 else "black", fontsize='x-large') # Formatting tick_marks = np.arange(len(classes)) ax.set_xticks(tick_marks) ax.set_xticklabels(classes, fontsize='x-large') ax.set_yticks(tick_marks) ax.set_yticklabels(classes, fontsize='x-large') # ax.tight_layout() ax.set_title(title, fontsize='xx-large') ax.set_xlabel('Predicted Label', fontsize='x-large') ax.set_ylabel('True Label', fontsize='x-large') # plt.show() return ax def get_subplot_dims(num_plots, max_cols=3): '''Return subplot layout for a given number of plots''' if num_plots <= max_cols: num_rows = 1 num_cols = num_plots else: num_rows = num_plots // max_cols remainder = num_plots % max_cols if remainder > 0: num_rows += 1 num_cols = max_cols return num_rows, num_cols def plot_confusion_matrices(confusion_matrices, y_preds): ''' Plots a series of confusion matrices from a dictionary of CM arrays, from a set of trained models Parameters ---------- confusion_matrices : dict Dict of confusion matrix arrays ''' num_rows, num_cols = get_subplot_dims(len(confusion_matrices)) fig, ax = plt.subplots(num_rows, num_cols, figsize=[20*num_rows, 5*num_cols]) for ax_number, (clf_name, cm) in enumerate(confusion_matrices.items()): # Turn off initial axis ax[ax_number].axis('off') # Generate CM title title = f'Confusion Matrix \n {clf_name}' # Get subplot index and plot CM for given index index = int(str(num_rows) + str(num_cols) + str(ax_number + 1)) plot_confusion_matrix(cm, classes=y_preds[clf_name].unique(), fig=fig, index=index, title=title) def plot_binary_clf_histogram(y_test, y_pred, bins=50, normalize=True, fig=None, index=111, title='Model predictions (histograms of positive and negative classes)', categorical_palette=sns.color_palette()): ''' Plot histograms of model-predicted probability counts for both classes Parameters ---------- y_test : pandas.Series Test-set labels y_pred : pandas.Series Test-set model predictions bins : int Number of bins in each histogram normalize : bool Whether to display absolute or relative counts (useful for visualising when big 0/1 class imbalance) ''' if fig is None: fig = plt.figure(figsize=[20, 10]) ax = fig.add_subplot(index) negatives = y_pred[y_test == False] positives = y_pred[y_test == True] # plt.figure(figsize=[20, 10]) sns.set_palette(categorical_palette) sns.distplot(negatives, hist=True, kde=False, norm_hist=normalize, bins=bins, ax=ax) sns.distplot(positives, hist=True, kde=False, norm_hist=normalize, bins=bins, ax=ax) ax.set_xlabel('Model predicted probability of positive class', fontsize='x-large'), ax.set_ylabel('Counts (of binned probability)', fontsize='x-large') ax.set_title(title, fontsize='xx-large') def plot_binary_clf_histograms(y_test, y_scores): ''' Plots a series of histograms from a set of y predictions Parameters ---------- confusion_matrices : dict Dict of confusion matrix arrays ''' y_scores_models = y_scores.drop('LABELS', axis=1) num_rows, num_cols = get_subplot_dims(y_scores_models.shape[1], max_cols=1) fig, ax = plt.subplots(num_rows, num_cols, figsize=[20, 10*num_rows]) for ax_number, (clf_name, y_score) in enumerate(y_scores_models.iteritems()): # Turn off initial axis ax[ax_number].axis('off') # Generate CM title title = f'Model Predictions \n {clf_name}' # Get subplot index and plot CM for given index index = int(str(num_rows) + str(num_cols) + str(ax_number + 1)) plot_binary_clf_histogram(y_test, y_score, title=title, fig=fig, index=index)
0
0
0
738af6df11840f0140881d5dad6589ed10adce25
1,028
py
Python
update.py
marcus-grant/binder
394f7b9de7f50bbc2fd9d3626365407c1566be20
[ "MIT" ]
null
null
null
update.py
marcus-grant/binder
394f7b9de7f50bbc2fd9d3626365407c1566be20
[ "MIT" ]
null
null
null
update.py
marcus-grant/binder
394f7b9de7f50bbc2fd9d3626365407c1566be20
[ "MIT" ]
null
null
null
#!/bin/env python # used to update all local and remote references into this bin folder import subprocess GITHUB_SSH_BASE_URL = 'git@github.com:' GITHUB_HTTPS_BASE_URL = 'https://github.com/' if __name__ == "__main__": UPDATE_QUEUE = [ intro_msg, clone_go_buffer_repo, ] for update_action in UPDATE_QUEUE: std_out = update_action() print(std_out)
27.052632
79
0.679961
#!/bin/env python # used to update all local and remote references into this bin folder import subprocess GITHUB_SSH_BASE_URL = 'git@github.com:' GITHUB_HTTPS_BASE_URL = 'https://github.com/' def intro_msg(): msg = "For the binder to work..." msg += "\nexternal and internal repos need to be linked to.\n" msg += "Starting with external sources like github.com\n" print(msg) def clone_repo(repo_user, repo_name, use_ssh=True): if use_ssh: request_url = GITHUB_SSH_BASE_URL else: request_url = GITHUB_HTTPS_BASE_URL request_url += repo_user + '/' + repo_name return subprocess.check_output(['git', 'clone', request_url]) def clone_go_buffer_repo(): # print("Cloning the go-buffer (a monolithic go repo) into the binder...") clone_repo('marcus-grant', 'go-buffer') if __name__ == "__main__": UPDATE_QUEUE = [ intro_msg, clone_go_buffer_repo, ] for update_action in UPDATE_QUEUE: std_out = update_action() print(std_out)
562
0
69
ce47359382dcb779c3de1650e35c093edd3d2b23
3,720
py
Python
onmt/translate/penalties.py
kanghj/OpenNMT-py
759d5b5a663ee8de3da781ba57f19b3873024753
[ "MIT" ]
null
null
null
onmt/translate/penalties.py
kanghj/OpenNMT-py
759d5b5a663ee8de3da781ba57f19b3873024753
[ "MIT" ]
null
null
null
onmt/translate/penalties.py
kanghj/OpenNMT-py
759d5b5a663ee8de3da781ba57f19b3873024753
[ "MIT" ]
null
null
null
from __future__ import division import torch class PenaltyBuilder(object): """Returns the Length and Coverage Penalty function for Beam Search. Args: length_pen (str): option name of length pen cov_pen (str): option name of cov pen Attributes: has_cov_pen (bool): Whether coverage penalty is None (applying it is a no-op). Note that the converse isn't true. Setting beta to 0 should force coverage length to be a no-op. has_len_pen (bool): Whether length penalty is None (applying it is a no-op). Note that the converse isn't true. Setting alpha to 1 should force length penalty to be a no-op. coverage_penalty (callable[[torch.FloatTensor, float], torch.FloatTensor]): Calculates the coverage penalty. length_penalty (callable[[int, float], float]): Calculates the length penalty. """ @staticmethod # Below are all the different penalty terms implemented so far. # Subtract coverage penalty from topk log probs. # Divide topk log probs by length penalty. def coverage_wu(self, cov, beta=0.): """GNMT coverage re-ranking score. See "Google's Neural Machine Translation System" :cite:`wu2016google`. ``cov`` is expected to be sized ``(*, seq_len)``, where ``*`` is probably ``batch_size x beam_size`` but could be several dimensions like ``batch_size, beam_size``. If ``cov`` is attention, then the ``seq_len`` axis probably sums to (almost) 1. """ penalty = -torch.min(cov, cov.clone().fill_(1.0)).log().sum(-1) return beta * penalty def coverage_summary(self, cov, beta=0.): """Our summary penalty.""" penalty = torch.max(cov, cov.clone().fill_(1.0)).sum(-1) penalty -= cov.size(-1) return beta * penalty def coverage_none(self, cov, beta=0.): """Returns zero as penalty""" none = torch.zeros((1,), device=cov.device, dtype=torch.float) if cov.dim() == 3: none = none.unsqueeze(0) return none def length_wu(self, cur_len, alpha=0.): """GNMT length re-ranking score. See "Google's Neural Machine Translation System" :cite:`wu2016google`. """ return ((5 + cur_len) / 6.0) ** alpha def length_average(self, cur_len, alpha=0.): """Returns the current sequence length.""" return cur_len def length_none(self, cur_len, alpha=0.): """Returns unmodified scores.""" return 1.0
36.116505
78
0.614516
from __future__ import division import torch class PenaltyBuilder(object): """Returns the Length and Coverage Penalty function for Beam Search. Args: length_pen (str): option name of length pen cov_pen (str): option name of cov pen Attributes: has_cov_pen (bool): Whether coverage penalty is None (applying it is a no-op). Note that the converse isn't true. Setting beta to 0 should force coverage length to be a no-op. has_len_pen (bool): Whether length penalty is None (applying it is a no-op). Note that the converse isn't true. Setting alpha to 1 should force length penalty to be a no-op. coverage_penalty (callable[[torch.FloatTensor, float], torch.FloatTensor]): Calculates the coverage penalty. length_penalty (callable[[int, float], float]): Calculates the length penalty. """ def __init__(self, cov_pen, length_pen): self.has_cov_pen = not self._pen_is_none(cov_pen) self.coverage_penalty = self._coverage_penalty(cov_pen) self.has_len_pen = not self._pen_is_none(length_pen) self.length_penalty = self._length_penalty(length_pen) @staticmethod def _pen_is_none(pen): return pen == "none" or pen is None def _coverage_penalty(self, cov_pen): if cov_pen == "wu": return self.coverage_wu elif cov_pen == "summary": return self.coverage_summary elif self._pen_is_none(cov_pen): return self.coverage_none else: raise NotImplementedError("No '{:s}' coverage penalty.".format( cov_pen)) def _length_penalty(self, length_pen): if length_pen == "wu": return self.length_wu elif length_pen == "avg": return self.length_average elif self._pen_is_none(length_pen): return self.length_none else: raise NotImplementedError("No '{:s}' length penalty.".format( length_pen)) # Below are all the different penalty terms implemented so far. # Subtract coverage penalty from topk log probs. # Divide topk log probs by length penalty. def coverage_wu(self, cov, beta=0.): """GNMT coverage re-ranking score. See "Google's Neural Machine Translation System" :cite:`wu2016google`. ``cov`` is expected to be sized ``(*, seq_len)``, where ``*`` is probably ``batch_size x beam_size`` but could be several dimensions like ``batch_size, beam_size``. If ``cov`` is attention, then the ``seq_len`` axis probably sums to (almost) 1. """ penalty = -torch.min(cov, cov.clone().fill_(1.0)).log().sum(-1) return beta * penalty def coverage_summary(self, cov, beta=0.): """Our summary penalty.""" penalty = torch.max(cov, cov.clone().fill_(1.0)).sum(-1) penalty -= cov.size(-1) return beta * penalty def coverage_none(self, cov, beta=0.): """Returns zero as penalty""" none = torch.zeros((1,), device=cov.device, dtype=torch.float) if cov.dim() == 3: none = none.unsqueeze(0) return none def length_wu(self, cur_len, alpha=0.): """GNMT length re-ranking score. See "Google's Neural Machine Translation System" :cite:`wu2016google`. """ return ((5 + cur_len) / 6.0) ** alpha def length_average(self, cur_len, alpha=0.): """Returns the current sequence length.""" return cur_len def length_none(self, cur_len, alpha=0.): """Returns unmodified scores.""" return 1.0
1,013
0
107
3f8288e09a35e04cacbea328128047688348e978
1,120
py
Python
lib/spack/spack/cmd/undevelop.py
padamson/spack
d3f67a48552691b4846ccc4a10f76740b154090c
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
2
2021-03-05T10:54:32.000Z
2021-03-05T14:14:52.000Z
lib/spack/spack/cmd/undevelop.py
padamson/spack
d3f67a48552691b4846ccc4a10f76740b154090c
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
32
2020-12-15T17:29:20.000Z
2022-03-21T15:08:31.000Z
lib/spack/spack/cmd/undevelop.py
padamson/spack
d3f67a48552691b4846ccc4a10f76740b154090c
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
2
2021-07-19T20:31:27.000Z
2021-07-19T21:14:14.000Z
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import llnl.util.tty as tty import spack.cmd import spack.cmd.common.arguments as arguments import spack.environment as ev description = 'remove specs from an environment' section = "environments" level = "long"
28
73
0.666071
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import llnl.util.tty as tty import spack.cmd import spack.cmd.common.arguments as arguments import spack.environment as ev description = 'remove specs from an environment' section = "environments" level = "long" def setup_parser(subparser): subparser.add_argument( '-a', '--all', action='store_true', help="remove all specs from (clear) the environment") arguments.add_common_arguments(subparser, ['specs']) def undevelop(parser, args): env = ev.get_env(args, 'undevelop', required=True) if args.all: specs = env.dev_specs.keys() else: specs = spack.cmd.parse_specs(args.specs) with env.write_transaction(): changed = False for spec in specs: tty.msg('Removing %s from environment %s development specs' % (spec, env.name)) changed |= env.undevelop(spec) if changed: env.write()
660
0
46
474fcf280dbf03b56feb3415571b83327f69f782
726,435
py
Python
SDK/bindings/webservice/python/lib/VirtualBox_wrappers.py
dgomez10/xanon
540bdf0229f53652591e593cf057a0c9e04e2dc8
[ "Apache-2.0" ]
null
null
null
SDK/bindings/webservice/python/lib/VirtualBox_wrappers.py
dgomez10/xanon
540bdf0229f53652591e593cf057a0c9e04e2dc8
[ "Apache-2.0" ]
null
null
null
SDK/bindings/webservice/python/lib/VirtualBox_wrappers.py
dgomez10/xanon
540bdf0229f53652591e593cf057a0c9e04e2dc8
[ "Apache-2.0" ]
null
null
null
# Copyright (C) 2008-2011 Oracle Corporation # # This file is part of a free software library; you can redistribute # it and/or modify it under the terms of the GNU Lesser General # Public License version 2.1 as published by the Free Software # Foundation and shipped in the "COPYING.LIB" file with this library. # The library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY of any kind. # # Oracle LGPL Disclaimer: For the avoidance of doubt, except that if # any license choice other than GPL or LGPL is available it will # apply instead, Oracle elects to use only the Lesser General Public # License version 2.1 (LGPLv2) at this time for any software where # a choice of LGPL license versions is made available with the # language indicating that LGPLv2 or any later version may be used, # or where a choice of which version of the LGPL is applied is # otherwise unspecified. # # This file is autogenerated from VirtualBox.xidl, DO NOT EDIT! # from VirtualBox_services import * try: from VirtualBox_client import * except: pass import base64
30.914759
1,797
0.648848
# Copyright (C) 2008-2011 Oracle Corporation # # This file is part of a free software library; you can redistribute # it and/or modify it under the terms of the GNU Lesser General # Public License version 2.1 as published by the Free Software # Foundation and shipped in the "COPYING.LIB" file with this library. # The library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY of any kind. # # Oracle LGPL Disclaimer: For the avoidance of doubt, except that if # any license choice other than GPL or LGPL is available it will # apply instead, Oracle elects to use only the Lesser General Public # License version 2.1 (LGPLv2) at this time for any software where # a choice of LGPL license versions is made available with the # language indicating that LGPLv2 or any later version may be used, # or where a choice of which version of the LGPL is applied is # otherwise unspecified. # # This file is autogenerated from VirtualBox.xidl, DO NOT EDIT! # from VirtualBox_services import * try: from VirtualBox_client import * except: pass class ManagedManager: def __init__(self): self.map = {} def register(self,handle): if handle == None: return c = self.map.get(handle,0) c = c + 1 self.map[handle]=c def unregister(self,handle): if handle == None: return c = self.map.get(handle,-1) if c == -1: raise Error, 'wrong refcount' c = c - 1 if c == 0: try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass self.map[handle] = -1 else: self.map[handle] = c class String: def __init__(self, mgr, handle, isarray = False): self.handle = handle self.mgr = mgr self.isarray = isarray def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return String(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return str(self.handle) def __eq__(self,other): if self.isarray: return isinstance(other,String) and self.handle == other.handle if isinstance(other,String): return self.handle == other.handle if isinstance(other,basestring): return self.handle == other return False def __ne__(self,other): if self.isarray: return not isinstance(other,String) or self.handle != other.handle if isinstance(other,String): return self.handle != other.handle if isinstance(other,basestring): return self.handle != other return True def __add__(self,other): return str(self.handle)+str(other) class Boolean: def __init__(self, mgr, handle, isarray = False): self.handle = handle if self.handle == "false": self.handle = None self.mgr = mgr self.isarray = isarray def __str__(self): if self.handle: return "true" else: return "false" def __eq__(self,other): if isinstance(other,Bool): return self.handle == other.value if isinstance(other,bool): return self.handle == other return False def __ne__(self,other): if isinstance(other,Bool): return self.handle != other.handle if isinstance(other,bool): return self.handle != other return True def __int__(self): if self.handle: return 1 else: return 0 def __long__(self): if self.handle: return 1 else: return 0 def __nonzero__(self): if self.handle: return True else: return False def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return Boolean(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" class Number: def __init__(self, mgr, handle, isarray = False): self.handle = handle self.mgr = mgr self.isarray = isarray def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __str__(self): return str(self.handle) def __int__(self): return int(self.handle) def __long__(self): return long(self.handle) def __float__(self): return float(self.handle) def __lt__(self, other): if self.isarray: return NotImplemented else: return self.handle < other def __le__(self, other): if self.isarray: return NotImplemented else: return self.handle <= other def __eq__(self, other): return self.handle == other def __ne__(self, other): return self.handle != other def __gt__(self, other): if self.isarray: return NotImplemented else: return self.handle > other def __ge__(self, other): if self.isarray: return NotImplemented else: return self.handle >= other class Octet: def __init__(self, mgr, handle, isarray = False): self.mgr = mgr self.isarray = isarray if isarray: self.handle = mgr.decodebase64(handle) else: raise TypeError, "only octet arrays" def __getitem__(self, index): return self.handle[index] def __str__(self): return str(self.handle) def __len__(self): return self.handle.__len__() class UnsignedInt(Number): def __init__(self, mgr, handle, isarray = False): self.handle = handle self.mgr = mgr self.isarray = isarray def __getitem__(self, index): if self.isarray: return UnsignedInt(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" class Int(Number): def __init__(self, mgr, handle, isarray = False): self.handle = handle self.mgr = mgr self.isarray = isarray def __getitem__(self, index): if self.isarray: return Int(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" class UnsignedShort(Number): def __init__(self, mgr, handle, isarray = False): self.handle = handle self.mgr = mgr self.isarray = isarray def __getitem__(self, index): if self.isarray: return UnsignedShort(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" class Short(Number): def __init__(self, mgr, handle, isarray = False): self.handle = handle self.mgr = mgr self.isarray = isarray def __getitem__(self, index): if self.isarray: return Short(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" class UnsignedLong(Number): def __init__(self, mgr, handle, isarray = False): self.handle = handle self.mgr = mgr self.isarray = isarray def __getitem__(self, index): if self.isarray: return UnsignedLong(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" class Long(Number): def __init__(self, mgr, handle, isarray = False): self.handle = handle self.mgr = mgr self.isarray = isarray def __getitem__(self, index): if self.isarray: return Long(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" class Double(Number): def __init__(self, mgr, handle, isarray = False): self.handle = handle self.mgr = mgr self.isarray = isarray def __getitem__(self, index): if self.isarray: return Double(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" class Float(Number): def __init__(self, mgr, handle, isarray = False): self.handle = handle self.mgr = mgr self.isarray = isarray def __getitem__(self, index): if self.isarray: return Float(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" class IUnknown: def __init__(self, mgr, handle, isarray = False): self.handle = handle self.mgr = mgr self.isarray = isarray def __nonzero__(self): if self.handle != "": return True else: return False def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IUnknown(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return str(self.handle) def __eq__(self, other): return self.handle == other def __ne__(self, other): return self.handle != other def __getattr__(self,attr): if self.__class__.__dict__.get(attr) != None: return self.__class__.__dict__.get(attr) if self.__dict__.get(attr) != None: return self.__dict__.get(attr) raise AttributeError class IVirtualBoxErrorInfo(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IVirtualBoxErrorInfo(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IVirtualBoxErrorInfo._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IVirtualBoxErrorInfo._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getResultCode(self): req=IVirtualBoxErrorInfo_getResultCodeRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBoxErrorInfo_getResultCode(req) return Int(self.mgr,val._returnval) def getResultDetail(self): req=IVirtualBoxErrorInfo_getResultDetailRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBoxErrorInfo_getResultDetail(req) return Int(self.mgr,val._returnval) def getInterfaceID(self): req=IVirtualBoxErrorInfo_getInterfaceIDRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBoxErrorInfo_getInterfaceID(req) return String(self.mgr,val._returnval) def getComponent(self): req=IVirtualBoxErrorInfo_getComponentRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBoxErrorInfo_getComponent(req) return String(self.mgr,val._returnval) def getText(self): req=IVirtualBoxErrorInfo_getTextRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBoxErrorInfo_getText(req) return String(self.mgr,val._returnval) def getNext(self): req=IVirtualBoxErrorInfo_getNextRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBoxErrorInfo_getNext(req) return IVirtualBoxErrorInfo(self.mgr,val._returnval) _Attrs_={ 'resultCode':[getResultCode,None], 'resultDetail':[getResultDetail,None], 'interfaceID':[getInterfaceID,None], 'component':[getComponent,None], 'text':[getText,None], 'next':[getNext,None]} class INATNetwork(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return INATNetwork(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = INATNetwork._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = INATNetwork._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def addLocalMapping(self, _arg_hostid, _arg_offset): req=INATNetwork_addLocalMappingRequestMsg() req._this=self.handle req._hostid=_arg_hostid req._offset=_arg_offset val=self.mgr.getPort().INATNetwork_addLocalMapping(req) return def addPortForwardRule(self, _arg_isIpv6, _arg_ruleName, _arg_proto, _arg_hostIP, _arg_hostPort, _arg_guestIP, _arg_guestPort): req=INATNetwork_addPortForwardRuleRequestMsg() req._this=self.handle req._isIpv6=_arg_isIpv6 req._ruleName=_arg_ruleName req._proto=_arg_proto req._hostIP=_arg_hostIP req._hostPort=_arg_hostPort req._guestIP=_arg_guestIP req._guestPort=_arg_guestPort val=self.mgr.getPort().INATNetwork_addPortForwardRule(req) return def removePortForwardRule(self, _arg_iSipv6, _arg_ruleName): req=INATNetwork_removePortForwardRuleRequestMsg() req._this=self.handle req._iSipv6=_arg_iSipv6 req._ruleName=_arg_ruleName val=self.mgr.getPort().INATNetwork_removePortForwardRule(req) return def start(self, _arg_trunkType): req=INATNetwork_startRequestMsg() req._this=self.handle req._trunkType=_arg_trunkType val=self.mgr.getPort().INATNetwork_start(req) return def stop(self): req=INATNetwork_stopRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetwork_stop(req) return def getNetworkName(self): req=INATNetwork_getNetworkNameRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetwork_getNetworkName(req) return String(self.mgr,val._returnval) def setNetworkName(self, value): req=INATNetwork_setNetworkNameRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._networkName = value else: req._networkName = value.handle self.mgr.getPort().INATNetwork_setNetworkName(req) def getEnabled(self): req=INATNetwork_getEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetwork_getEnabled(req) return Boolean(self.mgr,val._returnval) def setEnabled(self, value): req=INATNetwork_setEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._enabled = value else: req._enabled = value.handle self.mgr.getPort().INATNetwork_setEnabled(req) def getNetwork(self): req=INATNetwork_getNetworkRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetwork_getNetwork(req) return String(self.mgr,val._returnval) def setNetwork(self, value): req=INATNetwork_setNetworkRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._network = value else: req._network = value.handle self.mgr.getPort().INATNetwork_setNetwork(req) def getGateway(self): req=INATNetwork_getGatewayRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetwork_getGateway(req) return String(self.mgr,val._returnval) def getIPv6Enabled(self): req=INATNetwork_getIPv6EnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetwork_getIPv6Enabled(req) return Boolean(self.mgr,val._returnval) def setIPv6Enabled(self, value): req=INATNetwork_setIPv6EnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._IPv6Enabled = value else: req._IPv6Enabled = value.handle self.mgr.getPort().INATNetwork_setIPv6Enabled(req) def getIPv6Prefix(self): req=INATNetwork_getIPv6PrefixRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetwork_getIPv6Prefix(req) return String(self.mgr,val._returnval) def setIPv6Prefix(self, value): req=INATNetwork_setIPv6PrefixRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._IPv6Prefix = value else: req._IPv6Prefix = value.handle self.mgr.getPort().INATNetwork_setIPv6Prefix(req) def getAdvertiseDefaultIPv6RouteEnabled(self): req=INATNetwork_getAdvertiseDefaultIPv6RouteEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetwork_getAdvertiseDefaultIPv6RouteEnabled(req) return Boolean(self.mgr,val._returnval) def setAdvertiseDefaultIPv6RouteEnabled(self, value): req=INATNetwork_setAdvertiseDefaultIPv6RouteEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._advertiseDefaultIPv6RouteEnabled = value else: req._advertiseDefaultIPv6RouteEnabled = value.handle self.mgr.getPort().INATNetwork_setAdvertiseDefaultIPv6RouteEnabled(req) def getNeedDhcpServer(self): req=INATNetwork_getNeedDhcpServerRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetwork_getNeedDhcpServer(req) return Boolean(self.mgr,val._returnval) def setNeedDhcpServer(self, value): req=INATNetwork_setNeedDhcpServerRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._needDhcpServer = value else: req._needDhcpServer = value.handle self.mgr.getPort().INATNetwork_setNeedDhcpServer(req) def getEventSource(self): req=INATNetwork_getEventSourceRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetwork_getEventSource(req) return IEventSource(self.mgr,val._returnval) def getPortForwardRules4(self): req=INATNetwork_getPortForwardRules4RequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetwork_getPortForwardRules4(req) return String(self.mgr,val._returnval, True) def getLocalMappings(self): req=INATNetwork_getLocalMappingsRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetwork_getLocalMappings(req) return String(self.mgr,val._returnval, True) def getLoopbackIp6(self): req=INATNetwork_getLoopbackIp6RequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetwork_getLoopbackIp6(req) return Int(self.mgr,val._returnval) def setLoopbackIp6(self, value): req=INATNetwork_setLoopbackIp6RequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._loopbackIp6 = value else: req._loopbackIp6 = value.handle self.mgr.getPort().INATNetwork_setLoopbackIp6(req) def getPortForwardRules6(self): req=INATNetwork_getPortForwardRules6RequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetwork_getPortForwardRules6(req) return String(self.mgr,val._returnval, True) _Attrs_={ 'networkName':[getNetworkName,setNetworkName, ], 'enabled':[getEnabled,setEnabled, ], 'network':[getNetwork,setNetwork, ], 'gateway':[getGateway,None], 'IPv6Enabled':[getIPv6Enabled,setIPv6Enabled, ], 'IPv6Prefix':[getIPv6Prefix,setIPv6Prefix, ], 'advertiseDefaultIPv6RouteEnabled':[getAdvertiseDefaultIPv6RouteEnabled,setAdvertiseDefaultIPv6RouteEnabled, ], 'needDhcpServer':[getNeedDhcpServer,setNeedDhcpServer, ], 'eventSource':[getEventSource,None], 'portForwardRules4':[getPortForwardRules4,None], 'localMappings':[getLocalMappings,None], 'loopbackIp6':[getLoopbackIp6,setLoopbackIp6, ], 'portForwardRules6':[getPortForwardRules6,None]} class IDHCPServer(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IDHCPServer(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IDHCPServer._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IDHCPServer._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def addGlobalOption(self, _arg_option, _arg_value): req=IDHCPServer_addGlobalOptionRequestMsg() req._this=self.handle req._option=_arg_option req._value=_arg_value val=self.mgr.getPort().IDHCPServer_addGlobalOption(req) return def addVmSlotOption(self, _arg_vmname, _arg_slot, _arg_option, _arg_value): req=IDHCPServer_addVmSlotOptionRequestMsg() req._this=self.handle req._vmname=_arg_vmname req._slot=_arg_slot req._option=_arg_option req._value=_arg_value val=self.mgr.getPort().IDHCPServer_addVmSlotOption(req) return def removeVmSlotOptions(self, _arg_vmname, _arg_slot): req=IDHCPServer_removeVmSlotOptionsRequestMsg() req._this=self.handle req._vmname=_arg_vmname req._slot=_arg_slot val=self.mgr.getPort().IDHCPServer_removeVmSlotOptions(req) return def getVmSlotOptions(self, _arg_vmname, _arg_slot): req=IDHCPServer_getVmSlotOptionsRequestMsg() req._this=self.handle req._vmname=_arg_vmname req._slot=_arg_slot val=self.mgr.getPort().IDHCPServer_getVmSlotOptions(req) return String(self.mgr,val._returnval, True) def getMacOptions(self, _arg_mac): req=IDHCPServer_getMacOptionsRequestMsg() req._this=self.handle req._mac=_arg_mac val=self.mgr.getPort().IDHCPServer_getMacOptions(req) return String(self.mgr,val._returnval, True) def setConfiguration(self, _arg_IPAddress, _arg_networkMask, _arg_FromIPAddress, _arg_ToIPAddress): req=IDHCPServer_setConfigurationRequestMsg() req._this=self.handle req._IPAddress=_arg_IPAddress req._networkMask=_arg_networkMask req._FromIPAddress=_arg_FromIPAddress req._ToIPAddress=_arg_ToIPAddress val=self.mgr.getPort().IDHCPServer_setConfiguration(req) return def start(self, _arg_networkName, _arg_trunkName, _arg_trunkType): req=IDHCPServer_startRequestMsg() req._this=self.handle req._networkName=_arg_networkName req._trunkName=_arg_trunkName req._trunkType=_arg_trunkType val=self.mgr.getPort().IDHCPServer_start(req) return def stop(self): req=IDHCPServer_stopRequestMsg() req._this=self.handle val=self.mgr.getPort().IDHCPServer_stop(req) return def getEventSource(self): req=IDHCPServer_getEventSourceRequestMsg() req._this=self.handle val=self.mgr.getPort().IDHCPServer_getEventSource(req) return IEventSource(self.mgr,val._returnval) def getEnabled(self): req=IDHCPServer_getEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IDHCPServer_getEnabled(req) return Boolean(self.mgr,val._returnval) def setEnabled(self, value): req=IDHCPServer_setEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._enabled = value else: req._enabled = value.handle self.mgr.getPort().IDHCPServer_setEnabled(req) def getIPAddress(self): req=IDHCPServer_getIPAddressRequestMsg() req._this=self.handle val=self.mgr.getPort().IDHCPServer_getIPAddress(req) return String(self.mgr,val._returnval) def getNetworkMask(self): req=IDHCPServer_getNetworkMaskRequestMsg() req._this=self.handle val=self.mgr.getPort().IDHCPServer_getNetworkMask(req) return String(self.mgr,val._returnval) def getNetworkName(self): req=IDHCPServer_getNetworkNameRequestMsg() req._this=self.handle val=self.mgr.getPort().IDHCPServer_getNetworkName(req) return String(self.mgr,val._returnval) def getLowerIP(self): req=IDHCPServer_getLowerIPRequestMsg() req._this=self.handle val=self.mgr.getPort().IDHCPServer_getLowerIP(req) return String(self.mgr,val._returnval) def getUpperIP(self): req=IDHCPServer_getUpperIPRequestMsg() req._this=self.handle val=self.mgr.getPort().IDHCPServer_getUpperIP(req) return String(self.mgr,val._returnval) def getGlobalOptions(self): req=IDHCPServer_getGlobalOptionsRequestMsg() req._this=self.handle val=self.mgr.getPort().IDHCPServer_getGlobalOptions(req) return String(self.mgr,val._returnval, True) def getVmConfigs(self): req=IDHCPServer_getVmConfigsRequestMsg() req._this=self.handle val=self.mgr.getPort().IDHCPServer_getVmConfigs(req) return String(self.mgr,val._returnval, True) _Attrs_={ 'eventSource':[getEventSource,None], 'enabled':[getEnabled,setEnabled, ], 'IPAddress':[getIPAddress,None], 'networkMask':[getNetworkMask,None], 'networkName':[getNetworkName,None], 'lowerIP':[getLowerIP,None], 'upperIP':[getUpperIP,None], 'globalOptions':[getGlobalOptions,None], 'vmConfigs':[getVmConfigs,None]} class IVirtualBox(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IVirtualBox(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IVirtualBox._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IVirtualBox._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def composeMachineFilename(self, _arg_name, _arg_group, _arg_createFlags, _arg_baseFolder): req=IVirtualBox_composeMachineFilenameRequestMsg() req._this=self.handle req._name=_arg_name req._group=_arg_group req._createFlags=_arg_createFlags req._baseFolder=_arg_baseFolder val=self.mgr.getPort().IVirtualBox_composeMachineFilename(req) return String(self.mgr,val._returnval) def createMachine(self, _arg_settingsFile, _arg_name, _arg_groups, _arg_osTypeId, _arg_flags): req=IVirtualBox_createMachineRequestMsg() req._this=self.handle req._settingsFile=_arg_settingsFile req._name=_arg_name req._groups=_arg_groups req._osTypeId=_arg_osTypeId req._flags=_arg_flags val=self.mgr.getPort().IVirtualBox_createMachine(req) return IMachine(self.mgr,val._returnval) def openMachine(self, _arg_settingsFile): req=IVirtualBox_openMachineRequestMsg() req._this=self.handle req._settingsFile=_arg_settingsFile val=self.mgr.getPort().IVirtualBox_openMachine(req) return IMachine(self.mgr,val._returnval) def registerMachine(self, _arg_machine): req=IVirtualBox_registerMachineRequestMsg() req._this=self.handle req._machine=_arg_machine val=self.mgr.getPort().IVirtualBox_registerMachine(req) return def findMachine(self, _arg_nameOrId): req=IVirtualBox_findMachineRequestMsg() req._this=self.handle req._nameOrId=_arg_nameOrId val=self.mgr.getPort().IVirtualBox_findMachine(req) return IMachine(self.mgr,val._returnval) def getMachinesByGroups(self, _arg_groups): req=IVirtualBox_getMachinesByGroupsRequestMsg() req._this=self.handle req._groups=_arg_groups val=self.mgr.getPort().IVirtualBox_getMachinesByGroups(req) return IMachine(self.mgr,val._returnval, True) def getMachineStates(self, _arg_machines): req=IVirtualBox_getMachineStatesRequestMsg() req._this=self.handle req._machines=_arg_machines val=self.mgr.getPort().IVirtualBox_getMachineStates(req) return MachineState(self.mgr,val._returnval, True) def createAppliance(self): req=IVirtualBox_createApplianceRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBox_createAppliance(req) return IAppliance(self.mgr,val._returnval) def createHardDisk(self, _arg_format, _arg_location): req=IVirtualBox_createHardDiskRequestMsg() req._this=self.handle req._format=_arg_format req._location=_arg_location val=self.mgr.getPort().IVirtualBox_createHardDisk(req) return IMedium(self.mgr,val._returnval) def openMedium(self, _arg_location, _arg_deviceType, _arg_accessMode, _arg_forceNewUuid): req=IVirtualBox_openMediumRequestMsg() req._this=self.handle req._location=_arg_location req._deviceType=_arg_deviceType req._accessMode=_arg_accessMode req._forceNewUuid=_arg_forceNewUuid val=self.mgr.getPort().IVirtualBox_openMedium(req) return IMedium(self.mgr,val._returnval) def getGuestOSType(self, _arg_id): req=IVirtualBox_getGuestOSTypeRequestMsg() req._this=self.handle req._id=_arg_id val=self.mgr.getPort().IVirtualBox_getGuestOSType(req) return IGuestOSType(self.mgr,val._returnval) def createSharedFolder(self, _arg_name, _arg_hostPath, _arg_writable, _arg_automount): req=IVirtualBox_createSharedFolderRequestMsg() req._this=self.handle req._name=_arg_name req._hostPath=_arg_hostPath req._writable=_arg_writable req._automount=_arg_automount val=self.mgr.getPort().IVirtualBox_createSharedFolder(req) return def removeSharedFolder(self, _arg_name): req=IVirtualBox_removeSharedFolderRequestMsg() req._this=self.handle req._name=_arg_name val=self.mgr.getPort().IVirtualBox_removeSharedFolder(req) return def getExtraDataKeys(self): req=IVirtualBox_getExtraDataKeysRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBox_getExtraDataKeys(req) return String(self.mgr,val._returnval, True) def getExtraData(self, _arg_key): req=IVirtualBox_getExtraDataRequestMsg() req._this=self.handle req._key=_arg_key val=self.mgr.getPort().IVirtualBox_getExtraData(req) return String(self.mgr,val._returnval) def setExtraData(self, _arg_key, _arg_value): req=IVirtualBox_setExtraDataRequestMsg() req._this=self.handle req._key=_arg_key req._value=_arg_value val=self.mgr.getPort().IVirtualBox_setExtraData(req) return def setSettingsSecret(self, _arg_password): req=IVirtualBox_setSettingsSecretRequestMsg() req._this=self.handle req._password=_arg_password val=self.mgr.getPort().IVirtualBox_setSettingsSecret(req) return def createDHCPServer(self, _arg_name): req=IVirtualBox_createDHCPServerRequestMsg() req._this=self.handle req._name=_arg_name val=self.mgr.getPort().IVirtualBox_createDHCPServer(req) return IDHCPServer(self.mgr,val._returnval) def findDHCPServerByNetworkName(self, _arg_name): req=IVirtualBox_findDHCPServerByNetworkNameRequestMsg() req._this=self.handle req._name=_arg_name val=self.mgr.getPort().IVirtualBox_findDHCPServerByNetworkName(req) return IDHCPServer(self.mgr,val._returnval) def removeDHCPServer(self, _arg_server): req=IVirtualBox_removeDHCPServerRequestMsg() req._this=self.handle req._server=_arg_server val=self.mgr.getPort().IVirtualBox_removeDHCPServer(req) return def createNATNetwork(self, _arg_networkName): req=IVirtualBox_createNATNetworkRequestMsg() req._this=self.handle req._networkName=_arg_networkName val=self.mgr.getPort().IVirtualBox_createNATNetwork(req) return INATNetwork(self.mgr,val._returnval) def findNATNetworkByName(self, _arg_networkName): req=IVirtualBox_findNATNetworkByNameRequestMsg() req._this=self.handle req._networkName=_arg_networkName val=self.mgr.getPort().IVirtualBox_findNATNetworkByName(req) return INATNetwork(self.mgr,val._returnval) def removeNATNetwork(self, _arg_network): req=IVirtualBox_removeNATNetworkRequestMsg() req._this=self.handle req._network=_arg_network val=self.mgr.getPort().IVirtualBox_removeNATNetwork(req) return def checkFirmwarePresent(self, _arg_firmwareType, _arg_version): req=IVirtualBox_checkFirmwarePresentRequestMsg() req._this=self.handle req._firmwareType=_arg_firmwareType req._version=_arg_version val=self.mgr.getPort().IVirtualBox_checkFirmwarePresent(req) return Boolean(self.mgr,val._returnval), String(self.mgr,val._url), String(self.mgr,val._file) def getVersion(self): req=IVirtualBox_getVersionRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBox_getVersion(req) return String(self.mgr,val._returnval) def getVersionNormalized(self): req=IVirtualBox_getVersionNormalizedRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBox_getVersionNormalized(req) return String(self.mgr,val._returnval) def getRevision(self): req=IVirtualBox_getRevisionRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBox_getRevision(req) return UnsignedInt(self.mgr,val._returnval) def getPackageType(self): req=IVirtualBox_getPackageTypeRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBox_getPackageType(req) return String(self.mgr,val._returnval) def getAPIVersion(self): req=IVirtualBox_getAPIVersionRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBox_getAPIVersion(req) return String(self.mgr,val._returnval) def getHomeFolder(self): req=IVirtualBox_getHomeFolderRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBox_getHomeFolder(req) return String(self.mgr,val._returnval) def getSettingsFilePath(self): req=IVirtualBox_getSettingsFilePathRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBox_getSettingsFilePath(req) return String(self.mgr,val._returnval) def getHost(self): req=IVirtualBox_getHostRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBox_getHost(req) return IHost(self.mgr,val._returnval) def getSystemProperties(self): req=IVirtualBox_getSystemPropertiesRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBox_getSystemProperties(req) return ISystemProperties(self.mgr,val._returnval) def getMachines(self): req=IVirtualBox_getMachinesRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBox_getMachines(req) return IMachine(self.mgr,val._returnval, True) def getMachineGroups(self): req=IVirtualBox_getMachineGroupsRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBox_getMachineGroups(req) return String(self.mgr,val._returnval, True) def getHardDisks(self): req=IVirtualBox_getHardDisksRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBox_getHardDisks(req) return IMedium(self.mgr,val._returnval, True) def getDVDImages(self): req=IVirtualBox_getDVDImagesRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBox_getDVDImages(req) return IMedium(self.mgr,val._returnval, True) def getFloppyImages(self): req=IVirtualBox_getFloppyImagesRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBox_getFloppyImages(req) return IMedium(self.mgr,val._returnval, True) def getProgressOperations(self): req=IVirtualBox_getProgressOperationsRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBox_getProgressOperations(req) return IProgress(self.mgr,val._returnval, True) def getGuestOSTypes(self): req=IVirtualBox_getGuestOSTypesRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBox_getGuestOSTypes(req) return IGuestOSType(self.mgr,val._returnval, True) def getSharedFolders(self): req=IVirtualBox_getSharedFoldersRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBox_getSharedFolders(req) return ISharedFolder(self.mgr,val._returnval, True) def getPerformanceCollector(self): req=IVirtualBox_getPerformanceCollectorRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBox_getPerformanceCollector(req) return IPerformanceCollector(self.mgr,val._returnval) def getDHCPServers(self): req=IVirtualBox_getDHCPServersRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBox_getDHCPServers(req) return IDHCPServer(self.mgr,val._returnval, True) def getNATNetworks(self): req=IVirtualBox_getNATNetworksRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBox_getNATNetworks(req) return INATNetwork(self.mgr,val._returnval, True) def getEventSource(self): req=IVirtualBox_getEventSourceRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBox_getEventSource(req) return IEventSource(self.mgr,val._returnval) def getInternalNetworks(self): req=IVirtualBox_getInternalNetworksRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBox_getInternalNetworks(req) return String(self.mgr,val._returnval, True) def getGenericNetworkDrivers(self): req=IVirtualBox_getGenericNetworkDriversRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualBox_getGenericNetworkDrivers(req) return String(self.mgr,val._returnval, True) _Attrs_={ 'version':[getVersion,None], 'versionNormalized':[getVersionNormalized,None], 'revision':[getRevision,None], 'packageType':[getPackageType,None], 'APIVersion':[getAPIVersion,None], 'homeFolder':[getHomeFolder,None], 'settingsFilePath':[getSettingsFilePath,None], 'host':[getHost,None], 'systemProperties':[getSystemProperties,None], 'machines':[getMachines,None], 'machineGroups':[getMachineGroups,None], 'hardDisks':[getHardDisks,None], 'DVDImages':[getDVDImages,None], 'floppyImages':[getFloppyImages,None], 'progressOperations':[getProgressOperations,None], 'guestOSTypes':[getGuestOSTypes,None], 'sharedFolders':[getSharedFolders,None], 'performanceCollector':[getPerformanceCollector,None], 'DHCPServers':[getDHCPServers,None], 'NATNetworks':[getNATNetworks,None], 'eventSource':[getEventSource,None], 'internalNetworks':[getInternalNetworks,None], 'genericNetworkDrivers':[getGenericNetworkDrivers,None]} class IVFSExplorer(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IVFSExplorer(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IVFSExplorer._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IVFSExplorer._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def update(self): req=IVFSExplorer_updateRequestMsg() req._this=self.handle val=self.mgr.getPort().IVFSExplorer_update(req) return IProgress(self.mgr,val._returnval) def cd(self, _arg_dir): req=IVFSExplorer_cdRequestMsg() req._this=self.handle req._dir=_arg_dir val=self.mgr.getPort().IVFSExplorer_cd(req) return IProgress(self.mgr,val._returnval) def cdUp(self): req=IVFSExplorer_cdUpRequestMsg() req._this=self.handle val=self.mgr.getPort().IVFSExplorer_cdUp(req) return IProgress(self.mgr,val._returnval) def entryList(self): req=IVFSExplorer_entryListRequestMsg() req._this=self.handle val=self.mgr.getPort().IVFSExplorer_entryList(req) return String(self.mgr,val._names, True), UnsignedInt(self.mgr,val._types, True), Long(self.mgr,val._sizes, True), UnsignedInt(self.mgr,val._modes, True) def exists(self, _arg_names): req=IVFSExplorer_existsRequestMsg() req._this=self.handle req._names=_arg_names val=self.mgr.getPort().IVFSExplorer_exists(req) return String(self.mgr,val._returnval, True) def remove(self, _arg_names): req=IVFSExplorer_removeRequestMsg() req._this=self.handle req._names=_arg_names val=self.mgr.getPort().IVFSExplorer_remove(req) return IProgress(self.mgr,val._returnval) def getPath(self): req=IVFSExplorer_getPathRequestMsg() req._this=self.handle val=self.mgr.getPort().IVFSExplorer_getPath(req) return String(self.mgr,val._returnval) def getType(self): req=IVFSExplorer_getTypeRequestMsg() req._this=self.handle val=self.mgr.getPort().IVFSExplorer_getType(req) return VFSType(self.mgr,val._returnval) _Attrs_={ 'path':[getPath,None], 'type':[getType,None]} class IAppliance(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IAppliance(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IAppliance._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IAppliance._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def read(self, _arg_file): req=IAppliance_readRequestMsg() req._this=self.handle req._file=_arg_file val=self.mgr.getPort().IAppliance_read(req) return IProgress(self.mgr,val._returnval) def interpret(self): req=IAppliance_interpretRequestMsg() req._this=self.handle val=self.mgr.getPort().IAppliance_interpret(req) return def importMachines(self, _arg_options): req=IAppliance_importMachinesRequestMsg() req._this=self.handle req._options=_arg_options val=self.mgr.getPort().IAppliance_importMachines(req) return IProgress(self.mgr,val._returnval) def createVFSExplorer(self, _arg_URI): req=IAppliance_createVFSExplorerRequestMsg() req._this=self.handle req._URI=_arg_URI val=self.mgr.getPort().IAppliance_createVFSExplorer(req) return IVFSExplorer(self.mgr,val._returnval) def write(self, _arg_format, _arg_options, _arg_path): req=IAppliance_writeRequestMsg() req._this=self.handle req._format=_arg_format req._options=_arg_options req._path=_arg_path val=self.mgr.getPort().IAppliance_write(req) return IProgress(self.mgr,val._returnval) def getWarnings(self): req=IAppliance_getWarningsRequestMsg() req._this=self.handle val=self.mgr.getPort().IAppliance_getWarnings(req) return String(self.mgr,val._returnval, True) def getPath(self): req=IAppliance_getPathRequestMsg() req._this=self.handle val=self.mgr.getPort().IAppliance_getPath(req) return String(self.mgr,val._returnval) def getDisks(self): req=IAppliance_getDisksRequestMsg() req._this=self.handle val=self.mgr.getPort().IAppliance_getDisks(req) return String(self.mgr,val._returnval, True) def getVirtualSystemDescriptions(self): req=IAppliance_getVirtualSystemDescriptionsRequestMsg() req._this=self.handle val=self.mgr.getPort().IAppliance_getVirtualSystemDescriptions(req) return IVirtualSystemDescription(self.mgr,val._returnval, True) def getMachines(self): req=IAppliance_getMachinesRequestMsg() req._this=self.handle val=self.mgr.getPort().IAppliance_getMachines(req) return String(self.mgr,val._returnval, True) _Attrs_={ 'path':[getPath,None], 'disks':[getDisks,None], 'virtualSystemDescriptions':[getVirtualSystemDescriptions,None], 'machines':[getMachines,None]} class IVirtualSystemDescription(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IVirtualSystemDescription(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IVirtualSystemDescription._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IVirtualSystemDescription._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getDescription(self): req=IVirtualSystemDescription_getDescriptionRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualSystemDescription_getDescription(req) return VirtualSystemDescriptionType(self.mgr,val._types, True), String(self.mgr,val._refs, True), String(self.mgr,val._OVFValues, True), String(self.mgr,val._VBoxValues, True), String(self.mgr,val._extraConfigValues, True) def getDescriptionByType(self, _arg_type): req=IVirtualSystemDescription_getDescriptionByTypeRequestMsg() req._this=self.handle req._type=_arg_type val=self.mgr.getPort().IVirtualSystemDescription_getDescriptionByType(req) return VirtualSystemDescriptionType(self.mgr,val._types, True), String(self.mgr,val._refs, True), String(self.mgr,val._OVFValues, True), String(self.mgr,val._VBoxValues, True), String(self.mgr,val._extraConfigValues, True) def getValuesByType(self, _arg_type, _arg_which): req=IVirtualSystemDescription_getValuesByTypeRequestMsg() req._this=self.handle req._type=_arg_type req._which=_arg_which val=self.mgr.getPort().IVirtualSystemDescription_getValuesByType(req) return String(self.mgr,val._returnval, True) def setFinalValues(self, _arg_enabled, _arg_VBoxValues, _arg_extraConfigValues): req=IVirtualSystemDescription_setFinalValuesRequestMsg() req._this=self.handle req._enabled=_arg_enabled req._VBoxValues=_arg_VBoxValues req._extraConfigValues=_arg_extraConfigValues val=self.mgr.getPort().IVirtualSystemDescription_setFinalValues(req) return def addDescription(self, _arg_type, _arg_VBoxValue, _arg_extraConfigValue): req=IVirtualSystemDescription_addDescriptionRequestMsg() req._this=self.handle req._type=_arg_type req._VBoxValue=_arg_VBoxValue req._extraConfigValue=_arg_extraConfigValue val=self.mgr.getPort().IVirtualSystemDescription_addDescription(req) return def getCount(self): req=IVirtualSystemDescription_getCountRequestMsg() req._this=self.handle val=self.mgr.getPort().IVirtualSystemDescription_getCount(req) return UnsignedInt(self.mgr,val._returnval) _Attrs_={ 'count':[getCount,None]} class IBIOSSettings(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IBIOSSettings(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IBIOSSettings._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IBIOSSettings._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getLogoFadeIn(self): req=IBIOSSettings_getLogoFadeInRequestMsg() req._this=self.handle val=self.mgr.getPort().IBIOSSettings_getLogoFadeIn(req) return Boolean(self.mgr,val._returnval) def setLogoFadeIn(self, value): req=IBIOSSettings_setLogoFadeInRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._logoFadeIn = value else: req._logoFadeIn = value.handle self.mgr.getPort().IBIOSSettings_setLogoFadeIn(req) def getLogoFadeOut(self): req=IBIOSSettings_getLogoFadeOutRequestMsg() req._this=self.handle val=self.mgr.getPort().IBIOSSettings_getLogoFadeOut(req) return Boolean(self.mgr,val._returnval) def setLogoFadeOut(self, value): req=IBIOSSettings_setLogoFadeOutRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._logoFadeOut = value else: req._logoFadeOut = value.handle self.mgr.getPort().IBIOSSettings_setLogoFadeOut(req) def getLogoDisplayTime(self): req=IBIOSSettings_getLogoDisplayTimeRequestMsg() req._this=self.handle val=self.mgr.getPort().IBIOSSettings_getLogoDisplayTime(req) return UnsignedInt(self.mgr,val._returnval) def setLogoDisplayTime(self, value): req=IBIOSSettings_setLogoDisplayTimeRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._logoDisplayTime = value else: req._logoDisplayTime = value.handle self.mgr.getPort().IBIOSSettings_setLogoDisplayTime(req) def getLogoImagePath(self): req=IBIOSSettings_getLogoImagePathRequestMsg() req._this=self.handle val=self.mgr.getPort().IBIOSSettings_getLogoImagePath(req) return String(self.mgr,val._returnval) def setLogoImagePath(self, value): req=IBIOSSettings_setLogoImagePathRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._logoImagePath = value else: req._logoImagePath = value.handle self.mgr.getPort().IBIOSSettings_setLogoImagePath(req) def getBootMenuMode(self): req=IBIOSSettings_getBootMenuModeRequestMsg() req._this=self.handle val=self.mgr.getPort().IBIOSSettings_getBootMenuMode(req) return BIOSBootMenuMode(self.mgr,val._returnval) def setBootMenuMode(self, value): req=IBIOSSettings_setBootMenuModeRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._bootMenuMode = value else: req._bootMenuMode = value.handle self.mgr.getPort().IBIOSSettings_setBootMenuMode(req) def getACPIEnabled(self): req=IBIOSSettings_getACPIEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IBIOSSettings_getACPIEnabled(req) return Boolean(self.mgr,val._returnval) def setACPIEnabled(self, value): req=IBIOSSettings_setACPIEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._ACPIEnabled = value else: req._ACPIEnabled = value.handle self.mgr.getPort().IBIOSSettings_setACPIEnabled(req) def getIOAPICEnabled(self): req=IBIOSSettings_getIOAPICEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IBIOSSettings_getIOAPICEnabled(req) return Boolean(self.mgr,val._returnval) def setIOAPICEnabled(self, value): req=IBIOSSettings_setIOAPICEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._IOAPICEnabled = value else: req._IOAPICEnabled = value.handle self.mgr.getPort().IBIOSSettings_setIOAPICEnabled(req) def getTimeOffset(self): req=IBIOSSettings_getTimeOffsetRequestMsg() req._this=self.handle val=self.mgr.getPort().IBIOSSettings_getTimeOffset(req) return Long(self.mgr,val._returnval) def setTimeOffset(self, value): req=IBIOSSettings_setTimeOffsetRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._timeOffset = value else: req._timeOffset = value.handle self.mgr.getPort().IBIOSSettings_setTimeOffset(req) def getPXEDebugEnabled(self): req=IBIOSSettings_getPXEDebugEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IBIOSSettings_getPXEDebugEnabled(req) return Boolean(self.mgr,val._returnval) def setPXEDebugEnabled(self, value): req=IBIOSSettings_setPXEDebugEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._PXEDebugEnabled = value else: req._PXEDebugEnabled = value.handle self.mgr.getPort().IBIOSSettings_setPXEDebugEnabled(req) def getNonVolatileStorageFile(self): req=IBIOSSettings_getNonVolatileStorageFileRequestMsg() req._this=self.handle val=self.mgr.getPort().IBIOSSettings_getNonVolatileStorageFile(req) return String(self.mgr,val._returnval) _Attrs_={ 'logoFadeIn':[getLogoFadeIn,setLogoFadeIn, ], 'logoFadeOut':[getLogoFadeOut,setLogoFadeOut, ], 'logoDisplayTime':[getLogoDisplayTime,setLogoDisplayTime, ], 'logoImagePath':[getLogoImagePath,setLogoImagePath, ], 'bootMenuMode':[getBootMenuMode,setBootMenuMode, ], 'ACPIEnabled':[getACPIEnabled,setACPIEnabled, ], 'IOAPICEnabled':[getIOAPICEnabled,setIOAPICEnabled, ], 'timeOffset':[getTimeOffset,setTimeOffset, ], 'PXEDebugEnabled':[getPXEDebugEnabled,setPXEDebugEnabled, ], 'nonVolatileStorageFile':[getNonVolatileStorageFile,None]} class IPCIAddress(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IPCIAddress(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IPCIAddress._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IPCIAddress._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def asLong(self): req=IPCIAddress_asLongRequestMsg() req._this=self.handle val=self.mgr.getPort().IPCIAddress_asLong(req) return Int(self.mgr,val._returnval) def fromLong(self, _arg_number): req=IPCIAddress_fromLongRequestMsg() req._this=self.handle req._number=_arg_number val=self.mgr.getPort().IPCIAddress_fromLong(req) return def getBus(self): req=IPCIAddress_getBusRequestMsg() req._this=self.handle val=self.mgr.getPort().IPCIAddress_getBus(req) return Short(self.mgr,val._returnval) def setBus(self, value): req=IPCIAddress_setBusRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._bus = value else: req._bus = value.handle self.mgr.getPort().IPCIAddress_setBus(req) def getDevice(self): req=IPCIAddress_getDeviceRequestMsg() req._this=self.handle val=self.mgr.getPort().IPCIAddress_getDevice(req) return Short(self.mgr,val._returnval) def setDevice(self, value): req=IPCIAddress_setDeviceRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._device = value else: req._device = value.handle self.mgr.getPort().IPCIAddress_setDevice(req) def getDevFunction(self): req=IPCIAddress_getDevFunctionRequestMsg() req._this=self.handle val=self.mgr.getPort().IPCIAddress_getDevFunction(req) return Short(self.mgr,val._returnval) def setDevFunction(self, value): req=IPCIAddress_setDevFunctionRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._devFunction = value else: req._devFunction = value.handle self.mgr.getPort().IPCIAddress_setDevFunction(req) _Attrs_={ 'bus':[getBus,setBus, ], 'device':[getDevice,setDevice, ], 'devFunction':[getDevFunction,setDevFunction, ]} class IMachine(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IMachine(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IMachine._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IMachine._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def lockMachine(self, _arg_session, _arg_lockType): req=IMachine_lockMachineRequestMsg() req._this=self.handle req._session=_arg_session req._lockType=_arg_lockType val=self.mgr.getPort().IMachine_lockMachine(req) return def launchVMProcess(self, _arg_session, _arg_type, _arg_environment): req=IMachine_launchVMProcessRequestMsg() req._this=self.handle req._session=_arg_session req._type=_arg_type req._environment=_arg_environment val=self.mgr.getPort().IMachine_launchVMProcess(req) return IProgress(self.mgr,val._returnval) def setBootOrder(self, _arg_position, _arg_device): req=IMachine_setBootOrderRequestMsg() req._this=self.handle req._position=_arg_position req._device=_arg_device val=self.mgr.getPort().IMachine_setBootOrder(req) return def getBootOrder(self, _arg_position): req=IMachine_getBootOrderRequestMsg() req._this=self.handle req._position=_arg_position val=self.mgr.getPort().IMachine_getBootOrder(req) return DeviceType(self.mgr,val._returnval) def attachDevice(self, _arg_name, _arg_controllerPort, _arg_device, _arg_type, _arg_medium): req=IMachine_attachDeviceRequestMsg() req._this=self.handle req._name=_arg_name req._controllerPort=_arg_controllerPort req._device=_arg_device req._type=_arg_type req._medium=_arg_medium val=self.mgr.getPort().IMachine_attachDevice(req) return def attachDeviceWithoutMedium(self, _arg_name, _arg_controllerPort, _arg_device, _arg_type): req=IMachine_attachDeviceWithoutMediumRequestMsg() req._this=self.handle req._name=_arg_name req._controllerPort=_arg_controllerPort req._device=_arg_device req._type=_arg_type val=self.mgr.getPort().IMachine_attachDeviceWithoutMedium(req) return def detachDevice(self, _arg_name, _arg_controllerPort, _arg_device): req=IMachine_detachDeviceRequestMsg() req._this=self.handle req._name=_arg_name req._controllerPort=_arg_controllerPort req._device=_arg_device val=self.mgr.getPort().IMachine_detachDevice(req) return def passthroughDevice(self, _arg_name, _arg_controllerPort, _arg_device, _arg_passthrough): req=IMachine_passthroughDeviceRequestMsg() req._this=self.handle req._name=_arg_name req._controllerPort=_arg_controllerPort req._device=_arg_device req._passthrough=_arg_passthrough val=self.mgr.getPort().IMachine_passthroughDevice(req) return def temporaryEjectDevice(self, _arg_name, _arg_controllerPort, _arg_device, _arg_temporaryEject): req=IMachine_temporaryEjectDeviceRequestMsg() req._this=self.handle req._name=_arg_name req._controllerPort=_arg_controllerPort req._device=_arg_device req._temporaryEject=_arg_temporaryEject val=self.mgr.getPort().IMachine_temporaryEjectDevice(req) return def nonRotationalDevice(self, _arg_name, _arg_controllerPort, _arg_device, _arg_nonRotational): req=IMachine_nonRotationalDeviceRequestMsg() req._this=self.handle req._name=_arg_name req._controllerPort=_arg_controllerPort req._device=_arg_device req._nonRotational=_arg_nonRotational val=self.mgr.getPort().IMachine_nonRotationalDevice(req) return def setAutoDiscardForDevice(self, _arg_name, _arg_controllerPort, _arg_device, _arg_discard): req=IMachine_setAutoDiscardForDeviceRequestMsg() req._this=self.handle req._name=_arg_name req._controllerPort=_arg_controllerPort req._device=_arg_device req._discard=_arg_discard val=self.mgr.getPort().IMachine_setAutoDiscardForDevice(req) return def setHotPluggableForDevice(self, _arg_name, _arg_controllerPort, _arg_device, _arg_hotPluggable): req=IMachine_setHotPluggableForDeviceRequestMsg() req._this=self.handle req._name=_arg_name req._controllerPort=_arg_controllerPort req._device=_arg_device req._hotPluggable=_arg_hotPluggable val=self.mgr.getPort().IMachine_setHotPluggableForDevice(req) return def setBandwidthGroupForDevice(self, _arg_name, _arg_controllerPort, _arg_device, _arg_bandwidthGroup): req=IMachine_setBandwidthGroupForDeviceRequestMsg() req._this=self.handle req._name=_arg_name req._controllerPort=_arg_controllerPort req._device=_arg_device req._bandwidthGroup=_arg_bandwidthGroup val=self.mgr.getPort().IMachine_setBandwidthGroupForDevice(req) return def setNoBandwidthGroupForDevice(self, _arg_name, _arg_controllerPort, _arg_device): req=IMachine_setNoBandwidthGroupForDeviceRequestMsg() req._this=self.handle req._name=_arg_name req._controllerPort=_arg_controllerPort req._device=_arg_device val=self.mgr.getPort().IMachine_setNoBandwidthGroupForDevice(req) return def unmountMedium(self, _arg_name, _arg_controllerPort, _arg_device, _arg_force): req=IMachine_unmountMediumRequestMsg() req._this=self.handle req._name=_arg_name req._controllerPort=_arg_controllerPort req._device=_arg_device req._force=_arg_force val=self.mgr.getPort().IMachine_unmountMedium(req) return def mountMedium(self, _arg_name, _arg_controllerPort, _arg_device, _arg_medium, _arg_force): req=IMachine_mountMediumRequestMsg() req._this=self.handle req._name=_arg_name req._controllerPort=_arg_controllerPort req._device=_arg_device req._medium=_arg_medium req._force=_arg_force val=self.mgr.getPort().IMachine_mountMedium(req) return def getMedium(self, _arg_name, _arg_controllerPort, _arg_device): req=IMachine_getMediumRequestMsg() req._this=self.handle req._name=_arg_name req._controllerPort=_arg_controllerPort req._device=_arg_device val=self.mgr.getPort().IMachine_getMedium(req) return IMedium(self.mgr,val._returnval) def getMediumAttachmentsOfController(self, _arg_name): req=IMachine_getMediumAttachmentsOfControllerRequestMsg() req._this=self.handle req._name=_arg_name val=self.mgr.getPort().IMachine_getMediumAttachmentsOfController(req) return IMediumAttachment(self.mgr,val._returnval, True) def getMediumAttachment(self, _arg_name, _arg_controllerPort, _arg_device): req=IMachine_getMediumAttachmentRequestMsg() req._this=self.handle req._name=_arg_name req._controllerPort=_arg_controllerPort req._device=_arg_device val=self.mgr.getPort().IMachine_getMediumAttachment(req) return IMediumAttachment(self.mgr,val._returnval) def attachHostPCIDevice(self, _arg_hostAddress, _arg_desiredGuestAddress, _arg_tryToUnbind): req=IMachine_attachHostPCIDeviceRequestMsg() req._this=self.handle req._hostAddress=_arg_hostAddress req._desiredGuestAddress=_arg_desiredGuestAddress req._tryToUnbind=_arg_tryToUnbind val=self.mgr.getPort().IMachine_attachHostPCIDevice(req) return def detachHostPCIDevice(self, _arg_hostAddress): req=IMachine_detachHostPCIDeviceRequestMsg() req._this=self.handle req._hostAddress=_arg_hostAddress val=self.mgr.getPort().IMachine_detachHostPCIDevice(req) return def getNetworkAdapter(self, _arg_slot): req=IMachine_getNetworkAdapterRequestMsg() req._this=self.handle req._slot=_arg_slot val=self.mgr.getPort().IMachine_getNetworkAdapter(req) return INetworkAdapter(self.mgr,val._returnval) def addStorageController(self, _arg_name, _arg_connectionType): req=IMachine_addStorageControllerRequestMsg() req._this=self.handle req._name=_arg_name req._connectionType=_arg_connectionType val=self.mgr.getPort().IMachine_addStorageController(req) return IStorageController(self.mgr,val._returnval) def getStorageControllerByName(self, _arg_name): req=IMachine_getStorageControllerByNameRequestMsg() req._this=self.handle req._name=_arg_name val=self.mgr.getPort().IMachine_getStorageControllerByName(req) return IStorageController(self.mgr,val._returnval) def getStorageControllerByInstance(self, _arg_instance): req=IMachine_getStorageControllerByInstanceRequestMsg() req._this=self.handle req._instance=_arg_instance val=self.mgr.getPort().IMachine_getStorageControllerByInstance(req) return IStorageController(self.mgr,val._returnval) def removeStorageController(self, _arg_name): req=IMachine_removeStorageControllerRequestMsg() req._this=self.handle req._name=_arg_name val=self.mgr.getPort().IMachine_removeStorageController(req) return def setStorageControllerBootable(self, _arg_name, _arg_bootable): req=IMachine_setStorageControllerBootableRequestMsg() req._this=self.handle req._name=_arg_name req._bootable=_arg_bootable val=self.mgr.getPort().IMachine_setStorageControllerBootable(req) return def addUSBController(self, _arg_name, _arg_type): req=IMachine_addUSBControllerRequestMsg() req._this=self.handle req._name=_arg_name req._type=_arg_type val=self.mgr.getPort().IMachine_addUSBController(req) return IUSBController(self.mgr,val._returnval) def removeUSBController(self, _arg_name): req=IMachine_removeUSBControllerRequestMsg() req._this=self.handle req._name=_arg_name val=self.mgr.getPort().IMachine_removeUSBController(req) return def getUSBControllerByName(self, _arg_name): req=IMachine_getUSBControllerByNameRequestMsg() req._this=self.handle req._name=_arg_name val=self.mgr.getPort().IMachine_getUSBControllerByName(req) return IUSBController(self.mgr,val._returnval) def getUSBControllerCountByType(self, _arg_type): req=IMachine_getUSBControllerCountByTypeRequestMsg() req._this=self.handle req._type=_arg_type val=self.mgr.getPort().IMachine_getUSBControllerCountByType(req) return UnsignedInt(self.mgr,val._returnval) def getSerialPort(self, _arg_slot): req=IMachine_getSerialPortRequestMsg() req._this=self.handle req._slot=_arg_slot val=self.mgr.getPort().IMachine_getSerialPort(req) return ISerialPort(self.mgr,val._returnval) def getParallelPort(self, _arg_slot): req=IMachine_getParallelPortRequestMsg() req._this=self.handle req._slot=_arg_slot val=self.mgr.getPort().IMachine_getParallelPort(req) return IParallelPort(self.mgr,val._returnval) def getExtraDataKeys(self): req=IMachine_getExtraDataKeysRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getExtraDataKeys(req) return String(self.mgr,val._returnval, True) def getExtraData(self, _arg_key): req=IMachine_getExtraDataRequestMsg() req._this=self.handle req._key=_arg_key val=self.mgr.getPort().IMachine_getExtraData(req) return String(self.mgr,val._returnval) def setExtraData(self, _arg_key, _arg_value): req=IMachine_setExtraDataRequestMsg() req._this=self.handle req._key=_arg_key req._value=_arg_value val=self.mgr.getPort().IMachine_setExtraData(req) return def getCPUProperty(self, _arg_property): req=IMachine_getCPUPropertyRequestMsg() req._this=self.handle req._property=_arg_property val=self.mgr.getPort().IMachine_getCPUProperty(req) return Boolean(self.mgr,val._returnval) def setCPUProperty(self, _arg_property, _arg_value): req=IMachine_setCPUPropertyRequestMsg() req._this=self.handle req._property=_arg_property req._value=_arg_value val=self.mgr.getPort().IMachine_setCPUProperty(req) return def getCPUIDLeaf(self, _arg_id): req=IMachine_getCPUIDLeafRequestMsg() req._this=self.handle req._id=_arg_id val=self.mgr.getPort().IMachine_getCPUIDLeaf(req) return UnsignedInt(self.mgr,val._valEax), UnsignedInt(self.mgr,val._valEbx), UnsignedInt(self.mgr,val._valEcx), UnsignedInt(self.mgr,val._valEdx) def setCPUIDLeaf(self, _arg_id, _arg_valEax, _arg_valEbx, _arg_valEcx, _arg_valEdx): req=IMachine_setCPUIDLeafRequestMsg() req._this=self.handle req._id=_arg_id req._valEax=_arg_valEax req._valEbx=_arg_valEbx req._valEcx=_arg_valEcx req._valEdx=_arg_valEdx val=self.mgr.getPort().IMachine_setCPUIDLeaf(req) return def removeCPUIDLeaf(self, _arg_id): req=IMachine_removeCPUIDLeafRequestMsg() req._this=self.handle req._id=_arg_id val=self.mgr.getPort().IMachine_removeCPUIDLeaf(req) return def removeAllCPUIDLeaves(self): req=IMachine_removeAllCPUIDLeavesRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_removeAllCPUIDLeaves(req) return def getHWVirtExProperty(self, _arg_property): req=IMachine_getHWVirtExPropertyRequestMsg() req._this=self.handle req._property=_arg_property val=self.mgr.getPort().IMachine_getHWVirtExProperty(req) return Boolean(self.mgr,val._returnval) def setHWVirtExProperty(self, _arg_property, _arg_value): req=IMachine_setHWVirtExPropertyRequestMsg() req._this=self.handle req._property=_arg_property req._value=_arg_value val=self.mgr.getPort().IMachine_setHWVirtExProperty(req) return def setSettingsFilePath(self, _arg_settingsFilePath): req=IMachine_setSettingsFilePathRequestMsg() req._this=self.handle req._settingsFilePath=_arg_settingsFilePath val=self.mgr.getPort().IMachine_setSettingsFilePath(req) return IProgress(self.mgr,val._returnval) def saveSettings(self): req=IMachine_saveSettingsRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_saveSettings(req) return def discardSettings(self): req=IMachine_discardSettingsRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_discardSettings(req) return def unregister(self, _arg_cleanupMode): req=IMachine_unregisterRequestMsg() req._this=self.handle req._cleanupMode=_arg_cleanupMode val=self.mgr.getPort().IMachine_unregister(req) return IMedium(self.mgr,val._returnval, True) def deleteConfig(self, _arg_media): req=IMachine_deleteConfigRequestMsg() req._this=self.handle req._media=_arg_media val=self.mgr.getPort().IMachine_deleteConfig(req) return IProgress(self.mgr,val._returnval) def exportTo(self, _arg_appliance, _arg_location): req=IMachine_exportToRequestMsg() req._this=self.handle req._appliance=_arg_appliance req._location=_arg_location val=self.mgr.getPort().IMachine_exportTo(req) return IVirtualSystemDescription(self.mgr,val._returnval) def findSnapshot(self, _arg_nameOrId): req=IMachine_findSnapshotRequestMsg() req._this=self.handle req._nameOrId=_arg_nameOrId val=self.mgr.getPort().IMachine_findSnapshot(req) return ISnapshot(self.mgr,val._returnval) def createSharedFolder(self, _arg_name, _arg_hostPath, _arg_writable, _arg_automount): req=IMachine_createSharedFolderRequestMsg() req._this=self.handle req._name=_arg_name req._hostPath=_arg_hostPath req._writable=_arg_writable req._automount=_arg_automount val=self.mgr.getPort().IMachine_createSharedFolder(req) return def removeSharedFolder(self, _arg_name): req=IMachine_removeSharedFolderRequestMsg() req._this=self.handle req._name=_arg_name val=self.mgr.getPort().IMachine_removeSharedFolder(req) return def canShowConsoleWindow(self): req=IMachine_canShowConsoleWindowRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_canShowConsoleWindow(req) return Boolean(self.mgr,val._returnval) def showConsoleWindow(self): req=IMachine_showConsoleWindowRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_showConsoleWindow(req) return Long(self.mgr,val._returnval) def getGuestProperty(self, _arg_name): req=IMachine_getGuestPropertyRequestMsg() req._this=self.handle req._name=_arg_name val=self.mgr.getPort().IMachine_getGuestProperty(req) return String(self.mgr,val._value), Long(self.mgr,val._timestamp), String(self.mgr,val._flags) def getGuestPropertyValue(self, _arg_property): req=IMachine_getGuestPropertyValueRequestMsg() req._this=self.handle req._property=_arg_property val=self.mgr.getPort().IMachine_getGuestPropertyValue(req) return String(self.mgr,val._returnval) def getGuestPropertyTimestamp(self, _arg_property): req=IMachine_getGuestPropertyTimestampRequestMsg() req._this=self.handle req._property=_arg_property val=self.mgr.getPort().IMachine_getGuestPropertyTimestamp(req) return Long(self.mgr,val._returnval) def setGuestProperty(self, _arg_property, _arg_value, _arg_flags): req=IMachine_setGuestPropertyRequestMsg() req._this=self.handle req._property=_arg_property req._value=_arg_value req._flags=_arg_flags val=self.mgr.getPort().IMachine_setGuestProperty(req) return def setGuestPropertyValue(self, _arg_property, _arg_value): req=IMachine_setGuestPropertyValueRequestMsg() req._this=self.handle req._property=_arg_property req._value=_arg_value val=self.mgr.getPort().IMachine_setGuestPropertyValue(req) return def deleteGuestProperty(self, _arg_name): req=IMachine_deleteGuestPropertyRequestMsg() req._this=self.handle req._name=_arg_name val=self.mgr.getPort().IMachine_deleteGuestProperty(req) return def enumerateGuestProperties(self, _arg_patterns): req=IMachine_enumerateGuestPropertiesRequestMsg() req._this=self.handle req._patterns=_arg_patterns val=self.mgr.getPort().IMachine_enumerateGuestProperties(req) return String(self.mgr,val._names, True), String(self.mgr,val._values, True), Long(self.mgr,val._timestamps, True), String(self.mgr,val._flags, True) def querySavedGuestScreenInfo(self, _arg_screenId): req=IMachine_querySavedGuestScreenInfoRequestMsg() req._this=self.handle req._screenId=_arg_screenId val=self.mgr.getPort().IMachine_querySavedGuestScreenInfo(req) return UnsignedInt(self.mgr,val._originX), UnsignedInt(self.mgr,val._originY), UnsignedInt(self.mgr,val._width), UnsignedInt(self.mgr,val._height), Boolean(self.mgr,val._enabled) def querySavedThumbnailSize(self, _arg_screenId): req=IMachine_querySavedThumbnailSizeRequestMsg() req._this=self.handle req._screenId=_arg_screenId val=self.mgr.getPort().IMachine_querySavedThumbnailSize(req) return UnsignedInt(self.mgr,val._size), UnsignedInt(self.mgr,val._width), UnsignedInt(self.mgr,val._height) def readSavedThumbnailToArray(self, _arg_screenId, _arg_BGR): req=IMachine_readSavedThumbnailToArrayRequestMsg() req._this=self.handle req._screenId=_arg_screenId req._BGR=_arg_BGR val=self.mgr.getPort().IMachine_readSavedThumbnailToArray(req) return self.mgr.decodebase64(val._returnval), UnsignedInt(self.mgr,val._width), UnsignedInt(self.mgr,val._height) def readSavedThumbnailPNGToArray(self, _arg_screenId): req=IMachine_readSavedThumbnailPNGToArrayRequestMsg() req._this=self.handle req._screenId=_arg_screenId val=self.mgr.getPort().IMachine_readSavedThumbnailPNGToArray(req) return self.mgr.decodebase64(val._returnval), UnsignedInt(self.mgr,val._width), UnsignedInt(self.mgr,val._height) def querySavedScreenshotPNGSize(self, _arg_screenId): req=IMachine_querySavedScreenshotPNGSizeRequestMsg() req._this=self.handle req._screenId=_arg_screenId val=self.mgr.getPort().IMachine_querySavedScreenshotPNGSize(req) return UnsignedInt(self.mgr,val._size), UnsignedInt(self.mgr,val._width), UnsignedInt(self.mgr,val._height) def readSavedScreenshotPNGToArray(self, _arg_screenId): req=IMachine_readSavedScreenshotPNGToArrayRequestMsg() req._this=self.handle req._screenId=_arg_screenId val=self.mgr.getPort().IMachine_readSavedScreenshotPNGToArray(req) return self.mgr.decodebase64(val._returnval), UnsignedInt(self.mgr,val._width), UnsignedInt(self.mgr,val._height) def hotPlugCPU(self, _arg_cpu): req=IMachine_hotPlugCPURequestMsg() req._this=self.handle req._cpu=_arg_cpu val=self.mgr.getPort().IMachine_hotPlugCPU(req) return def hotUnplugCPU(self, _arg_cpu): req=IMachine_hotUnplugCPURequestMsg() req._this=self.handle req._cpu=_arg_cpu val=self.mgr.getPort().IMachine_hotUnplugCPU(req) return def getCPUStatus(self, _arg_cpu): req=IMachine_getCPUStatusRequestMsg() req._this=self.handle req._cpu=_arg_cpu val=self.mgr.getPort().IMachine_getCPUStatus(req) return Boolean(self.mgr,val._returnval) def queryLogFilename(self, _arg_idx): req=IMachine_queryLogFilenameRequestMsg() req._this=self.handle req._idx=_arg_idx val=self.mgr.getPort().IMachine_queryLogFilename(req) return String(self.mgr,val._returnval) def readLog(self, _arg_idx, _arg_offset, _arg_size): req=IMachine_readLogRequestMsg() req._this=self.handle req._idx=_arg_idx req._offset=_arg_offset req._size=_arg_size val=self.mgr.getPort().IMachine_readLog(req) return self.mgr.decodebase64(val._returnval) def cloneTo(self, _arg_target, _arg_mode, _arg_options): req=IMachine_cloneToRequestMsg() req._this=self.handle req._target=_arg_target req._mode=_arg_mode req._options=_arg_options val=self.mgr.getPort().IMachine_cloneTo(req) return IProgress(self.mgr,val._returnval) def getParent(self): req=IMachine_getParentRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getParent(req) return IVirtualBox(self.mgr,val._returnval) def getIcon(self): req=IMachine_getIconRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getIcon(req) return self.mgr.decodebase64(val._returnval) def setIcon(self, value): req=IMachine_setIconRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._icon = value else: req._icon = value.handle self.mgr.getPort().IMachine_setIcon(req) def getAccessible(self): req=IMachine_getAccessibleRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getAccessible(req) return Boolean(self.mgr,val._returnval) def getAccessError(self): req=IMachine_getAccessErrorRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getAccessError(req) return IVirtualBoxErrorInfo(self.mgr,val._returnval) def getName(self): req=IMachine_getNameRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getName(req) return String(self.mgr,val._returnval) def setName(self, value): req=IMachine_setNameRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._name = value else: req._name = value.handle self.mgr.getPort().IMachine_setName(req) def getDescription(self): req=IMachine_getDescriptionRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getDescription(req) return String(self.mgr,val._returnval) def setDescription(self, value): req=IMachine_setDescriptionRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._description = value else: req._description = value.handle self.mgr.getPort().IMachine_setDescription(req) def getId(self): req=IMachine_getIdRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getId(req) return String(self.mgr,val._returnval) def getGroups(self): req=IMachine_getGroupsRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getGroups(req) return String(self.mgr,val._returnval, True) def setGroups(self, value): req=IMachine_setGroupsRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._groups = value else: req._groups = value.handle self.mgr.getPort().IMachine_setGroups(req) def getOSTypeId(self): req=IMachine_getOSTypeIdRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getOSTypeId(req) return String(self.mgr,val._returnval) def setOSTypeId(self, value): req=IMachine_setOSTypeIdRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._OSTypeId = value else: req._OSTypeId = value.handle self.mgr.getPort().IMachine_setOSTypeId(req) def getHardwareVersion(self): req=IMachine_getHardwareVersionRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getHardwareVersion(req) return String(self.mgr,val._returnval) def setHardwareVersion(self, value): req=IMachine_setHardwareVersionRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._hardwareVersion = value else: req._hardwareVersion = value.handle self.mgr.getPort().IMachine_setHardwareVersion(req) def getHardwareUUID(self): req=IMachine_getHardwareUUIDRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getHardwareUUID(req) return String(self.mgr,val._returnval) def setHardwareUUID(self, value): req=IMachine_setHardwareUUIDRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._hardwareUUID = value else: req._hardwareUUID = value.handle self.mgr.getPort().IMachine_setHardwareUUID(req) def getCPUCount(self): req=IMachine_getCPUCountRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getCPUCount(req) return UnsignedInt(self.mgr,val._returnval) def setCPUCount(self, value): req=IMachine_setCPUCountRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._CPUCount = value else: req._CPUCount = value.handle self.mgr.getPort().IMachine_setCPUCount(req) def getCPUHotPlugEnabled(self): req=IMachine_getCPUHotPlugEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getCPUHotPlugEnabled(req) return Boolean(self.mgr,val._returnval) def setCPUHotPlugEnabled(self, value): req=IMachine_setCPUHotPlugEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._CPUHotPlugEnabled = value else: req._CPUHotPlugEnabled = value.handle self.mgr.getPort().IMachine_setCPUHotPlugEnabled(req) def getCPUExecutionCap(self): req=IMachine_getCPUExecutionCapRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getCPUExecutionCap(req) return UnsignedInt(self.mgr,val._returnval) def setCPUExecutionCap(self, value): req=IMachine_setCPUExecutionCapRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._CPUExecutionCap = value else: req._CPUExecutionCap = value.handle self.mgr.getPort().IMachine_setCPUExecutionCap(req) def getMemorySize(self): req=IMachine_getMemorySizeRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getMemorySize(req) return UnsignedInt(self.mgr,val._returnval) def setMemorySize(self, value): req=IMachine_setMemorySizeRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._memorySize = value else: req._memorySize = value.handle self.mgr.getPort().IMachine_setMemorySize(req) def getMemoryBalloonSize(self): req=IMachine_getMemoryBalloonSizeRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getMemoryBalloonSize(req) return UnsignedInt(self.mgr,val._returnval) def setMemoryBalloonSize(self, value): req=IMachine_setMemoryBalloonSizeRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._memoryBalloonSize = value else: req._memoryBalloonSize = value.handle self.mgr.getPort().IMachine_setMemoryBalloonSize(req) def getPageFusionEnabled(self): req=IMachine_getPageFusionEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getPageFusionEnabled(req) return Boolean(self.mgr,val._returnval) def setPageFusionEnabled(self, value): req=IMachine_setPageFusionEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._pageFusionEnabled = value else: req._pageFusionEnabled = value.handle self.mgr.getPort().IMachine_setPageFusionEnabled(req) def getGraphicsControllerType(self): req=IMachine_getGraphicsControllerTypeRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getGraphicsControllerType(req) return GraphicsControllerType(self.mgr,val._returnval) def setGraphicsControllerType(self, value): req=IMachine_setGraphicsControllerTypeRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._graphicsControllerType = value else: req._graphicsControllerType = value.handle self.mgr.getPort().IMachine_setGraphicsControllerType(req) def getVRAMSize(self): req=IMachine_getVRAMSizeRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getVRAMSize(req) return UnsignedInt(self.mgr,val._returnval) def setVRAMSize(self, value): req=IMachine_setVRAMSizeRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._VRAMSize = value else: req._VRAMSize = value.handle self.mgr.getPort().IMachine_setVRAMSize(req) def getAccelerate3DEnabled(self): req=IMachine_getAccelerate3DEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getAccelerate3DEnabled(req) return Boolean(self.mgr,val._returnval) def setAccelerate3DEnabled(self, value): req=IMachine_setAccelerate3DEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._accelerate3DEnabled = value else: req._accelerate3DEnabled = value.handle self.mgr.getPort().IMachine_setAccelerate3DEnabled(req) def getAccelerate2DVideoEnabled(self): req=IMachine_getAccelerate2DVideoEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getAccelerate2DVideoEnabled(req) return Boolean(self.mgr,val._returnval) def setAccelerate2DVideoEnabled(self, value): req=IMachine_setAccelerate2DVideoEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._accelerate2DVideoEnabled = value else: req._accelerate2DVideoEnabled = value.handle self.mgr.getPort().IMachine_setAccelerate2DVideoEnabled(req) def getMonitorCount(self): req=IMachine_getMonitorCountRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getMonitorCount(req) return UnsignedInt(self.mgr,val._returnval) def setMonitorCount(self, value): req=IMachine_setMonitorCountRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._monitorCount = value else: req._monitorCount = value.handle self.mgr.getPort().IMachine_setMonitorCount(req) def getVideoCaptureEnabled(self): req=IMachine_getVideoCaptureEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getVideoCaptureEnabled(req) return Boolean(self.mgr,val._returnval) def setVideoCaptureEnabled(self, value): req=IMachine_setVideoCaptureEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._videoCaptureEnabled = value else: req._videoCaptureEnabled = value.handle self.mgr.getPort().IMachine_setVideoCaptureEnabled(req) def getVideoCaptureScreens(self): req=IMachine_getVideoCaptureScreensRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getVideoCaptureScreens(req) return Boolean(self.mgr,val._returnval, True) def setVideoCaptureScreens(self, value): req=IMachine_setVideoCaptureScreensRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._videoCaptureScreens = value else: req._videoCaptureScreens = value.handle self.mgr.getPort().IMachine_setVideoCaptureScreens(req) def getVideoCaptureFile(self): req=IMachine_getVideoCaptureFileRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getVideoCaptureFile(req) return String(self.mgr,val._returnval) def setVideoCaptureFile(self, value): req=IMachine_setVideoCaptureFileRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._videoCaptureFile = value else: req._videoCaptureFile = value.handle self.mgr.getPort().IMachine_setVideoCaptureFile(req) def getVideoCaptureWidth(self): req=IMachine_getVideoCaptureWidthRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getVideoCaptureWidth(req) return UnsignedInt(self.mgr,val._returnval) def setVideoCaptureWidth(self, value): req=IMachine_setVideoCaptureWidthRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._videoCaptureWidth = value else: req._videoCaptureWidth = value.handle self.mgr.getPort().IMachine_setVideoCaptureWidth(req) def getVideoCaptureHeight(self): req=IMachine_getVideoCaptureHeightRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getVideoCaptureHeight(req) return UnsignedInt(self.mgr,val._returnval) def setVideoCaptureHeight(self, value): req=IMachine_setVideoCaptureHeightRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._videoCaptureHeight = value else: req._videoCaptureHeight = value.handle self.mgr.getPort().IMachine_setVideoCaptureHeight(req) def getVideoCaptureRate(self): req=IMachine_getVideoCaptureRateRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getVideoCaptureRate(req) return UnsignedInt(self.mgr,val._returnval) def setVideoCaptureRate(self, value): req=IMachine_setVideoCaptureRateRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._videoCaptureRate = value else: req._videoCaptureRate = value.handle self.mgr.getPort().IMachine_setVideoCaptureRate(req) def getVideoCaptureFPS(self): req=IMachine_getVideoCaptureFPSRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getVideoCaptureFPS(req) return UnsignedInt(self.mgr,val._returnval) def setVideoCaptureFPS(self, value): req=IMachine_setVideoCaptureFPSRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._videoCaptureFPS = value else: req._videoCaptureFPS = value.handle self.mgr.getPort().IMachine_setVideoCaptureFPS(req) def getBIOSSettings(self): req=IMachine_getBIOSSettingsRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getBIOSSettings(req) return IBIOSSettings(self.mgr,val._returnval) def getFirmwareType(self): req=IMachine_getFirmwareTypeRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getFirmwareType(req) return FirmwareType(self.mgr,val._returnval) def setFirmwareType(self, value): req=IMachine_setFirmwareTypeRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._firmwareType = value else: req._firmwareType = value.handle self.mgr.getPort().IMachine_setFirmwareType(req) def getPointingHIDType(self): req=IMachine_getPointingHIDTypeRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getPointingHIDType(req) return PointingHIDType(self.mgr,val._returnval) def setPointingHIDType(self, value): req=IMachine_setPointingHIDTypeRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._pointingHIDType = value else: req._pointingHIDType = value.handle self.mgr.getPort().IMachine_setPointingHIDType(req) def getKeyboardHIDType(self): req=IMachine_getKeyboardHIDTypeRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getKeyboardHIDType(req) return KeyboardHIDType(self.mgr,val._returnval) def setKeyboardHIDType(self, value): req=IMachine_setKeyboardHIDTypeRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._keyboardHIDType = value else: req._keyboardHIDType = value.handle self.mgr.getPort().IMachine_setKeyboardHIDType(req) def getHPETEnabled(self): req=IMachine_getHPETEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getHPETEnabled(req) return Boolean(self.mgr,val._returnval) def setHPETEnabled(self, value): req=IMachine_setHPETEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._HPETEnabled = value else: req._HPETEnabled = value.handle self.mgr.getPort().IMachine_setHPETEnabled(req) def getChipsetType(self): req=IMachine_getChipsetTypeRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getChipsetType(req) return ChipsetType(self.mgr,val._returnval) def setChipsetType(self, value): req=IMachine_setChipsetTypeRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._chipsetType = value else: req._chipsetType = value.handle self.mgr.getPort().IMachine_setChipsetType(req) def getSnapshotFolder(self): req=IMachine_getSnapshotFolderRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getSnapshotFolder(req) return String(self.mgr,val._returnval) def setSnapshotFolder(self, value): req=IMachine_setSnapshotFolderRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._snapshotFolder = value else: req._snapshotFolder = value.handle self.mgr.getPort().IMachine_setSnapshotFolder(req) def getVRDEServer(self): req=IMachine_getVRDEServerRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getVRDEServer(req) return IVRDEServer(self.mgr,val._returnval) def getEmulatedUSBCardReaderEnabled(self): req=IMachine_getEmulatedUSBCardReaderEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getEmulatedUSBCardReaderEnabled(req) return Boolean(self.mgr,val._returnval) def setEmulatedUSBCardReaderEnabled(self, value): req=IMachine_setEmulatedUSBCardReaderEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._emulatedUSBCardReaderEnabled = value else: req._emulatedUSBCardReaderEnabled = value.handle self.mgr.getPort().IMachine_setEmulatedUSBCardReaderEnabled(req) def getMediumAttachments(self): req=IMachine_getMediumAttachmentsRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getMediumAttachments(req) return IMediumAttachment(self.mgr,val._returnval, True) def getUSBControllers(self): req=IMachine_getUSBControllersRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getUSBControllers(req) return IUSBController(self.mgr,val._returnval, True) def getUSBDeviceFilters(self): req=IMachine_getUSBDeviceFiltersRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getUSBDeviceFilters(req) return IUSBDeviceFilters(self.mgr,val._returnval) def getAudioAdapter(self): req=IMachine_getAudioAdapterRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getAudioAdapter(req) return IAudioAdapter(self.mgr,val._returnval) def getStorageControllers(self): req=IMachine_getStorageControllersRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getStorageControllers(req) return IStorageController(self.mgr,val._returnval, True) def getSettingsFilePath(self): req=IMachine_getSettingsFilePathRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getSettingsFilePath(req) return String(self.mgr,val._returnval) def getSettingsModified(self): req=IMachine_getSettingsModifiedRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getSettingsModified(req) return Boolean(self.mgr,val._returnval) def getSessionState(self): req=IMachine_getSessionStateRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getSessionState(req) return SessionState(self.mgr,val._returnval) def getSessionType(self): req=IMachine_getSessionTypeRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getSessionType(req) return String(self.mgr,val._returnval) def getSessionPID(self): req=IMachine_getSessionPIDRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getSessionPID(req) return UnsignedInt(self.mgr,val._returnval) def getState(self): req=IMachine_getStateRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getState(req) return MachineState(self.mgr,val._returnval) def getLastStateChange(self): req=IMachine_getLastStateChangeRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getLastStateChange(req) return Long(self.mgr,val._returnval) def getStateFilePath(self): req=IMachine_getStateFilePathRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getStateFilePath(req) return String(self.mgr,val._returnval) def getLogFolder(self): req=IMachine_getLogFolderRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getLogFolder(req) return String(self.mgr,val._returnval) def getCurrentSnapshot(self): req=IMachine_getCurrentSnapshotRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getCurrentSnapshot(req) return ISnapshot(self.mgr,val._returnval) def getSnapshotCount(self): req=IMachine_getSnapshotCountRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getSnapshotCount(req) return UnsignedInt(self.mgr,val._returnval) def getCurrentStateModified(self): req=IMachine_getCurrentStateModifiedRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getCurrentStateModified(req) return Boolean(self.mgr,val._returnval) def getSharedFolders(self): req=IMachine_getSharedFoldersRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getSharedFolders(req) return ISharedFolder(self.mgr,val._returnval, True) def getClipboardMode(self): req=IMachine_getClipboardModeRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getClipboardMode(req) return ClipboardMode(self.mgr,val._returnval) def setClipboardMode(self, value): req=IMachine_setClipboardModeRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._clipboardMode = value else: req._clipboardMode = value.handle self.mgr.getPort().IMachine_setClipboardMode(req) def getDragAndDropMode(self): req=IMachine_getDragAndDropModeRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getDragAndDropMode(req) return DragAndDropMode(self.mgr,val._returnval) def setDragAndDropMode(self, value): req=IMachine_setDragAndDropModeRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._dragAndDropMode = value else: req._dragAndDropMode = value.handle self.mgr.getPort().IMachine_setDragAndDropMode(req) def getGuestPropertyNotificationPatterns(self): req=IMachine_getGuestPropertyNotificationPatternsRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getGuestPropertyNotificationPatterns(req) return String(self.mgr,val._returnval) def setGuestPropertyNotificationPatterns(self, value): req=IMachine_setGuestPropertyNotificationPatternsRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._guestPropertyNotificationPatterns = value else: req._guestPropertyNotificationPatterns = value.handle self.mgr.getPort().IMachine_setGuestPropertyNotificationPatterns(req) def getTeleporterEnabled(self): req=IMachine_getTeleporterEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getTeleporterEnabled(req) return Boolean(self.mgr,val._returnval) def setTeleporterEnabled(self, value): req=IMachine_setTeleporterEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._teleporterEnabled = value else: req._teleporterEnabled = value.handle self.mgr.getPort().IMachine_setTeleporterEnabled(req) def getTeleporterPort(self): req=IMachine_getTeleporterPortRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getTeleporterPort(req) return UnsignedInt(self.mgr,val._returnval) def setTeleporterPort(self, value): req=IMachine_setTeleporterPortRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._teleporterPort = value else: req._teleporterPort = value.handle self.mgr.getPort().IMachine_setTeleporterPort(req) def getTeleporterAddress(self): req=IMachine_getTeleporterAddressRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getTeleporterAddress(req) return String(self.mgr,val._returnval) def setTeleporterAddress(self, value): req=IMachine_setTeleporterAddressRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._teleporterAddress = value else: req._teleporterAddress = value.handle self.mgr.getPort().IMachine_setTeleporterAddress(req) def getTeleporterPassword(self): req=IMachine_getTeleporterPasswordRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getTeleporterPassword(req) return String(self.mgr,val._returnval) def setTeleporterPassword(self, value): req=IMachine_setTeleporterPasswordRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._teleporterPassword = value else: req._teleporterPassword = value.handle self.mgr.getPort().IMachine_setTeleporterPassword(req) def getFaultToleranceState(self): req=IMachine_getFaultToleranceStateRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getFaultToleranceState(req) return FaultToleranceState(self.mgr,val._returnval) def setFaultToleranceState(self, value): req=IMachine_setFaultToleranceStateRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._faultToleranceState = value else: req._faultToleranceState = value.handle self.mgr.getPort().IMachine_setFaultToleranceState(req) def getFaultTolerancePort(self): req=IMachine_getFaultTolerancePortRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getFaultTolerancePort(req) return UnsignedInt(self.mgr,val._returnval) def setFaultTolerancePort(self, value): req=IMachine_setFaultTolerancePortRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._faultTolerancePort = value else: req._faultTolerancePort = value.handle self.mgr.getPort().IMachine_setFaultTolerancePort(req) def getFaultToleranceAddress(self): req=IMachine_getFaultToleranceAddressRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getFaultToleranceAddress(req) return String(self.mgr,val._returnval) def setFaultToleranceAddress(self, value): req=IMachine_setFaultToleranceAddressRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._faultToleranceAddress = value else: req._faultToleranceAddress = value.handle self.mgr.getPort().IMachine_setFaultToleranceAddress(req) def getFaultTolerancePassword(self): req=IMachine_getFaultTolerancePasswordRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getFaultTolerancePassword(req) return String(self.mgr,val._returnval) def setFaultTolerancePassword(self, value): req=IMachine_setFaultTolerancePasswordRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._faultTolerancePassword = value else: req._faultTolerancePassword = value.handle self.mgr.getPort().IMachine_setFaultTolerancePassword(req) def getFaultToleranceSyncInterval(self): req=IMachine_getFaultToleranceSyncIntervalRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getFaultToleranceSyncInterval(req) return UnsignedInt(self.mgr,val._returnval) def setFaultToleranceSyncInterval(self, value): req=IMachine_setFaultToleranceSyncIntervalRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._faultToleranceSyncInterval = value else: req._faultToleranceSyncInterval = value.handle self.mgr.getPort().IMachine_setFaultToleranceSyncInterval(req) def getRTCUseUTC(self): req=IMachine_getRTCUseUTCRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getRTCUseUTC(req) return Boolean(self.mgr,val._returnval) def setRTCUseUTC(self, value): req=IMachine_setRTCUseUTCRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._RTCUseUTC = value else: req._RTCUseUTC = value.handle self.mgr.getPort().IMachine_setRTCUseUTC(req) def getIOCacheEnabled(self): req=IMachine_getIOCacheEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getIOCacheEnabled(req) return Boolean(self.mgr,val._returnval) def setIOCacheEnabled(self, value): req=IMachine_setIOCacheEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._IOCacheEnabled = value else: req._IOCacheEnabled = value.handle self.mgr.getPort().IMachine_setIOCacheEnabled(req) def getIOCacheSize(self): req=IMachine_getIOCacheSizeRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getIOCacheSize(req) return UnsignedInt(self.mgr,val._returnval) def setIOCacheSize(self, value): req=IMachine_setIOCacheSizeRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._IOCacheSize = value else: req._IOCacheSize = value.handle self.mgr.getPort().IMachine_setIOCacheSize(req) def getPCIDeviceAssignments(self): req=IMachine_getPCIDeviceAssignmentsRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getPCIDeviceAssignments(req) return IPCIDeviceAttachment(self.mgr,val._returnval, True) def getBandwidthControl(self): req=IMachine_getBandwidthControlRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getBandwidthControl(req) return IBandwidthControl(self.mgr,val._returnval) def getTracingEnabled(self): req=IMachine_getTracingEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getTracingEnabled(req) return Boolean(self.mgr,val._returnval) def setTracingEnabled(self, value): req=IMachine_setTracingEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._tracingEnabled = value else: req._tracingEnabled = value.handle self.mgr.getPort().IMachine_setTracingEnabled(req) def getTracingConfig(self): req=IMachine_getTracingConfigRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getTracingConfig(req) return String(self.mgr,val._returnval) def setTracingConfig(self, value): req=IMachine_setTracingConfigRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._tracingConfig = value else: req._tracingConfig = value.handle self.mgr.getPort().IMachine_setTracingConfig(req) def getAllowTracingToAccessVM(self): req=IMachine_getAllowTracingToAccessVMRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getAllowTracingToAccessVM(req) return Boolean(self.mgr,val._returnval) def setAllowTracingToAccessVM(self, value): req=IMachine_setAllowTracingToAccessVMRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._allowTracingToAccessVM = value else: req._allowTracingToAccessVM = value.handle self.mgr.getPort().IMachine_setAllowTracingToAccessVM(req) def getAutostartEnabled(self): req=IMachine_getAutostartEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getAutostartEnabled(req) return Boolean(self.mgr,val._returnval) def setAutostartEnabled(self, value): req=IMachine_setAutostartEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._autostartEnabled = value else: req._autostartEnabled = value.handle self.mgr.getPort().IMachine_setAutostartEnabled(req) def getAutostartDelay(self): req=IMachine_getAutostartDelayRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getAutostartDelay(req) return UnsignedInt(self.mgr,val._returnval) def setAutostartDelay(self, value): req=IMachine_setAutostartDelayRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._autostartDelay = value else: req._autostartDelay = value.handle self.mgr.getPort().IMachine_setAutostartDelay(req) def getAutostopType(self): req=IMachine_getAutostopTypeRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getAutostopType(req) return AutostopType(self.mgr,val._returnval) def setAutostopType(self, value): req=IMachine_setAutostopTypeRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._autostopType = value else: req._autostopType = value.handle self.mgr.getPort().IMachine_setAutostopType(req) def getDefaultFrontend(self): req=IMachine_getDefaultFrontendRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getDefaultFrontend(req) return String(self.mgr,val._returnval) def setDefaultFrontend(self, value): req=IMachine_setDefaultFrontendRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._defaultFrontend = value else: req._defaultFrontend = value.handle self.mgr.getPort().IMachine_setDefaultFrontend(req) def getUSBProxyAvailable(self): req=IMachine_getUSBProxyAvailableRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachine_getUSBProxyAvailable(req) return Boolean(self.mgr,val._returnval) _Attrs_={ 'parent':[getParent,None], 'icon':[getIcon,setIcon, ], 'accessible':[getAccessible,None], 'accessError':[getAccessError,None], 'name':[getName,setName, ], 'description':[getDescription,setDescription, ], 'id':[getId,None], 'groups':[getGroups,setGroups, ], 'OSTypeId':[getOSTypeId,setOSTypeId, ], 'hardwareVersion':[getHardwareVersion,setHardwareVersion, ], 'hardwareUUID':[getHardwareUUID,setHardwareUUID, ], 'CPUCount':[getCPUCount,setCPUCount, ], 'CPUHotPlugEnabled':[getCPUHotPlugEnabled,setCPUHotPlugEnabled, ], 'CPUExecutionCap':[getCPUExecutionCap,setCPUExecutionCap, ], 'memorySize':[getMemorySize,setMemorySize, ], 'memoryBalloonSize':[getMemoryBalloonSize,setMemoryBalloonSize, ], 'pageFusionEnabled':[getPageFusionEnabled,setPageFusionEnabled, ], 'graphicsControllerType':[getGraphicsControllerType,setGraphicsControllerType, ], 'VRAMSize':[getVRAMSize,setVRAMSize, ], 'accelerate3DEnabled':[getAccelerate3DEnabled,setAccelerate3DEnabled, ], 'accelerate2DVideoEnabled':[getAccelerate2DVideoEnabled,setAccelerate2DVideoEnabled, ], 'monitorCount':[getMonitorCount,setMonitorCount, ], 'videoCaptureEnabled':[getVideoCaptureEnabled,setVideoCaptureEnabled, ], 'videoCaptureScreens':[getVideoCaptureScreens,setVideoCaptureScreens, ], 'videoCaptureFile':[getVideoCaptureFile,setVideoCaptureFile, ], 'videoCaptureWidth':[getVideoCaptureWidth,setVideoCaptureWidth, ], 'videoCaptureHeight':[getVideoCaptureHeight,setVideoCaptureHeight, ], 'videoCaptureRate':[getVideoCaptureRate,setVideoCaptureRate, ], 'videoCaptureFPS':[getVideoCaptureFPS,setVideoCaptureFPS, ], 'BIOSSettings':[getBIOSSettings,None], 'firmwareType':[getFirmwareType,setFirmwareType, ], 'pointingHIDType':[getPointingHIDType,setPointingHIDType, ], 'keyboardHIDType':[getKeyboardHIDType,setKeyboardHIDType, ], 'HPETEnabled':[getHPETEnabled,setHPETEnabled, ], 'chipsetType':[getChipsetType,setChipsetType, ], 'snapshotFolder':[getSnapshotFolder,setSnapshotFolder, ], 'VRDEServer':[getVRDEServer,None], 'emulatedUSBCardReaderEnabled':[getEmulatedUSBCardReaderEnabled,setEmulatedUSBCardReaderEnabled, ], 'mediumAttachments':[getMediumAttachments,None], 'USBControllers':[getUSBControllers,None], 'USBDeviceFilters':[getUSBDeviceFilters,None], 'audioAdapter':[getAudioAdapter,None], 'storageControllers':[getStorageControllers,None], 'settingsFilePath':[getSettingsFilePath,None], 'settingsModified':[getSettingsModified,None], 'sessionState':[getSessionState,None], 'sessionType':[getSessionType,None], 'sessionPID':[getSessionPID,None], 'state':[getState,None], 'lastStateChange':[getLastStateChange,None], 'stateFilePath':[getStateFilePath,None], 'logFolder':[getLogFolder,None], 'currentSnapshot':[getCurrentSnapshot,None], 'snapshotCount':[getSnapshotCount,None], 'currentStateModified':[getCurrentStateModified,None], 'sharedFolders':[getSharedFolders,None], 'clipboardMode':[getClipboardMode,setClipboardMode, ], 'dragAndDropMode':[getDragAndDropMode,setDragAndDropMode, ], 'guestPropertyNotificationPatterns':[getGuestPropertyNotificationPatterns,setGuestPropertyNotificationPatterns, ], 'teleporterEnabled':[getTeleporterEnabled,setTeleporterEnabled, ], 'teleporterPort':[getTeleporterPort,setTeleporterPort, ], 'teleporterAddress':[getTeleporterAddress,setTeleporterAddress, ], 'teleporterPassword':[getTeleporterPassword,setTeleporterPassword, ], 'faultToleranceState':[getFaultToleranceState,setFaultToleranceState, ], 'faultTolerancePort':[getFaultTolerancePort,setFaultTolerancePort, ], 'faultToleranceAddress':[getFaultToleranceAddress,setFaultToleranceAddress, ], 'faultTolerancePassword':[getFaultTolerancePassword,setFaultTolerancePassword, ], 'faultToleranceSyncInterval':[getFaultToleranceSyncInterval,setFaultToleranceSyncInterval, ], 'RTCUseUTC':[getRTCUseUTC,setRTCUseUTC, ], 'IOCacheEnabled':[getIOCacheEnabled,setIOCacheEnabled, ], 'IOCacheSize':[getIOCacheSize,setIOCacheSize, ], 'PCIDeviceAssignments':[getPCIDeviceAssignments,None], 'bandwidthControl':[getBandwidthControl,None], 'tracingEnabled':[getTracingEnabled,setTracingEnabled, ], 'tracingConfig':[getTracingConfig,setTracingConfig, ], 'allowTracingToAccessVM':[getAllowTracingToAccessVM,setAllowTracingToAccessVM, ], 'autostartEnabled':[getAutostartEnabled,setAutostartEnabled, ], 'autostartDelay':[getAutostartDelay,setAutostartDelay, ], 'autostopType':[getAutostopType,setAutostopType, ], 'defaultFrontend':[getDefaultFrontend,setDefaultFrontend, ], 'USBProxyAvailable':[getUSBProxyAvailable,None]} class IEmulatedUSB(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IEmulatedUSB(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IEmulatedUSB._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IEmulatedUSB._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def webcamAttach(self, _arg_path, _arg_settings): req=IEmulatedUSB_webcamAttachRequestMsg() req._this=self.handle req._path=_arg_path req._settings=_arg_settings val=self.mgr.getPort().IEmulatedUSB_webcamAttach(req) return def webcamDetach(self, _arg_path): req=IEmulatedUSB_webcamDetachRequestMsg() req._this=self.handle req._path=_arg_path val=self.mgr.getPort().IEmulatedUSB_webcamDetach(req) return def getWebcams(self): req=IEmulatedUSB_getWebcamsRequestMsg() req._this=self.handle val=self.mgr.getPort().IEmulatedUSB_getWebcams(req) return String(self.mgr,val._returnval, True) _Attrs_={ 'webcams':[getWebcams,None]} class IConsole(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IConsole(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IConsole._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IConsole._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def powerUp(self): req=IConsole_powerUpRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_powerUp(req) return IProgress(self.mgr,val._returnval) def powerUpPaused(self): req=IConsole_powerUpPausedRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_powerUpPaused(req) return IProgress(self.mgr,val._returnval) def powerDown(self): req=IConsole_powerDownRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_powerDown(req) return IProgress(self.mgr,val._returnval) def reset(self): req=IConsole_resetRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_reset(req) return def pause(self): req=IConsole_pauseRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_pause(req) return def resume(self): req=IConsole_resumeRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_resume(req) return def powerButton(self): req=IConsole_powerButtonRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_powerButton(req) return def sleepButton(self): req=IConsole_sleepButtonRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_sleepButton(req) return def getPowerButtonHandled(self): req=IConsole_getPowerButtonHandledRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_getPowerButtonHandled(req) return Boolean(self.mgr,val._returnval) def getGuestEnteredACPIMode(self): req=IConsole_getGuestEnteredACPIModeRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_getGuestEnteredACPIMode(req) return Boolean(self.mgr,val._returnval) def saveState(self): req=IConsole_saveStateRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_saveState(req) return IProgress(self.mgr,val._returnval) def adoptSavedState(self, _arg_savedStateFile): req=IConsole_adoptSavedStateRequestMsg() req._this=self.handle req._savedStateFile=_arg_savedStateFile val=self.mgr.getPort().IConsole_adoptSavedState(req) return def discardSavedState(self, _arg_fRemoveFile): req=IConsole_discardSavedStateRequestMsg() req._this=self.handle req._fRemoveFile=_arg_fRemoveFile val=self.mgr.getPort().IConsole_discardSavedState(req) return def getDeviceActivity(self, _arg_type): req=IConsole_getDeviceActivityRequestMsg() req._this=self.handle req._type=_arg_type val=self.mgr.getPort().IConsole_getDeviceActivity(req) return DeviceActivity(self.mgr,val._returnval) def attachUSBDevice(self, _arg_id): req=IConsole_attachUSBDeviceRequestMsg() req._this=self.handle req._id=_arg_id val=self.mgr.getPort().IConsole_attachUSBDevice(req) return def detachUSBDevice(self, _arg_id): req=IConsole_detachUSBDeviceRequestMsg() req._this=self.handle req._id=_arg_id val=self.mgr.getPort().IConsole_detachUSBDevice(req) return IUSBDevice(self.mgr,val._returnval) def findUSBDeviceByAddress(self, _arg_name): req=IConsole_findUSBDeviceByAddressRequestMsg() req._this=self.handle req._name=_arg_name val=self.mgr.getPort().IConsole_findUSBDeviceByAddress(req) return IUSBDevice(self.mgr,val._returnval) def findUSBDeviceById(self, _arg_id): req=IConsole_findUSBDeviceByIdRequestMsg() req._this=self.handle req._id=_arg_id val=self.mgr.getPort().IConsole_findUSBDeviceById(req) return IUSBDevice(self.mgr,val._returnval) def createSharedFolder(self, _arg_name, _arg_hostPath, _arg_writable, _arg_automount): req=IConsole_createSharedFolderRequestMsg() req._this=self.handle req._name=_arg_name req._hostPath=_arg_hostPath req._writable=_arg_writable req._automount=_arg_automount val=self.mgr.getPort().IConsole_createSharedFolder(req) return def removeSharedFolder(self, _arg_name): req=IConsole_removeSharedFolderRequestMsg() req._this=self.handle req._name=_arg_name val=self.mgr.getPort().IConsole_removeSharedFolder(req) return def takeSnapshot(self, _arg_name, _arg_description): req=IConsole_takeSnapshotRequestMsg() req._this=self.handle req._name=_arg_name req._description=_arg_description val=self.mgr.getPort().IConsole_takeSnapshot(req) return IProgress(self.mgr,val._returnval) def deleteSnapshot(self, _arg_id): req=IConsole_deleteSnapshotRequestMsg() req._this=self.handle req._id=_arg_id val=self.mgr.getPort().IConsole_deleteSnapshot(req) return IProgress(self.mgr,val._returnval) def deleteSnapshotAndAllChildren(self, _arg_id): req=IConsole_deleteSnapshotAndAllChildrenRequestMsg() req._this=self.handle req._id=_arg_id val=self.mgr.getPort().IConsole_deleteSnapshotAndAllChildren(req) return IProgress(self.mgr,val._returnval) def deleteSnapshotRange(self, _arg_startId, _arg_endId): req=IConsole_deleteSnapshotRangeRequestMsg() req._this=self.handle req._startId=_arg_startId req._endId=_arg_endId val=self.mgr.getPort().IConsole_deleteSnapshotRange(req) return IProgress(self.mgr,val._returnval) def restoreSnapshot(self, _arg_snapshot): req=IConsole_restoreSnapshotRequestMsg() req._this=self.handle req._snapshot=_arg_snapshot val=self.mgr.getPort().IConsole_restoreSnapshot(req) return IProgress(self.mgr,val._returnval) def teleport(self, _arg_hostname, _arg_tcpport, _arg_password, _arg_maxDowntime): req=IConsole_teleportRequestMsg() req._this=self.handle req._hostname=_arg_hostname req._tcpport=_arg_tcpport req._password=_arg_password req._maxDowntime=_arg_maxDowntime val=self.mgr.getPort().IConsole_teleport(req) return IProgress(self.mgr,val._returnval) def getMachine(self): req=IConsole_getMachineRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_getMachine(req) return IMachine(self.mgr,val._returnval) def getState(self): req=IConsole_getStateRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_getState(req) return MachineState(self.mgr,val._returnval) def getGuest(self): req=IConsole_getGuestRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_getGuest(req) return IGuest(self.mgr,val._returnval) def getKeyboard(self): req=IConsole_getKeyboardRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_getKeyboard(req) return IKeyboard(self.mgr,val._returnval) def getMouse(self): req=IConsole_getMouseRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_getMouse(req) return IMouse(self.mgr,val._returnval) def getDisplay(self): req=IConsole_getDisplayRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_getDisplay(req) return IDisplay(self.mgr,val._returnval) def getDebugger(self): req=IConsole_getDebuggerRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_getDebugger(req) return IMachineDebugger(self.mgr,val._returnval) def getUSBDevices(self): req=IConsole_getUSBDevicesRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_getUSBDevices(req) return IUSBDevice(self.mgr,val._returnval, True) def getRemoteUSBDevices(self): req=IConsole_getRemoteUSBDevicesRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_getRemoteUSBDevices(req) return IHostUSBDevice(self.mgr,val._returnval, True) def getSharedFolders(self): req=IConsole_getSharedFoldersRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_getSharedFolders(req) return ISharedFolder(self.mgr,val._returnval, True) def getVRDEServerInfo(self): req=IConsole_getVRDEServerInfoRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_getVRDEServerInfo(req) return IVRDEServerInfo(self.mgr,val._returnval) def getEventSource(self): req=IConsole_getEventSourceRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_getEventSource(req) return IEventSource(self.mgr,val._returnval) def getAttachedPCIDevices(self): req=IConsole_getAttachedPCIDevicesRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_getAttachedPCIDevices(req) return IPCIDeviceAttachment(self.mgr,val._returnval, True) def getUseHostClipboard(self): req=IConsole_getUseHostClipboardRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_getUseHostClipboard(req) return Boolean(self.mgr,val._returnval) def setUseHostClipboard(self, value): req=IConsole_setUseHostClipboardRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._useHostClipboard = value else: req._useHostClipboard = value.handle self.mgr.getPort().IConsole_setUseHostClipboard(req) def getEmulatedUSB(self): req=IConsole_getEmulatedUSBRequestMsg() req._this=self.handle val=self.mgr.getPort().IConsole_getEmulatedUSB(req) return IEmulatedUSB(self.mgr,val._returnval) _Attrs_={ 'machine':[getMachine,None], 'state':[getState,None], 'guest':[getGuest,None], 'keyboard':[getKeyboard,None], 'mouse':[getMouse,None], 'display':[getDisplay,None], 'debugger':[getDebugger,None], 'USBDevices':[getUSBDevices,None], 'remoteUSBDevices':[getRemoteUSBDevices,None], 'sharedFolders':[getSharedFolders,None], 'VRDEServerInfo':[getVRDEServerInfo,None], 'eventSource':[getEventSource,None], 'attachedPCIDevices':[getAttachedPCIDevices,None], 'useHostClipboard':[getUseHostClipboard,setUseHostClipboard, ], 'emulatedUSB':[getEmulatedUSB,None]} class IHostNetworkInterface(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IHostNetworkInterface(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IHostNetworkInterface._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IHostNetworkInterface._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def enableStaticIPConfig(self, _arg_IPAddress, _arg_networkMask): req=IHostNetworkInterface_enableStaticIPConfigRequestMsg() req._this=self.handle req._IPAddress=_arg_IPAddress req._networkMask=_arg_networkMask val=self.mgr.getPort().IHostNetworkInterface_enableStaticIPConfig(req) return def enableStaticIPConfigV6(self, _arg_IPV6Address, _arg_IPV6NetworkMaskPrefixLength): req=IHostNetworkInterface_enableStaticIPConfigV6RequestMsg() req._this=self.handle req._IPV6Address=_arg_IPV6Address req._IPV6NetworkMaskPrefixLength=_arg_IPV6NetworkMaskPrefixLength val=self.mgr.getPort().IHostNetworkInterface_enableStaticIPConfigV6(req) return def enableDynamicIPConfig(self): req=IHostNetworkInterface_enableDynamicIPConfigRequestMsg() req._this=self.handle val=self.mgr.getPort().IHostNetworkInterface_enableDynamicIPConfig(req) return def DHCPRediscover(self): req=IHostNetworkInterface_DHCPRediscoverRequestMsg() req._this=self.handle val=self.mgr.getPort().IHostNetworkInterface_DHCPRediscover(req) return def getName(self): req=IHostNetworkInterface_getNameRequestMsg() req._this=self.handle val=self.mgr.getPort().IHostNetworkInterface_getName(req) return String(self.mgr,val._returnval) def getShortName(self): req=IHostNetworkInterface_getShortNameRequestMsg() req._this=self.handle val=self.mgr.getPort().IHostNetworkInterface_getShortName(req) return String(self.mgr,val._returnval) def getId(self): req=IHostNetworkInterface_getIdRequestMsg() req._this=self.handle val=self.mgr.getPort().IHostNetworkInterface_getId(req) return String(self.mgr,val._returnval) def getNetworkName(self): req=IHostNetworkInterface_getNetworkNameRequestMsg() req._this=self.handle val=self.mgr.getPort().IHostNetworkInterface_getNetworkName(req) return String(self.mgr,val._returnval) def getDHCPEnabled(self): req=IHostNetworkInterface_getDHCPEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IHostNetworkInterface_getDHCPEnabled(req) return Boolean(self.mgr,val._returnval) def getIPAddress(self): req=IHostNetworkInterface_getIPAddressRequestMsg() req._this=self.handle val=self.mgr.getPort().IHostNetworkInterface_getIPAddress(req) return String(self.mgr,val._returnval) def getNetworkMask(self): req=IHostNetworkInterface_getNetworkMaskRequestMsg() req._this=self.handle val=self.mgr.getPort().IHostNetworkInterface_getNetworkMask(req) return String(self.mgr,val._returnval) def getIPV6Supported(self): req=IHostNetworkInterface_getIPV6SupportedRequestMsg() req._this=self.handle val=self.mgr.getPort().IHostNetworkInterface_getIPV6Supported(req) return Boolean(self.mgr,val._returnval) def getIPV6Address(self): req=IHostNetworkInterface_getIPV6AddressRequestMsg() req._this=self.handle val=self.mgr.getPort().IHostNetworkInterface_getIPV6Address(req) return String(self.mgr,val._returnval) def getIPV6NetworkMaskPrefixLength(self): req=IHostNetworkInterface_getIPV6NetworkMaskPrefixLengthRequestMsg() req._this=self.handle val=self.mgr.getPort().IHostNetworkInterface_getIPV6NetworkMaskPrefixLength(req) return UnsignedInt(self.mgr,val._returnval) def getHardwareAddress(self): req=IHostNetworkInterface_getHardwareAddressRequestMsg() req._this=self.handle val=self.mgr.getPort().IHostNetworkInterface_getHardwareAddress(req) return String(self.mgr,val._returnval) def getMediumType(self): req=IHostNetworkInterface_getMediumTypeRequestMsg() req._this=self.handle val=self.mgr.getPort().IHostNetworkInterface_getMediumType(req) return HostNetworkInterfaceMediumType(self.mgr,val._returnval) def getStatus(self): req=IHostNetworkInterface_getStatusRequestMsg() req._this=self.handle val=self.mgr.getPort().IHostNetworkInterface_getStatus(req) return HostNetworkInterfaceStatus(self.mgr,val._returnval) def getInterfaceType(self): req=IHostNetworkInterface_getInterfaceTypeRequestMsg() req._this=self.handle val=self.mgr.getPort().IHostNetworkInterface_getInterfaceType(req) return HostNetworkInterfaceType(self.mgr,val._returnval) _Attrs_={ 'name':[getName,None], 'shortName':[getShortName,None], 'id':[getId,None], 'networkName':[getNetworkName,None], 'DHCPEnabled':[getDHCPEnabled,None], 'IPAddress':[getIPAddress,None], 'networkMask':[getNetworkMask,None], 'IPV6Supported':[getIPV6Supported,None], 'IPV6Address':[getIPV6Address,None], 'IPV6NetworkMaskPrefixLength':[getIPV6NetworkMaskPrefixLength,None], 'hardwareAddress':[getHardwareAddress,None], 'mediumType':[getMediumType,None], 'status':[getStatus,None], 'interfaceType':[getInterfaceType,None]} class IHostVideoInputDevice(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IHostVideoInputDevice(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IHostVideoInputDevice._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IHostVideoInputDevice._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getName(self): req=IHostVideoInputDevice_getNameRequestMsg() req._this=self.handle val=self.mgr.getPort().IHostVideoInputDevice_getName(req) return String(self.mgr,val._returnval) def getPath(self): req=IHostVideoInputDevice_getPathRequestMsg() req._this=self.handle val=self.mgr.getPort().IHostVideoInputDevice_getPath(req) return String(self.mgr,val._returnval) def getAlias(self): req=IHostVideoInputDevice_getAliasRequestMsg() req._this=self.handle val=self.mgr.getPort().IHostVideoInputDevice_getAlias(req) return String(self.mgr,val._returnval) _Attrs_={ 'name':[getName,None], 'path':[getPath,None], 'alias':[getAlias,None]} class IHost(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IHost(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IHost._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IHost._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getProcessorSpeed(self, _arg_cpuId): req=IHost_getProcessorSpeedRequestMsg() req._this=self.handle req._cpuId=_arg_cpuId val=self.mgr.getPort().IHost_getProcessorSpeed(req) return UnsignedInt(self.mgr,val._returnval) def getProcessorFeature(self, _arg_feature): req=IHost_getProcessorFeatureRequestMsg() req._this=self.handle req._feature=_arg_feature val=self.mgr.getPort().IHost_getProcessorFeature(req) return Boolean(self.mgr,val._returnval) def getProcessorDescription(self, _arg_cpuId): req=IHost_getProcessorDescriptionRequestMsg() req._this=self.handle req._cpuId=_arg_cpuId val=self.mgr.getPort().IHost_getProcessorDescription(req) return String(self.mgr,val._returnval) def getProcessorCPUIDLeaf(self, _arg_cpuId, _arg_leaf, _arg_subLeaf): req=IHost_getProcessorCPUIDLeafRequestMsg() req._this=self.handle req._cpuId=_arg_cpuId req._leaf=_arg_leaf req._subLeaf=_arg_subLeaf val=self.mgr.getPort().IHost_getProcessorCPUIDLeaf(req) return UnsignedInt(self.mgr,val._valEax), UnsignedInt(self.mgr,val._valEbx), UnsignedInt(self.mgr,val._valEcx), UnsignedInt(self.mgr,val._valEdx) def createHostOnlyNetworkInterface(self): req=IHost_createHostOnlyNetworkInterfaceRequestMsg() req._this=self.handle val=self.mgr.getPort().IHost_createHostOnlyNetworkInterface(req) return IProgress(self.mgr,val._returnval), IHostNetworkInterface(self.mgr,val._hostInterface) def removeHostOnlyNetworkInterface(self, _arg_id): req=IHost_removeHostOnlyNetworkInterfaceRequestMsg() req._this=self.handle req._id=_arg_id val=self.mgr.getPort().IHost_removeHostOnlyNetworkInterface(req) return IProgress(self.mgr,val._returnval) def createUSBDeviceFilter(self, _arg_name): req=IHost_createUSBDeviceFilterRequestMsg() req._this=self.handle req._name=_arg_name val=self.mgr.getPort().IHost_createUSBDeviceFilter(req) return IHostUSBDeviceFilter(self.mgr,val._returnval) def insertUSBDeviceFilter(self, _arg_position, _arg_filter): req=IHost_insertUSBDeviceFilterRequestMsg() req._this=self.handle req._position=_arg_position req._filter=_arg_filter val=self.mgr.getPort().IHost_insertUSBDeviceFilter(req) return def removeUSBDeviceFilter(self, _arg_position): req=IHost_removeUSBDeviceFilterRequestMsg() req._this=self.handle req._position=_arg_position val=self.mgr.getPort().IHost_removeUSBDeviceFilter(req) return def findHostDVDDrive(self, _arg_name): req=IHost_findHostDVDDriveRequestMsg() req._this=self.handle req._name=_arg_name val=self.mgr.getPort().IHost_findHostDVDDrive(req) return IMedium(self.mgr,val._returnval) def findHostFloppyDrive(self, _arg_name): req=IHost_findHostFloppyDriveRequestMsg() req._this=self.handle req._name=_arg_name val=self.mgr.getPort().IHost_findHostFloppyDrive(req) return IMedium(self.mgr,val._returnval) def findHostNetworkInterfaceByName(self, _arg_name): req=IHost_findHostNetworkInterfaceByNameRequestMsg() req._this=self.handle req._name=_arg_name val=self.mgr.getPort().IHost_findHostNetworkInterfaceByName(req) return IHostNetworkInterface(self.mgr,val._returnval) def findHostNetworkInterfaceById(self, _arg_id): req=IHost_findHostNetworkInterfaceByIdRequestMsg() req._this=self.handle req._id=_arg_id val=self.mgr.getPort().IHost_findHostNetworkInterfaceById(req) return IHostNetworkInterface(self.mgr,val._returnval) def findHostNetworkInterfacesOfType(self, _arg_type): req=IHost_findHostNetworkInterfacesOfTypeRequestMsg() req._this=self.handle req._type=_arg_type val=self.mgr.getPort().IHost_findHostNetworkInterfacesOfType(req) return IHostNetworkInterface(self.mgr,val._returnval, True) def findUSBDeviceById(self, _arg_id): req=IHost_findUSBDeviceByIdRequestMsg() req._this=self.handle req._id=_arg_id val=self.mgr.getPort().IHost_findUSBDeviceById(req) return IHostUSBDevice(self.mgr,val._returnval) def findUSBDeviceByAddress(self, _arg_name): req=IHost_findUSBDeviceByAddressRequestMsg() req._this=self.handle req._name=_arg_name val=self.mgr.getPort().IHost_findUSBDeviceByAddress(req) return IHostUSBDevice(self.mgr,val._returnval) def generateMACAddress(self): req=IHost_generateMACAddressRequestMsg() req._this=self.handle val=self.mgr.getPort().IHost_generateMACAddress(req) return String(self.mgr,val._returnval) def getDVDDrives(self): req=IHost_getDVDDrivesRequestMsg() req._this=self.handle val=self.mgr.getPort().IHost_getDVDDrives(req) return IMedium(self.mgr,val._returnval, True) def getFloppyDrives(self): req=IHost_getFloppyDrivesRequestMsg() req._this=self.handle val=self.mgr.getPort().IHost_getFloppyDrives(req) return IMedium(self.mgr,val._returnval, True) def getUSBDevices(self): req=IHost_getUSBDevicesRequestMsg() req._this=self.handle val=self.mgr.getPort().IHost_getUSBDevices(req) return IHostUSBDevice(self.mgr,val._returnval, True) def getUSBDeviceFilters(self): req=IHost_getUSBDeviceFiltersRequestMsg() req._this=self.handle val=self.mgr.getPort().IHost_getUSBDeviceFilters(req) return IHostUSBDeviceFilter(self.mgr,val._returnval, True) def getNetworkInterfaces(self): req=IHost_getNetworkInterfacesRequestMsg() req._this=self.handle val=self.mgr.getPort().IHost_getNetworkInterfaces(req) return IHostNetworkInterface(self.mgr,val._returnval, True) def getNameServers(self): req=IHost_getNameServersRequestMsg() req._this=self.handle val=self.mgr.getPort().IHost_getNameServers(req) return String(self.mgr,val._returnval, True) def getDomainName(self): req=IHost_getDomainNameRequestMsg() req._this=self.handle val=self.mgr.getPort().IHost_getDomainName(req) return String(self.mgr,val._returnval) def getSearchStrings(self): req=IHost_getSearchStringsRequestMsg() req._this=self.handle val=self.mgr.getPort().IHost_getSearchStrings(req) return String(self.mgr,val._returnval, True) def getProcessorCount(self): req=IHost_getProcessorCountRequestMsg() req._this=self.handle val=self.mgr.getPort().IHost_getProcessorCount(req) return UnsignedInt(self.mgr,val._returnval) def getProcessorOnlineCount(self): req=IHost_getProcessorOnlineCountRequestMsg() req._this=self.handle val=self.mgr.getPort().IHost_getProcessorOnlineCount(req) return UnsignedInt(self.mgr,val._returnval) def getProcessorCoreCount(self): req=IHost_getProcessorCoreCountRequestMsg() req._this=self.handle val=self.mgr.getPort().IHost_getProcessorCoreCount(req) return UnsignedInt(self.mgr,val._returnval) def getProcessorOnlineCoreCount(self): req=IHost_getProcessorOnlineCoreCountRequestMsg() req._this=self.handle val=self.mgr.getPort().IHost_getProcessorOnlineCoreCount(req) return UnsignedInt(self.mgr,val._returnval) def getMemorySize(self): req=IHost_getMemorySizeRequestMsg() req._this=self.handle val=self.mgr.getPort().IHost_getMemorySize(req) return UnsignedInt(self.mgr,val._returnval) def getMemoryAvailable(self): req=IHost_getMemoryAvailableRequestMsg() req._this=self.handle val=self.mgr.getPort().IHost_getMemoryAvailable(req) return UnsignedInt(self.mgr,val._returnval) def getOperatingSystem(self): req=IHost_getOperatingSystemRequestMsg() req._this=self.handle val=self.mgr.getPort().IHost_getOperatingSystem(req) return String(self.mgr,val._returnval) def getOSVersion(self): req=IHost_getOSVersionRequestMsg() req._this=self.handle val=self.mgr.getPort().IHost_getOSVersion(req) return String(self.mgr,val._returnval) def getUTCTime(self): req=IHost_getUTCTimeRequestMsg() req._this=self.handle val=self.mgr.getPort().IHost_getUTCTime(req) return Long(self.mgr,val._returnval) def getAcceleration3DAvailable(self): req=IHost_getAcceleration3DAvailableRequestMsg() req._this=self.handle val=self.mgr.getPort().IHost_getAcceleration3DAvailable(req) return Boolean(self.mgr,val._returnval) def getVideoInputDevices(self): req=IHost_getVideoInputDevicesRequestMsg() req._this=self.handle val=self.mgr.getPort().IHost_getVideoInputDevices(req) return IHostVideoInputDevice(self.mgr,val._returnval, True) _Attrs_={ 'DVDDrives':[getDVDDrives,None], 'floppyDrives':[getFloppyDrives,None], 'USBDevices':[getUSBDevices,None], 'USBDeviceFilters':[getUSBDeviceFilters,None], 'networkInterfaces':[getNetworkInterfaces,None], 'nameServers':[getNameServers,None], 'domainName':[getDomainName,None], 'searchStrings':[getSearchStrings,None], 'processorCount':[getProcessorCount,None], 'processorOnlineCount':[getProcessorOnlineCount,None], 'processorCoreCount':[getProcessorCoreCount,None], 'processorOnlineCoreCount':[getProcessorOnlineCoreCount,None], 'memorySize':[getMemorySize,None], 'memoryAvailable':[getMemoryAvailable,None], 'operatingSystem':[getOperatingSystem,None], 'OSVersion':[getOSVersion,None], 'UTCTime':[getUTCTime,None], 'acceleration3DAvailable':[getAcceleration3DAvailable,None], 'videoInputDevices':[getVideoInputDevices,None]} class ISystemProperties(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return ISystemProperties(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = ISystemProperties._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = ISystemProperties._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getMaxNetworkAdapters(self, _arg_chipset): req=ISystemProperties_getMaxNetworkAdaptersRequestMsg() req._this=self.handle req._chipset=_arg_chipset val=self.mgr.getPort().ISystemProperties_getMaxNetworkAdapters(req) return UnsignedInt(self.mgr,val._returnval) def getMaxNetworkAdaptersOfType(self, _arg_chipset, _arg_type): req=ISystemProperties_getMaxNetworkAdaptersOfTypeRequestMsg() req._this=self.handle req._chipset=_arg_chipset req._type=_arg_type val=self.mgr.getPort().ISystemProperties_getMaxNetworkAdaptersOfType(req) return UnsignedInt(self.mgr,val._returnval) def getMaxDevicesPerPortForStorageBus(self, _arg_bus): req=ISystemProperties_getMaxDevicesPerPortForStorageBusRequestMsg() req._this=self.handle req._bus=_arg_bus val=self.mgr.getPort().ISystemProperties_getMaxDevicesPerPortForStorageBus(req) return UnsignedInt(self.mgr,val._returnval) def getMinPortCountForStorageBus(self, _arg_bus): req=ISystemProperties_getMinPortCountForStorageBusRequestMsg() req._this=self.handle req._bus=_arg_bus val=self.mgr.getPort().ISystemProperties_getMinPortCountForStorageBus(req) return UnsignedInt(self.mgr,val._returnval) def getMaxPortCountForStorageBus(self, _arg_bus): req=ISystemProperties_getMaxPortCountForStorageBusRequestMsg() req._this=self.handle req._bus=_arg_bus val=self.mgr.getPort().ISystemProperties_getMaxPortCountForStorageBus(req) return UnsignedInt(self.mgr,val._returnval) def getMaxInstancesOfStorageBus(self, _arg_chipset, _arg_bus): req=ISystemProperties_getMaxInstancesOfStorageBusRequestMsg() req._this=self.handle req._chipset=_arg_chipset req._bus=_arg_bus val=self.mgr.getPort().ISystemProperties_getMaxInstancesOfStorageBus(req) return UnsignedInt(self.mgr,val._returnval) def getDeviceTypesForStorageBus(self, _arg_bus): req=ISystemProperties_getDeviceTypesForStorageBusRequestMsg() req._this=self.handle req._bus=_arg_bus val=self.mgr.getPort().ISystemProperties_getDeviceTypesForStorageBus(req) return DeviceType(self.mgr,val._returnval, True) def getDefaultIoCacheSettingForStorageController(self, _arg_controllerType): req=ISystemProperties_getDefaultIoCacheSettingForStorageControllerRequestMsg() req._this=self.handle req._controllerType=_arg_controllerType val=self.mgr.getPort().ISystemProperties_getDefaultIoCacheSettingForStorageController(req) return Boolean(self.mgr,val._returnval) def getMaxInstancesOfUSBControllerType(self, _arg_chipset, _arg_type): req=ISystemProperties_getMaxInstancesOfUSBControllerTypeRequestMsg() req._this=self.handle req._chipset=_arg_chipset req._type=_arg_type val=self.mgr.getPort().ISystemProperties_getMaxInstancesOfUSBControllerType(req) return UnsignedInt(self.mgr,val._returnval) def getMinGuestRAM(self): req=ISystemProperties_getMinGuestRAMRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getMinGuestRAM(req) return UnsignedInt(self.mgr,val._returnval) def getMaxGuestRAM(self): req=ISystemProperties_getMaxGuestRAMRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getMaxGuestRAM(req) return UnsignedInt(self.mgr,val._returnval) def getMinGuestVRAM(self): req=ISystemProperties_getMinGuestVRAMRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getMinGuestVRAM(req) return UnsignedInt(self.mgr,val._returnval) def getMaxGuestVRAM(self): req=ISystemProperties_getMaxGuestVRAMRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getMaxGuestVRAM(req) return UnsignedInt(self.mgr,val._returnval) def getMinGuestCPUCount(self): req=ISystemProperties_getMinGuestCPUCountRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getMinGuestCPUCount(req) return UnsignedInt(self.mgr,val._returnval) def getMaxGuestCPUCount(self): req=ISystemProperties_getMaxGuestCPUCountRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getMaxGuestCPUCount(req) return UnsignedInt(self.mgr,val._returnval) def getMaxGuestMonitors(self): req=ISystemProperties_getMaxGuestMonitorsRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getMaxGuestMonitors(req) return UnsignedInt(self.mgr,val._returnval) def getInfoVDSize(self): req=ISystemProperties_getInfoVDSizeRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getInfoVDSize(req) return Long(self.mgr,val._returnval) def getSerialPortCount(self): req=ISystemProperties_getSerialPortCountRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getSerialPortCount(req) return UnsignedInt(self.mgr,val._returnval) def getParallelPortCount(self): req=ISystemProperties_getParallelPortCountRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getParallelPortCount(req) return UnsignedInt(self.mgr,val._returnval) def getMaxBootPosition(self): req=ISystemProperties_getMaxBootPositionRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getMaxBootPosition(req) return UnsignedInt(self.mgr,val._returnval) def getExclusiveHwVirt(self): req=ISystemProperties_getExclusiveHwVirtRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getExclusiveHwVirt(req) return Boolean(self.mgr,val._returnval) def setExclusiveHwVirt(self, value): req=ISystemProperties_setExclusiveHwVirtRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._exclusiveHwVirt = value else: req._exclusiveHwVirt = value.handle self.mgr.getPort().ISystemProperties_setExclusiveHwVirt(req) def getDefaultMachineFolder(self): req=ISystemProperties_getDefaultMachineFolderRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getDefaultMachineFolder(req) return String(self.mgr,val._returnval) def setDefaultMachineFolder(self, value): req=ISystemProperties_setDefaultMachineFolderRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._defaultMachineFolder = value else: req._defaultMachineFolder = value.handle self.mgr.getPort().ISystemProperties_setDefaultMachineFolder(req) def getLoggingLevel(self): req=ISystemProperties_getLoggingLevelRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getLoggingLevel(req) return String(self.mgr,val._returnval) def setLoggingLevel(self, value): req=ISystemProperties_setLoggingLevelRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._loggingLevel = value else: req._loggingLevel = value.handle self.mgr.getPort().ISystemProperties_setLoggingLevel(req) def getMediumFormats(self): req=ISystemProperties_getMediumFormatsRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getMediumFormats(req) return IMediumFormat(self.mgr,val._returnval, True) def getDefaultHardDiskFormat(self): req=ISystemProperties_getDefaultHardDiskFormatRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getDefaultHardDiskFormat(req) return String(self.mgr,val._returnval) def setDefaultHardDiskFormat(self, value): req=ISystemProperties_setDefaultHardDiskFormatRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._defaultHardDiskFormat = value else: req._defaultHardDiskFormat = value.handle self.mgr.getPort().ISystemProperties_setDefaultHardDiskFormat(req) def getFreeDiskSpaceWarning(self): req=ISystemProperties_getFreeDiskSpaceWarningRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getFreeDiskSpaceWarning(req) return Long(self.mgr,val._returnval) def setFreeDiskSpaceWarning(self, value): req=ISystemProperties_setFreeDiskSpaceWarningRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._freeDiskSpaceWarning = value else: req._freeDiskSpaceWarning = value.handle self.mgr.getPort().ISystemProperties_setFreeDiskSpaceWarning(req) def getFreeDiskSpacePercentWarning(self): req=ISystemProperties_getFreeDiskSpacePercentWarningRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getFreeDiskSpacePercentWarning(req) return UnsignedInt(self.mgr,val._returnval) def setFreeDiskSpacePercentWarning(self, value): req=ISystemProperties_setFreeDiskSpacePercentWarningRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._freeDiskSpacePercentWarning = value else: req._freeDiskSpacePercentWarning = value.handle self.mgr.getPort().ISystemProperties_setFreeDiskSpacePercentWarning(req) def getFreeDiskSpaceError(self): req=ISystemProperties_getFreeDiskSpaceErrorRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getFreeDiskSpaceError(req) return Long(self.mgr,val._returnval) def setFreeDiskSpaceError(self, value): req=ISystemProperties_setFreeDiskSpaceErrorRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._freeDiskSpaceError = value else: req._freeDiskSpaceError = value.handle self.mgr.getPort().ISystemProperties_setFreeDiskSpaceError(req) def getFreeDiskSpacePercentError(self): req=ISystemProperties_getFreeDiskSpacePercentErrorRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getFreeDiskSpacePercentError(req) return UnsignedInt(self.mgr,val._returnval) def setFreeDiskSpacePercentError(self, value): req=ISystemProperties_setFreeDiskSpacePercentErrorRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._freeDiskSpacePercentError = value else: req._freeDiskSpacePercentError = value.handle self.mgr.getPort().ISystemProperties_setFreeDiskSpacePercentError(req) def getVRDEAuthLibrary(self): req=ISystemProperties_getVRDEAuthLibraryRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getVRDEAuthLibrary(req) return String(self.mgr,val._returnval) def setVRDEAuthLibrary(self, value): req=ISystemProperties_setVRDEAuthLibraryRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._VRDEAuthLibrary = value else: req._VRDEAuthLibrary = value.handle self.mgr.getPort().ISystemProperties_setVRDEAuthLibrary(req) def getWebServiceAuthLibrary(self): req=ISystemProperties_getWebServiceAuthLibraryRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getWebServiceAuthLibrary(req) return String(self.mgr,val._returnval) def setWebServiceAuthLibrary(self, value): req=ISystemProperties_setWebServiceAuthLibraryRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._webServiceAuthLibrary = value else: req._webServiceAuthLibrary = value.handle self.mgr.getPort().ISystemProperties_setWebServiceAuthLibrary(req) def getDefaultVRDEExtPack(self): req=ISystemProperties_getDefaultVRDEExtPackRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getDefaultVRDEExtPack(req) return String(self.mgr,val._returnval) def setDefaultVRDEExtPack(self, value): req=ISystemProperties_setDefaultVRDEExtPackRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._defaultVRDEExtPack = value else: req._defaultVRDEExtPack = value.handle self.mgr.getPort().ISystemProperties_setDefaultVRDEExtPack(req) def getLogHistoryCount(self): req=ISystemProperties_getLogHistoryCountRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getLogHistoryCount(req) return UnsignedInt(self.mgr,val._returnval) def setLogHistoryCount(self, value): req=ISystemProperties_setLogHistoryCountRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._logHistoryCount = value else: req._logHistoryCount = value.handle self.mgr.getPort().ISystemProperties_setLogHistoryCount(req) def getDefaultAudioDriver(self): req=ISystemProperties_getDefaultAudioDriverRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getDefaultAudioDriver(req) return AudioDriverType(self.mgr,val._returnval) def getAutostartDatabasePath(self): req=ISystemProperties_getAutostartDatabasePathRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getAutostartDatabasePath(req) return String(self.mgr,val._returnval) def setAutostartDatabasePath(self, value): req=ISystemProperties_setAutostartDatabasePathRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._autostartDatabasePath = value else: req._autostartDatabasePath = value.handle self.mgr.getPort().ISystemProperties_setAutostartDatabasePath(req) def getDefaultAdditionsISO(self): req=ISystemProperties_getDefaultAdditionsISORequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getDefaultAdditionsISO(req) return String(self.mgr,val._returnval) def setDefaultAdditionsISO(self, value): req=ISystemProperties_setDefaultAdditionsISORequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._defaultAdditionsISO = value else: req._defaultAdditionsISO = value.handle self.mgr.getPort().ISystemProperties_setDefaultAdditionsISO(req) def getDefaultFrontend(self): req=ISystemProperties_getDefaultFrontendRequestMsg() req._this=self.handle val=self.mgr.getPort().ISystemProperties_getDefaultFrontend(req) return String(self.mgr,val._returnval) def setDefaultFrontend(self, value): req=ISystemProperties_setDefaultFrontendRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._defaultFrontend = value else: req._defaultFrontend = value.handle self.mgr.getPort().ISystemProperties_setDefaultFrontend(req) _Attrs_={ 'minGuestRAM':[getMinGuestRAM,None], 'maxGuestRAM':[getMaxGuestRAM,None], 'minGuestVRAM':[getMinGuestVRAM,None], 'maxGuestVRAM':[getMaxGuestVRAM,None], 'minGuestCPUCount':[getMinGuestCPUCount,None], 'maxGuestCPUCount':[getMaxGuestCPUCount,None], 'maxGuestMonitors':[getMaxGuestMonitors,None], 'infoVDSize':[getInfoVDSize,None], 'serialPortCount':[getSerialPortCount,None], 'parallelPortCount':[getParallelPortCount,None], 'maxBootPosition':[getMaxBootPosition,None], 'exclusiveHwVirt':[getExclusiveHwVirt,setExclusiveHwVirt, ], 'defaultMachineFolder':[getDefaultMachineFolder,setDefaultMachineFolder, ], 'loggingLevel':[getLoggingLevel,setLoggingLevel, ], 'mediumFormats':[getMediumFormats,None], 'defaultHardDiskFormat':[getDefaultHardDiskFormat,setDefaultHardDiskFormat, ], 'freeDiskSpaceWarning':[getFreeDiskSpaceWarning,setFreeDiskSpaceWarning, ], 'freeDiskSpacePercentWarning':[getFreeDiskSpacePercentWarning,setFreeDiskSpacePercentWarning, ], 'freeDiskSpaceError':[getFreeDiskSpaceError,setFreeDiskSpaceError, ], 'freeDiskSpacePercentError':[getFreeDiskSpacePercentError,setFreeDiskSpacePercentError, ], 'VRDEAuthLibrary':[getVRDEAuthLibrary,setVRDEAuthLibrary, ], 'webServiceAuthLibrary':[getWebServiceAuthLibrary,setWebServiceAuthLibrary, ], 'defaultVRDEExtPack':[getDefaultVRDEExtPack,setDefaultVRDEExtPack, ], 'logHistoryCount':[getLogHistoryCount,setLogHistoryCount, ], 'defaultAudioDriver':[getDefaultAudioDriver,None], 'autostartDatabasePath':[getAutostartDatabasePath,setAutostartDatabasePath, ], 'defaultAdditionsISO':[getDefaultAdditionsISO,setDefaultAdditionsISO, ], 'defaultFrontend':[getDefaultFrontend,setDefaultFrontend, ]} class IGuestSession(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestSession(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestSession._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestSession._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def close(self): req=IGuestSession_closeRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestSession_close(req) return def copyFrom(self, _arg_source, _arg_dest, _arg_flags): req=IGuestSession_copyFromRequestMsg() req._this=self.handle req._source=_arg_source req._dest=_arg_dest req._flags=_arg_flags val=self.mgr.getPort().IGuestSession_copyFrom(req) return IProgress(self.mgr,val._returnval) def copyTo(self, _arg_source, _arg_dest, _arg_flags): req=IGuestSession_copyToRequestMsg() req._this=self.handle req._source=_arg_source req._dest=_arg_dest req._flags=_arg_flags val=self.mgr.getPort().IGuestSession_copyTo(req) return IProgress(self.mgr,val._returnval) def directoryCreate(self, _arg_path, _arg_mode, _arg_flags): req=IGuestSession_directoryCreateRequestMsg() req._this=self.handle req._path=_arg_path req._mode=_arg_mode req._flags=_arg_flags val=self.mgr.getPort().IGuestSession_directoryCreate(req) return def directoryCreateTemp(self, _arg_templateName, _arg_mode, _arg_path, _arg_secure): req=IGuestSession_directoryCreateTempRequestMsg() req._this=self.handle req._templateName=_arg_templateName req._mode=_arg_mode req._path=_arg_path req._secure=_arg_secure val=self.mgr.getPort().IGuestSession_directoryCreateTemp(req) return String(self.mgr,val._returnval) def directoryExists(self, _arg_path): req=IGuestSession_directoryExistsRequestMsg() req._this=self.handle req._path=_arg_path val=self.mgr.getPort().IGuestSession_directoryExists(req) return Boolean(self.mgr,val._returnval) def directoryOpen(self, _arg_path, _arg_filter, _arg_flags): req=IGuestSession_directoryOpenRequestMsg() req._this=self.handle req._path=_arg_path req._filter=_arg_filter req._flags=_arg_flags val=self.mgr.getPort().IGuestSession_directoryOpen(req) return IGuestDirectory(self.mgr,val._returnval) def directoryQueryInfo(self, _arg_path): req=IGuestSession_directoryQueryInfoRequestMsg() req._this=self.handle req._path=_arg_path val=self.mgr.getPort().IGuestSession_directoryQueryInfo(req) return IGuestFsObjInfo(self.mgr,val._returnval) def directoryRemove(self, _arg_path): req=IGuestSession_directoryRemoveRequestMsg() req._this=self.handle req._path=_arg_path val=self.mgr.getPort().IGuestSession_directoryRemove(req) return def directoryRemoveRecursive(self, _arg_path, _arg_flags): req=IGuestSession_directoryRemoveRecursiveRequestMsg() req._this=self.handle req._path=_arg_path req._flags=_arg_flags val=self.mgr.getPort().IGuestSession_directoryRemoveRecursive(req) return IProgress(self.mgr,val._returnval) def directoryRename(self, _arg_source, _arg_dest, _arg_flags): req=IGuestSession_directoryRenameRequestMsg() req._this=self.handle req._source=_arg_source req._dest=_arg_dest req._flags=_arg_flags val=self.mgr.getPort().IGuestSession_directoryRename(req) return def directorySetACL(self, _arg_path, _arg_acl): req=IGuestSession_directorySetACLRequestMsg() req._this=self.handle req._path=_arg_path req._acl=_arg_acl val=self.mgr.getPort().IGuestSession_directorySetACL(req) return def environmentClear(self): req=IGuestSession_environmentClearRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestSession_environmentClear(req) return def environmentGet(self, _arg_name): req=IGuestSession_environmentGetRequestMsg() req._this=self.handle req._name=_arg_name val=self.mgr.getPort().IGuestSession_environmentGet(req) return String(self.mgr,val._returnval) def environmentSet(self, _arg_name, _arg_value): req=IGuestSession_environmentSetRequestMsg() req._this=self.handle req._name=_arg_name req._value=_arg_value val=self.mgr.getPort().IGuestSession_environmentSet(req) return def environmentUnset(self, _arg_name): req=IGuestSession_environmentUnsetRequestMsg() req._this=self.handle req._name=_arg_name val=self.mgr.getPort().IGuestSession_environmentUnset(req) return def fileCreateTemp(self, _arg_templateName, _arg_mode, _arg_path, _arg_secure): req=IGuestSession_fileCreateTempRequestMsg() req._this=self.handle req._templateName=_arg_templateName req._mode=_arg_mode req._path=_arg_path req._secure=_arg_secure val=self.mgr.getPort().IGuestSession_fileCreateTemp(req) return IGuestFile(self.mgr,val._returnval) def fileExists(self, _arg_path): req=IGuestSession_fileExistsRequestMsg() req._this=self.handle req._path=_arg_path val=self.mgr.getPort().IGuestSession_fileExists(req) return Boolean(self.mgr,val._returnval) def fileRemove(self, _arg_path): req=IGuestSession_fileRemoveRequestMsg() req._this=self.handle req._path=_arg_path val=self.mgr.getPort().IGuestSession_fileRemove(req) return def fileOpen(self, _arg_path, _arg_openMode, _arg_disposition, _arg_creationMode): req=IGuestSession_fileOpenRequestMsg() req._this=self.handle req._path=_arg_path req._openMode=_arg_openMode req._disposition=_arg_disposition req._creationMode=_arg_creationMode val=self.mgr.getPort().IGuestSession_fileOpen(req) return IGuestFile(self.mgr,val._returnval) def fileOpenEx(self, _arg_path, _arg_openMode, _arg_disposition, _arg_sharingMode, _arg_creationMode, _arg_offset): req=IGuestSession_fileOpenExRequestMsg() req._this=self.handle req._path=_arg_path req._openMode=_arg_openMode req._disposition=_arg_disposition req._sharingMode=_arg_sharingMode req._creationMode=_arg_creationMode req._offset=_arg_offset val=self.mgr.getPort().IGuestSession_fileOpenEx(req) return IGuestFile(self.mgr,val._returnval) def fileQueryInfo(self, _arg_path): req=IGuestSession_fileQueryInfoRequestMsg() req._this=self.handle req._path=_arg_path val=self.mgr.getPort().IGuestSession_fileQueryInfo(req) return IGuestFsObjInfo(self.mgr,val._returnval) def fileQuerySize(self, _arg_path): req=IGuestSession_fileQuerySizeRequestMsg() req._this=self.handle req._path=_arg_path val=self.mgr.getPort().IGuestSession_fileQuerySize(req) return Long(self.mgr,val._returnval) def fileRename(self, _arg_source, _arg_dest, _arg_flags): req=IGuestSession_fileRenameRequestMsg() req._this=self.handle req._source=_arg_source req._dest=_arg_dest req._flags=_arg_flags val=self.mgr.getPort().IGuestSession_fileRename(req) return def fileSetACL(self, _arg_file, _arg_acl): req=IGuestSession_fileSetACLRequestMsg() req._this=self.handle req._file=_arg_file req._acl=_arg_acl val=self.mgr.getPort().IGuestSession_fileSetACL(req) return def processCreate(self, _arg_command, _arg_arguments, _arg_environment, _arg_flags, _arg_timeoutMS): req=IGuestSession_processCreateRequestMsg() req._this=self.handle req._command=_arg_command req._arguments=_arg_arguments req._environment=_arg_environment req._flags=_arg_flags req._timeoutMS=_arg_timeoutMS val=self.mgr.getPort().IGuestSession_processCreate(req) return IGuestProcess(self.mgr,val._returnval) def processCreateEx(self, _arg_command, _arg_arguments, _arg_environment, _arg_flags, _arg_timeoutMS, _arg_priority, _arg_affinity): req=IGuestSession_processCreateExRequestMsg() req._this=self.handle req._command=_arg_command req._arguments=_arg_arguments req._environment=_arg_environment req._flags=_arg_flags req._timeoutMS=_arg_timeoutMS req._priority=_arg_priority req._affinity=_arg_affinity val=self.mgr.getPort().IGuestSession_processCreateEx(req) return IGuestProcess(self.mgr,val._returnval) def processGet(self, _arg_pid): req=IGuestSession_processGetRequestMsg() req._this=self.handle req._pid=_arg_pid val=self.mgr.getPort().IGuestSession_processGet(req) return IGuestProcess(self.mgr,val._returnval) def symlinkCreate(self, _arg_source, _arg_target, _arg_type): req=IGuestSession_symlinkCreateRequestMsg() req._this=self.handle req._source=_arg_source req._target=_arg_target req._type=_arg_type val=self.mgr.getPort().IGuestSession_symlinkCreate(req) return def symlinkExists(self, _arg_symlink): req=IGuestSession_symlinkExistsRequestMsg() req._this=self.handle req._symlink=_arg_symlink val=self.mgr.getPort().IGuestSession_symlinkExists(req) return Boolean(self.mgr,val._returnval) def symlinkRead(self, _arg_symlink, _arg_flags): req=IGuestSession_symlinkReadRequestMsg() req._this=self.handle req._symlink=_arg_symlink req._flags=_arg_flags val=self.mgr.getPort().IGuestSession_symlinkRead(req) return String(self.mgr,val._returnval) def symlinkRemoveDirectory(self, _arg_path): req=IGuestSession_symlinkRemoveDirectoryRequestMsg() req._this=self.handle req._path=_arg_path val=self.mgr.getPort().IGuestSession_symlinkRemoveDirectory(req) return def symlinkRemoveFile(self, _arg_file): req=IGuestSession_symlinkRemoveFileRequestMsg() req._this=self.handle req._file=_arg_file val=self.mgr.getPort().IGuestSession_symlinkRemoveFile(req) return def waitFor(self, _arg_waitFor, _arg_timeoutMS): req=IGuestSession_waitForRequestMsg() req._this=self.handle req._waitFor=_arg_waitFor req._timeoutMS=_arg_timeoutMS val=self.mgr.getPort().IGuestSession_waitFor(req) return GuestSessionWaitResult(self.mgr,val._returnval) def waitForArray(self, _arg_waitFor, _arg_timeoutMS): req=IGuestSession_waitForArrayRequestMsg() req._this=self.handle req._waitFor=_arg_waitFor req._timeoutMS=_arg_timeoutMS val=self.mgr.getPort().IGuestSession_waitForArray(req) return GuestSessionWaitResult(self.mgr,val._returnval) def getUser(self): req=IGuestSession_getUserRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestSession_getUser(req) return String(self.mgr,val._returnval) def getDomain(self): req=IGuestSession_getDomainRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestSession_getDomain(req) return String(self.mgr,val._returnval) def getName(self): req=IGuestSession_getNameRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestSession_getName(req) return String(self.mgr,val._returnval) def getId(self): req=IGuestSession_getIdRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestSession_getId(req) return UnsignedInt(self.mgr,val._returnval) def getTimeout(self): req=IGuestSession_getTimeoutRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestSession_getTimeout(req) return UnsignedInt(self.mgr,val._returnval) def setTimeout(self, value): req=IGuestSession_setTimeoutRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._timeout = value else: req._timeout = value.handle self.mgr.getPort().IGuestSession_setTimeout(req) def getProtocolVersion(self): req=IGuestSession_getProtocolVersionRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestSession_getProtocolVersion(req) return UnsignedInt(self.mgr,val._returnval) def getStatus(self): req=IGuestSession_getStatusRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestSession_getStatus(req) return GuestSessionStatus(self.mgr,val._returnval) def getEnvironment(self): req=IGuestSession_getEnvironmentRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestSession_getEnvironment(req) return String(self.mgr,val._returnval, True) def setEnvironment(self, value): req=IGuestSession_setEnvironmentRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._environment = value else: req._environment = value.handle self.mgr.getPort().IGuestSession_setEnvironment(req) def getProcesses(self): req=IGuestSession_getProcessesRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestSession_getProcesses(req) return IGuestProcess(self.mgr,val._returnval, True) def getDirectories(self): req=IGuestSession_getDirectoriesRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestSession_getDirectories(req) return IGuestDirectory(self.mgr,val._returnval, True) def getFiles(self): req=IGuestSession_getFilesRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestSession_getFiles(req) return IGuestFile(self.mgr,val._returnval, True) def getEventSource(self): req=IGuestSession_getEventSourceRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestSession_getEventSource(req) return IEventSource(self.mgr,val._returnval) _Attrs_={ 'user':[getUser,None], 'domain':[getDomain,None], 'name':[getName,None], 'id':[getId,None], 'timeout':[getTimeout,setTimeout, ], 'protocolVersion':[getProtocolVersion,None], 'status':[getStatus,None], 'environment':[getEnvironment,setEnvironment, ], 'processes':[getProcesses,None], 'directories':[getDirectories,None], 'files':[getFiles,None], 'eventSource':[getEventSource,None]} class IProcess(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IProcess(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IProcess._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IProcess._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def waitFor(self, _arg_waitFor, _arg_timeoutMS): req=IProcess_waitForRequestMsg() req._this=self.handle req._waitFor=_arg_waitFor req._timeoutMS=_arg_timeoutMS val=self.mgr.getPort().IProcess_waitFor(req) return ProcessWaitResult(self.mgr,val._returnval) def waitForArray(self, _arg_waitFor, _arg_timeoutMS): req=IProcess_waitForArrayRequestMsg() req._this=self.handle req._waitFor=_arg_waitFor req._timeoutMS=_arg_timeoutMS val=self.mgr.getPort().IProcess_waitForArray(req) return ProcessWaitResult(self.mgr,val._returnval) def read(self, _arg_handle, _arg_toRead, _arg_timeoutMS): req=IProcess_readRequestMsg() req._this=self.handle req._handle=_arg_handle req._toRead=_arg_toRead req._timeoutMS=_arg_timeoutMS val=self.mgr.getPort().IProcess_read(req) return self.mgr.decodebase64(val._returnval) def write(self, _arg_handle, _arg_flags, _arg_data, _arg_timeoutMS): req=IProcess_writeRequestMsg() req._this=self.handle req._handle=_arg_handle req._flags=_arg_flags req._data=self.mgr.encodebase64(_arg_data) req._timeoutMS=_arg_timeoutMS val=self.mgr.getPort().IProcess_write(req) return UnsignedInt(self.mgr,val._returnval) def writeArray(self, _arg_handle, _arg_flags, _arg_data, _arg_timeoutMS): req=IProcess_writeArrayRequestMsg() req._this=self.handle req._handle=_arg_handle req._flags=_arg_flags req._data=self.mgr.encodebase64(_arg_data) req._timeoutMS=_arg_timeoutMS val=self.mgr.getPort().IProcess_writeArray(req) return UnsignedInt(self.mgr,val._returnval) def terminate(self): req=IProcess_terminateRequestMsg() req._this=self.handle val=self.mgr.getPort().IProcess_terminate(req) return def getArguments(self): req=IProcess_getArgumentsRequestMsg() req._this=self.handle val=self.mgr.getPort().IProcess_getArguments(req) return String(self.mgr,val._returnval, True) def getEnvironment(self): req=IProcess_getEnvironmentRequestMsg() req._this=self.handle val=self.mgr.getPort().IProcess_getEnvironment(req) return String(self.mgr,val._returnval, True) def getEventSource(self): req=IProcess_getEventSourceRequestMsg() req._this=self.handle val=self.mgr.getPort().IProcess_getEventSource(req) return IEventSource(self.mgr,val._returnval) def getExecutablePath(self): req=IProcess_getExecutablePathRequestMsg() req._this=self.handle val=self.mgr.getPort().IProcess_getExecutablePath(req) return String(self.mgr,val._returnval) def getExitCode(self): req=IProcess_getExitCodeRequestMsg() req._this=self.handle val=self.mgr.getPort().IProcess_getExitCode(req) return Int(self.mgr,val._returnval) def getName(self): req=IProcess_getNameRequestMsg() req._this=self.handle val=self.mgr.getPort().IProcess_getName(req) return String(self.mgr,val._returnval) def getPID(self): req=IProcess_getPIDRequestMsg() req._this=self.handle val=self.mgr.getPort().IProcess_getPID(req) return UnsignedInt(self.mgr,val._returnval) def getStatus(self): req=IProcess_getStatusRequestMsg() req._this=self.handle val=self.mgr.getPort().IProcess_getStatus(req) return ProcessStatus(self.mgr,val._returnval) _Attrs_={ 'arguments':[getArguments,None], 'environment':[getEnvironment,None], 'eventSource':[getEventSource,None], 'executablePath':[getExecutablePath,None], 'exitCode':[getExitCode,None], 'name':[getName,None], 'PID':[getPID,None], 'status':[getStatus,None]} class IGuestProcess(IProcess): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestProcess(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestProcess._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IProcess.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestProcess._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val _Attrs_={} class IDirectory(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IDirectory(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IDirectory._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IDirectory._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def close(self): req=IDirectory_closeRequestMsg() req._this=self.handle val=self.mgr.getPort().IDirectory_close(req) return def read(self): req=IDirectory_readRequestMsg() req._this=self.handle val=self.mgr.getPort().IDirectory_read(req) return IFsObjInfo(self.mgr,val._returnval) def getDirectoryName(self): req=IDirectory_getDirectoryNameRequestMsg() req._this=self.handle val=self.mgr.getPort().IDirectory_getDirectoryName(req) return String(self.mgr,val._returnval) def getFilter(self): req=IDirectory_getFilterRequestMsg() req._this=self.handle val=self.mgr.getPort().IDirectory_getFilter(req) return String(self.mgr,val._returnval) _Attrs_={ 'directoryName':[getDirectoryName,None], 'filter':[getFilter,None]} class IGuestDirectory(IDirectory): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestDirectory(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestDirectory._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IDirectory.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestDirectory._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val _Attrs_={} class IFile(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IFile(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IFile._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IFile._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def close(self): req=IFile_closeRequestMsg() req._this=self.handle val=self.mgr.getPort().IFile_close(req) return def queryInfo(self): req=IFile_queryInfoRequestMsg() req._this=self.handle val=self.mgr.getPort().IFile_queryInfo(req) return IFsObjInfo(self.mgr,val._returnval) def read(self, _arg_toRead, _arg_timeoutMS): req=IFile_readRequestMsg() req._this=self.handle req._toRead=_arg_toRead req._timeoutMS=_arg_timeoutMS val=self.mgr.getPort().IFile_read(req) return self.mgr.decodebase64(val._returnval) def readAt(self, _arg_offset, _arg_toRead, _arg_timeoutMS): req=IFile_readAtRequestMsg() req._this=self.handle req._offset=_arg_offset req._toRead=_arg_toRead req._timeoutMS=_arg_timeoutMS val=self.mgr.getPort().IFile_readAt(req) return self.mgr.decodebase64(val._returnval) def seek(self, _arg_offset, _arg_whence): req=IFile_seekRequestMsg() req._this=self.handle req._offset=_arg_offset req._whence=_arg_whence val=self.mgr.getPort().IFile_seek(req) return def setACL(self, _arg_acl): req=IFile_setACLRequestMsg() req._this=self.handle req._acl=_arg_acl val=self.mgr.getPort().IFile_setACL(req) return def write(self, _arg_data, _arg_timeoutMS): req=IFile_writeRequestMsg() req._this=self.handle req._data=self.mgr.encodebase64(_arg_data) req._timeoutMS=_arg_timeoutMS val=self.mgr.getPort().IFile_write(req) return UnsignedInt(self.mgr,val._returnval) def writeAt(self, _arg_offset, _arg_data, _arg_timeoutMS): req=IFile_writeAtRequestMsg() req._this=self.handle req._offset=_arg_offset req._data=self.mgr.encodebase64(_arg_data) req._timeoutMS=_arg_timeoutMS val=self.mgr.getPort().IFile_writeAt(req) return UnsignedInt(self.mgr,val._returnval) def getCreationMode(self): req=IFile_getCreationModeRequestMsg() req._this=self.handle val=self.mgr.getPort().IFile_getCreationMode(req) return UnsignedInt(self.mgr,val._returnval) def getDisposition(self): req=IFile_getDispositionRequestMsg() req._this=self.handle val=self.mgr.getPort().IFile_getDisposition(req) return String(self.mgr,val._returnval) def getEventSource(self): req=IFile_getEventSourceRequestMsg() req._this=self.handle val=self.mgr.getPort().IFile_getEventSource(req) return IEventSource(self.mgr,val._returnval) def getFileName(self): req=IFile_getFileNameRequestMsg() req._this=self.handle val=self.mgr.getPort().IFile_getFileName(req) return String(self.mgr,val._returnval) def getId(self): req=IFile_getIdRequestMsg() req._this=self.handle val=self.mgr.getPort().IFile_getId(req) return UnsignedInt(self.mgr,val._returnval) def getInitialSize(self): req=IFile_getInitialSizeRequestMsg() req._this=self.handle val=self.mgr.getPort().IFile_getInitialSize(req) return Long(self.mgr,val._returnval) def getOpenMode(self): req=IFile_getOpenModeRequestMsg() req._this=self.handle val=self.mgr.getPort().IFile_getOpenMode(req) return String(self.mgr,val._returnval) def getOffset(self): req=IFile_getOffsetRequestMsg() req._this=self.handle val=self.mgr.getPort().IFile_getOffset(req) return Long(self.mgr,val._returnval) def getStatus(self): req=IFile_getStatusRequestMsg() req._this=self.handle val=self.mgr.getPort().IFile_getStatus(req) return FileStatus(self.mgr,val._returnval) _Attrs_={ 'creationMode':[getCreationMode,None], 'disposition':[getDisposition,None], 'eventSource':[getEventSource,None], 'fileName':[getFileName,None], 'id':[getId,None], 'initialSize':[getInitialSize,None], 'openMode':[getOpenMode,None], 'offset':[getOffset,None], 'status':[getStatus,None]} class IGuestFile(IFile): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestFile(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestFile._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IFile.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestFile._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val _Attrs_={} class IFsObjInfo(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IFsObjInfo(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IFsObjInfo._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IFsObjInfo._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getAccessTime(self): req=IFsObjInfo_getAccessTimeRequestMsg() req._this=self.handle val=self.mgr.getPort().IFsObjInfo_getAccessTime(req) return Long(self.mgr,val._returnval) def getAllocatedSize(self): req=IFsObjInfo_getAllocatedSizeRequestMsg() req._this=self.handle val=self.mgr.getPort().IFsObjInfo_getAllocatedSize(req) return Long(self.mgr,val._returnval) def getBirthTime(self): req=IFsObjInfo_getBirthTimeRequestMsg() req._this=self.handle val=self.mgr.getPort().IFsObjInfo_getBirthTime(req) return Long(self.mgr,val._returnval) def getChangeTime(self): req=IFsObjInfo_getChangeTimeRequestMsg() req._this=self.handle val=self.mgr.getPort().IFsObjInfo_getChangeTime(req) return Long(self.mgr,val._returnval) def getDeviceNumber(self): req=IFsObjInfo_getDeviceNumberRequestMsg() req._this=self.handle val=self.mgr.getPort().IFsObjInfo_getDeviceNumber(req) return UnsignedInt(self.mgr,val._returnval) def getFileAttributes(self): req=IFsObjInfo_getFileAttributesRequestMsg() req._this=self.handle val=self.mgr.getPort().IFsObjInfo_getFileAttributes(req) return String(self.mgr,val._returnval) def getGenerationId(self): req=IFsObjInfo_getGenerationIdRequestMsg() req._this=self.handle val=self.mgr.getPort().IFsObjInfo_getGenerationId(req) return UnsignedInt(self.mgr,val._returnval) def getGID(self): req=IFsObjInfo_getGIDRequestMsg() req._this=self.handle val=self.mgr.getPort().IFsObjInfo_getGID(req) return UnsignedInt(self.mgr,val._returnval) def getGroupName(self): req=IFsObjInfo_getGroupNameRequestMsg() req._this=self.handle val=self.mgr.getPort().IFsObjInfo_getGroupName(req) return String(self.mgr,val._returnval) def getHardLinks(self): req=IFsObjInfo_getHardLinksRequestMsg() req._this=self.handle val=self.mgr.getPort().IFsObjInfo_getHardLinks(req) return UnsignedInt(self.mgr,val._returnval) def getModificationTime(self): req=IFsObjInfo_getModificationTimeRequestMsg() req._this=self.handle val=self.mgr.getPort().IFsObjInfo_getModificationTime(req) return Long(self.mgr,val._returnval) def getName(self): req=IFsObjInfo_getNameRequestMsg() req._this=self.handle val=self.mgr.getPort().IFsObjInfo_getName(req) return String(self.mgr,val._returnval) def getNodeId(self): req=IFsObjInfo_getNodeIdRequestMsg() req._this=self.handle val=self.mgr.getPort().IFsObjInfo_getNodeId(req) return Long(self.mgr,val._returnval) def getNodeIdDevice(self): req=IFsObjInfo_getNodeIdDeviceRequestMsg() req._this=self.handle val=self.mgr.getPort().IFsObjInfo_getNodeIdDevice(req) return UnsignedInt(self.mgr,val._returnval) def getObjectSize(self): req=IFsObjInfo_getObjectSizeRequestMsg() req._this=self.handle val=self.mgr.getPort().IFsObjInfo_getObjectSize(req) return Long(self.mgr,val._returnval) def getType(self): req=IFsObjInfo_getTypeRequestMsg() req._this=self.handle val=self.mgr.getPort().IFsObjInfo_getType(req) return FsObjType(self.mgr,val._returnval) def getUID(self): req=IFsObjInfo_getUIDRequestMsg() req._this=self.handle val=self.mgr.getPort().IFsObjInfo_getUID(req) return UnsignedInt(self.mgr,val._returnval) def getUserFlags(self): req=IFsObjInfo_getUserFlagsRequestMsg() req._this=self.handle val=self.mgr.getPort().IFsObjInfo_getUserFlags(req) return UnsignedInt(self.mgr,val._returnval) def getUserName(self): req=IFsObjInfo_getUserNameRequestMsg() req._this=self.handle val=self.mgr.getPort().IFsObjInfo_getUserName(req) return String(self.mgr,val._returnval) _Attrs_={ 'accessTime':[getAccessTime,None], 'allocatedSize':[getAllocatedSize,None], 'birthTime':[getBirthTime,None], 'changeTime':[getChangeTime,None], 'deviceNumber':[getDeviceNumber,None], 'fileAttributes':[getFileAttributes,None], 'generationId':[getGenerationId,None], 'GID':[getGID,None], 'groupName':[getGroupName,None], 'hardLinks':[getHardLinks,None], 'modificationTime':[getModificationTime,None], 'name':[getName,None], 'nodeId':[getNodeId,None], 'nodeIdDevice':[getNodeIdDevice,None], 'objectSize':[getObjectSize,None], 'type':[getType,None], 'UID':[getUID,None], 'userFlags':[getUserFlags,None], 'userName':[getUserName,None]} class IGuestFsObjInfo(IFsObjInfo): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestFsObjInfo(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestFsObjInfo._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IFsObjInfo.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestFsObjInfo._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val _Attrs_={} class IGuest(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuest(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuest._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuest._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def internalGetStatistics(self): req=IGuest_internalGetStatisticsRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuest_internalGetStatistics(req) return UnsignedInt(self.mgr,val._cpuUser), UnsignedInt(self.mgr,val._cpuKernel), UnsignedInt(self.mgr,val._cpuIdle), UnsignedInt(self.mgr,val._memTotal), UnsignedInt(self.mgr,val._memFree), UnsignedInt(self.mgr,val._memBalloon), UnsignedInt(self.mgr,val._memShared), UnsignedInt(self.mgr,val._memCache), UnsignedInt(self.mgr,val._pagedTotal), UnsignedInt(self.mgr,val._memAllocTotal), UnsignedInt(self.mgr,val._memFreeTotal), UnsignedInt(self.mgr,val._memBalloonTotal), UnsignedInt(self.mgr,val._memSharedTotal) def getFacilityStatus(self, _arg_facility): req=IGuest_getFacilityStatusRequestMsg() req._this=self.handle req._facility=_arg_facility val=self.mgr.getPort().IGuest_getFacilityStatus(req) return AdditionsFacilityStatus(self.mgr,val._returnval), Long(self.mgr,val._timestamp) def getAdditionsStatus(self, _arg_level): req=IGuest_getAdditionsStatusRequestMsg() req._this=self.handle req._level=_arg_level val=self.mgr.getPort().IGuest_getAdditionsStatus(req) return Boolean(self.mgr,val._returnval) def setCredentials(self, _arg_userName, _arg_password, _arg_domain, _arg_allowInteractiveLogon): req=IGuest_setCredentialsRequestMsg() req._this=self.handle req._userName=_arg_userName req._password=_arg_password req._domain=_arg_domain req._allowInteractiveLogon=_arg_allowInteractiveLogon val=self.mgr.getPort().IGuest_setCredentials(req) return def dragHGEnter(self, _arg_screenId, _arg_y, _arg_x, _arg_defaultAction, _arg_allowedActions, _arg_formats): req=IGuest_dragHGEnterRequestMsg() req._this=self.handle req._screenId=_arg_screenId req._y=_arg_y req._x=_arg_x req._defaultAction=_arg_defaultAction req._allowedActions=_arg_allowedActions req._formats=_arg_formats val=self.mgr.getPort().IGuest_dragHGEnter(req) return DragAndDropAction(self.mgr,val._returnval) def dragHGMove(self, _arg_screenId, _arg_x, _arg_y, _arg_defaultAction, _arg_allowedActions, _arg_formats): req=IGuest_dragHGMoveRequestMsg() req._this=self.handle req._screenId=_arg_screenId req._x=_arg_x req._y=_arg_y req._defaultAction=_arg_defaultAction req._allowedActions=_arg_allowedActions req._formats=_arg_formats val=self.mgr.getPort().IGuest_dragHGMove(req) return DragAndDropAction(self.mgr,val._returnval) def dragHGLeave(self, _arg_screenId): req=IGuest_dragHGLeaveRequestMsg() req._this=self.handle req._screenId=_arg_screenId val=self.mgr.getPort().IGuest_dragHGLeave(req) return def dragHGDrop(self, _arg_screenId, _arg_x, _arg_y, _arg_defaultAction, _arg_allowedActions, _arg_formats): req=IGuest_dragHGDropRequestMsg() req._this=self.handle req._screenId=_arg_screenId req._x=_arg_x req._y=_arg_y req._defaultAction=_arg_defaultAction req._allowedActions=_arg_allowedActions req._formats=_arg_formats val=self.mgr.getPort().IGuest_dragHGDrop(req) return DragAndDropAction(self.mgr,val._returnval), String(self.mgr,val._format) def dragHGPutData(self, _arg_screenId, _arg_format, _arg_data): req=IGuest_dragHGPutDataRequestMsg() req._this=self.handle req._screenId=_arg_screenId req._format=_arg_format req._data=self.mgr.encodebase64(_arg_data) val=self.mgr.getPort().IGuest_dragHGPutData(req) return IProgress(self.mgr,val._returnval) def dragGHPending(self, _arg_screenId): req=IGuest_dragGHPendingRequestMsg() req._this=self.handle req._screenId=_arg_screenId val=self.mgr.getPort().IGuest_dragGHPending(req) return DragAndDropAction(self.mgr,val._returnval), String(self.mgr,val._formats, True), DragAndDropAction(self.mgr,val._allowedActions, True) def dragGHDropped(self, _arg_format, _arg_action): req=IGuest_dragGHDroppedRequestMsg() req._this=self.handle req._format=_arg_format req._action=_arg_action val=self.mgr.getPort().IGuest_dragGHDropped(req) return IProgress(self.mgr,val._returnval) def dragGHGetData(self): req=IGuest_dragGHGetDataRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuest_dragGHGetData(req) return self.mgr.decodebase64(val._returnval) def createSession(self, _arg_user, _arg_password, _arg_domain, _arg_sessionName): req=IGuest_createSessionRequestMsg() req._this=self.handle req._user=_arg_user req._password=_arg_password req._domain=_arg_domain req._sessionName=_arg_sessionName val=self.mgr.getPort().IGuest_createSession(req) return IGuestSession(self.mgr,val._returnval) def findSession(self, _arg_sessionName): req=IGuest_findSessionRequestMsg() req._this=self.handle req._sessionName=_arg_sessionName val=self.mgr.getPort().IGuest_findSession(req) return IGuestSession(self.mgr,val._returnval, True) def updateGuestAdditions(self, _arg_source, _arg_arguments, _arg_flags): req=IGuest_updateGuestAdditionsRequestMsg() req._this=self.handle req._source=_arg_source req._arguments=_arg_arguments req._flags=_arg_flags val=self.mgr.getPort().IGuest_updateGuestAdditions(req) return IProgress(self.mgr,val._returnval) def getOSTypeId(self): req=IGuest_getOSTypeIdRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuest_getOSTypeId(req) return String(self.mgr,val._returnval) def getAdditionsRunLevel(self): req=IGuest_getAdditionsRunLevelRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuest_getAdditionsRunLevel(req) return AdditionsRunLevelType(self.mgr,val._returnval) def getAdditionsVersion(self): req=IGuest_getAdditionsVersionRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuest_getAdditionsVersion(req) return String(self.mgr,val._returnval) def getAdditionsRevision(self): req=IGuest_getAdditionsRevisionRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuest_getAdditionsRevision(req) return UnsignedInt(self.mgr,val._returnval) def getEventSource(self): req=IGuest_getEventSourceRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuest_getEventSource(req) return IEventSource(self.mgr,val._returnval) def getFacilities(self): req=IGuest_getFacilitiesRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuest_getFacilities(req) return IAdditionsFacility(self.mgr,val._returnval, True) def getSessions(self): req=IGuest_getSessionsRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuest_getSessions(req) return IGuestSession(self.mgr,val._returnval, True) def getMemoryBalloonSize(self): req=IGuest_getMemoryBalloonSizeRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuest_getMemoryBalloonSize(req) return UnsignedInt(self.mgr,val._returnval) def setMemoryBalloonSize(self, value): req=IGuest_setMemoryBalloonSizeRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._memoryBalloonSize = value else: req._memoryBalloonSize = value.handle self.mgr.getPort().IGuest_setMemoryBalloonSize(req) def getStatisticsUpdateInterval(self): req=IGuest_getStatisticsUpdateIntervalRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuest_getStatisticsUpdateInterval(req) return UnsignedInt(self.mgr,val._returnval) def setStatisticsUpdateInterval(self, value): req=IGuest_setStatisticsUpdateIntervalRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._statisticsUpdateInterval = value else: req._statisticsUpdateInterval = value.handle self.mgr.getPort().IGuest_setStatisticsUpdateInterval(req) _Attrs_={ 'OSTypeId':[getOSTypeId,None], 'additionsRunLevel':[getAdditionsRunLevel,None], 'additionsVersion':[getAdditionsVersion,None], 'additionsRevision':[getAdditionsRevision,None], 'eventSource':[getEventSource,None], 'facilities':[getFacilities,None], 'sessions':[getSessions,None], 'memoryBalloonSize':[getMemoryBalloonSize,setMemoryBalloonSize, ], 'statisticsUpdateInterval':[getStatisticsUpdateInterval,setStatisticsUpdateInterval, ]} class IProgress(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IProgress(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IProgress._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IProgress._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def setCurrentOperationProgress(self, _arg_percent): req=IProgress_setCurrentOperationProgressRequestMsg() req._this=self.handle req._percent=_arg_percent val=self.mgr.getPort().IProgress_setCurrentOperationProgress(req) return def setNextOperation(self, _arg_nextOperationDescription, _arg_nextOperationsWeight): req=IProgress_setNextOperationRequestMsg() req._this=self.handle req._nextOperationDescription=_arg_nextOperationDescription req._nextOperationsWeight=_arg_nextOperationsWeight val=self.mgr.getPort().IProgress_setNextOperation(req) return def waitForCompletion(self, _arg_timeout): req=IProgress_waitForCompletionRequestMsg() req._this=self.handle req._timeout=_arg_timeout val=self.mgr.getPort().IProgress_waitForCompletion(req) return def waitForOperationCompletion(self, _arg_operation, _arg_timeout): req=IProgress_waitForOperationCompletionRequestMsg() req._this=self.handle req._operation=_arg_operation req._timeout=_arg_timeout val=self.mgr.getPort().IProgress_waitForOperationCompletion(req) return def waitForAsyncProgressCompletion(self, _arg_pProgressAsync): req=IProgress_waitForAsyncProgressCompletionRequestMsg() req._this=self.handle req._pProgressAsync=_arg_pProgressAsync val=self.mgr.getPort().IProgress_waitForAsyncProgressCompletion(req) return def cancel(self): req=IProgress_cancelRequestMsg() req._this=self.handle val=self.mgr.getPort().IProgress_cancel(req) return def getId(self): req=IProgress_getIdRequestMsg() req._this=self.handle val=self.mgr.getPort().IProgress_getId(req) return String(self.mgr,val._returnval) def getDescription(self): req=IProgress_getDescriptionRequestMsg() req._this=self.handle val=self.mgr.getPort().IProgress_getDescription(req) return String(self.mgr,val._returnval) def getInitiator(self): req=IProgress_getInitiatorRequestMsg() req._this=self.handle val=self.mgr.getPort().IProgress_getInitiator(req) return IUnknown(self.mgr,val._returnval) def getCancelable(self): req=IProgress_getCancelableRequestMsg() req._this=self.handle val=self.mgr.getPort().IProgress_getCancelable(req) return Boolean(self.mgr,val._returnval) def getPercent(self): req=IProgress_getPercentRequestMsg() req._this=self.handle val=self.mgr.getPort().IProgress_getPercent(req) return UnsignedInt(self.mgr,val._returnval) def getTimeRemaining(self): req=IProgress_getTimeRemainingRequestMsg() req._this=self.handle val=self.mgr.getPort().IProgress_getTimeRemaining(req) return Int(self.mgr,val._returnval) def getCompleted(self): req=IProgress_getCompletedRequestMsg() req._this=self.handle val=self.mgr.getPort().IProgress_getCompleted(req) return Boolean(self.mgr,val._returnval) def getCanceled(self): req=IProgress_getCanceledRequestMsg() req._this=self.handle val=self.mgr.getPort().IProgress_getCanceled(req) return Boolean(self.mgr,val._returnval) def getResultCode(self): req=IProgress_getResultCodeRequestMsg() req._this=self.handle val=self.mgr.getPort().IProgress_getResultCode(req) return Int(self.mgr,val._returnval) def getErrorInfo(self): req=IProgress_getErrorInfoRequestMsg() req._this=self.handle val=self.mgr.getPort().IProgress_getErrorInfo(req) return IVirtualBoxErrorInfo(self.mgr,val._returnval) def getOperationCount(self): req=IProgress_getOperationCountRequestMsg() req._this=self.handle val=self.mgr.getPort().IProgress_getOperationCount(req) return UnsignedInt(self.mgr,val._returnval) def getOperation(self): req=IProgress_getOperationRequestMsg() req._this=self.handle val=self.mgr.getPort().IProgress_getOperation(req) return UnsignedInt(self.mgr,val._returnval) def getOperationDescription(self): req=IProgress_getOperationDescriptionRequestMsg() req._this=self.handle val=self.mgr.getPort().IProgress_getOperationDescription(req) return String(self.mgr,val._returnval) def getOperationPercent(self): req=IProgress_getOperationPercentRequestMsg() req._this=self.handle val=self.mgr.getPort().IProgress_getOperationPercent(req) return UnsignedInt(self.mgr,val._returnval) def getOperationWeight(self): req=IProgress_getOperationWeightRequestMsg() req._this=self.handle val=self.mgr.getPort().IProgress_getOperationWeight(req) return UnsignedInt(self.mgr,val._returnval) def getTimeout(self): req=IProgress_getTimeoutRequestMsg() req._this=self.handle val=self.mgr.getPort().IProgress_getTimeout(req) return UnsignedInt(self.mgr,val._returnval) def setTimeout(self, value): req=IProgress_setTimeoutRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._timeout = value else: req._timeout = value.handle self.mgr.getPort().IProgress_setTimeout(req) _Attrs_={ 'id':[getId,None], 'description':[getDescription,None], 'initiator':[getInitiator,None], 'cancelable':[getCancelable,None], 'percent':[getPercent,None], 'timeRemaining':[getTimeRemaining,None], 'completed':[getCompleted,None], 'canceled':[getCanceled,None], 'resultCode':[getResultCode,None], 'errorInfo':[getErrorInfo,None], 'operationCount':[getOperationCount,None], 'operation':[getOperation,None], 'operationDescription':[getOperationDescription,None], 'operationPercent':[getOperationPercent,None], 'operationWeight':[getOperationWeight,None], 'timeout':[getTimeout,setTimeout, ]} class ISnapshot(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return ISnapshot(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = ISnapshot._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = ISnapshot._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getChildrenCount(self): req=ISnapshot_getChildrenCountRequestMsg() req._this=self.handle val=self.mgr.getPort().ISnapshot_getChildrenCount(req) return UnsignedInt(self.mgr,val._returnval) def getId(self): req=ISnapshot_getIdRequestMsg() req._this=self.handle val=self.mgr.getPort().ISnapshot_getId(req) return String(self.mgr,val._returnval) def getName(self): req=ISnapshot_getNameRequestMsg() req._this=self.handle val=self.mgr.getPort().ISnapshot_getName(req) return String(self.mgr,val._returnval) def setName(self, value): req=ISnapshot_setNameRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._name = value else: req._name = value.handle self.mgr.getPort().ISnapshot_setName(req) def getDescription(self): req=ISnapshot_getDescriptionRequestMsg() req._this=self.handle val=self.mgr.getPort().ISnapshot_getDescription(req) return String(self.mgr,val._returnval) def setDescription(self, value): req=ISnapshot_setDescriptionRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._description = value else: req._description = value.handle self.mgr.getPort().ISnapshot_setDescription(req) def getTimeStamp(self): req=ISnapshot_getTimeStampRequestMsg() req._this=self.handle val=self.mgr.getPort().ISnapshot_getTimeStamp(req) return Long(self.mgr,val._returnval) def getOnline(self): req=ISnapshot_getOnlineRequestMsg() req._this=self.handle val=self.mgr.getPort().ISnapshot_getOnline(req) return Boolean(self.mgr,val._returnval) def getMachine(self): req=ISnapshot_getMachineRequestMsg() req._this=self.handle val=self.mgr.getPort().ISnapshot_getMachine(req) return IMachine(self.mgr,val._returnval) def getParent(self): req=ISnapshot_getParentRequestMsg() req._this=self.handle val=self.mgr.getPort().ISnapshot_getParent(req) return ISnapshot(self.mgr,val._returnval) def getChildren(self): req=ISnapshot_getChildrenRequestMsg() req._this=self.handle val=self.mgr.getPort().ISnapshot_getChildren(req) return ISnapshot(self.mgr,val._returnval, True) _Attrs_={ 'id':[getId,None], 'name':[getName,setName, ], 'description':[getDescription,setDescription, ], 'timeStamp':[getTimeStamp,None], 'online':[getOnline,None], 'machine':[getMachine,None], 'parent':[getParent,None], 'children':[getChildren,None]} class IMedium(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IMedium(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IMedium._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IMedium._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def setIds(self, _arg_setImageId, _arg_imageId, _arg_setParentId, _arg_parentId): req=IMedium_setIdsRequestMsg() req._this=self.handle req._setImageId=_arg_setImageId req._imageId=_arg_imageId req._setParentId=_arg_setParentId req._parentId=_arg_parentId val=self.mgr.getPort().IMedium_setIds(req) return def refreshState(self): req=IMedium_refreshStateRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_refreshState(req) return MediumState(self.mgr,val._returnval) def getSnapshotIds(self, _arg_machineId): req=IMedium_getSnapshotIdsRequestMsg() req._this=self.handle req._machineId=_arg_machineId val=self.mgr.getPort().IMedium_getSnapshotIds(req) return String(self.mgr,val._returnval, True) def lockRead(self): req=IMedium_lockReadRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_lockRead(req) return IToken(self.mgr,val._returnval) def lockWrite(self): req=IMedium_lockWriteRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_lockWrite(req) return IToken(self.mgr,val._returnval) def close(self): req=IMedium_closeRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_close(req) return def getProperty(self, _arg_name): req=IMedium_getPropertyRequestMsg() req._this=self.handle req._name=_arg_name val=self.mgr.getPort().IMedium_getProperty(req) return String(self.mgr,val._returnval) def setProperty(self, _arg_name, _arg_value): req=IMedium_setPropertyRequestMsg() req._this=self.handle req._name=_arg_name req._value=_arg_value val=self.mgr.getPort().IMedium_setProperty(req) return def getProperties(self, _arg_names): req=IMedium_getPropertiesRequestMsg() req._this=self.handle req._names=_arg_names val=self.mgr.getPort().IMedium_getProperties(req) return String(self.mgr,val._returnval, True), String(self.mgr,val._returnNames, True) def setProperties(self, _arg_names, _arg_values): req=IMedium_setPropertiesRequestMsg() req._this=self.handle req._names=_arg_names req._values=_arg_values val=self.mgr.getPort().IMedium_setProperties(req) return def createBaseStorage(self, _arg_logicalSize, _arg_variant): req=IMedium_createBaseStorageRequestMsg() req._this=self.handle req._logicalSize=_arg_logicalSize req._variant=_arg_variant val=self.mgr.getPort().IMedium_createBaseStorage(req) return IProgress(self.mgr,val._returnval) def deleteStorage(self): req=IMedium_deleteStorageRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_deleteStorage(req) return IProgress(self.mgr,val._returnval) def createDiffStorage(self, _arg_target, _arg_variant): req=IMedium_createDiffStorageRequestMsg() req._this=self.handle req._target=_arg_target req._variant=_arg_variant val=self.mgr.getPort().IMedium_createDiffStorage(req) return IProgress(self.mgr,val._returnval) def mergeTo(self, _arg_target): req=IMedium_mergeToRequestMsg() req._this=self.handle req._target=_arg_target val=self.mgr.getPort().IMedium_mergeTo(req) return IProgress(self.mgr,val._returnval) def cloneTo(self, _arg_target, _arg_variant, _arg_parent): req=IMedium_cloneToRequestMsg() req._this=self.handle req._target=_arg_target req._variant=_arg_variant req._parent=_arg_parent val=self.mgr.getPort().IMedium_cloneTo(req) return IProgress(self.mgr,val._returnval) def cloneToBase(self, _arg_target, _arg_variant): req=IMedium_cloneToBaseRequestMsg() req._this=self.handle req._target=_arg_target req._variant=_arg_variant val=self.mgr.getPort().IMedium_cloneToBase(req) return IProgress(self.mgr,val._returnval) def setLocation(self, _arg_location): req=IMedium_setLocationRequestMsg() req._this=self.handle req._location=_arg_location val=self.mgr.getPort().IMedium_setLocation(req) return IProgress(self.mgr,val._returnval) def compact(self): req=IMedium_compactRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_compact(req) return IProgress(self.mgr,val._returnval) def resize(self, _arg_logicalSize): req=IMedium_resizeRequestMsg() req._this=self.handle req._logicalSize=_arg_logicalSize val=self.mgr.getPort().IMedium_resize(req) return IProgress(self.mgr,val._returnval) def reset(self): req=IMedium_resetRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_reset(req) return IProgress(self.mgr,val._returnval) def getId(self): req=IMedium_getIdRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_getId(req) return String(self.mgr,val._returnval) def getDescription(self): req=IMedium_getDescriptionRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_getDescription(req) return String(self.mgr,val._returnval) def setDescription(self, value): req=IMedium_setDescriptionRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._description = value else: req._description = value.handle self.mgr.getPort().IMedium_setDescription(req) def getState(self): req=IMedium_getStateRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_getState(req) return MediumState(self.mgr,val._returnval) def getVariant(self): req=IMedium_getVariantRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_getVariant(req) return MediumVariant(self.mgr,val._returnval, True) def getLocation(self): req=IMedium_getLocationRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_getLocation(req) return String(self.mgr,val._returnval) def getName(self): req=IMedium_getNameRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_getName(req) return String(self.mgr,val._returnval) def getDeviceType(self): req=IMedium_getDeviceTypeRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_getDeviceType(req) return DeviceType(self.mgr,val._returnval) def getHostDrive(self): req=IMedium_getHostDriveRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_getHostDrive(req) return Boolean(self.mgr,val._returnval) def getSize(self): req=IMedium_getSizeRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_getSize(req) return Long(self.mgr,val._returnval) def getFormat(self): req=IMedium_getFormatRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_getFormat(req) return String(self.mgr,val._returnval) def getMediumFormat(self): req=IMedium_getMediumFormatRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_getMediumFormat(req) return IMediumFormat(self.mgr,val._returnval) def getType(self): req=IMedium_getTypeRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_getType(req) return MediumType(self.mgr,val._returnval) def setType(self, value): req=IMedium_setTypeRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._type = value else: req._type = value.handle self.mgr.getPort().IMedium_setType(req) def getAllowedTypes(self): req=IMedium_getAllowedTypesRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_getAllowedTypes(req) return MediumType(self.mgr,val._returnval, True) def getParent(self): req=IMedium_getParentRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_getParent(req) return IMedium(self.mgr,val._returnval) def getChildren(self): req=IMedium_getChildrenRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_getChildren(req) return IMedium(self.mgr,val._returnval, True) def getBase(self): req=IMedium_getBaseRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_getBase(req) return IMedium(self.mgr,val._returnval) def getReadOnly(self): req=IMedium_getReadOnlyRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_getReadOnly(req) return Boolean(self.mgr,val._returnval) def getLogicalSize(self): req=IMedium_getLogicalSizeRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_getLogicalSize(req) return Long(self.mgr,val._returnval) def getAutoReset(self): req=IMedium_getAutoResetRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_getAutoReset(req) return Boolean(self.mgr,val._returnval) def setAutoReset(self, value): req=IMedium_setAutoResetRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._autoReset = value else: req._autoReset = value.handle self.mgr.getPort().IMedium_setAutoReset(req) def getLastAccessError(self): req=IMedium_getLastAccessErrorRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_getLastAccessError(req) return String(self.mgr,val._returnval) def getMachineIds(self): req=IMedium_getMachineIdsRequestMsg() req._this=self.handle val=self.mgr.getPort().IMedium_getMachineIds(req) return String(self.mgr,val._returnval, True) _Attrs_={ 'id':[getId,None], 'description':[getDescription,setDescription, ], 'state':[getState,None], 'variant':[getVariant,None], 'location':[getLocation,None], 'name':[getName,None], 'deviceType':[getDeviceType,None], 'hostDrive':[getHostDrive,None], 'size':[getSize,None], 'format':[getFormat,None], 'mediumFormat':[getMediumFormat,None], 'type':[getType,setType, ], 'allowedTypes':[getAllowedTypes,None], 'parent':[getParent,None], 'children':[getChildren,None], 'base':[getBase,None], 'readOnly':[getReadOnly,None], 'logicalSize':[getLogicalSize,None], 'autoReset':[getAutoReset,setAutoReset, ], 'lastAccessError':[getLastAccessError,None], 'machineIds':[getMachineIds,None]} class IMediumFormat(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IMediumFormat(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IMediumFormat._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IMediumFormat._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def describeFileExtensions(self): req=IMediumFormat_describeFileExtensionsRequestMsg() req._this=self.handle val=self.mgr.getPort().IMediumFormat_describeFileExtensions(req) return String(self.mgr,val._extensions, True), DeviceType(self.mgr,val._types, True) def describeProperties(self): req=IMediumFormat_describePropertiesRequestMsg() req._this=self.handle val=self.mgr.getPort().IMediumFormat_describeProperties(req) return String(self.mgr,val._names, True), String(self.mgr,val._descriptions, True), DataType(self.mgr,val._types, True), UnsignedInt(self.mgr,val._flags, True), String(self.mgr,val._defaults, True) def getId(self): req=IMediumFormat_getIdRequestMsg() req._this=self.handle val=self.mgr.getPort().IMediumFormat_getId(req) return String(self.mgr,val._returnval) def getName(self): req=IMediumFormat_getNameRequestMsg() req._this=self.handle val=self.mgr.getPort().IMediumFormat_getName(req) return String(self.mgr,val._returnval) def getCapabilities(self): req=IMediumFormat_getCapabilitiesRequestMsg() req._this=self.handle val=self.mgr.getPort().IMediumFormat_getCapabilities(req) return MediumFormatCapabilities(self.mgr,val._returnval, True) _Attrs_={ 'id':[getId,None], 'name':[getName,None], 'capabilities':[getCapabilities,None]} class IToken(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IToken(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IToken._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IToken._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def abandon(self): req=IToken_abandonRequestMsg() req._this=self.handle val=self.mgr.getPort().IToken_abandon(req) return def dummy(self): req=IToken_dummyRequestMsg() req._this=self.handle val=self.mgr.getPort().IToken_dummy(req) return _Attrs_={} class IKeyboard(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IKeyboard(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IKeyboard._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IKeyboard._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def putScancode(self, _arg_scancode): req=IKeyboard_putScancodeRequestMsg() req._this=self.handle req._scancode=_arg_scancode val=self.mgr.getPort().IKeyboard_putScancode(req) return def putScancodes(self, _arg_scancodes): req=IKeyboard_putScancodesRequestMsg() req._this=self.handle req._scancodes=_arg_scancodes val=self.mgr.getPort().IKeyboard_putScancodes(req) return UnsignedInt(self.mgr,val._returnval) def putCAD(self): req=IKeyboard_putCADRequestMsg() req._this=self.handle val=self.mgr.getPort().IKeyboard_putCAD(req) return def getEventSource(self): req=IKeyboard_getEventSourceRequestMsg() req._this=self.handle val=self.mgr.getPort().IKeyboard_getEventSource(req) return IEventSource(self.mgr,val._returnval) _Attrs_={ 'eventSource':[getEventSource,None]} class IMouse(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IMouse(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IMouse._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IMouse._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def putMouseEvent(self, _arg_dx, _arg_dy, _arg_dz, _arg_dw, _arg_buttonState): req=IMouse_putMouseEventRequestMsg() req._this=self.handle req._dx=_arg_dx req._dy=_arg_dy req._dz=_arg_dz req._dw=_arg_dw req._buttonState=_arg_buttonState val=self.mgr.getPort().IMouse_putMouseEvent(req) return def putMouseEventAbsolute(self, _arg_x, _arg_y, _arg_dz, _arg_dw, _arg_buttonState): req=IMouse_putMouseEventAbsoluteRequestMsg() req._this=self.handle req._x=_arg_x req._y=_arg_y req._dz=_arg_dz req._dw=_arg_dw req._buttonState=_arg_buttonState val=self.mgr.getPort().IMouse_putMouseEventAbsolute(req) return def putEventMultiTouch(self, _arg_count, _arg_contacts, _arg_scanTime): req=IMouse_putEventMultiTouchRequestMsg() req._this=self.handle req._count=_arg_count req._contacts=_arg_contacts req._scanTime=_arg_scanTime val=self.mgr.getPort().IMouse_putEventMultiTouch(req) return def putEventMultiTouchString(self, _arg_count, _arg_contacts, _arg_scanTime): req=IMouse_putEventMultiTouchStringRequestMsg() req._this=self.handle req._count=_arg_count req._contacts=_arg_contacts req._scanTime=_arg_scanTime val=self.mgr.getPort().IMouse_putEventMultiTouchString(req) return def getAbsoluteSupported(self): req=IMouse_getAbsoluteSupportedRequestMsg() req._this=self.handle val=self.mgr.getPort().IMouse_getAbsoluteSupported(req) return Boolean(self.mgr,val._returnval) def getRelativeSupported(self): req=IMouse_getRelativeSupportedRequestMsg() req._this=self.handle val=self.mgr.getPort().IMouse_getRelativeSupported(req) return Boolean(self.mgr,val._returnval) def getMultiTouchSupported(self): req=IMouse_getMultiTouchSupportedRequestMsg() req._this=self.handle val=self.mgr.getPort().IMouse_getMultiTouchSupported(req) return Boolean(self.mgr,val._returnval) def getNeedsHostCursor(self): req=IMouse_getNeedsHostCursorRequestMsg() req._this=self.handle val=self.mgr.getPort().IMouse_getNeedsHostCursor(req) return Boolean(self.mgr,val._returnval) def getEventSource(self): req=IMouse_getEventSourceRequestMsg() req._this=self.handle val=self.mgr.getPort().IMouse_getEventSource(req) return IEventSource(self.mgr,val._returnval) _Attrs_={ 'absoluteSupported':[getAbsoluteSupported,None], 'relativeSupported':[getRelativeSupported,None], 'multiTouchSupported':[getMultiTouchSupported,None], 'needsHostCursor':[getNeedsHostCursor,None], 'eventSource':[getEventSource,None]} class IFramebuffer(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IFramebuffer(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IFramebuffer._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IFramebuffer._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def lock(self): req=IFramebuffer_lockRequestMsg() req._this=self.handle val=self.mgr.getPort().IFramebuffer_lock(req) return def unlock(self): req=IFramebuffer_unlockRequestMsg() req._this=self.handle val=self.mgr.getPort().IFramebuffer_unlock(req) return def notifyUpdate(self, _arg_x, _arg_y, _arg_width, _arg_height): req=IFramebuffer_notifyUpdateRequestMsg() req._this=self.handle req._x=_arg_x req._y=_arg_y req._width=_arg_width req._height=_arg_height val=self.mgr.getPort().IFramebuffer_notifyUpdate(req) return def requestResize(self, _arg_screenId, _arg_pixelFormat, _arg_VRAM, _arg_bitsPerPixel, _arg_bytesPerLine, _arg_width, _arg_height): req=IFramebuffer_requestResizeRequestMsg() req._this=self.handle req._screenId=_arg_screenId req._pixelFormat=_arg_pixelFormat req._VRAM=_arg_VRAM req._bitsPerPixel=_arg_bitsPerPixel req._bytesPerLine=_arg_bytesPerLine req._width=_arg_width req._height=_arg_height val=self.mgr.getPort().IFramebuffer_requestResize(req) return Boolean(self.mgr,val._returnval) def videoModeSupported(self, _arg_width, _arg_height, _arg_bpp): req=IFramebuffer_videoModeSupportedRequestMsg() req._this=self.handle req._width=_arg_width req._height=_arg_height req._bpp=_arg_bpp val=self.mgr.getPort().IFramebuffer_videoModeSupported(req) return Boolean(self.mgr,val._returnval) def getVisibleRegion(self, _arg_rectangles, _arg_count): req=IFramebuffer_getVisibleRegionRequestMsg() req._this=self.handle req._rectangles=_arg_rectangles req._count=_arg_count val=self.mgr.getPort().IFramebuffer_getVisibleRegion(req) return UnsignedInt(self.mgr,val._returnval) def setVisibleRegion(self, _arg_rectangles, _arg_count): req=IFramebuffer_setVisibleRegionRequestMsg() req._this=self.handle req._rectangles=_arg_rectangles req._count=_arg_count val=self.mgr.getPort().IFramebuffer_setVisibleRegion(req) return def processVHWACommand(self, _arg_command): req=IFramebuffer_processVHWACommandRequestMsg() req._this=self.handle req._command=_arg_command val=self.mgr.getPort().IFramebuffer_processVHWACommand(req) return def notify3DEvent(self, _arg_type, _arg_data): req=IFramebuffer_notify3DEventRequestMsg() req._this=self.handle req._type=_arg_type req._data=_arg_data val=self.mgr.getPort().IFramebuffer_notify3DEvent(req) return def getAddress(self): req=IFramebuffer_getAddressRequestMsg() req._this=self.handle val=self.mgr.getPort().IFramebuffer_getAddress(req) return Octet(self.mgr,val._returnval) def getWidth(self): req=IFramebuffer_getWidthRequestMsg() req._this=self.handle val=self.mgr.getPort().IFramebuffer_getWidth(req) return UnsignedInt(self.mgr,val._returnval) def getHeight(self): req=IFramebuffer_getHeightRequestMsg() req._this=self.handle val=self.mgr.getPort().IFramebuffer_getHeight(req) return UnsignedInt(self.mgr,val._returnval) def getBitsPerPixel(self): req=IFramebuffer_getBitsPerPixelRequestMsg() req._this=self.handle val=self.mgr.getPort().IFramebuffer_getBitsPerPixel(req) return UnsignedInt(self.mgr,val._returnval) def getBytesPerLine(self): req=IFramebuffer_getBytesPerLineRequestMsg() req._this=self.handle val=self.mgr.getPort().IFramebuffer_getBytesPerLine(req) return UnsignedInt(self.mgr,val._returnval) def getPixelFormat(self): req=IFramebuffer_getPixelFormatRequestMsg() req._this=self.handle val=self.mgr.getPort().IFramebuffer_getPixelFormat(req) return UnsignedInt(self.mgr,val._returnval) def getUsesGuestVRAM(self): req=IFramebuffer_getUsesGuestVRAMRequestMsg() req._this=self.handle val=self.mgr.getPort().IFramebuffer_getUsesGuestVRAM(req) return Boolean(self.mgr,val._returnval) def getHeightReduction(self): req=IFramebuffer_getHeightReductionRequestMsg() req._this=self.handle val=self.mgr.getPort().IFramebuffer_getHeightReduction(req) return UnsignedInt(self.mgr,val._returnval) def getOverlay(self): req=IFramebuffer_getOverlayRequestMsg() req._this=self.handle val=self.mgr.getPort().IFramebuffer_getOverlay(req) return IFramebufferOverlay(self.mgr,val._returnval) def getWinId(self): req=IFramebuffer_getWinIdRequestMsg() req._this=self.handle val=self.mgr.getPort().IFramebuffer_getWinId(req) return Long(self.mgr,val._returnval) _Attrs_={ 'address':[getAddress,None], 'width':[getWidth,None], 'height':[getHeight,None], 'bitsPerPixel':[getBitsPerPixel,None], 'bytesPerLine':[getBytesPerLine,None], 'pixelFormat':[getPixelFormat,None], 'usesGuestVRAM':[getUsesGuestVRAM,None], 'heightReduction':[getHeightReduction,None], 'overlay':[getOverlay,None], 'winId':[getWinId,None]} class IFramebufferOverlay(IFramebuffer): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IFramebufferOverlay(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IFramebufferOverlay._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IFramebuffer.__getattr__(self, name) def __setattr__(self, name, val): hndl = IFramebufferOverlay._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def move(self, _arg_x, _arg_y): req=IFramebufferOverlay_moveRequestMsg() req._this=self.handle req._x=_arg_x req._y=_arg_y val=self.mgr.getPort().IFramebufferOverlay_move(req) return def getX(self): req=IFramebufferOverlay_getXRequestMsg() req._this=self.handle val=self.mgr.getPort().IFramebufferOverlay_getX(req) return UnsignedInt(self.mgr,val._returnval) def getY(self): req=IFramebufferOverlay_getYRequestMsg() req._this=self.handle val=self.mgr.getPort().IFramebufferOverlay_getY(req) return UnsignedInt(self.mgr,val._returnval) def getVisible(self): req=IFramebufferOverlay_getVisibleRequestMsg() req._this=self.handle val=self.mgr.getPort().IFramebufferOverlay_getVisible(req) return Boolean(self.mgr,val._returnval) def setVisible(self, value): req=IFramebufferOverlay_setVisibleRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._visible = value else: req._visible = value.handle self.mgr.getPort().IFramebufferOverlay_setVisible(req) def getAlpha(self): req=IFramebufferOverlay_getAlphaRequestMsg() req._this=self.handle val=self.mgr.getPort().IFramebufferOverlay_getAlpha(req) return UnsignedInt(self.mgr,val._returnval) def setAlpha(self, value): req=IFramebufferOverlay_setAlphaRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._alpha = value else: req._alpha = value.handle self.mgr.getPort().IFramebufferOverlay_setAlpha(req) _Attrs_={ 'x':[getX,None], 'y':[getY,None], 'visible':[getVisible,setVisible, ], 'alpha':[getAlpha,setAlpha, ]} class IDisplay(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IDisplay(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IDisplay._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IDisplay._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getScreenResolution(self, _arg_screenId): req=IDisplay_getScreenResolutionRequestMsg() req._this=self.handle req._screenId=_arg_screenId val=self.mgr.getPort().IDisplay_getScreenResolution(req) return UnsignedInt(self.mgr,val._width), UnsignedInt(self.mgr,val._height), UnsignedInt(self.mgr,val._bitsPerPixel), Int(self.mgr,val._xOrigin), Int(self.mgr,val._yOrigin) def setFramebuffer(self, _arg_screenId, _arg_framebuffer): req=IDisplay_setFramebufferRequestMsg() req._this=self.handle req._screenId=_arg_screenId req._framebuffer=_arg_framebuffer val=self.mgr.getPort().IDisplay_setFramebuffer(req) return def getFramebuffer(self, _arg_screenId): req=IDisplay_getFramebufferRequestMsg() req._this=self.handle req._screenId=_arg_screenId val=self.mgr.getPort().IDisplay_getFramebuffer(req) return IFramebuffer(self.mgr,val._framebuffer), Int(self.mgr,val._xOrigin), Int(self.mgr,val._yOrigin) def setVideoModeHint(self, _arg_display, _arg_enabled, _arg_changeOrigin, _arg_originX, _arg_originY, _arg_width, _arg_height, _arg_bitsPerPixel): req=IDisplay_setVideoModeHintRequestMsg() req._this=self.handle req._display=_arg_display req._enabled=_arg_enabled req._changeOrigin=_arg_changeOrigin req._originX=_arg_originX req._originY=_arg_originY req._width=_arg_width req._height=_arg_height req._bitsPerPixel=_arg_bitsPerPixel val=self.mgr.getPort().IDisplay_setVideoModeHint(req) return def setSeamlessMode(self, _arg_enabled): req=IDisplay_setSeamlessModeRequestMsg() req._this=self.handle req._enabled=_arg_enabled val=self.mgr.getPort().IDisplay_setSeamlessMode(req) return def takeScreenShot(self, _arg_screenId, _arg_address, _arg_width, _arg_height): req=IDisplay_takeScreenShotRequestMsg() req._this=self.handle req._screenId=_arg_screenId req._address=_arg_address req._width=_arg_width req._height=_arg_height val=self.mgr.getPort().IDisplay_takeScreenShot(req) return def takeScreenShotToArray(self, _arg_screenId, _arg_width, _arg_height): req=IDisplay_takeScreenShotToArrayRequestMsg() req._this=self.handle req._screenId=_arg_screenId req._width=_arg_width req._height=_arg_height val=self.mgr.getPort().IDisplay_takeScreenShotToArray(req) return self.mgr.decodebase64(val._returnval) def takeScreenShotPNGToArray(self, _arg_screenId, _arg_width, _arg_height): req=IDisplay_takeScreenShotPNGToArrayRequestMsg() req._this=self.handle req._screenId=_arg_screenId req._width=_arg_width req._height=_arg_height val=self.mgr.getPort().IDisplay_takeScreenShotPNGToArray(req) return self.mgr.decodebase64(val._returnval) def drawToScreen(self, _arg_screenId, _arg_address, _arg_x, _arg_y, _arg_width, _arg_height): req=IDisplay_drawToScreenRequestMsg() req._this=self.handle req._screenId=_arg_screenId req._address=_arg_address req._x=_arg_x req._y=_arg_y req._width=_arg_width req._height=_arg_height val=self.mgr.getPort().IDisplay_drawToScreen(req) return def invalidateAndUpdate(self): req=IDisplay_invalidateAndUpdateRequestMsg() req._this=self.handle val=self.mgr.getPort().IDisplay_invalidateAndUpdate(req) return def resizeCompleted(self, _arg_screenId): req=IDisplay_resizeCompletedRequestMsg() req._this=self.handle req._screenId=_arg_screenId val=self.mgr.getPort().IDisplay_resizeCompleted(req) return def completeVHWACommand(self, _arg_command): req=IDisplay_completeVHWACommandRequestMsg() req._this=self.handle req._command=_arg_command val=self.mgr.getPort().IDisplay_completeVHWACommand(req) return def viewportChanged(self, _arg_screenId, _arg_x, _arg_y, _arg_width, _arg_height): req=IDisplay_viewportChangedRequestMsg() req._this=self.handle req._screenId=_arg_screenId req._x=_arg_x req._y=_arg_y req._width=_arg_width req._height=_arg_height val=self.mgr.getPort().IDisplay_viewportChanged(req) return _Attrs_={} class INetworkAdapter(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return INetworkAdapter(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = INetworkAdapter._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = INetworkAdapter._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getProperty(self, _arg_key): req=INetworkAdapter_getPropertyRequestMsg() req._this=self.handle req._key=_arg_key val=self.mgr.getPort().INetworkAdapter_getProperty(req) return String(self.mgr,val._returnval) def setProperty(self, _arg_key, _arg_value): req=INetworkAdapter_setPropertyRequestMsg() req._this=self.handle req._key=_arg_key req._value=_arg_value val=self.mgr.getPort().INetworkAdapter_setProperty(req) return def getProperties(self, _arg_names): req=INetworkAdapter_getPropertiesRequestMsg() req._this=self.handle req._names=_arg_names val=self.mgr.getPort().INetworkAdapter_getProperties(req) return String(self.mgr,val._returnval, True), String(self.mgr,val._returnNames, True) def getAdapterType(self): req=INetworkAdapter_getAdapterTypeRequestMsg() req._this=self.handle val=self.mgr.getPort().INetworkAdapter_getAdapterType(req) return NetworkAdapterType(self.mgr,val._returnval) def setAdapterType(self, value): req=INetworkAdapter_setAdapterTypeRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._adapterType = value else: req._adapterType = value.handle self.mgr.getPort().INetworkAdapter_setAdapterType(req) def getSlot(self): req=INetworkAdapter_getSlotRequestMsg() req._this=self.handle val=self.mgr.getPort().INetworkAdapter_getSlot(req) return UnsignedInt(self.mgr,val._returnval) def getEnabled(self): req=INetworkAdapter_getEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().INetworkAdapter_getEnabled(req) return Boolean(self.mgr,val._returnval) def setEnabled(self, value): req=INetworkAdapter_setEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._enabled = value else: req._enabled = value.handle self.mgr.getPort().INetworkAdapter_setEnabled(req) def getMACAddress(self): req=INetworkAdapter_getMACAddressRequestMsg() req._this=self.handle val=self.mgr.getPort().INetworkAdapter_getMACAddress(req) return String(self.mgr,val._returnval) def setMACAddress(self, value): req=INetworkAdapter_setMACAddressRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._MACAddress = value else: req._MACAddress = value.handle self.mgr.getPort().INetworkAdapter_setMACAddress(req) def getAttachmentType(self): req=INetworkAdapter_getAttachmentTypeRequestMsg() req._this=self.handle val=self.mgr.getPort().INetworkAdapter_getAttachmentType(req) return NetworkAttachmentType(self.mgr,val._returnval) def setAttachmentType(self, value): req=INetworkAdapter_setAttachmentTypeRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._attachmentType = value else: req._attachmentType = value.handle self.mgr.getPort().INetworkAdapter_setAttachmentType(req) def getBridgedInterface(self): req=INetworkAdapter_getBridgedInterfaceRequestMsg() req._this=self.handle val=self.mgr.getPort().INetworkAdapter_getBridgedInterface(req) return String(self.mgr,val._returnval) def setBridgedInterface(self, value): req=INetworkAdapter_setBridgedInterfaceRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._bridgedInterface = value else: req._bridgedInterface = value.handle self.mgr.getPort().INetworkAdapter_setBridgedInterface(req) def getHostOnlyInterface(self): req=INetworkAdapter_getHostOnlyInterfaceRequestMsg() req._this=self.handle val=self.mgr.getPort().INetworkAdapter_getHostOnlyInterface(req) return String(self.mgr,val._returnval) def setHostOnlyInterface(self, value): req=INetworkAdapter_setHostOnlyInterfaceRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._hostOnlyInterface = value else: req._hostOnlyInterface = value.handle self.mgr.getPort().INetworkAdapter_setHostOnlyInterface(req) def getInternalNetwork(self): req=INetworkAdapter_getInternalNetworkRequestMsg() req._this=self.handle val=self.mgr.getPort().INetworkAdapter_getInternalNetwork(req) return String(self.mgr,val._returnval) def setInternalNetwork(self, value): req=INetworkAdapter_setInternalNetworkRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._internalNetwork = value else: req._internalNetwork = value.handle self.mgr.getPort().INetworkAdapter_setInternalNetwork(req) def getNATNetwork(self): req=INetworkAdapter_getNATNetworkRequestMsg() req._this=self.handle val=self.mgr.getPort().INetworkAdapter_getNATNetwork(req) return String(self.mgr,val._returnval) def setNATNetwork(self, value): req=INetworkAdapter_setNATNetworkRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._NATNetwork = value else: req._NATNetwork = value.handle self.mgr.getPort().INetworkAdapter_setNATNetwork(req) def getGenericDriver(self): req=INetworkAdapter_getGenericDriverRequestMsg() req._this=self.handle val=self.mgr.getPort().INetworkAdapter_getGenericDriver(req) return String(self.mgr,val._returnval) def setGenericDriver(self, value): req=INetworkAdapter_setGenericDriverRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._genericDriver = value else: req._genericDriver = value.handle self.mgr.getPort().INetworkAdapter_setGenericDriver(req) def getCableConnected(self): req=INetworkAdapter_getCableConnectedRequestMsg() req._this=self.handle val=self.mgr.getPort().INetworkAdapter_getCableConnected(req) return Boolean(self.mgr,val._returnval) def setCableConnected(self, value): req=INetworkAdapter_setCableConnectedRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._cableConnected = value else: req._cableConnected = value.handle self.mgr.getPort().INetworkAdapter_setCableConnected(req) def getLineSpeed(self): req=INetworkAdapter_getLineSpeedRequestMsg() req._this=self.handle val=self.mgr.getPort().INetworkAdapter_getLineSpeed(req) return UnsignedInt(self.mgr,val._returnval) def setLineSpeed(self, value): req=INetworkAdapter_setLineSpeedRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._lineSpeed = value else: req._lineSpeed = value.handle self.mgr.getPort().INetworkAdapter_setLineSpeed(req) def getPromiscModePolicy(self): req=INetworkAdapter_getPromiscModePolicyRequestMsg() req._this=self.handle val=self.mgr.getPort().INetworkAdapter_getPromiscModePolicy(req) return NetworkAdapterPromiscModePolicy(self.mgr,val._returnval) def setPromiscModePolicy(self, value): req=INetworkAdapter_setPromiscModePolicyRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._promiscModePolicy = value else: req._promiscModePolicy = value.handle self.mgr.getPort().INetworkAdapter_setPromiscModePolicy(req) def getTraceEnabled(self): req=INetworkAdapter_getTraceEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().INetworkAdapter_getTraceEnabled(req) return Boolean(self.mgr,val._returnval) def setTraceEnabled(self, value): req=INetworkAdapter_setTraceEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._traceEnabled = value else: req._traceEnabled = value.handle self.mgr.getPort().INetworkAdapter_setTraceEnabled(req) def getTraceFile(self): req=INetworkAdapter_getTraceFileRequestMsg() req._this=self.handle val=self.mgr.getPort().INetworkAdapter_getTraceFile(req) return String(self.mgr,val._returnval) def setTraceFile(self, value): req=INetworkAdapter_setTraceFileRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._traceFile = value else: req._traceFile = value.handle self.mgr.getPort().INetworkAdapter_setTraceFile(req) def getNATEngine(self): req=INetworkAdapter_getNATEngineRequestMsg() req._this=self.handle val=self.mgr.getPort().INetworkAdapter_getNATEngine(req) return INATEngine(self.mgr,val._returnval) def getBootPriority(self): req=INetworkAdapter_getBootPriorityRequestMsg() req._this=self.handle val=self.mgr.getPort().INetworkAdapter_getBootPriority(req) return UnsignedInt(self.mgr,val._returnval) def setBootPriority(self, value): req=INetworkAdapter_setBootPriorityRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._bootPriority = value else: req._bootPriority = value.handle self.mgr.getPort().INetworkAdapter_setBootPriority(req) def getBandwidthGroup(self): req=INetworkAdapter_getBandwidthGroupRequestMsg() req._this=self.handle val=self.mgr.getPort().INetworkAdapter_getBandwidthGroup(req) return IBandwidthGroup(self.mgr,val._returnval) def setBandwidthGroup(self, value): req=INetworkAdapter_setBandwidthGroupRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._bandwidthGroup = value else: req._bandwidthGroup = value.handle self.mgr.getPort().INetworkAdapter_setBandwidthGroup(req) _Attrs_={ 'adapterType':[getAdapterType,setAdapterType, ], 'slot':[getSlot,None], 'enabled':[getEnabled,setEnabled, ], 'MACAddress':[getMACAddress,setMACAddress, ], 'attachmentType':[getAttachmentType,setAttachmentType, ], 'bridgedInterface':[getBridgedInterface,setBridgedInterface, ], 'hostOnlyInterface':[getHostOnlyInterface,setHostOnlyInterface, ], 'internalNetwork':[getInternalNetwork,setInternalNetwork, ], 'NATNetwork':[getNATNetwork,setNATNetwork, ], 'genericDriver':[getGenericDriver,setGenericDriver, ], 'cableConnected':[getCableConnected,setCableConnected, ], 'lineSpeed':[getLineSpeed,setLineSpeed, ], 'promiscModePolicy':[getPromiscModePolicy,setPromiscModePolicy, ], 'traceEnabled':[getTraceEnabled,setTraceEnabled, ], 'traceFile':[getTraceFile,setTraceFile, ], 'NATEngine':[getNATEngine,None], 'bootPriority':[getBootPriority,setBootPriority, ], 'bandwidthGroup':[getBandwidthGroup,setBandwidthGroup, ]} class ISerialPort(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return ISerialPort(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = ISerialPort._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = ISerialPort._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getSlot(self): req=ISerialPort_getSlotRequestMsg() req._this=self.handle val=self.mgr.getPort().ISerialPort_getSlot(req) return UnsignedInt(self.mgr,val._returnval) def getEnabled(self): req=ISerialPort_getEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().ISerialPort_getEnabled(req) return Boolean(self.mgr,val._returnval) def setEnabled(self, value): req=ISerialPort_setEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._enabled = value else: req._enabled = value.handle self.mgr.getPort().ISerialPort_setEnabled(req) def getIOBase(self): req=ISerialPort_getIOBaseRequestMsg() req._this=self.handle val=self.mgr.getPort().ISerialPort_getIOBase(req) return UnsignedInt(self.mgr,val._returnval) def setIOBase(self, value): req=ISerialPort_setIOBaseRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._IOBase = value else: req._IOBase = value.handle self.mgr.getPort().ISerialPort_setIOBase(req) def getIRQ(self): req=ISerialPort_getIRQRequestMsg() req._this=self.handle val=self.mgr.getPort().ISerialPort_getIRQ(req) return UnsignedInt(self.mgr,val._returnval) def setIRQ(self, value): req=ISerialPort_setIRQRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._IRQ = value else: req._IRQ = value.handle self.mgr.getPort().ISerialPort_setIRQ(req) def getHostMode(self): req=ISerialPort_getHostModeRequestMsg() req._this=self.handle val=self.mgr.getPort().ISerialPort_getHostMode(req) return PortMode(self.mgr,val._returnval) def setHostMode(self, value): req=ISerialPort_setHostModeRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._hostMode = value else: req._hostMode = value.handle self.mgr.getPort().ISerialPort_setHostMode(req) def getServer(self): req=ISerialPort_getServerRequestMsg() req._this=self.handle val=self.mgr.getPort().ISerialPort_getServer(req) return Boolean(self.mgr,val._returnval) def setServer(self, value): req=ISerialPort_setServerRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._server = value else: req._server = value.handle self.mgr.getPort().ISerialPort_setServer(req) def getPath(self): req=ISerialPort_getPathRequestMsg() req._this=self.handle val=self.mgr.getPort().ISerialPort_getPath(req) return String(self.mgr,val._returnval) def setPath(self, value): req=ISerialPort_setPathRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._path = value else: req._path = value.handle self.mgr.getPort().ISerialPort_setPath(req) _Attrs_={ 'slot':[getSlot,None], 'enabled':[getEnabled,setEnabled, ], 'IOBase':[getIOBase,setIOBase, ], 'IRQ':[getIRQ,setIRQ, ], 'hostMode':[getHostMode,setHostMode, ], 'server':[getServer,setServer, ], 'path':[getPath,setPath, ]} class IParallelPort(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IParallelPort(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IParallelPort._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IParallelPort._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getSlot(self): req=IParallelPort_getSlotRequestMsg() req._this=self.handle val=self.mgr.getPort().IParallelPort_getSlot(req) return UnsignedInt(self.mgr,val._returnval) def getEnabled(self): req=IParallelPort_getEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IParallelPort_getEnabled(req) return Boolean(self.mgr,val._returnval) def setEnabled(self, value): req=IParallelPort_setEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._enabled = value else: req._enabled = value.handle self.mgr.getPort().IParallelPort_setEnabled(req) def getIOBase(self): req=IParallelPort_getIOBaseRequestMsg() req._this=self.handle val=self.mgr.getPort().IParallelPort_getIOBase(req) return UnsignedInt(self.mgr,val._returnval) def setIOBase(self, value): req=IParallelPort_setIOBaseRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._IOBase = value else: req._IOBase = value.handle self.mgr.getPort().IParallelPort_setIOBase(req) def getIRQ(self): req=IParallelPort_getIRQRequestMsg() req._this=self.handle val=self.mgr.getPort().IParallelPort_getIRQ(req) return UnsignedInt(self.mgr,val._returnval) def setIRQ(self, value): req=IParallelPort_setIRQRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._IRQ = value else: req._IRQ = value.handle self.mgr.getPort().IParallelPort_setIRQ(req) def getPath(self): req=IParallelPort_getPathRequestMsg() req._this=self.handle val=self.mgr.getPort().IParallelPort_getPath(req) return String(self.mgr,val._returnval) def setPath(self, value): req=IParallelPort_setPathRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._path = value else: req._path = value.handle self.mgr.getPort().IParallelPort_setPath(req) _Attrs_={ 'slot':[getSlot,None], 'enabled':[getEnabled,setEnabled, ], 'IOBase':[getIOBase,setIOBase, ], 'IRQ':[getIRQ,setIRQ, ], 'path':[getPath,setPath, ]} class IMachineDebugger(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IMachineDebugger(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IMachineDebugger._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IMachineDebugger._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def dumpGuestCore(self, _arg_filename, _arg_compression): req=IMachineDebugger_dumpGuestCoreRequestMsg() req._this=self.handle req._filename=_arg_filename req._compression=_arg_compression val=self.mgr.getPort().IMachineDebugger_dumpGuestCore(req) return def dumpHostProcessCore(self, _arg_filename, _arg_compression): req=IMachineDebugger_dumpHostProcessCoreRequestMsg() req._this=self.handle req._filename=_arg_filename req._compression=_arg_compression val=self.mgr.getPort().IMachineDebugger_dumpHostProcessCore(req) return def info(self, _arg_name, _arg_args): req=IMachineDebugger_infoRequestMsg() req._this=self.handle req._name=_arg_name req._args=_arg_args val=self.mgr.getPort().IMachineDebugger_info(req) return String(self.mgr,val._returnval) def injectNMI(self): req=IMachineDebugger_injectNMIRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineDebugger_injectNMI(req) return def modifyLogGroups(self, _arg_settings): req=IMachineDebugger_modifyLogGroupsRequestMsg() req._this=self.handle req._settings=_arg_settings val=self.mgr.getPort().IMachineDebugger_modifyLogGroups(req) return def modifyLogFlags(self, _arg_settings): req=IMachineDebugger_modifyLogFlagsRequestMsg() req._this=self.handle req._settings=_arg_settings val=self.mgr.getPort().IMachineDebugger_modifyLogFlags(req) return def modifyLogDestinations(self, _arg_settings): req=IMachineDebugger_modifyLogDestinationsRequestMsg() req._this=self.handle req._settings=_arg_settings val=self.mgr.getPort().IMachineDebugger_modifyLogDestinations(req) return def readPhysicalMemory(self, _arg_address, _arg_size): req=IMachineDebugger_readPhysicalMemoryRequestMsg() req._this=self.handle req._address=_arg_address req._size=_arg_size val=self.mgr.getPort().IMachineDebugger_readPhysicalMemory(req) return self.mgr.decodebase64(val._returnval) def writePhysicalMemory(self, _arg_address, _arg_size, _arg_bytes): req=IMachineDebugger_writePhysicalMemoryRequestMsg() req._this=self.handle req._address=_arg_address req._size=_arg_size req._bytes=self.mgr.encodebase64(_arg_bytes) val=self.mgr.getPort().IMachineDebugger_writePhysicalMemory(req) return def readVirtualMemory(self, _arg_cpuId, _arg_address, _arg_size): req=IMachineDebugger_readVirtualMemoryRequestMsg() req._this=self.handle req._cpuId=_arg_cpuId req._address=_arg_address req._size=_arg_size val=self.mgr.getPort().IMachineDebugger_readVirtualMemory(req) return self.mgr.decodebase64(val._returnval) def writeVirtualMemory(self, _arg_cpuId, _arg_address, _arg_size, _arg_bytes): req=IMachineDebugger_writeVirtualMemoryRequestMsg() req._this=self.handle req._cpuId=_arg_cpuId req._address=_arg_address req._size=_arg_size req._bytes=self.mgr.encodebase64(_arg_bytes) val=self.mgr.getPort().IMachineDebugger_writeVirtualMemory(req) return def detectOS(self): req=IMachineDebugger_detectOSRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineDebugger_detectOS(req) return String(self.mgr,val._returnval) def getRegister(self, _arg_cpuId, _arg_name): req=IMachineDebugger_getRegisterRequestMsg() req._this=self.handle req._cpuId=_arg_cpuId req._name=_arg_name val=self.mgr.getPort().IMachineDebugger_getRegister(req) return String(self.mgr,val._returnval) def getRegisters(self, _arg_cpuId): req=IMachineDebugger_getRegistersRequestMsg() req._this=self.handle req._cpuId=_arg_cpuId val=self.mgr.getPort().IMachineDebugger_getRegisters(req) return String(self.mgr,val._names, True), String(self.mgr,val._values, True) def setRegister(self, _arg_cpuId, _arg_name, _arg_value): req=IMachineDebugger_setRegisterRequestMsg() req._this=self.handle req._cpuId=_arg_cpuId req._name=_arg_name req._value=_arg_value val=self.mgr.getPort().IMachineDebugger_setRegister(req) return def setRegisters(self, _arg_cpuId, _arg_names, _arg_values): req=IMachineDebugger_setRegistersRequestMsg() req._this=self.handle req._cpuId=_arg_cpuId req._names=_arg_names req._values=_arg_values val=self.mgr.getPort().IMachineDebugger_setRegisters(req) return def dumpGuestStack(self, _arg_cpuId): req=IMachineDebugger_dumpGuestStackRequestMsg() req._this=self.handle req._cpuId=_arg_cpuId val=self.mgr.getPort().IMachineDebugger_dumpGuestStack(req) return String(self.mgr,val._returnval) def resetStats(self, _arg_pattern): req=IMachineDebugger_resetStatsRequestMsg() req._this=self.handle req._pattern=_arg_pattern val=self.mgr.getPort().IMachineDebugger_resetStats(req) return def dumpStats(self, _arg_pattern): req=IMachineDebugger_dumpStatsRequestMsg() req._this=self.handle req._pattern=_arg_pattern val=self.mgr.getPort().IMachineDebugger_dumpStats(req) return def getStats(self, _arg_pattern, _arg_withDescriptions): req=IMachineDebugger_getStatsRequestMsg() req._this=self.handle req._pattern=_arg_pattern req._withDescriptions=_arg_withDescriptions val=self.mgr.getPort().IMachineDebugger_getStats(req) return String(self.mgr,val._returnval) def getSingleStep(self): req=IMachineDebugger_getSingleStepRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineDebugger_getSingleStep(req) return Boolean(self.mgr,val._returnval) def setSingleStep(self, value): req=IMachineDebugger_setSingleStepRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._singleStep = value else: req._singleStep = value.handle self.mgr.getPort().IMachineDebugger_setSingleStep(req) def getRecompileUser(self): req=IMachineDebugger_getRecompileUserRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineDebugger_getRecompileUser(req) return Boolean(self.mgr,val._returnval) def setRecompileUser(self, value): req=IMachineDebugger_setRecompileUserRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._recompileUser = value else: req._recompileUser = value.handle self.mgr.getPort().IMachineDebugger_setRecompileUser(req) def getRecompileSupervisor(self): req=IMachineDebugger_getRecompileSupervisorRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineDebugger_getRecompileSupervisor(req) return Boolean(self.mgr,val._returnval) def setRecompileSupervisor(self, value): req=IMachineDebugger_setRecompileSupervisorRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._recompileSupervisor = value else: req._recompileSupervisor = value.handle self.mgr.getPort().IMachineDebugger_setRecompileSupervisor(req) def getExecuteAllInIEM(self): req=IMachineDebugger_getExecuteAllInIEMRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineDebugger_getExecuteAllInIEM(req) return Boolean(self.mgr,val._returnval) def setExecuteAllInIEM(self, value): req=IMachineDebugger_setExecuteAllInIEMRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._executeAllInIEM = value else: req._executeAllInIEM = value.handle self.mgr.getPort().IMachineDebugger_setExecuteAllInIEM(req) def getPATMEnabled(self): req=IMachineDebugger_getPATMEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineDebugger_getPATMEnabled(req) return Boolean(self.mgr,val._returnval) def setPATMEnabled(self, value): req=IMachineDebugger_setPATMEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._PATMEnabled = value else: req._PATMEnabled = value.handle self.mgr.getPort().IMachineDebugger_setPATMEnabled(req) def getCSAMEnabled(self): req=IMachineDebugger_getCSAMEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineDebugger_getCSAMEnabled(req) return Boolean(self.mgr,val._returnval) def setCSAMEnabled(self, value): req=IMachineDebugger_setCSAMEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._CSAMEnabled = value else: req._CSAMEnabled = value.handle self.mgr.getPort().IMachineDebugger_setCSAMEnabled(req) def getLogEnabled(self): req=IMachineDebugger_getLogEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineDebugger_getLogEnabled(req) return Boolean(self.mgr,val._returnval) def setLogEnabled(self, value): req=IMachineDebugger_setLogEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._logEnabled = value else: req._logEnabled = value.handle self.mgr.getPort().IMachineDebugger_setLogEnabled(req) def getLogDbgFlags(self): req=IMachineDebugger_getLogDbgFlagsRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineDebugger_getLogDbgFlags(req) return String(self.mgr,val._returnval) def getLogDbgGroups(self): req=IMachineDebugger_getLogDbgGroupsRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineDebugger_getLogDbgGroups(req) return String(self.mgr,val._returnval) def getLogDbgDestinations(self): req=IMachineDebugger_getLogDbgDestinationsRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineDebugger_getLogDbgDestinations(req) return String(self.mgr,val._returnval) def getLogRelFlags(self): req=IMachineDebugger_getLogRelFlagsRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineDebugger_getLogRelFlags(req) return String(self.mgr,val._returnval) def getLogRelGroups(self): req=IMachineDebugger_getLogRelGroupsRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineDebugger_getLogRelGroups(req) return String(self.mgr,val._returnval) def getLogRelDestinations(self): req=IMachineDebugger_getLogRelDestinationsRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineDebugger_getLogRelDestinations(req) return String(self.mgr,val._returnval) def getHWVirtExEnabled(self): req=IMachineDebugger_getHWVirtExEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineDebugger_getHWVirtExEnabled(req) return Boolean(self.mgr,val._returnval) def getHWVirtExNestedPagingEnabled(self): req=IMachineDebugger_getHWVirtExNestedPagingEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineDebugger_getHWVirtExNestedPagingEnabled(req) return Boolean(self.mgr,val._returnval) def getHWVirtExVPIDEnabled(self): req=IMachineDebugger_getHWVirtExVPIDEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineDebugger_getHWVirtExVPIDEnabled(req) return Boolean(self.mgr,val._returnval) def getHWVirtExUXEnabled(self): req=IMachineDebugger_getHWVirtExUXEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineDebugger_getHWVirtExUXEnabled(req) return Boolean(self.mgr,val._returnval) def getOSName(self): req=IMachineDebugger_getOSNameRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineDebugger_getOSName(req) return String(self.mgr,val._returnval) def getOSVersion(self): req=IMachineDebugger_getOSVersionRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineDebugger_getOSVersion(req) return String(self.mgr,val._returnval) def getPAEEnabled(self): req=IMachineDebugger_getPAEEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineDebugger_getPAEEnabled(req) return Boolean(self.mgr,val._returnval) def getVirtualTimeRate(self): req=IMachineDebugger_getVirtualTimeRateRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineDebugger_getVirtualTimeRate(req) return UnsignedInt(self.mgr,val._returnval) def setVirtualTimeRate(self, value): req=IMachineDebugger_setVirtualTimeRateRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._virtualTimeRate = value else: req._virtualTimeRate = value.handle self.mgr.getPort().IMachineDebugger_setVirtualTimeRate(req) def getVM(self): req=IMachineDebugger_getVMRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineDebugger_getVM(req) return Long(self.mgr,val._returnval) _Attrs_={ 'singleStep':[getSingleStep,setSingleStep, ], 'recompileUser':[getRecompileUser,setRecompileUser, ], 'recompileSupervisor':[getRecompileSupervisor,setRecompileSupervisor, ], 'executeAllInIEM':[getExecuteAllInIEM,setExecuteAllInIEM, ], 'PATMEnabled':[getPATMEnabled,setPATMEnabled, ], 'CSAMEnabled':[getCSAMEnabled,setCSAMEnabled, ], 'logEnabled':[getLogEnabled,setLogEnabled, ], 'logDbgFlags':[getLogDbgFlags,None], 'logDbgGroups':[getLogDbgGroups,None], 'logDbgDestinations':[getLogDbgDestinations,None], 'logRelFlags':[getLogRelFlags,None], 'logRelGroups':[getLogRelGroups,None], 'logRelDestinations':[getLogRelDestinations,None], 'HWVirtExEnabled':[getHWVirtExEnabled,None], 'HWVirtExNestedPagingEnabled':[getHWVirtExNestedPagingEnabled,None], 'HWVirtExVPIDEnabled':[getHWVirtExVPIDEnabled,None], 'HWVirtExUXEnabled':[getHWVirtExUXEnabled,None], 'OSName':[getOSName,None], 'OSVersion':[getOSVersion,None], 'PAEEnabled':[getPAEEnabled,None], 'virtualTimeRate':[getVirtualTimeRate,setVirtualTimeRate, ], 'VM':[getVM,None]} class IUSBDeviceFilters(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IUSBDeviceFilters(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IUSBDeviceFilters._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IUSBDeviceFilters._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def createDeviceFilter(self, _arg_name): req=IUSBDeviceFilters_createDeviceFilterRequestMsg() req._this=self.handle req._name=_arg_name val=self.mgr.getPort().IUSBDeviceFilters_createDeviceFilter(req) return IUSBDeviceFilter(self.mgr,val._returnval) def insertDeviceFilter(self, _arg_position, _arg_filter): req=IUSBDeviceFilters_insertDeviceFilterRequestMsg() req._this=self.handle req._position=_arg_position req._filter=_arg_filter val=self.mgr.getPort().IUSBDeviceFilters_insertDeviceFilter(req) return def removeDeviceFilter(self, _arg_position): req=IUSBDeviceFilters_removeDeviceFilterRequestMsg() req._this=self.handle req._position=_arg_position val=self.mgr.getPort().IUSBDeviceFilters_removeDeviceFilter(req) return IUSBDeviceFilter(self.mgr,val._returnval) def getDeviceFilters(self): req=IUSBDeviceFilters_getDeviceFiltersRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDeviceFilters_getDeviceFilters(req) return IUSBDeviceFilter(self.mgr,val._returnval, True) _Attrs_={ 'deviceFilters':[getDeviceFilters,None]} class IUSBController(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IUSBController(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IUSBController._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IUSBController._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getName(self): req=IUSBController_getNameRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBController_getName(req) return String(self.mgr,val._returnval) def getType(self): req=IUSBController_getTypeRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBController_getType(req) return USBControllerType(self.mgr,val._returnval) def getUSBStandard(self): req=IUSBController_getUSBStandardRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBController_getUSBStandard(req) return UnsignedShort(self.mgr,val._returnval) _Attrs_={ 'name':[getName,None], 'type':[getType,None], 'USBStandard':[getUSBStandard,None]} class IUSBDevice(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IUSBDevice(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IUSBDevice._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IUSBDevice._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getId(self): req=IUSBDevice_getIdRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDevice_getId(req) return String(self.mgr,val._returnval) def getVendorId(self): req=IUSBDevice_getVendorIdRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDevice_getVendorId(req) return UnsignedShort(self.mgr,val._returnval) def getProductId(self): req=IUSBDevice_getProductIdRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDevice_getProductId(req) return UnsignedShort(self.mgr,val._returnval) def getRevision(self): req=IUSBDevice_getRevisionRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDevice_getRevision(req) return UnsignedShort(self.mgr,val._returnval) def getManufacturer(self): req=IUSBDevice_getManufacturerRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDevice_getManufacturer(req) return String(self.mgr,val._returnval) def getProduct(self): req=IUSBDevice_getProductRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDevice_getProduct(req) return String(self.mgr,val._returnval) def getSerialNumber(self): req=IUSBDevice_getSerialNumberRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDevice_getSerialNumber(req) return String(self.mgr,val._returnval) def getAddress(self): req=IUSBDevice_getAddressRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDevice_getAddress(req) return String(self.mgr,val._returnval) def getPort(self): req=IUSBDevice_getPortRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDevice_getPort(req) return UnsignedShort(self.mgr,val._returnval) def getVersion(self): req=IUSBDevice_getVersionRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDevice_getVersion(req) return UnsignedShort(self.mgr,val._returnval) def getPortVersion(self): req=IUSBDevice_getPortVersionRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDevice_getPortVersion(req) return UnsignedShort(self.mgr,val._returnval) def getRemote(self): req=IUSBDevice_getRemoteRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDevice_getRemote(req) return Boolean(self.mgr,val._returnval) _Attrs_={ 'id':[getId,None], 'vendorId':[getVendorId,None], 'productId':[getProductId,None], 'revision':[getRevision,None], 'manufacturer':[getManufacturer,None], 'product':[getProduct,None], 'serialNumber':[getSerialNumber,None], 'address':[getAddress,None], 'port':[getPort,None], 'version':[getVersion,None], 'portVersion':[getPortVersion,None], 'remote':[getRemote,None]} class IUSBDeviceFilter(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IUSBDeviceFilter(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IUSBDeviceFilter._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IUSBDeviceFilter._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getName(self): req=IUSBDeviceFilter_getNameRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDeviceFilter_getName(req) return String(self.mgr,val._returnval) def setName(self, value): req=IUSBDeviceFilter_setNameRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._name = value else: req._name = value.handle self.mgr.getPort().IUSBDeviceFilter_setName(req) def getActive(self): req=IUSBDeviceFilter_getActiveRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDeviceFilter_getActive(req) return Boolean(self.mgr,val._returnval) def setActive(self, value): req=IUSBDeviceFilter_setActiveRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._active = value else: req._active = value.handle self.mgr.getPort().IUSBDeviceFilter_setActive(req) def getVendorId(self): req=IUSBDeviceFilter_getVendorIdRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDeviceFilter_getVendorId(req) return String(self.mgr,val._returnval) def setVendorId(self, value): req=IUSBDeviceFilter_setVendorIdRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._vendorId = value else: req._vendorId = value.handle self.mgr.getPort().IUSBDeviceFilter_setVendorId(req) def getProductId(self): req=IUSBDeviceFilter_getProductIdRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDeviceFilter_getProductId(req) return String(self.mgr,val._returnval) def setProductId(self, value): req=IUSBDeviceFilter_setProductIdRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._productId = value else: req._productId = value.handle self.mgr.getPort().IUSBDeviceFilter_setProductId(req) def getRevision(self): req=IUSBDeviceFilter_getRevisionRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDeviceFilter_getRevision(req) return String(self.mgr,val._returnval) def setRevision(self, value): req=IUSBDeviceFilter_setRevisionRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._revision = value else: req._revision = value.handle self.mgr.getPort().IUSBDeviceFilter_setRevision(req) def getManufacturer(self): req=IUSBDeviceFilter_getManufacturerRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDeviceFilter_getManufacturer(req) return String(self.mgr,val._returnval) def setManufacturer(self, value): req=IUSBDeviceFilter_setManufacturerRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._manufacturer = value else: req._manufacturer = value.handle self.mgr.getPort().IUSBDeviceFilter_setManufacturer(req) def getProduct(self): req=IUSBDeviceFilter_getProductRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDeviceFilter_getProduct(req) return String(self.mgr,val._returnval) def setProduct(self, value): req=IUSBDeviceFilter_setProductRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._product = value else: req._product = value.handle self.mgr.getPort().IUSBDeviceFilter_setProduct(req) def getSerialNumber(self): req=IUSBDeviceFilter_getSerialNumberRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDeviceFilter_getSerialNumber(req) return String(self.mgr,val._returnval) def setSerialNumber(self, value): req=IUSBDeviceFilter_setSerialNumberRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._serialNumber = value else: req._serialNumber = value.handle self.mgr.getPort().IUSBDeviceFilter_setSerialNumber(req) def getPort(self): req=IUSBDeviceFilter_getPortRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDeviceFilter_getPort(req) return String(self.mgr,val._returnval) def setPort(self, value): req=IUSBDeviceFilter_setPortRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._port = value else: req._port = value.handle self.mgr.getPort().IUSBDeviceFilter_setPort(req) def getRemote(self): req=IUSBDeviceFilter_getRemoteRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDeviceFilter_getRemote(req) return String(self.mgr,val._returnval) def setRemote(self, value): req=IUSBDeviceFilter_setRemoteRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._remote = value else: req._remote = value.handle self.mgr.getPort().IUSBDeviceFilter_setRemote(req) def getMaskedInterfaces(self): req=IUSBDeviceFilter_getMaskedInterfacesRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDeviceFilter_getMaskedInterfaces(req) return UnsignedInt(self.mgr,val._returnval) def setMaskedInterfaces(self, value): req=IUSBDeviceFilter_setMaskedInterfacesRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._maskedInterfaces = value else: req._maskedInterfaces = value.handle self.mgr.getPort().IUSBDeviceFilter_setMaskedInterfaces(req) _Attrs_={ 'name':[getName,setName, ], 'active':[getActive,setActive, ], 'vendorId':[getVendorId,setVendorId, ], 'productId':[getProductId,setProductId, ], 'revision':[getRevision,setRevision, ], 'manufacturer':[getManufacturer,setManufacturer, ], 'product':[getProduct,setProduct, ], 'serialNumber':[getSerialNumber,setSerialNumber, ], 'port':[getPort,setPort, ], 'remote':[getRemote,setRemote, ], 'maskedInterfaces':[getMaskedInterfaces,setMaskedInterfaces, ]} class IHostUSBDevice(IUSBDevice): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IHostUSBDevice(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IHostUSBDevice._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUSBDevice.__getattr__(self, name) def __setattr__(self, name, val): hndl = IHostUSBDevice._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getState(self): req=IHostUSBDevice_getStateRequestMsg() req._this=self.handle val=self.mgr.getPort().IHostUSBDevice_getState(req) return USBDeviceState(self.mgr,val._returnval) _Attrs_={ 'state':[getState,None]} class IHostUSBDeviceFilter(IUSBDeviceFilter): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IHostUSBDeviceFilter(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IHostUSBDeviceFilter._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUSBDeviceFilter.__getattr__(self, name) def __setattr__(self, name, val): hndl = IHostUSBDeviceFilter._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getAction(self): req=IHostUSBDeviceFilter_getActionRequestMsg() req._this=self.handle val=self.mgr.getPort().IHostUSBDeviceFilter_getAction(req) return USBDeviceFilterAction(self.mgr,val._returnval) def setAction(self, value): req=IHostUSBDeviceFilter_setActionRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._action = value else: req._action = value.handle self.mgr.getPort().IHostUSBDeviceFilter_setAction(req) _Attrs_={ 'action':[getAction,setAction, ]} class IAudioAdapter(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IAudioAdapter(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IAudioAdapter._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IAudioAdapter._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getEnabled(self): req=IAudioAdapter_getEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IAudioAdapter_getEnabled(req) return Boolean(self.mgr,val._returnval) def setEnabled(self, value): req=IAudioAdapter_setEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._enabled = value else: req._enabled = value.handle self.mgr.getPort().IAudioAdapter_setEnabled(req) def getAudioController(self): req=IAudioAdapter_getAudioControllerRequestMsg() req._this=self.handle val=self.mgr.getPort().IAudioAdapter_getAudioController(req) return AudioControllerType(self.mgr,val._returnval) def setAudioController(self, value): req=IAudioAdapter_setAudioControllerRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._audioController = value else: req._audioController = value.handle self.mgr.getPort().IAudioAdapter_setAudioController(req) def getAudioDriver(self): req=IAudioAdapter_getAudioDriverRequestMsg() req._this=self.handle val=self.mgr.getPort().IAudioAdapter_getAudioDriver(req) return AudioDriverType(self.mgr,val._returnval) def setAudioDriver(self, value): req=IAudioAdapter_setAudioDriverRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._audioDriver = value else: req._audioDriver = value.handle self.mgr.getPort().IAudioAdapter_setAudioDriver(req) _Attrs_={ 'enabled':[getEnabled,setEnabled, ], 'audioController':[getAudioController,setAudioController, ], 'audioDriver':[getAudioDriver,setAudioDriver, ]} class IVRDEServer(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IVRDEServer(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IVRDEServer._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IVRDEServer._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def setVRDEProperty(self, _arg_key, _arg_value): req=IVRDEServer_setVRDEPropertyRequestMsg() req._this=self.handle req._key=_arg_key req._value=_arg_value val=self.mgr.getPort().IVRDEServer_setVRDEProperty(req) return def getVRDEProperty(self, _arg_key): req=IVRDEServer_getVRDEPropertyRequestMsg() req._this=self.handle req._key=_arg_key val=self.mgr.getPort().IVRDEServer_getVRDEProperty(req) return String(self.mgr,val._returnval) def getEnabled(self): req=IVRDEServer_getEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().IVRDEServer_getEnabled(req) return Boolean(self.mgr,val._returnval) def setEnabled(self, value): req=IVRDEServer_setEnabledRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._enabled = value else: req._enabled = value.handle self.mgr.getPort().IVRDEServer_setEnabled(req) def getAuthType(self): req=IVRDEServer_getAuthTypeRequestMsg() req._this=self.handle val=self.mgr.getPort().IVRDEServer_getAuthType(req) return AuthType(self.mgr,val._returnval) def setAuthType(self, value): req=IVRDEServer_setAuthTypeRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._authType = value else: req._authType = value.handle self.mgr.getPort().IVRDEServer_setAuthType(req) def getAuthTimeout(self): req=IVRDEServer_getAuthTimeoutRequestMsg() req._this=self.handle val=self.mgr.getPort().IVRDEServer_getAuthTimeout(req) return UnsignedInt(self.mgr,val._returnval) def setAuthTimeout(self, value): req=IVRDEServer_setAuthTimeoutRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._authTimeout = value else: req._authTimeout = value.handle self.mgr.getPort().IVRDEServer_setAuthTimeout(req) def getAllowMultiConnection(self): req=IVRDEServer_getAllowMultiConnectionRequestMsg() req._this=self.handle val=self.mgr.getPort().IVRDEServer_getAllowMultiConnection(req) return Boolean(self.mgr,val._returnval) def setAllowMultiConnection(self, value): req=IVRDEServer_setAllowMultiConnectionRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._allowMultiConnection = value else: req._allowMultiConnection = value.handle self.mgr.getPort().IVRDEServer_setAllowMultiConnection(req) def getReuseSingleConnection(self): req=IVRDEServer_getReuseSingleConnectionRequestMsg() req._this=self.handle val=self.mgr.getPort().IVRDEServer_getReuseSingleConnection(req) return Boolean(self.mgr,val._returnval) def setReuseSingleConnection(self, value): req=IVRDEServer_setReuseSingleConnectionRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._reuseSingleConnection = value else: req._reuseSingleConnection = value.handle self.mgr.getPort().IVRDEServer_setReuseSingleConnection(req) def getVRDEExtPack(self): req=IVRDEServer_getVRDEExtPackRequestMsg() req._this=self.handle val=self.mgr.getPort().IVRDEServer_getVRDEExtPack(req) return String(self.mgr,val._returnval) def setVRDEExtPack(self, value): req=IVRDEServer_setVRDEExtPackRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._VRDEExtPack = value else: req._VRDEExtPack = value.handle self.mgr.getPort().IVRDEServer_setVRDEExtPack(req) def getAuthLibrary(self): req=IVRDEServer_getAuthLibraryRequestMsg() req._this=self.handle val=self.mgr.getPort().IVRDEServer_getAuthLibrary(req) return String(self.mgr,val._returnval) def setAuthLibrary(self, value): req=IVRDEServer_setAuthLibraryRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._authLibrary = value else: req._authLibrary = value.handle self.mgr.getPort().IVRDEServer_setAuthLibrary(req) def getVRDEProperties(self): req=IVRDEServer_getVRDEPropertiesRequestMsg() req._this=self.handle val=self.mgr.getPort().IVRDEServer_getVRDEProperties(req) return String(self.mgr,val._returnval, True) _Attrs_={ 'enabled':[getEnabled,setEnabled, ], 'authType':[getAuthType,setAuthType, ], 'authTimeout':[getAuthTimeout,setAuthTimeout, ], 'allowMultiConnection':[getAllowMultiConnection,setAllowMultiConnection, ], 'reuseSingleConnection':[getReuseSingleConnection,setReuseSingleConnection, ], 'VRDEExtPack':[getVRDEExtPack,setVRDEExtPack, ], 'authLibrary':[getAuthLibrary,setAuthLibrary, ], 'VRDEProperties':[getVRDEProperties,None]} class ISession(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return ISession(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = ISession._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = ISession._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def unlockMachine(self): req=ISession_unlockMachineRequestMsg() req._this=self.handle val=self.mgr.getPort().ISession_unlockMachine(req) return def getState(self): req=ISession_getStateRequestMsg() req._this=self.handle val=self.mgr.getPort().ISession_getState(req) return SessionState(self.mgr,val._returnval) def getType(self): req=ISession_getTypeRequestMsg() req._this=self.handle val=self.mgr.getPort().ISession_getType(req) return SessionType(self.mgr,val._returnval) def getMachine(self): req=ISession_getMachineRequestMsg() req._this=self.handle val=self.mgr.getPort().ISession_getMachine(req) return IMachine(self.mgr,val._returnval) def getConsole(self): req=ISession_getConsoleRequestMsg() req._this=self.handle val=self.mgr.getPort().ISession_getConsole(req) return IConsole(self.mgr,val._returnval) _Attrs_={ 'state':[getState,None], 'type':[getType,None], 'machine':[getMachine,None], 'console':[getConsole,None]} class IStorageController(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IStorageController(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IStorageController._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IStorageController._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getName(self): req=IStorageController_getNameRequestMsg() req._this=self.handle val=self.mgr.getPort().IStorageController_getName(req) return String(self.mgr,val._returnval) def getMaxDevicesPerPortCount(self): req=IStorageController_getMaxDevicesPerPortCountRequestMsg() req._this=self.handle val=self.mgr.getPort().IStorageController_getMaxDevicesPerPortCount(req) return UnsignedInt(self.mgr,val._returnval) def getMinPortCount(self): req=IStorageController_getMinPortCountRequestMsg() req._this=self.handle val=self.mgr.getPort().IStorageController_getMinPortCount(req) return UnsignedInt(self.mgr,val._returnval) def getMaxPortCount(self): req=IStorageController_getMaxPortCountRequestMsg() req._this=self.handle val=self.mgr.getPort().IStorageController_getMaxPortCount(req) return UnsignedInt(self.mgr,val._returnval) def getInstance(self): req=IStorageController_getInstanceRequestMsg() req._this=self.handle val=self.mgr.getPort().IStorageController_getInstance(req) return UnsignedInt(self.mgr,val._returnval) def setInstance(self, value): req=IStorageController_setInstanceRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._instance = value else: req._instance = value.handle self.mgr.getPort().IStorageController_setInstance(req) def getPortCount(self): req=IStorageController_getPortCountRequestMsg() req._this=self.handle val=self.mgr.getPort().IStorageController_getPortCount(req) return UnsignedInt(self.mgr,val._returnval) def setPortCount(self, value): req=IStorageController_setPortCountRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._portCount = value else: req._portCount = value.handle self.mgr.getPort().IStorageController_setPortCount(req) def getBus(self): req=IStorageController_getBusRequestMsg() req._this=self.handle val=self.mgr.getPort().IStorageController_getBus(req) return StorageBus(self.mgr,val._returnval) def getControllerType(self): req=IStorageController_getControllerTypeRequestMsg() req._this=self.handle val=self.mgr.getPort().IStorageController_getControllerType(req) return StorageControllerType(self.mgr,val._returnval) def setControllerType(self, value): req=IStorageController_setControllerTypeRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._controllerType = value else: req._controllerType = value.handle self.mgr.getPort().IStorageController_setControllerType(req) def getUseHostIOCache(self): req=IStorageController_getUseHostIOCacheRequestMsg() req._this=self.handle val=self.mgr.getPort().IStorageController_getUseHostIOCache(req) return Boolean(self.mgr,val._returnval) def setUseHostIOCache(self, value): req=IStorageController_setUseHostIOCacheRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._useHostIOCache = value else: req._useHostIOCache = value.handle self.mgr.getPort().IStorageController_setUseHostIOCache(req) def getBootable(self): req=IStorageController_getBootableRequestMsg() req._this=self.handle val=self.mgr.getPort().IStorageController_getBootable(req) return Boolean(self.mgr,val._returnval) _Attrs_={ 'name':[getName,None], 'maxDevicesPerPortCount':[getMaxDevicesPerPortCount,None], 'minPortCount':[getMinPortCount,None], 'maxPortCount':[getMaxPortCount,None], 'instance':[getInstance,setInstance, ], 'portCount':[getPortCount,setPortCount, ], 'bus':[getBus,None], 'controllerType':[getControllerType,setControllerType, ], 'useHostIOCache':[getUseHostIOCache,setUseHostIOCache, ], 'bootable':[getBootable,None]} class IManagedObjectRef(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IManagedObjectRef(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IManagedObjectRef._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IManagedObjectRef._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getInterfaceName(self): req=IManagedObjectRef_getInterfaceNameRequestMsg() req._this=self.handle val=self.mgr.getPort().IManagedObjectRef_getInterfaceName(req) return String(self.mgr,val._returnval) def release(self): req=IManagedObjectRef_releaseRequestMsg() req._this=self.handle val=self.mgr.getPort().IManagedObjectRef_release(req) return _Attrs_={} class IWebsessionManager(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IWebsessionManager(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IWebsessionManager._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IWebsessionManager._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def logon(self, _arg_username, _arg_password): req=IWebsessionManager_logonRequestMsg() req._this=self.handle req._username=_arg_username req._password=_arg_password val=self.mgr.getPort().IWebsessionManager_logon(req) return IVirtualBox(self.mgr,val._returnval) def getSessionObject(self, _arg_refIVirtualBox): req=IWebsessionManager_getSessionObjectRequestMsg() req._this=self.handle req._refIVirtualBox=_arg_refIVirtualBox val=self.mgr.getPort().IWebsessionManager_getSessionObject(req) return ISession(self.mgr,val._returnval) def logoff(self, _arg_refIVirtualBox): req=IWebsessionManager_logoffRequestMsg() req._this=self.handle req._refIVirtualBox=_arg_refIVirtualBox val=self.mgr.getPort().IWebsessionManager_logoff(req) return _Attrs_={} class IPerformanceMetric(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IPerformanceMetric(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IPerformanceMetric._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IPerformanceMetric._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getMetricName(self): req=IPerformanceMetric_getMetricNameRequestMsg() req._this=self.handle val=self.mgr.getPort().IPerformanceMetric_getMetricName(req) return String(self.mgr,val._returnval) def getObject(self): req=IPerformanceMetric_getObjectRequestMsg() req._this=self.handle val=self.mgr.getPort().IPerformanceMetric_getObject(req) return IUnknown(self.mgr,val._returnval) def getDescription(self): req=IPerformanceMetric_getDescriptionRequestMsg() req._this=self.handle val=self.mgr.getPort().IPerformanceMetric_getDescription(req) return String(self.mgr,val._returnval) def getPeriod(self): req=IPerformanceMetric_getPeriodRequestMsg() req._this=self.handle val=self.mgr.getPort().IPerformanceMetric_getPeriod(req) return UnsignedInt(self.mgr,val._returnval) def getCount(self): req=IPerformanceMetric_getCountRequestMsg() req._this=self.handle val=self.mgr.getPort().IPerformanceMetric_getCount(req) return UnsignedInt(self.mgr,val._returnval) def getUnit(self): req=IPerformanceMetric_getUnitRequestMsg() req._this=self.handle val=self.mgr.getPort().IPerformanceMetric_getUnit(req) return String(self.mgr,val._returnval) def getMinimumValue(self): req=IPerformanceMetric_getMinimumValueRequestMsg() req._this=self.handle val=self.mgr.getPort().IPerformanceMetric_getMinimumValue(req) return Int(self.mgr,val._returnval) def getMaximumValue(self): req=IPerformanceMetric_getMaximumValueRequestMsg() req._this=self.handle val=self.mgr.getPort().IPerformanceMetric_getMaximumValue(req) return Int(self.mgr,val._returnval) _Attrs_={ 'metricName':[getMetricName,None], 'object':[getObject,None], 'description':[getDescription,None], 'period':[getPeriod,None], 'count':[getCount,None], 'unit':[getUnit,None], 'minimumValue':[getMinimumValue,None], 'maximumValue':[getMaximumValue,None]} class IPerformanceCollector(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IPerformanceCollector(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IPerformanceCollector._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IPerformanceCollector._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getMetrics(self, _arg_metricNames, _arg_objects): req=IPerformanceCollector_getMetricsRequestMsg() req._this=self.handle req._metricNames=_arg_metricNames req._objects=_arg_objects val=self.mgr.getPort().IPerformanceCollector_getMetrics(req) return IPerformanceMetric(self.mgr,val._returnval, True) def setupMetrics(self, _arg_metricNames, _arg_objects, _arg_period, _arg_count): req=IPerformanceCollector_setupMetricsRequestMsg() req._this=self.handle req._metricNames=_arg_metricNames req._objects=_arg_objects req._period=_arg_period req._count=_arg_count val=self.mgr.getPort().IPerformanceCollector_setupMetrics(req) return IPerformanceMetric(self.mgr,val._returnval, True) def enableMetrics(self, _arg_metricNames, _arg_objects): req=IPerformanceCollector_enableMetricsRequestMsg() req._this=self.handle req._metricNames=_arg_metricNames req._objects=_arg_objects val=self.mgr.getPort().IPerformanceCollector_enableMetrics(req) return IPerformanceMetric(self.mgr,val._returnval, True) def disableMetrics(self, _arg_metricNames, _arg_objects): req=IPerformanceCollector_disableMetricsRequestMsg() req._this=self.handle req._metricNames=_arg_metricNames req._objects=_arg_objects val=self.mgr.getPort().IPerformanceCollector_disableMetrics(req) return IPerformanceMetric(self.mgr,val._returnval, True) def queryMetricsData(self, _arg_metricNames, _arg_objects): req=IPerformanceCollector_queryMetricsDataRequestMsg() req._this=self.handle req._metricNames=_arg_metricNames req._objects=_arg_objects val=self.mgr.getPort().IPerformanceCollector_queryMetricsData(req) return Int(self.mgr,val._returnval, True), String(self.mgr,val._returnMetricNames, True), IUnknown(self.mgr,val._returnObjects, True), String(self.mgr,val._returnUnits, True), UnsignedInt(self.mgr,val._returnScales, True), UnsignedInt(self.mgr,val._returnSequenceNumbers, True), UnsignedInt(self.mgr,val._returnDataIndices, True), UnsignedInt(self.mgr,val._returnDataLengths, True) def getMetricNames(self): req=IPerformanceCollector_getMetricNamesRequestMsg() req._this=self.handle val=self.mgr.getPort().IPerformanceCollector_getMetricNames(req) return String(self.mgr,val._returnval, True) _Attrs_={ 'metricNames':[getMetricNames,None]} class INATEngine(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return INATEngine(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = INATEngine._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = INATEngine._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def setNetworkSettings(self, _arg_mtu, _arg_sockSnd, _arg_sockRcv, _arg_TcpWndSnd, _arg_TcpWndRcv): req=INATEngine_setNetworkSettingsRequestMsg() req._this=self.handle req._mtu=_arg_mtu req._sockSnd=_arg_sockSnd req._sockRcv=_arg_sockRcv req._TcpWndSnd=_arg_TcpWndSnd req._TcpWndRcv=_arg_TcpWndRcv val=self.mgr.getPort().INATEngine_setNetworkSettings(req) return def getNetworkSettings(self): req=INATEngine_getNetworkSettingsRequestMsg() req._this=self.handle val=self.mgr.getPort().INATEngine_getNetworkSettings(req) return UnsignedInt(self.mgr,val._mtu), UnsignedInt(self.mgr,val._sockSnd), UnsignedInt(self.mgr,val._sockRcv), UnsignedInt(self.mgr,val._TcpWndSnd), UnsignedInt(self.mgr,val._TcpWndRcv) def addRedirect(self, _arg_name, _arg_proto, _arg_hostIP, _arg_hostPort, _arg_guestIP, _arg_guestPort): req=INATEngine_addRedirectRequestMsg() req._this=self.handle req._name=_arg_name req._proto=_arg_proto req._hostIP=_arg_hostIP req._hostPort=_arg_hostPort req._guestIP=_arg_guestIP req._guestPort=_arg_guestPort val=self.mgr.getPort().INATEngine_addRedirect(req) return def removeRedirect(self, _arg_name): req=INATEngine_removeRedirectRequestMsg() req._this=self.handle req._name=_arg_name val=self.mgr.getPort().INATEngine_removeRedirect(req) return def getNetwork(self): req=INATEngine_getNetworkRequestMsg() req._this=self.handle val=self.mgr.getPort().INATEngine_getNetwork(req) return String(self.mgr,val._returnval) def setNetwork(self, value): req=INATEngine_setNetworkRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._network = value else: req._network = value.handle self.mgr.getPort().INATEngine_setNetwork(req) def getHostIP(self): req=INATEngine_getHostIPRequestMsg() req._this=self.handle val=self.mgr.getPort().INATEngine_getHostIP(req) return String(self.mgr,val._returnval) def setHostIP(self, value): req=INATEngine_setHostIPRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._hostIP = value else: req._hostIP = value.handle self.mgr.getPort().INATEngine_setHostIP(req) def getTFTPPrefix(self): req=INATEngine_getTFTPPrefixRequestMsg() req._this=self.handle val=self.mgr.getPort().INATEngine_getTFTPPrefix(req) return String(self.mgr,val._returnval) def setTFTPPrefix(self, value): req=INATEngine_setTFTPPrefixRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._TFTPPrefix = value else: req._TFTPPrefix = value.handle self.mgr.getPort().INATEngine_setTFTPPrefix(req) def getTFTPBootFile(self): req=INATEngine_getTFTPBootFileRequestMsg() req._this=self.handle val=self.mgr.getPort().INATEngine_getTFTPBootFile(req) return String(self.mgr,val._returnval) def setTFTPBootFile(self, value): req=INATEngine_setTFTPBootFileRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._TFTPBootFile = value else: req._TFTPBootFile = value.handle self.mgr.getPort().INATEngine_setTFTPBootFile(req) def getTFTPNextServer(self): req=INATEngine_getTFTPNextServerRequestMsg() req._this=self.handle val=self.mgr.getPort().INATEngine_getTFTPNextServer(req) return String(self.mgr,val._returnval) def setTFTPNextServer(self, value): req=INATEngine_setTFTPNextServerRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._TFTPNextServer = value else: req._TFTPNextServer = value.handle self.mgr.getPort().INATEngine_setTFTPNextServer(req) def getAliasMode(self): req=INATEngine_getAliasModeRequestMsg() req._this=self.handle val=self.mgr.getPort().INATEngine_getAliasMode(req) return UnsignedInt(self.mgr,val._returnval) def setAliasMode(self, value): req=INATEngine_setAliasModeRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._aliasMode = value else: req._aliasMode = value.handle self.mgr.getPort().INATEngine_setAliasMode(req) def getDNSPassDomain(self): req=INATEngine_getDNSPassDomainRequestMsg() req._this=self.handle val=self.mgr.getPort().INATEngine_getDNSPassDomain(req) return Boolean(self.mgr,val._returnval) def setDNSPassDomain(self, value): req=INATEngine_setDNSPassDomainRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._DNSPassDomain = value else: req._DNSPassDomain = value.handle self.mgr.getPort().INATEngine_setDNSPassDomain(req) def getDNSProxy(self): req=INATEngine_getDNSProxyRequestMsg() req._this=self.handle val=self.mgr.getPort().INATEngine_getDNSProxy(req) return Boolean(self.mgr,val._returnval) def setDNSProxy(self, value): req=INATEngine_setDNSProxyRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._DNSProxy = value else: req._DNSProxy = value.handle self.mgr.getPort().INATEngine_setDNSProxy(req) def getDNSUseHostResolver(self): req=INATEngine_getDNSUseHostResolverRequestMsg() req._this=self.handle val=self.mgr.getPort().INATEngine_getDNSUseHostResolver(req) return Boolean(self.mgr,val._returnval) def setDNSUseHostResolver(self, value): req=INATEngine_setDNSUseHostResolverRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._DNSUseHostResolver = value else: req._DNSUseHostResolver = value.handle self.mgr.getPort().INATEngine_setDNSUseHostResolver(req) def getRedirects(self): req=INATEngine_getRedirectsRequestMsg() req._this=self.handle val=self.mgr.getPort().INATEngine_getRedirects(req) return String(self.mgr,val._returnval, True) _Attrs_={ 'network':[getNetwork,setNetwork, ], 'hostIP':[getHostIP,setHostIP, ], 'TFTPPrefix':[getTFTPPrefix,setTFTPPrefix, ], 'TFTPBootFile':[getTFTPBootFile,setTFTPBootFile, ], 'TFTPNextServer':[getTFTPNextServer,setTFTPNextServer, ], 'aliasMode':[getAliasMode,setAliasMode, ], 'DNSPassDomain':[getDNSPassDomain,setDNSPassDomain, ], 'DNSProxy':[getDNSProxy,setDNSProxy, ], 'DNSUseHostResolver':[getDNSUseHostResolver,setDNSUseHostResolver, ], 'redirects':[getRedirects,None]} class IBandwidthGroup(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IBandwidthGroup(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IBandwidthGroup._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IBandwidthGroup._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getName(self): req=IBandwidthGroup_getNameRequestMsg() req._this=self.handle val=self.mgr.getPort().IBandwidthGroup_getName(req) return String(self.mgr,val._returnval) def getType(self): req=IBandwidthGroup_getTypeRequestMsg() req._this=self.handle val=self.mgr.getPort().IBandwidthGroup_getType(req) return BandwidthGroupType(self.mgr,val._returnval) def getReference(self): req=IBandwidthGroup_getReferenceRequestMsg() req._this=self.handle val=self.mgr.getPort().IBandwidthGroup_getReference(req) return UnsignedInt(self.mgr,val._returnval) def getMaxBytesPerSec(self): req=IBandwidthGroup_getMaxBytesPerSecRequestMsg() req._this=self.handle val=self.mgr.getPort().IBandwidthGroup_getMaxBytesPerSec(req) return Long(self.mgr,val._returnval) def setMaxBytesPerSec(self, value): req=IBandwidthGroup_setMaxBytesPerSecRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._maxBytesPerSec = value else: req._maxBytesPerSec = value.handle self.mgr.getPort().IBandwidthGroup_setMaxBytesPerSec(req) _Attrs_={ 'name':[getName,None], 'type':[getType,None], 'reference':[getReference,None], 'maxBytesPerSec':[getMaxBytesPerSec,setMaxBytesPerSec, ]} class IBandwidthControl(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IBandwidthControl(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IBandwidthControl._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IBandwidthControl._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def createBandwidthGroup(self, _arg_name, _arg_type, _arg_maxBytesPerSec): req=IBandwidthControl_createBandwidthGroupRequestMsg() req._this=self.handle req._name=_arg_name req._type=_arg_type req._maxBytesPerSec=_arg_maxBytesPerSec val=self.mgr.getPort().IBandwidthControl_createBandwidthGroup(req) return def deleteBandwidthGroup(self, _arg_name): req=IBandwidthControl_deleteBandwidthGroupRequestMsg() req._this=self.handle req._name=_arg_name val=self.mgr.getPort().IBandwidthControl_deleteBandwidthGroup(req) return def getBandwidthGroup(self, _arg_name): req=IBandwidthControl_getBandwidthGroupRequestMsg() req._this=self.handle req._name=_arg_name val=self.mgr.getPort().IBandwidthControl_getBandwidthGroup(req) return IBandwidthGroup(self.mgr,val._returnval) def getAllBandwidthGroups(self): req=IBandwidthControl_getAllBandwidthGroupsRequestMsg() req._this=self.handle val=self.mgr.getPort().IBandwidthControl_getAllBandwidthGroups(req) return IBandwidthGroup(self.mgr,val._returnval, True) def getNumGroups(self): req=IBandwidthControl_getNumGroupsRequestMsg() req._this=self.handle val=self.mgr.getPort().IBandwidthControl_getNumGroups(req) return UnsignedInt(self.mgr,val._returnval) _Attrs_={ 'numGroups':[getNumGroups,None]} class IEventSource(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IEventSource(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IEventSource._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IEventSource._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def createListener(self): req=IEventSource_createListenerRequestMsg() req._this=self.handle val=self.mgr.getPort().IEventSource_createListener(req) return IEventListener(self.mgr,val._returnval) def createAggregator(self, _arg_subordinates): req=IEventSource_createAggregatorRequestMsg() req._this=self.handle req._subordinates=_arg_subordinates val=self.mgr.getPort().IEventSource_createAggregator(req) return IEventSource(self.mgr,val._returnval) def registerListener(self, _arg_listener, _arg_interesting, _arg_active): req=IEventSource_registerListenerRequestMsg() req._this=self.handle req._listener=_arg_listener req._interesting=_arg_interesting req._active=_arg_active val=self.mgr.getPort().IEventSource_registerListener(req) return def unregisterListener(self, _arg_listener): req=IEventSource_unregisterListenerRequestMsg() req._this=self.handle req._listener=_arg_listener val=self.mgr.getPort().IEventSource_unregisterListener(req) return def fireEvent(self, _arg_event, _arg_timeout): req=IEventSource_fireEventRequestMsg() req._this=self.handle req._event=_arg_event req._timeout=_arg_timeout val=self.mgr.getPort().IEventSource_fireEvent(req) return Boolean(self.mgr,val._returnval) def getEvent(self, _arg_listener, _arg_timeout): req=IEventSource_getEventRequestMsg() req._this=self.handle req._listener=_arg_listener req._timeout=_arg_timeout val=self.mgr.getPort().IEventSource_getEvent(req) return IEvent(self.mgr,val._returnval) def eventProcessed(self, _arg_listener, _arg_event): req=IEventSource_eventProcessedRequestMsg() req._this=self.handle req._listener=_arg_listener req._event=_arg_event val=self.mgr.getPort().IEventSource_eventProcessed(req) return _Attrs_={} class IEventListener(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IEventListener(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IEventListener._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IEventListener._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def handleEvent(self, _arg_event): req=IEventListener_handleEventRequestMsg() req._this=self.handle req._event=_arg_event val=self.mgr.getPort().IEventListener_handleEvent(req) return _Attrs_={} class IEvent(IUnknown): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IUnknown.__getattr__(self, name) def __setattr__(self, name, val): hndl = IEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def setProcessed(self): req=IEvent_setProcessedRequestMsg() req._this=self.handle val=self.mgr.getPort().IEvent_setProcessed(req) return def waitProcessed(self, _arg_timeout): req=IEvent_waitProcessedRequestMsg() req._this=self.handle req._timeout=_arg_timeout val=self.mgr.getPort().IEvent_waitProcessed(req) return Boolean(self.mgr,val._returnval) def getType(self): req=IEvent_getTypeRequestMsg() req._this=self.handle val=self.mgr.getPort().IEvent_getType(req) return VBoxEventType(self.mgr,val._returnval) def getSource(self): req=IEvent_getSourceRequestMsg() req._this=self.handle val=self.mgr.getPort().IEvent_getSource(req) return IEventSource(self.mgr,val._returnval) def getWaitable(self): req=IEvent_getWaitableRequestMsg() req._this=self.handle val=self.mgr.getPort().IEvent_getWaitable(req) return Boolean(self.mgr,val._returnval) _Attrs_={ 'type':[getType,None], 'source':[getSource,None], 'waitable':[getWaitable,None]} class IReusableEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IReusableEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IReusableEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IReusableEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def reuse(self): req=IReusableEvent_reuseRequestMsg() req._this=self.handle val=self.mgr.getPort().IReusableEvent_reuse(req) return def getGeneration(self): req=IReusableEvent_getGenerationRequestMsg() req._this=self.handle val=self.mgr.getPort().IReusableEvent_getGeneration(req) return UnsignedInt(self.mgr,val._returnval) _Attrs_={ 'generation':[getGeneration,None]} class IMachineEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IMachineEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IMachineEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IMachineEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getMachineId(self): req=IMachineEvent_getMachineIdRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineEvent_getMachineId(req) return String(self.mgr,val._returnval) _Attrs_={ 'machineId':[getMachineId,None]} class IMachineStateChangedEvent(IMachineEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IMachineStateChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IMachineStateChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IMachineEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IMachineStateChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getState(self): req=IMachineStateChangedEvent_getStateRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineStateChangedEvent_getState(req) return MachineState(self.mgr,val._returnval) _Attrs_={ 'state':[getState,None]} class IMachineDataChangedEvent(IMachineEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IMachineDataChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IMachineDataChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IMachineEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IMachineDataChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getTemporary(self): req=IMachineDataChangedEvent_getTemporaryRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineDataChangedEvent_getTemporary(req) return Boolean(self.mgr,val._returnval) _Attrs_={ 'temporary':[getTemporary,None]} class IMediumRegisteredEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IMediumRegisteredEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IMediumRegisteredEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IMediumRegisteredEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getMediumId(self): req=IMediumRegisteredEvent_getMediumIdRequestMsg() req._this=self.handle val=self.mgr.getPort().IMediumRegisteredEvent_getMediumId(req) return String(self.mgr,val._returnval) def getMediumType(self): req=IMediumRegisteredEvent_getMediumTypeRequestMsg() req._this=self.handle val=self.mgr.getPort().IMediumRegisteredEvent_getMediumType(req) return DeviceType(self.mgr,val._returnval) def getRegistered(self): req=IMediumRegisteredEvent_getRegisteredRequestMsg() req._this=self.handle val=self.mgr.getPort().IMediumRegisteredEvent_getRegistered(req) return Boolean(self.mgr,val._returnval) _Attrs_={ 'mediumId':[getMediumId,None], 'mediumType':[getMediumType,None], 'registered':[getRegistered,None]} class IMachineRegisteredEvent(IMachineEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IMachineRegisteredEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IMachineRegisteredEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IMachineEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IMachineRegisteredEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getRegistered(self): req=IMachineRegisteredEvent_getRegisteredRequestMsg() req._this=self.handle val=self.mgr.getPort().IMachineRegisteredEvent_getRegistered(req) return Boolean(self.mgr,val._returnval) _Attrs_={ 'registered':[getRegistered,None]} class ISessionStateChangedEvent(IMachineEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return ISessionStateChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = ISessionStateChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IMachineEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = ISessionStateChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getState(self): req=ISessionStateChangedEvent_getStateRequestMsg() req._this=self.handle val=self.mgr.getPort().ISessionStateChangedEvent_getState(req) return SessionState(self.mgr,val._returnval) _Attrs_={ 'state':[getState,None]} class IGuestPropertyChangedEvent(IMachineEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestPropertyChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestPropertyChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IMachineEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestPropertyChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getName(self): req=IGuestPropertyChangedEvent_getNameRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestPropertyChangedEvent_getName(req) return String(self.mgr,val._returnval) def getValue(self): req=IGuestPropertyChangedEvent_getValueRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestPropertyChangedEvent_getValue(req) return String(self.mgr,val._returnval) def getFlags(self): req=IGuestPropertyChangedEvent_getFlagsRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestPropertyChangedEvent_getFlags(req) return String(self.mgr,val._returnval) _Attrs_={ 'name':[getName,None], 'value':[getValue,None], 'flags':[getFlags,None]} class ISnapshotEvent(IMachineEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return ISnapshotEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = ISnapshotEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IMachineEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = ISnapshotEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getSnapshotId(self): req=ISnapshotEvent_getSnapshotIdRequestMsg() req._this=self.handle val=self.mgr.getPort().ISnapshotEvent_getSnapshotId(req) return String(self.mgr,val._returnval) _Attrs_={ 'snapshotId':[getSnapshotId,None]} class ISnapshotTakenEvent(ISnapshotEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return ISnapshotTakenEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = ISnapshotTakenEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return ISnapshotEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = ISnapshotTakenEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val _Attrs_={} class ISnapshotDeletedEvent(ISnapshotEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return ISnapshotDeletedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = ISnapshotDeletedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return ISnapshotEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = ISnapshotDeletedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val _Attrs_={} class ISnapshotChangedEvent(ISnapshotEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return ISnapshotChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = ISnapshotChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return ISnapshotEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = ISnapshotChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val _Attrs_={} class IMousePointerShapeChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IMousePointerShapeChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IMousePointerShapeChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IMousePointerShapeChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getVisible(self): req=IMousePointerShapeChangedEvent_getVisibleRequestMsg() req._this=self.handle val=self.mgr.getPort().IMousePointerShapeChangedEvent_getVisible(req) return Boolean(self.mgr,val._returnval) def getAlpha(self): req=IMousePointerShapeChangedEvent_getAlphaRequestMsg() req._this=self.handle val=self.mgr.getPort().IMousePointerShapeChangedEvent_getAlpha(req) return Boolean(self.mgr,val._returnval) def getXhot(self): req=IMousePointerShapeChangedEvent_getXhotRequestMsg() req._this=self.handle val=self.mgr.getPort().IMousePointerShapeChangedEvent_getXhot(req) return UnsignedInt(self.mgr,val._returnval) def getYhot(self): req=IMousePointerShapeChangedEvent_getYhotRequestMsg() req._this=self.handle val=self.mgr.getPort().IMousePointerShapeChangedEvent_getYhot(req) return UnsignedInt(self.mgr,val._returnval) def getWidth(self): req=IMousePointerShapeChangedEvent_getWidthRequestMsg() req._this=self.handle val=self.mgr.getPort().IMousePointerShapeChangedEvent_getWidth(req) return UnsignedInt(self.mgr,val._returnval) def getHeight(self): req=IMousePointerShapeChangedEvent_getHeightRequestMsg() req._this=self.handle val=self.mgr.getPort().IMousePointerShapeChangedEvent_getHeight(req) return UnsignedInt(self.mgr,val._returnval) def getShape(self): req=IMousePointerShapeChangedEvent_getShapeRequestMsg() req._this=self.handle val=self.mgr.getPort().IMousePointerShapeChangedEvent_getShape(req) return self.mgr.decodebase64(val._returnval) _Attrs_={ 'visible':[getVisible,None], 'alpha':[getAlpha,None], 'xhot':[getXhot,None], 'yhot':[getYhot,None], 'width':[getWidth,None], 'height':[getHeight,None], 'shape':[getShape,None]} class IMouseCapabilityChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IMouseCapabilityChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IMouseCapabilityChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IMouseCapabilityChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getSupportsAbsolute(self): req=IMouseCapabilityChangedEvent_getSupportsAbsoluteRequestMsg() req._this=self.handle val=self.mgr.getPort().IMouseCapabilityChangedEvent_getSupportsAbsolute(req) return Boolean(self.mgr,val._returnval) def getSupportsRelative(self): req=IMouseCapabilityChangedEvent_getSupportsRelativeRequestMsg() req._this=self.handle val=self.mgr.getPort().IMouseCapabilityChangedEvent_getSupportsRelative(req) return Boolean(self.mgr,val._returnval) def getSupportsMultiTouch(self): req=IMouseCapabilityChangedEvent_getSupportsMultiTouchRequestMsg() req._this=self.handle val=self.mgr.getPort().IMouseCapabilityChangedEvent_getSupportsMultiTouch(req) return Boolean(self.mgr,val._returnval) def getNeedsHostCursor(self): req=IMouseCapabilityChangedEvent_getNeedsHostCursorRequestMsg() req._this=self.handle val=self.mgr.getPort().IMouseCapabilityChangedEvent_getNeedsHostCursor(req) return Boolean(self.mgr,val._returnval) _Attrs_={ 'supportsAbsolute':[getSupportsAbsolute,None], 'supportsRelative':[getSupportsRelative,None], 'supportsMultiTouch':[getSupportsMultiTouch,None], 'needsHostCursor':[getNeedsHostCursor,None]} class IKeyboardLedsChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IKeyboardLedsChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IKeyboardLedsChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IKeyboardLedsChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getNumLock(self): req=IKeyboardLedsChangedEvent_getNumLockRequestMsg() req._this=self.handle val=self.mgr.getPort().IKeyboardLedsChangedEvent_getNumLock(req) return Boolean(self.mgr,val._returnval) def getCapsLock(self): req=IKeyboardLedsChangedEvent_getCapsLockRequestMsg() req._this=self.handle val=self.mgr.getPort().IKeyboardLedsChangedEvent_getCapsLock(req) return Boolean(self.mgr,val._returnval) def getScrollLock(self): req=IKeyboardLedsChangedEvent_getScrollLockRequestMsg() req._this=self.handle val=self.mgr.getPort().IKeyboardLedsChangedEvent_getScrollLock(req) return Boolean(self.mgr,val._returnval) _Attrs_={ 'numLock':[getNumLock,None], 'capsLock':[getCapsLock,None], 'scrollLock':[getScrollLock,None]} class IStateChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IStateChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IStateChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IStateChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getState(self): req=IStateChangedEvent_getStateRequestMsg() req._this=self.handle val=self.mgr.getPort().IStateChangedEvent_getState(req) return MachineState(self.mgr,val._returnval) _Attrs_={ 'state':[getState,None]} class IAdditionsStateChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IAdditionsStateChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IAdditionsStateChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IAdditionsStateChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val _Attrs_={} class INetworkAdapterChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return INetworkAdapterChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = INetworkAdapterChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = INetworkAdapterChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getNetworkAdapter(self): req=INetworkAdapterChangedEvent_getNetworkAdapterRequestMsg() req._this=self.handle val=self.mgr.getPort().INetworkAdapterChangedEvent_getNetworkAdapter(req) return INetworkAdapter(self.mgr,val._returnval) _Attrs_={ 'networkAdapter':[getNetworkAdapter,None]} class ISerialPortChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return ISerialPortChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = ISerialPortChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = ISerialPortChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getSerialPort(self): req=ISerialPortChangedEvent_getSerialPortRequestMsg() req._this=self.handle val=self.mgr.getPort().ISerialPortChangedEvent_getSerialPort(req) return ISerialPort(self.mgr,val._returnval) _Attrs_={ 'serialPort':[getSerialPort,None]} class IParallelPortChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IParallelPortChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IParallelPortChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IParallelPortChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getParallelPort(self): req=IParallelPortChangedEvent_getParallelPortRequestMsg() req._this=self.handle val=self.mgr.getPort().IParallelPortChangedEvent_getParallelPort(req) return IParallelPort(self.mgr,val._returnval) _Attrs_={ 'parallelPort':[getParallelPort,None]} class IStorageControllerChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IStorageControllerChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IStorageControllerChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IStorageControllerChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val _Attrs_={} class IMediumChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IMediumChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IMediumChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IMediumChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getMediumAttachment(self): req=IMediumChangedEvent_getMediumAttachmentRequestMsg() req._this=self.handle val=self.mgr.getPort().IMediumChangedEvent_getMediumAttachment(req) return IMediumAttachment(self.mgr,val._returnval) _Attrs_={ 'mediumAttachment':[getMediumAttachment,None]} class IClipboardModeChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IClipboardModeChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IClipboardModeChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IClipboardModeChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getClipboardMode(self): req=IClipboardModeChangedEvent_getClipboardModeRequestMsg() req._this=self.handle val=self.mgr.getPort().IClipboardModeChangedEvent_getClipboardMode(req) return ClipboardMode(self.mgr,val._returnval) _Attrs_={ 'clipboardMode':[getClipboardMode,None]} class IDragAndDropModeChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IDragAndDropModeChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IDragAndDropModeChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IDragAndDropModeChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getDragAndDropMode(self): req=IDragAndDropModeChangedEvent_getDragAndDropModeRequestMsg() req._this=self.handle val=self.mgr.getPort().IDragAndDropModeChangedEvent_getDragAndDropMode(req) return DragAndDropMode(self.mgr,val._returnval) _Attrs_={ 'dragAndDropMode':[getDragAndDropMode,None]} class ICPUChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return ICPUChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = ICPUChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = ICPUChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getCPU(self): req=ICPUChangedEvent_getCPURequestMsg() req._this=self.handle val=self.mgr.getPort().ICPUChangedEvent_getCPU(req) return UnsignedInt(self.mgr,val._returnval) def getAdd(self): req=ICPUChangedEvent_getAddRequestMsg() req._this=self.handle val=self.mgr.getPort().ICPUChangedEvent_getAdd(req) return Boolean(self.mgr,val._returnval) _Attrs_={ 'CPU':[getCPU,None], 'add':[getAdd,None]} class ICPUExecutionCapChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return ICPUExecutionCapChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = ICPUExecutionCapChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = ICPUExecutionCapChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getExecutionCap(self): req=ICPUExecutionCapChangedEvent_getExecutionCapRequestMsg() req._this=self.handle val=self.mgr.getPort().ICPUExecutionCapChangedEvent_getExecutionCap(req) return UnsignedInt(self.mgr,val._returnval) _Attrs_={ 'executionCap':[getExecutionCap,None]} class IGuestKeyboardEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestKeyboardEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestKeyboardEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestKeyboardEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getScancodes(self): req=IGuestKeyboardEvent_getScancodesRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestKeyboardEvent_getScancodes(req) return Int(self.mgr,val._returnval, True) _Attrs_={ 'scancodes':[getScancodes,None]} class IGuestMouseEvent(IReusableEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestMouseEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestMouseEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IReusableEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestMouseEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getMode(self): req=IGuestMouseEvent_getModeRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestMouseEvent_getMode(req) return GuestMouseEventMode(self.mgr,val._returnval) def getX(self): req=IGuestMouseEvent_getXRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestMouseEvent_getX(req) return Int(self.mgr,val._returnval) def getY(self): req=IGuestMouseEvent_getYRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestMouseEvent_getY(req) return Int(self.mgr,val._returnval) def getZ(self): req=IGuestMouseEvent_getZRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestMouseEvent_getZ(req) return Int(self.mgr,val._returnval) def getW(self): req=IGuestMouseEvent_getWRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestMouseEvent_getW(req) return Int(self.mgr,val._returnval) def getButtons(self): req=IGuestMouseEvent_getButtonsRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestMouseEvent_getButtons(req) return Int(self.mgr,val._returnval) _Attrs_={ 'mode':[getMode,None], 'x':[getX,None], 'y':[getY,None], 'z':[getZ,None], 'w':[getW,None], 'buttons':[getButtons,None]} class IGuestMultiTouchEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestMultiTouchEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestMultiTouchEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestMultiTouchEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getContactCount(self): req=IGuestMultiTouchEvent_getContactCountRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestMultiTouchEvent_getContactCount(req) return Int(self.mgr,val._returnval) def getXPositions(self): req=IGuestMultiTouchEvent_getXPositionsRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestMultiTouchEvent_getXPositions(req) return Short(self.mgr,val._returnval, True) def getYPositions(self): req=IGuestMultiTouchEvent_getYPositionsRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestMultiTouchEvent_getYPositions(req) return Short(self.mgr,val._returnval, True) def getContactIds(self): req=IGuestMultiTouchEvent_getContactIdsRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestMultiTouchEvent_getContactIds(req) return UnsignedShort(self.mgr,val._returnval, True) def getContactFlags(self): req=IGuestMultiTouchEvent_getContactFlagsRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestMultiTouchEvent_getContactFlags(req) return UnsignedShort(self.mgr,val._returnval, True) def getScanTime(self): req=IGuestMultiTouchEvent_getScanTimeRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestMultiTouchEvent_getScanTime(req) return UnsignedInt(self.mgr,val._returnval) _Attrs_={ 'contactCount':[getContactCount,None], 'xPositions':[getXPositions,None], 'yPositions':[getYPositions,None], 'contactIds':[getContactIds,None], 'contactFlags':[getContactFlags,None], 'scanTime':[getScanTime,None]} class IGuestSessionEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestSessionEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestSessionEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestSessionEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getSession(self): req=IGuestSessionEvent_getSessionRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestSessionEvent_getSession(req) return IGuestSession(self.mgr,val._returnval) _Attrs_={ 'session':[getSession,None]} class IGuestSessionStateChangedEvent(IGuestSessionEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestSessionStateChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestSessionStateChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IGuestSessionEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestSessionStateChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getId(self): req=IGuestSessionStateChangedEvent_getIdRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestSessionStateChangedEvent_getId(req) return UnsignedInt(self.mgr,val._returnval) def getStatus(self): req=IGuestSessionStateChangedEvent_getStatusRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestSessionStateChangedEvent_getStatus(req) return GuestSessionStatus(self.mgr,val._returnval) def getError(self): req=IGuestSessionStateChangedEvent_getErrorRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestSessionStateChangedEvent_getError(req) return IVirtualBoxErrorInfo(self.mgr,val._returnval) _Attrs_={ 'id':[getId,None], 'status':[getStatus,None], 'error':[getError,None]} class IGuestSessionRegisteredEvent(IGuestSessionEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestSessionRegisteredEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestSessionRegisteredEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IGuestSessionEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestSessionRegisteredEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getRegistered(self): req=IGuestSessionRegisteredEvent_getRegisteredRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestSessionRegisteredEvent_getRegistered(req) return Boolean(self.mgr,val._returnval) _Attrs_={ 'registered':[getRegistered,None]} class IGuestProcessEvent(IGuestSessionEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestProcessEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestProcessEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IGuestSessionEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestProcessEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getProcess(self): req=IGuestProcessEvent_getProcessRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestProcessEvent_getProcess(req) return IGuestProcess(self.mgr,val._returnval) def getPid(self): req=IGuestProcessEvent_getPidRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestProcessEvent_getPid(req) return UnsignedInt(self.mgr,val._returnval) _Attrs_={ 'process':[getProcess,None], 'pid':[getPid,None]} class IGuestProcessRegisteredEvent(IGuestProcessEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestProcessRegisteredEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestProcessRegisteredEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IGuestProcessEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestProcessRegisteredEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getRegistered(self): req=IGuestProcessRegisteredEvent_getRegisteredRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestProcessRegisteredEvent_getRegistered(req) return Boolean(self.mgr,val._returnval) _Attrs_={ 'registered':[getRegistered,None]} class IGuestProcessStateChangedEvent(IGuestProcessEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestProcessStateChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestProcessStateChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IGuestProcessEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestProcessStateChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getStatus(self): req=IGuestProcessStateChangedEvent_getStatusRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestProcessStateChangedEvent_getStatus(req) return ProcessStatus(self.mgr,val._returnval) def getError(self): req=IGuestProcessStateChangedEvent_getErrorRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestProcessStateChangedEvent_getError(req) return IVirtualBoxErrorInfo(self.mgr,val._returnval) _Attrs_={ 'status':[getStatus,None], 'error':[getError,None]} class IGuestProcessIOEvent(IGuestProcessEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestProcessIOEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestProcessIOEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IGuestProcessEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestProcessIOEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getHandle(self): req=IGuestProcessIOEvent_getHandleRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestProcessIOEvent_getHandle(req) return UnsignedInt(self.mgr,val._returnval) def getProcessed(self): req=IGuestProcessIOEvent_getProcessedRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestProcessIOEvent_getProcessed(req) return UnsignedInt(self.mgr,val._returnval) _Attrs_={ 'handle':[getHandle,None], 'processed':[getProcessed,None]} class IGuestProcessInputNotifyEvent(IGuestProcessIOEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestProcessInputNotifyEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestProcessInputNotifyEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IGuestProcessIOEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestProcessInputNotifyEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getStatus(self): req=IGuestProcessInputNotifyEvent_getStatusRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestProcessInputNotifyEvent_getStatus(req) return ProcessInputStatus(self.mgr,val._returnval) _Attrs_={ 'status':[getStatus,None]} class IGuestProcessOutputEvent(IGuestProcessIOEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestProcessOutputEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestProcessOutputEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IGuestProcessIOEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestProcessOutputEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getData(self): req=IGuestProcessOutputEvent_getDataRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestProcessOutputEvent_getData(req) return self.mgr.decodebase64(val._returnval) _Attrs_={ 'data':[getData,None]} class IGuestFileEvent(IGuestSessionEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestFileEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestFileEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IGuestSessionEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestFileEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getFile(self): req=IGuestFileEvent_getFileRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestFileEvent_getFile(req) return IGuestFile(self.mgr,val._returnval) _Attrs_={ 'file':[getFile,None]} class IGuestFileRegisteredEvent(IGuestFileEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestFileRegisteredEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestFileRegisteredEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IGuestFileEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestFileRegisteredEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getRegistered(self): req=IGuestFileRegisteredEvent_getRegisteredRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestFileRegisteredEvent_getRegistered(req) return Boolean(self.mgr,val._returnval) _Attrs_={ 'registered':[getRegistered,None]} class IGuestFileStateChangedEvent(IGuestFileEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestFileStateChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestFileStateChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IGuestFileEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestFileStateChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getStatus(self): req=IGuestFileStateChangedEvent_getStatusRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestFileStateChangedEvent_getStatus(req) return FileStatus(self.mgr,val._returnval) def getError(self): req=IGuestFileStateChangedEvent_getErrorRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestFileStateChangedEvent_getError(req) return IVirtualBoxErrorInfo(self.mgr,val._returnval) _Attrs_={ 'status':[getStatus,None], 'error':[getError,None]} class IGuestFileIOEvent(IGuestFileEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestFileIOEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestFileIOEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IGuestFileEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestFileIOEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getOffset(self): req=IGuestFileIOEvent_getOffsetRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestFileIOEvent_getOffset(req) return Long(self.mgr,val._returnval) def getProcessed(self): req=IGuestFileIOEvent_getProcessedRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestFileIOEvent_getProcessed(req) return UnsignedInt(self.mgr,val._returnval) _Attrs_={ 'offset':[getOffset,None], 'processed':[getProcessed,None]} class IGuestFileOffsetChangedEvent(IGuestFileIOEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestFileOffsetChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestFileOffsetChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IGuestFileIOEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestFileOffsetChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val _Attrs_={} class IGuestFileReadEvent(IGuestFileIOEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestFileReadEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestFileReadEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IGuestFileIOEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestFileReadEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getData(self): req=IGuestFileReadEvent_getDataRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestFileReadEvent_getData(req) return self.mgr.decodebase64(val._returnval) _Attrs_={ 'data':[getData,None]} class IGuestFileWriteEvent(IGuestFileIOEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestFileWriteEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestFileWriteEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IGuestFileIOEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestFileWriteEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val _Attrs_={} class IVRDEServerChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IVRDEServerChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IVRDEServerChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IVRDEServerChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val _Attrs_={} class IVRDEServerInfoChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IVRDEServerInfoChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IVRDEServerInfoChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IVRDEServerInfoChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val _Attrs_={} class IVideoCaptureChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IVideoCaptureChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IVideoCaptureChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IVideoCaptureChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val _Attrs_={} class IUSBControllerChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IUSBControllerChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IUSBControllerChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IUSBControllerChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val _Attrs_={} class IUSBDeviceStateChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IUSBDeviceStateChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IUSBDeviceStateChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IUSBDeviceStateChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getDevice(self): req=IUSBDeviceStateChangedEvent_getDeviceRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDeviceStateChangedEvent_getDevice(req) return IUSBDevice(self.mgr,val._returnval) def getAttached(self): req=IUSBDeviceStateChangedEvent_getAttachedRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDeviceStateChangedEvent_getAttached(req) return Boolean(self.mgr,val._returnval) def getError(self): req=IUSBDeviceStateChangedEvent_getErrorRequestMsg() req._this=self.handle val=self.mgr.getPort().IUSBDeviceStateChangedEvent_getError(req) return IVirtualBoxErrorInfo(self.mgr,val._returnval) _Attrs_={ 'device':[getDevice,None], 'attached':[getAttached,None], 'error':[getError,None]} class ISharedFolderChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return ISharedFolderChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = ISharedFolderChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = ISharedFolderChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getScope(self): req=ISharedFolderChangedEvent_getScopeRequestMsg() req._this=self.handle val=self.mgr.getPort().ISharedFolderChangedEvent_getScope(req) return Scope(self.mgr,val._returnval) _Attrs_={ 'scope':[getScope,None]} class IRuntimeErrorEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IRuntimeErrorEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IRuntimeErrorEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IRuntimeErrorEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getFatal(self): req=IRuntimeErrorEvent_getFatalRequestMsg() req._this=self.handle val=self.mgr.getPort().IRuntimeErrorEvent_getFatal(req) return Boolean(self.mgr,val._returnval) def getId(self): req=IRuntimeErrorEvent_getIdRequestMsg() req._this=self.handle val=self.mgr.getPort().IRuntimeErrorEvent_getId(req) return String(self.mgr,val._returnval) def getMessage(self): req=IRuntimeErrorEvent_getMessageRequestMsg() req._this=self.handle val=self.mgr.getPort().IRuntimeErrorEvent_getMessage(req) return String(self.mgr,val._returnval) _Attrs_={ 'fatal':[getFatal,None], 'id':[getId,None], 'message':[getMessage,None]} class IEventSourceChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IEventSourceChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IEventSourceChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IEventSourceChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getListener(self): req=IEventSourceChangedEvent_getListenerRequestMsg() req._this=self.handle val=self.mgr.getPort().IEventSourceChangedEvent_getListener(req) return IEventListener(self.mgr,val._returnval) def getAdd(self): req=IEventSourceChangedEvent_getAddRequestMsg() req._this=self.handle val=self.mgr.getPort().IEventSourceChangedEvent_getAdd(req) return Boolean(self.mgr,val._returnval) _Attrs_={ 'listener':[getListener,None], 'add':[getAdd,None]} class IExtraDataChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IExtraDataChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IExtraDataChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IExtraDataChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getMachineId(self): req=IExtraDataChangedEvent_getMachineIdRequestMsg() req._this=self.handle val=self.mgr.getPort().IExtraDataChangedEvent_getMachineId(req) return String(self.mgr,val._returnval) def getKey(self): req=IExtraDataChangedEvent_getKeyRequestMsg() req._this=self.handle val=self.mgr.getPort().IExtraDataChangedEvent_getKey(req) return String(self.mgr,val._returnval) def getValue(self): req=IExtraDataChangedEvent_getValueRequestMsg() req._this=self.handle val=self.mgr.getPort().IExtraDataChangedEvent_getValue(req) return String(self.mgr,val._returnval) _Attrs_={ 'machineId':[getMachineId,None], 'key':[getKey,None], 'value':[getValue,None]} class IVetoEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IVetoEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IVetoEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IVetoEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def addVeto(self, _arg_reason): req=IVetoEvent_addVetoRequestMsg() req._this=self.handle req._reason=_arg_reason val=self.mgr.getPort().IVetoEvent_addVeto(req) return def isVetoed(self): req=IVetoEvent_isVetoedRequestMsg() req._this=self.handle val=self.mgr.getPort().IVetoEvent_isVetoed(req) return Boolean(self.mgr,val._returnval) def getVetos(self): req=IVetoEvent_getVetosRequestMsg() req._this=self.handle val=self.mgr.getPort().IVetoEvent_getVetos(req) return String(self.mgr,val._returnval, True) _Attrs_={} class IExtraDataCanChangeEvent(IVetoEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IExtraDataCanChangeEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IExtraDataCanChangeEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IVetoEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IExtraDataCanChangeEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getMachineId(self): req=IExtraDataCanChangeEvent_getMachineIdRequestMsg() req._this=self.handle val=self.mgr.getPort().IExtraDataCanChangeEvent_getMachineId(req) return String(self.mgr,val._returnval) def getKey(self): req=IExtraDataCanChangeEvent_getKeyRequestMsg() req._this=self.handle val=self.mgr.getPort().IExtraDataCanChangeEvent_getKey(req) return String(self.mgr,val._returnval) def getValue(self): req=IExtraDataCanChangeEvent_getValueRequestMsg() req._this=self.handle val=self.mgr.getPort().IExtraDataCanChangeEvent_getValue(req) return String(self.mgr,val._returnval) _Attrs_={ 'machineId':[getMachineId,None], 'key':[getKey,None], 'value':[getValue,None]} class ICanShowWindowEvent(IVetoEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return ICanShowWindowEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = ICanShowWindowEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IVetoEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = ICanShowWindowEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val _Attrs_={} class IShowWindowEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IShowWindowEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IShowWindowEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IShowWindowEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getWinId(self): req=IShowWindowEvent_getWinIdRequestMsg() req._this=self.handle val=self.mgr.getPort().IShowWindowEvent_getWinId(req) return Long(self.mgr,val._returnval) def setWinId(self, value): req=IShowWindowEvent_setWinIdRequestMsg() req._this=self.handle if type(value) in [int, bool, basestring, str]: req._winId = value else: req._winId = value.handle self.mgr.getPort().IShowWindowEvent_setWinId(req) _Attrs_={ 'winId':[getWinId,setWinId, ]} class INATRedirectEvent(IMachineEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return INATRedirectEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = INATRedirectEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IMachineEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = INATRedirectEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getSlot(self): req=INATRedirectEvent_getSlotRequestMsg() req._this=self.handle val=self.mgr.getPort().INATRedirectEvent_getSlot(req) return UnsignedInt(self.mgr,val._returnval) def getRemove(self): req=INATRedirectEvent_getRemoveRequestMsg() req._this=self.handle val=self.mgr.getPort().INATRedirectEvent_getRemove(req) return Boolean(self.mgr,val._returnval) def getName(self): req=INATRedirectEvent_getNameRequestMsg() req._this=self.handle val=self.mgr.getPort().INATRedirectEvent_getName(req) return String(self.mgr,val._returnval) def getProto(self): req=INATRedirectEvent_getProtoRequestMsg() req._this=self.handle val=self.mgr.getPort().INATRedirectEvent_getProto(req) return NATProtocol(self.mgr,val._returnval) def getHostIP(self): req=INATRedirectEvent_getHostIPRequestMsg() req._this=self.handle val=self.mgr.getPort().INATRedirectEvent_getHostIP(req) return String(self.mgr,val._returnval) def getHostPort(self): req=INATRedirectEvent_getHostPortRequestMsg() req._this=self.handle val=self.mgr.getPort().INATRedirectEvent_getHostPort(req) return Int(self.mgr,val._returnval) def getGuestIP(self): req=INATRedirectEvent_getGuestIPRequestMsg() req._this=self.handle val=self.mgr.getPort().INATRedirectEvent_getGuestIP(req) return String(self.mgr,val._returnval) def getGuestPort(self): req=INATRedirectEvent_getGuestPortRequestMsg() req._this=self.handle val=self.mgr.getPort().INATRedirectEvent_getGuestPort(req) return Int(self.mgr,val._returnval) _Attrs_={ 'slot':[getSlot,None], 'remove':[getRemove,None], 'name':[getName,None], 'proto':[getProto,None], 'hostIP':[getHostIP,None], 'hostPort':[getHostPort,None], 'guestIP':[getGuestIP,None], 'guestPort':[getGuestPort,None]} class IHostPCIDevicePlugEvent(IMachineEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IHostPCIDevicePlugEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IHostPCIDevicePlugEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IMachineEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IHostPCIDevicePlugEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getPlugged(self): req=IHostPCIDevicePlugEvent_getPluggedRequestMsg() req._this=self.handle val=self.mgr.getPort().IHostPCIDevicePlugEvent_getPlugged(req) return Boolean(self.mgr,val._returnval) def getSuccess(self): req=IHostPCIDevicePlugEvent_getSuccessRequestMsg() req._this=self.handle val=self.mgr.getPort().IHostPCIDevicePlugEvent_getSuccess(req) return Boolean(self.mgr,val._returnval) def getAttachment(self): req=IHostPCIDevicePlugEvent_getAttachmentRequestMsg() req._this=self.handle val=self.mgr.getPort().IHostPCIDevicePlugEvent_getAttachment(req) return IPCIDeviceAttachment(self.mgr,val._returnval) def getMessage(self): req=IHostPCIDevicePlugEvent_getMessageRequestMsg() req._this=self.handle val=self.mgr.getPort().IHostPCIDevicePlugEvent_getMessage(req) return String(self.mgr,val._returnval) _Attrs_={ 'plugged':[getPlugged,None], 'success':[getSuccess,None], 'attachment':[getAttachment,None], 'message':[getMessage,None]} class IVBoxSVCAvailabilityChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IVBoxSVCAvailabilityChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IVBoxSVCAvailabilityChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IVBoxSVCAvailabilityChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getAvailable(self): req=IVBoxSVCAvailabilityChangedEvent_getAvailableRequestMsg() req._this=self.handle val=self.mgr.getPort().IVBoxSVCAvailabilityChangedEvent_getAvailable(req) return Boolean(self.mgr,val._returnval) _Attrs_={ 'available':[getAvailable,None]} class IBandwidthGroupChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IBandwidthGroupChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IBandwidthGroupChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IBandwidthGroupChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getBandwidthGroup(self): req=IBandwidthGroupChangedEvent_getBandwidthGroupRequestMsg() req._this=self.handle val=self.mgr.getPort().IBandwidthGroupChangedEvent_getBandwidthGroup(req) return IBandwidthGroup(self.mgr,val._returnval) _Attrs_={ 'bandwidthGroup':[getBandwidthGroup,None]} class IGuestMonitorChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestMonitorChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestMonitorChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestMonitorChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getChangeType(self): req=IGuestMonitorChangedEvent_getChangeTypeRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestMonitorChangedEvent_getChangeType(req) return GuestMonitorChangedEventType(self.mgr,val._returnval) def getScreenId(self): req=IGuestMonitorChangedEvent_getScreenIdRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestMonitorChangedEvent_getScreenId(req) return UnsignedInt(self.mgr,val._returnval) def getOriginX(self): req=IGuestMonitorChangedEvent_getOriginXRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestMonitorChangedEvent_getOriginX(req) return UnsignedInt(self.mgr,val._returnval) def getOriginY(self): req=IGuestMonitorChangedEvent_getOriginYRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestMonitorChangedEvent_getOriginY(req) return UnsignedInt(self.mgr,val._returnval) def getWidth(self): req=IGuestMonitorChangedEvent_getWidthRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestMonitorChangedEvent_getWidth(req) return UnsignedInt(self.mgr,val._returnval) def getHeight(self): req=IGuestMonitorChangedEvent_getHeightRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestMonitorChangedEvent_getHeight(req) return UnsignedInt(self.mgr,val._returnval) _Attrs_={ 'changeType':[getChangeType,None], 'screenId':[getScreenId,None], 'originX':[getOriginX,None], 'originY':[getOriginY,None], 'width':[getWidth,None], 'height':[getHeight,None]} class IGuestUserStateChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestUserStateChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IGuestUserStateChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IGuestUserStateChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getName(self): req=IGuestUserStateChangedEvent_getNameRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestUserStateChangedEvent_getName(req) return String(self.mgr,val._returnval) def getDomain(self): req=IGuestUserStateChangedEvent_getDomainRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestUserStateChangedEvent_getDomain(req) return String(self.mgr,val._returnval) def getState(self): req=IGuestUserStateChangedEvent_getStateRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestUserStateChangedEvent_getState(req) return GuestUserState(self.mgr,val._returnval) def getStateDetails(self): req=IGuestUserStateChangedEvent_getStateDetailsRequestMsg() req._this=self.handle val=self.mgr.getPort().IGuestUserStateChangedEvent_getStateDetails(req) return String(self.mgr,val._returnval) _Attrs_={ 'name':[getName,None], 'domain':[getDomain,None], 'state':[getState,None], 'stateDetails':[getStateDetails,None]} class IStorageDeviceChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IStorageDeviceChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IStorageDeviceChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IStorageDeviceChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getStorageDevice(self): req=IStorageDeviceChangedEvent_getStorageDeviceRequestMsg() req._this=self.handle val=self.mgr.getPort().IStorageDeviceChangedEvent_getStorageDevice(req) return IMediumAttachment(self.mgr,val._returnval) def getRemoved(self): req=IStorageDeviceChangedEvent_getRemovedRequestMsg() req._this=self.handle val=self.mgr.getPort().IStorageDeviceChangedEvent_getRemoved(req) return Boolean(self.mgr,val._returnval) def getSilent(self): req=IStorageDeviceChangedEvent_getSilentRequestMsg() req._this=self.handle val=self.mgr.getPort().IStorageDeviceChangedEvent_getSilent(req) return Boolean(self.mgr,val._returnval) _Attrs_={ 'storageDevice':[getStorageDevice,None], 'removed':[getRemoved,None], 'silent':[getSilent,None]} class INATNetworkChangedEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return INATNetworkChangedEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = INATNetworkChangedEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = INATNetworkChangedEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getNetworkName(self): req=INATNetworkChangedEvent_getNetworkNameRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetworkChangedEvent_getNetworkName(req) return String(self.mgr,val._returnval) _Attrs_={ 'networkName':[getNetworkName,None]} class INATNetworkStartStopEvent(INATNetworkChangedEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return INATNetworkStartStopEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = INATNetworkStartStopEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return INATNetworkChangedEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = INATNetworkStartStopEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getStartEvent(self): req=INATNetworkStartStopEvent_getStartEventRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetworkStartStopEvent_getStartEvent(req) return Boolean(self.mgr,val._returnval) _Attrs_={ 'startEvent':[getStartEvent,None]} class INATNetworkAlterEvent(INATNetworkChangedEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return INATNetworkAlterEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = INATNetworkAlterEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return INATNetworkChangedEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = INATNetworkAlterEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val _Attrs_={} class INATNetworkCreationDeletionEvent(INATNetworkAlterEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return INATNetworkCreationDeletionEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = INATNetworkCreationDeletionEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return INATNetworkAlterEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = INATNetworkCreationDeletionEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getCreationEvent(self): req=INATNetworkCreationDeletionEvent_getCreationEventRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetworkCreationDeletionEvent_getCreationEvent(req) return Boolean(self.mgr,val._returnval) _Attrs_={ 'creationEvent':[getCreationEvent,None]} class INATNetworkSettingEvent(INATNetworkAlterEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return INATNetworkSettingEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = INATNetworkSettingEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return INATNetworkAlterEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = INATNetworkSettingEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getEnabled(self): req=INATNetworkSettingEvent_getEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetworkSettingEvent_getEnabled(req) return Boolean(self.mgr,val._returnval) def getNetwork(self): req=INATNetworkSettingEvent_getNetworkRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetworkSettingEvent_getNetwork(req) return String(self.mgr,val._returnval) def getGateway(self): req=INATNetworkSettingEvent_getGatewayRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetworkSettingEvent_getGateway(req) return String(self.mgr,val._returnval) def getAdvertiseDefaultIPv6RouteEnabled(self): req=INATNetworkSettingEvent_getAdvertiseDefaultIPv6RouteEnabledRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetworkSettingEvent_getAdvertiseDefaultIPv6RouteEnabled(req) return Boolean(self.mgr,val._returnval) def getNeedDhcpServer(self): req=INATNetworkSettingEvent_getNeedDhcpServerRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetworkSettingEvent_getNeedDhcpServer(req) return Boolean(self.mgr,val._returnval) _Attrs_={ 'enabled':[getEnabled,None], 'network':[getNetwork,None], 'gateway':[getGateway,None], 'advertiseDefaultIPv6RouteEnabled':[getAdvertiseDefaultIPv6RouteEnabled,None], 'needDhcpServer':[getNeedDhcpServer,None]} class INATNetworkPortForwardEvent(INATNetworkAlterEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return INATNetworkPortForwardEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = INATNetworkPortForwardEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return INATNetworkAlterEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = INATNetworkPortForwardEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val def getCreate(self): req=INATNetworkPortForwardEvent_getCreateRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetworkPortForwardEvent_getCreate(req) return Boolean(self.mgr,val._returnval) def getIpv6(self): req=INATNetworkPortForwardEvent_getIpv6RequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetworkPortForwardEvent_getIpv6(req) return Boolean(self.mgr,val._returnval) def getName(self): req=INATNetworkPortForwardEvent_getNameRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetworkPortForwardEvent_getName(req) return String(self.mgr,val._returnval) def getProto(self): req=INATNetworkPortForwardEvent_getProtoRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetworkPortForwardEvent_getProto(req) return NATProtocol(self.mgr,val._returnval) def getHostIp(self): req=INATNetworkPortForwardEvent_getHostIpRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetworkPortForwardEvent_getHostIp(req) return String(self.mgr,val._returnval) def getHostPort(self): req=INATNetworkPortForwardEvent_getHostPortRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetworkPortForwardEvent_getHostPort(req) return Int(self.mgr,val._returnval) def getGuestIp(self): req=INATNetworkPortForwardEvent_getGuestIpRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetworkPortForwardEvent_getGuestIp(req) return String(self.mgr,val._returnval) def getGuestPort(self): req=INATNetworkPortForwardEvent_getGuestPortRequestMsg() req._this=self.handle val=self.mgr.getPort().INATNetworkPortForwardEvent_getGuestPort(req) return Int(self.mgr,val._returnval) _Attrs_={ 'create':[getCreate,None], 'ipv6':[getIpv6,None], 'name':[getName,None], 'proto':[getProto,None], 'hostIp':[getHostIp,None], 'hostPort':[getHostPort,None], 'guestIp':[getGuestIp,None], 'guestPort':[getGuestPort,None]} class IHostNameResolutionConfigurationChangeEvent(IEvent): def __init__(self, mgr, handle, isarray = False): self.mgr = mgr if handle is None: raise Exception("bad handle: "+str(handle)) self.handle = handle self.isarray = isarray def releaseRemote(self): try: req=IManagedObjectRef_releaseRequestMsg() req._this=handle self.mgr.getPort().IManagedObjectRef_release(req) except: pass def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IHostNameResolutionConfigurationChangeEvent(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" def __str__(self): return self.handle def isValid(self): return self.handle != None and self.handle != '' def __getattr__(self,name): hndl = IHostNameResolutionConfigurationChangeEvent._Attrs_.get(name, None) if hndl != None: if hndl[0] != None: return hndl[0](self) else: raise AttributeError else: return IEvent.__getattr__(self, name) def __setattr__(self, name, val): hndl = IHostNameResolutionConfigurationChangeEvent._Attrs_.get(name, None) if (hndl != None and hndl[1] != None): hndl[1](self,val) else: self.__dict__[name] = val _Attrs_={} class IPCIDeviceAttachment: def __init__(self, mgr, handle, isarray = False): self.mgr = mgr self.isarray = isarray if isarray: self.handle = handle else: self.name = String(self.mgr, handle._name) self.isPhysicalDevice = Boolean(self.mgr, handle._isPhysicalDevice) self.hostAddress = Int(self.mgr, handle._hostAddress) self.guestAddress = Int(self.mgr, handle._guestAddress) pass def getName(self): return self.name def setName(self): raise Error, 'setters not supported' def getIsPhysicalDevice(self): return self.isPhysicalDevice def setIsPhysicalDevice(self): raise Error, 'setters not supported' def getHostAddress(self): return self.hostAddress def setHostAddress(self): raise Error, 'setters not supported' def getGuestAddress(self): return self.guestAddress def setGuestAddress(self): raise Error, 'setters not supported' def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IPCIDeviceAttachment(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" class IVRDEServerInfo: def __init__(self, mgr, handle, isarray = False): self.mgr = mgr self.isarray = isarray if isarray: self.handle = handle else: self.active = Boolean(self.mgr, handle._active) self.port = Int(self.mgr, handle._port) self.numberOfClients = UnsignedInt(self.mgr, handle._numberOfClients) self.beginTime = Long(self.mgr, handle._beginTime) self.endTime = Long(self.mgr, handle._endTime) self.bytesSent = Long(self.mgr, handle._bytesSent) self.bytesSentTotal = Long(self.mgr, handle._bytesSentTotal) self.bytesReceived = Long(self.mgr, handle._bytesReceived) self.bytesReceivedTotal = Long(self.mgr, handle._bytesReceivedTotal) self.user = String(self.mgr, handle._user) self.domain = String(self.mgr, handle._domain) self.clientName = String(self.mgr, handle._clientName) self.clientIP = String(self.mgr, handle._clientIP) self.clientVersion = UnsignedInt(self.mgr, handle._clientVersion) self.encryptionStyle = UnsignedInt(self.mgr, handle._encryptionStyle) pass def getActive(self): return self.active def setActive(self): raise Error, 'setters not supported' def getPort(self): return self.port def setPort(self): raise Error, 'setters not supported' def getNumberOfClients(self): return self.numberOfClients def setNumberOfClients(self): raise Error, 'setters not supported' def getBeginTime(self): return self.beginTime def setBeginTime(self): raise Error, 'setters not supported' def getEndTime(self): return self.endTime def setEndTime(self): raise Error, 'setters not supported' def getBytesSent(self): return self.bytesSent def setBytesSent(self): raise Error, 'setters not supported' def getBytesSentTotal(self): return self.bytesSentTotal def setBytesSentTotal(self): raise Error, 'setters not supported' def getBytesReceived(self): return self.bytesReceived def setBytesReceived(self): raise Error, 'setters not supported' def getBytesReceivedTotal(self): return self.bytesReceivedTotal def setBytesReceivedTotal(self): raise Error, 'setters not supported' def getUser(self): return self.user def setUser(self): raise Error, 'setters not supported' def getDomain(self): return self.domain def setDomain(self): raise Error, 'setters not supported' def getClientName(self): return self.clientName def setClientName(self): raise Error, 'setters not supported' def getClientIP(self): return self.clientIP def setClientIP(self): raise Error, 'setters not supported' def getClientVersion(self): return self.clientVersion def setClientVersion(self): raise Error, 'setters not supported' def getEncryptionStyle(self): return self.encryptionStyle def setEncryptionStyle(self): raise Error, 'setters not supported' def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IVRDEServerInfo(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" class IGuestOSType: def __init__(self, mgr, handle, isarray = False): self.mgr = mgr self.isarray = isarray if isarray: self.handle = handle else: self.familyId = String(self.mgr, handle._familyId) self.familyDescription = String(self.mgr, handle._familyDescription) self.id = String(self.mgr, handle._id) self.description = String(self.mgr, handle._description) self.is64Bit = Boolean(self.mgr, handle._is64Bit) self.recommendedIOAPIC = Boolean(self.mgr, handle._recommendedIOAPIC) self.recommendedVirtEx = Boolean(self.mgr, handle._recommendedVirtEx) self.recommendedRAM = UnsignedInt(self.mgr, handle._recommendedRAM) self.recommendedVRAM = UnsignedInt(self.mgr, handle._recommendedVRAM) self.recommended2DVideoAcceleration = Boolean(self.mgr, handle._recommended2DVideoAcceleration) self.recommended3DAcceleration = Boolean(self.mgr, handle._recommended3DAcceleration) self.recommendedHDD = Long(self.mgr, handle._recommendedHDD) self.adapterType = NetworkAdapterType(self.mgr, handle._adapterType) self.recommendedPAE = Boolean(self.mgr, handle._recommendedPAE) self.recommendedDVDStorageController = StorageControllerType(self.mgr, handle._recommendedDVDStorageController) self.recommendedDVDStorageBus = StorageBus(self.mgr, handle._recommendedDVDStorageBus) self.recommendedHDStorageController = StorageControllerType(self.mgr, handle._recommendedHDStorageController) self.recommendedHDStorageBus = StorageBus(self.mgr, handle._recommendedHDStorageBus) self.recommendedFirmware = FirmwareType(self.mgr, handle._recommendedFirmware) self.recommendedUSBHID = Boolean(self.mgr, handle._recommendedUSBHID) self.recommendedHPET = Boolean(self.mgr, handle._recommendedHPET) self.recommendedUSBTablet = Boolean(self.mgr, handle._recommendedUSBTablet) self.recommendedRTCUseUTC = Boolean(self.mgr, handle._recommendedRTCUseUTC) self.recommendedChipset = ChipsetType(self.mgr, handle._recommendedChipset) self.recommendedAudioController = AudioControllerType(self.mgr, handle._recommendedAudioController) self.recommendedFloppy = Boolean(self.mgr, handle._recommendedFloppy) self.recommendedUSB = Boolean(self.mgr, handle._recommendedUSB) pass def getFamilyId(self): return self.familyId def setFamilyId(self): raise Error, 'setters not supported' def getFamilyDescription(self): return self.familyDescription def setFamilyDescription(self): raise Error, 'setters not supported' def getId(self): return self.id def setId(self): raise Error, 'setters not supported' def getDescription(self): return self.description def setDescription(self): raise Error, 'setters not supported' def getIs64Bit(self): return self.is64Bit def setIs64Bit(self): raise Error, 'setters not supported' def getRecommendedIOAPIC(self): return self.recommendedIOAPIC def setRecommendedIOAPIC(self): raise Error, 'setters not supported' def getRecommendedVirtEx(self): return self.recommendedVirtEx def setRecommendedVirtEx(self): raise Error, 'setters not supported' def getRecommendedRAM(self): return self.recommendedRAM def setRecommendedRAM(self): raise Error, 'setters not supported' def getRecommendedVRAM(self): return self.recommendedVRAM def setRecommendedVRAM(self): raise Error, 'setters not supported' def getRecommended2DVideoAcceleration(self): return self.recommended2DVideoAcceleration def setRecommended2DVideoAcceleration(self): raise Error, 'setters not supported' def getRecommended3DAcceleration(self): return self.recommended3DAcceleration def setRecommended3DAcceleration(self): raise Error, 'setters not supported' def getRecommendedHDD(self): return self.recommendedHDD def setRecommendedHDD(self): raise Error, 'setters not supported' def getAdapterType(self): return self.adapterType def setAdapterType(self): raise Error, 'setters not supported' def getRecommendedPAE(self): return self.recommendedPAE def setRecommendedPAE(self): raise Error, 'setters not supported' def getRecommendedDVDStorageController(self): return self.recommendedDVDStorageController def setRecommendedDVDStorageController(self): raise Error, 'setters not supported' def getRecommendedDVDStorageBus(self): return self.recommendedDVDStorageBus def setRecommendedDVDStorageBus(self): raise Error, 'setters not supported' def getRecommendedHDStorageController(self): return self.recommendedHDStorageController def setRecommendedHDStorageController(self): raise Error, 'setters not supported' def getRecommendedHDStorageBus(self): return self.recommendedHDStorageBus def setRecommendedHDStorageBus(self): raise Error, 'setters not supported' def getRecommendedFirmware(self): return self.recommendedFirmware def setRecommendedFirmware(self): raise Error, 'setters not supported' def getRecommendedUSBHID(self): return self.recommendedUSBHID def setRecommendedUSBHID(self): raise Error, 'setters not supported' def getRecommendedHPET(self): return self.recommendedHPET def setRecommendedHPET(self): raise Error, 'setters not supported' def getRecommendedUSBTablet(self): return self.recommendedUSBTablet def setRecommendedUSBTablet(self): raise Error, 'setters not supported' def getRecommendedRTCUseUTC(self): return self.recommendedRTCUseUTC def setRecommendedRTCUseUTC(self): raise Error, 'setters not supported' def getRecommendedChipset(self): return self.recommendedChipset def setRecommendedChipset(self): raise Error, 'setters not supported' def getRecommendedAudioController(self): return self.recommendedAudioController def setRecommendedAudioController(self): raise Error, 'setters not supported' def getRecommendedFloppy(self): return self.recommendedFloppy def setRecommendedFloppy(self): raise Error, 'setters not supported' def getRecommendedUSB(self): return self.recommendedUSB def setRecommendedUSB(self): raise Error, 'setters not supported' def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IGuestOSType(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" class IAdditionsFacility: def __init__(self, mgr, handle, isarray = False): self.mgr = mgr self.isarray = isarray if isarray: self.handle = handle else: self.classType = AdditionsFacilityClass(self.mgr, handle._classType) self.lastUpdated = Long(self.mgr, handle._lastUpdated) self.name = String(self.mgr, handle._name) self.status = AdditionsFacilityStatus(self.mgr, handle._status) self.type = AdditionsFacilityType(self.mgr, handle._type) pass def getClassType(self): return self.classType def setClassType(self): raise Error, 'setters not supported' def getLastUpdated(self): return self.lastUpdated def setLastUpdated(self): raise Error, 'setters not supported' def getName(self): return self.name def setName(self): raise Error, 'setters not supported' def getStatus(self): return self.status def setStatus(self): raise Error, 'setters not supported' def getType(self): return self.type def setType(self): raise Error, 'setters not supported' def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IAdditionsFacility(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" class IMediumAttachment: def __init__(self, mgr, handle, isarray = False): self.mgr = mgr self.isarray = isarray if isarray: self.handle = handle else: self.medium = IMedium(self.mgr, handle._medium) self.controller = String(self.mgr, handle._controller) self.port = Int(self.mgr, handle._port) self.device = Int(self.mgr, handle._device) self.type = DeviceType(self.mgr, handle._type) self.passthrough = Boolean(self.mgr, handle._passthrough) self.temporaryEject = Boolean(self.mgr, handle._temporaryEject) self.isEjected = Boolean(self.mgr, handle._isEjected) self.nonRotational = Boolean(self.mgr, handle._nonRotational) self.discard = Boolean(self.mgr, handle._discard) self.hotPluggable = Boolean(self.mgr, handle._hotPluggable) self.bandwidthGroup = IBandwidthGroup(self.mgr, handle._bandwidthGroup) pass def getMedium(self): return self.medium def setMedium(self): raise Error, 'setters not supported' def getController(self): return self.controller def setController(self): raise Error, 'setters not supported' def getPort(self): return self.port def setPort(self): raise Error, 'setters not supported' def getDevice(self): return self.device def setDevice(self): raise Error, 'setters not supported' def getType(self): return self.type def setType(self): raise Error, 'setters not supported' def getPassthrough(self): return self.passthrough def setPassthrough(self): raise Error, 'setters not supported' def getTemporaryEject(self): return self.temporaryEject def setTemporaryEject(self): raise Error, 'setters not supported' def getIsEjected(self): return self.isEjected def setIsEjected(self): raise Error, 'setters not supported' def getNonRotational(self): return self.nonRotational def setNonRotational(self): raise Error, 'setters not supported' def getDiscard(self): return self.discard def setDiscard(self): raise Error, 'setters not supported' def getHotPluggable(self): return self.hotPluggable def setHotPluggable(self): raise Error, 'setters not supported' def getBandwidthGroup(self): return self.bandwidthGroup def setBandwidthGroup(self): raise Error, 'setters not supported' def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return IMediumAttachment(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" class ISharedFolder: def __init__(self, mgr, handle, isarray = False): self.mgr = mgr self.isarray = isarray if isarray: self.handle = handle else: self.name = String(self.mgr, handle._name) self.hostPath = String(self.mgr, handle._hostPath) self.accessible = Boolean(self.mgr, handle._accessible) self.writable = Boolean(self.mgr, handle._writable) self.autoMount = Boolean(self.mgr, handle._autoMount) self.lastAccessError = String(self.mgr, handle._lastAccessError) pass def getName(self): return self.name def setName(self): raise Error, 'setters not supported' def getHostPath(self): return self.hostPath def setHostPath(self): raise Error, 'setters not supported' def getAccessible(self): return self.accessible def setAccessible(self): raise Error, 'setters not supported' def getWritable(self): return self.writable def setWritable(self): raise Error, 'setters not supported' def getAutoMount(self): return self.autoMount def setAutoMount(self): raise Error, 'setters not supported' def getLastAccessError(self): return self.lastAccessError def setLastAccessError(self): raise Error, 'setters not supported' def __next(self): if self.isarray: return self.handle.__next() raise TypeError, "iteration over non-sequence" def __size(self): if self.isarray: return self.handle.__size() raise TypeError, "iteration over non-sequence" def __len__(self): if self.isarray: return self.handle.__len__() raise TypeError, "iteration over non-sequence" def __getitem__(self, index): if self.isarray: return ISharedFolder(self.mgr, self.handle[index]) raise TypeError, "iteration over non-sequence" class SettingsVersion: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=SettingsVersion._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,SettingsVersion): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,SettingsVersion): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return SettingsVersion._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Null',1:'v1_0',2:'v1_1',3:'v1_2',4:'v1_3pre',5:'v1_3',6:'v1_4',7:'v1_5',8:'v1_6',9:'v1_7',10:'v1_8',11:'v1_9',12:'v1_10',13:'v1_11',14:'v1_12',15:'v1_13',16:'v1_14',99999:'Future'} _ValueMap={ 'Null':0, 'v1_0':1, 'v1_1':2, 'v1_2':3, 'v1_3pre':4, 'v1_3':5, 'v1_4':6, 'v1_5':7, 'v1_6':8, 'v1_7':9, 'v1_8':10, 'v1_9':11, 'v1_10':12, 'v1_11':13, 'v1_12':14, 'v1_13':15, 'v1_14':16, 'Future':99999} Null=0 v1_0=1 v1_1=2 v1_2=3 v1_3pre=4 v1_3=5 v1_4=6 v1_5=7 v1_6=8 v1_7=9 v1_8=10 v1_9=11 v1_10=12 v1_11=13 v1_12=14 v1_13=15 v1_14=16 Future=99999 class AccessMode: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=AccessMode._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,AccessMode): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,AccessMode): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return AccessMode._NameMap[self.handle] def __int__(self): return self.handle _NameMap={1:'ReadOnly',2:'ReadWrite'} _ValueMap={ 'ReadOnly':1, 'ReadWrite':2} ReadOnly=1 ReadWrite=2 class MachineState: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=MachineState._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,MachineState): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,MachineState): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return MachineState._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Null',1:'PoweredOff',2:'Saved',3:'Teleported',4:'Aborted',5:'Running',6:'Paused',7:'Stuck',8:'Teleporting',9:'LiveSnapshotting',10:'Starting',11:'Stopping',12:'Saving',13:'Restoring',14:'TeleportingPausedVM',15:'TeleportingIn',16:'FaultTolerantSyncing',17:'DeletingSnapshotOnline',18:'DeletingSnapshotPaused',19:'RestoringSnapshot',20:'DeletingSnapshot',21:'SettingUp',5:'FirstOnline',18:'LastOnline',8:'FirstTransient',21:'LastTransient'} _ValueMap={ 'Null':0, 'PoweredOff':1, 'Saved':2, 'Teleported':3, 'Aborted':4, 'Running':5, 'Paused':6, 'Stuck':7, 'Teleporting':8, 'LiveSnapshotting':9, 'Starting':10, 'Stopping':11, 'Saving':12, 'Restoring':13, 'TeleportingPausedVM':14, 'TeleportingIn':15, 'FaultTolerantSyncing':16, 'DeletingSnapshotOnline':17, 'DeletingSnapshotPaused':18, 'RestoringSnapshot':19, 'DeletingSnapshot':20, 'SettingUp':21, 'FirstOnline':5, 'LastOnline':18, 'FirstTransient':8, 'LastTransient':21} Null=0 PoweredOff=1 Saved=2 Teleported=3 Aborted=4 Running=5 Paused=6 Stuck=7 Teleporting=8 LiveSnapshotting=9 Starting=10 Stopping=11 Saving=12 Restoring=13 TeleportingPausedVM=14 TeleportingIn=15 FaultTolerantSyncing=16 DeletingSnapshotOnline=17 DeletingSnapshotPaused=18 RestoringSnapshot=19 DeletingSnapshot=20 SettingUp=21 FirstOnline=5 LastOnline=18 FirstTransient=8 LastTransient=21 class SessionState: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=SessionState._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,SessionState): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,SessionState): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return SessionState._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Null',1:'Unlocked',2:'Locked',3:'Spawning',4:'Unlocking'} _ValueMap={ 'Null':0, 'Unlocked':1, 'Locked':2, 'Spawning':3, 'Unlocking':4} Null=0 Unlocked=1 Locked=2 Spawning=3 Unlocking=4 class CPUPropertyType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=CPUPropertyType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,CPUPropertyType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,CPUPropertyType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return CPUPropertyType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Null',1:'PAE',2:'Synthetic',3:'LongMode',4:'TripleFaultReset'} _ValueMap={ 'Null':0, 'PAE':1, 'Synthetic':2, 'LongMode':3, 'TripleFaultReset':4} Null=0 PAE=1 Synthetic=2 LongMode=3 TripleFaultReset=4 class HWVirtExPropertyType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=HWVirtExPropertyType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,HWVirtExPropertyType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,HWVirtExPropertyType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return HWVirtExPropertyType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Null',1:'Enabled',2:'VPID',3:'NestedPaging',4:'UnrestrictedExecution',5:'LargePages',6:'Force'} _ValueMap={ 'Null':0, 'Enabled':1, 'VPID':2, 'NestedPaging':3, 'UnrestrictedExecution':4, 'LargePages':5, 'Force':6} Null=0 Enabled=1 VPID=2 NestedPaging=3 UnrestrictedExecution=4 LargePages=5 Force=6 class FaultToleranceState: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=FaultToleranceState._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,FaultToleranceState): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,FaultToleranceState): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return FaultToleranceState._NameMap[self.handle] def __int__(self): return self.handle _NameMap={1:'Inactive',2:'Master',3:'Standby'} _ValueMap={ 'Inactive':1, 'Master':2, 'Standby':3} Inactive=1 Master=2 Standby=3 class LockType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=LockType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,LockType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,LockType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return LockType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={2:'Write',1:'Shared',3:'VM'} _ValueMap={ 'Write':2, 'Shared':1, 'VM':3} Write=2 Shared=1 VM=3 class SessionType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=SessionType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,SessionType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,SessionType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return SessionType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Null',1:'WriteLock',2:'Remote',3:'Shared'} _ValueMap={ 'Null':0, 'WriteLock':1, 'Remote':2, 'Shared':3} Null=0 WriteLock=1 Remote=2 Shared=3 class DeviceType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=DeviceType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,DeviceType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,DeviceType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return DeviceType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Null',1:'Floppy',2:'DVD',3:'HardDisk',4:'Network',5:'USB',6:'SharedFolder'} _ValueMap={ 'Null':0, 'Floppy':1, 'DVD':2, 'HardDisk':3, 'Network':4, 'USB':5, 'SharedFolder':6} Null=0 Floppy=1 DVD=2 HardDisk=3 Network=4 USB=5 SharedFolder=6 class DeviceActivity: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=DeviceActivity._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,DeviceActivity): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,DeviceActivity): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return DeviceActivity._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Null',1:'Idle',2:'Reading',3:'Writing'} _ValueMap={ 'Null':0, 'Idle':1, 'Reading':2, 'Writing':3} Null=0 Idle=1 Reading=2 Writing=3 class ClipboardMode: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=ClipboardMode._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,ClipboardMode): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,ClipboardMode): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return ClipboardMode._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Disabled',1:'HostToGuest',2:'GuestToHost',3:'Bidirectional'} _ValueMap={ 'Disabled':0, 'HostToGuest':1, 'GuestToHost':2, 'Bidirectional':3} Disabled=0 HostToGuest=1 GuestToHost=2 Bidirectional=3 class DragAndDropMode: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=DragAndDropMode._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,DragAndDropMode): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,DragAndDropMode): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return DragAndDropMode._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Disabled',1:'HostToGuest',2:'GuestToHost',3:'Bidirectional'} _ValueMap={ 'Disabled':0, 'HostToGuest':1, 'GuestToHost':2, 'Bidirectional':3} Disabled=0 HostToGuest=1 GuestToHost=2 Bidirectional=3 class Scope: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=Scope._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,Scope): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,Scope): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return Scope._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Global',1:'Machine',2:'Session'} _ValueMap={ 'Global':0, 'Machine':1, 'Session':2} Global=0 Machine=1 Session=2 class BIOSBootMenuMode: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=BIOSBootMenuMode._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,BIOSBootMenuMode): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,BIOSBootMenuMode): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return BIOSBootMenuMode._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Disabled',1:'MenuOnly',2:'MessageAndMenu'} _ValueMap={ 'Disabled':0, 'MenuOnly':1, 'MessageAndMenu':2} Disabled=0 MenuOnly=1 MessageAndMenu=2 class ProcessorFeature: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=ProcessorFeature._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,ProcessorFeature): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,ProcessorFeature): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return ProcessorFeature._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'HWVirtEx',1:'PAE',2:'LongMode',3:'NestedPaging'} _ValueMap={ 'HWVirtEx':0, 'PAE':1, 'LongMode':2, 'NestedPaging':3} HWVirtEx=0 PAE=1 LongMode=2 NestedPaging=3 class FirmwareType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=FirmwareType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,FirmwareType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,FirmwareType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return FirmwareType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={1:'BIOS',2:'EFI',3:'EFI32',4:'EFI64',5:'EFIDUAL'} _ValueMap={ 'BIOS':1, 'EFI':2, 'EFI32':3, 'EFI64':4, 'EFIDUAL':5} BIOS=1 EFI=2 EFI32=3 EFI64=4 EFIDUAL=5 class PointingHIDType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=PointingHIDType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,PointingHIDType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,PointingHIDType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return PointingHIDType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={1:'None',2:'PS2Mouse',3:'USBMouse',4:'USBTablet',5:'ComboMouse',6:'USBMultiTouch'} _ValueMap={ 'None':1, 'PS2Mouse':2, 'USBMouse':3, 'USBTablet':4, 'ComboMouse':5, 'USBMultiTouch':6} _None=1 PS2Mouse=2 USBMouse=3 USBTablet=4 ComboMouse=5 USBMultiTouch=6 class KeyboardHIDType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=KeyboardHIDType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,KeyboardHIDType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,KeyboardHIDType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return KeyboardHIDType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={1:'None',2:'PS2Keyboard',3:'USBKeyboard',4:'ComboKeyboard'} _ValueMap={ 'None':1, 'PS2Keyboard':2, 'USBKeyboard':3, 'ComboKeyboard':4} _None=1 PS2Keyboard=2 USBKeyboard=3 ComboKeyboard=4 class DhcpOpt: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=DhcpOpt._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,DhcpOpt): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,DhcpOpt): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return DhcpOpt._NameMap[self.handle] def __int__(self): return self.handle _NameMap={1:'SubnetMask',2:'TimeOffset',3:'Router',4:'TimeServer',5:'NameServer',6:'DomainNameServer',7:'LogServer',8:'Cookie',9:'LPRServer',10:'ImpressServer',11:'ResourseLocationServer',12:'HostName',13:'BootFileSize',14:'MeritDumpFile',15:'DomainName',16:'SwapServer',17:'RootPath',18:'ExtensionPath',19:'IPForwardingEnableDisable',20:'NonLocalSourceRoutingEnableDisable',21:'PolicyFilter',22:'MaximumDatagramReassemblySize',23:'DefaultIPTime2Live',24:'PathMTUAgingTimeout',25:'IPLayerParametersPerInterface',26:'InterfaceMTU',27:'AllSubnetsAreLocal',28:'BroadcastAddress',29:'PerformMaskDiscovery',30:'MaskSupplier',31:'PerformRouteDiscovery',32:'RouterSolicitationAddress',33:'StaticRoute',34:'TrailerEncapsulation',35:'ARPCacheTimeout',36:'EthernetEncapsulation',37:'TCPDefaultTTL',38:'TCPKeepAliveInterval',39:'TCPKeepAliveGarbage',40:'NetworkInformationServiceDomain',41:'NetworkInformationServiceServers',42:'NetworkTimeProtocolServers',43:'VendorSpecificInformation',44:'Option_44',45:'Option_45',46:'Option_46',47:'Option_47',48:'Option_48',49:'Option_49',51:'IPAddressLeaseTime',64:'Option_64',65:'Option_65',66:'TFTPServerName',67:'BootfileName',68:'Option_68',69:'Option_69',70:'Option_70',71:'Option_71',72:'Option_72',73:'Option_73',74:'Option_74',75:'Option_75',119:'Option_119'} _ValueMap={ 'SubnetMask':1, 'TimeOffset':2, 'Router':3, 'TimeServer':4, 'NameServer':5, 'DomainNameServer':6, 'LogServer':7, 'Cookie':8, 'LPRServer':9, 'ImpressServer':10, 'ResourseLocationServer':11, 'HostName':12, 'BootFileSize':13, 'MeritDumpFile':14, 'DomainName':15, 'SwapServer':16, 'RootPath':17, 'ExtensionPath':18, 'IPForwardingEnableDisable':19, 'NonLocalSourceRoutingEnableDisable':20, 'PolicyFilter':21, 'MaximumDatagramReassemblySize':22, 'DefaultIPTime2Live':23, 'PathMTUAgingTimeout':24, 'IPLayerParametersPerInterface':25, 'InterfaceMTU':26, 'AllSubnetsAreLocal':27, 'BroadcastAddress':28, 'PerformMaskDiscovery':29, 'MaskSupplier':30, 'PerformRouteDiscovery':31, 'RouterSolicitationAddress':32, 'StaticRoute':33, 'TrailerEncapsulation':34, 'ARPCacheTimeout':35, 'EthernetEncapsulation':36, 'TCPDefaultTTL':37, 'TCPKeepAliveInterval':38, 'TCPKeepAliveGarbage':39, 'NetworkInformationServiceDomain':40, 'NetworkInformationServiceServers':41, 'NetworkTimeProtocolServers':42, 'VendorSpecificInformation':43, 'Option_44':44, 'Option_45':45, 'Option_46':46, 'Option_47':47, 'Option_48':48, 'Option_49':49, 'IPAddressLeaseTime':51, 'Option_64':64, 'Option_65':65, 'TFTPServerName':66, 'BootfileName':67, 'Option_68':68, 'Option_69':69, 'Option_70':70, 'Option_71':71, 'Option_72':72, 'Option_73':73, 'Option_74':74, 'Option_75':75, 'Option_119':119} SubnetMask=1 TimeOffset=2 Router=3 TimeServer=4 NameServer=5 DomainNameServer=6 LogServer=7 Cookie=8 LPRServer=9 ImpressServer=10 ResourseLocationServer=11 HostName=12 BootFileSize=13 MeritDumpFile=14 DomainName=15 SwapServer=16 RootPath=17 ExtensionPath=18 IPForwardingEnableDisable=19 NonLocalSourceRoutingEnableDisable=20 PolicyFilter=21 MaximumDatagramReassemblySize=22 DefaultIPTime2Live=23 PathMTUAgingTimeout=24 IPLayerParametersPerInterface=25 InterfaceMTU=26 AllSubnetsAreLocal=27 BroadcastAddress=28 PerformMaskDiscovery=29 MaskSupplier=30 PerformRouteDiscovery=31 RouterSolicitationAddress=32 StaticRoute=33 TrailerEncapsulation=34 ARPCacheTimeout=35 EthernetEncapsulation=36 TCPDefaultTTL=37 TCPKeepAliveInterval=38 TCPKeepAliveGarbage=39 NetworkInformationServiceDomain=40 NetworkInformationServiceServers=41 NetworkTimeProtocolServers=42 VendorSpecificInformation=43 Option_44=44 Option_45=45 Option_46=46 Option_47=47 Option_48=48 Option_49=49 IPAddressLeaseTime=51 Option_64=64 Option_65=65 TFTPServerName=66 BootfileName=67 Option_68=68 Option_69=69 Option_70=70 Option_71=71 Option_72=72 Option_73=73 Option_74=74 Option_75=75 Option_119=119 class VFSType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=VFSType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,VFSType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,VFSType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return VFSType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={1:'File',2:'Cloud',3:'S3',4:'WebDav'} _ValueMap={ 'File':1, 'Cloud':2, 'S3':3, 'WebDav':4} File=1 Cloud=2 S3=3 WebDav=4 class VFSFileType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=VFSFileType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,VFSFileType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,VFSFileType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return VFSFileType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={1:'Unknown',2:'Fifo',3:'DevChar',4:'Directory',5:'DevBlock',6:'File',7:'SymLink',8:'Socket',9:'WhiteOut'} _ValueMap={ 'Unknown':1, 'Fifo':2, 'DevChar':3, 'Directory':4, 'DevBlock':5, 'File':6, 'SymLink':7, 'Socket':8, 'WhiteOut':9} Unknown=1 Fifo=2 DevChar=3 Directory=4 DevBlock=5 File=6 SymLink=7 Socket=8 WhiteOut=9 class ImportOptions: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=ImportOptions._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,ImportOptions): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,ImportOptions): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return ImportOptions._NameMap[self.handle] def __int__(self): return self.handle _NameMap={1:'KeepAllMACs',2:'KeepNATMACs'} _ValueMap={ 'KeepAllMACs':1, 'KeepNATMACs':2} KeepAllMACs=1 KeepNATMACs=2 class ExportOptions: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=ExportOptions._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,ExportOptions): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,ExportOptions): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return ExportOptions._NameMap[self.handle] def __int__(self): return self.handle _NameMap={1:'CreateManifest',2:'ExportDVDImages'} _ValueMap={ 'CreateManifest':1, 'ExportDVDImages':2} CreateManifest=1 ExportDVDImages=2 class VirtualSystemDescriptionType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=VirtualSystemDescriptionType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,VirtualSystemDescriptionType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,VirtualSystemDescriptionType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return VirtualSystemDescriptionType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={1:'Ignore',2:'OS',3:'Name',4:'Product',5:'Vendor',6:'Version',7:'ProductUrl',8:'VendorUrl',9:'Description',10:'License',11:'Miscellaneous',12:'CPU',13:'Memory',14:'HardDiskControllerIDE',15:'HardDiskControllerSATA',16:'HardDiskControllerSCSI',17:'HardDiskControllerSAS',18:'HardDiskImage',19:'Floppy',20:'CDROM',21:'NetworkAdapter',22:'USBController',23:'SoundCard',24:'SettingsFile'} _ValueMap={ 'Ignore':1, 'OS':2, 'Name':3, 'Product':4, 'Vendor':5, 'Version':6, 'ProductUrl':7, 'VendorUrl':8, 'Description':9, 'License':10, 'Miscellaneous':11, 'CPU':12, 'Memory':13, 'HardDiskControllerIDE':14, 'HardDiskControllerSATA':15, 'HardDiskControllerSCSI':16, 'HardDiskControllerSAS':17, 'HardDiskImage':18, 'Floppy':19, 'CDROM':20, 'NetworkAdapter':21, 'USBController':22, 'SoundCard':23, 'SettingsFile':24} Ignore=1 OS=2 Name=3 Product=4 Vendor=5 Version=6 ProductUrl=7 VendorUrl=8 Description=9 License=10 Miscellaneous=11 CPU=12 Memory=13 HardDiskControllerIDE=14 HardDiskControllerSATA=15 HardDiskControllerSCSI=16 HardDiskControllerSAS=17 HardDiskImage=18 Floppy=19 CDROM=20 NetworkAdapter=21 USBController=22 SoundCard=23 SettingsFile=24 class VirtualSystemDescriptionValueType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=VirtualSystemDescriptionValueType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,VirtualSystemDescriptionValueType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,VirtualSystemDescriptionValueType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return VirtualSystemDescriptionValueType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={1:'Reference',2:'Original',3:'Auto',4:'ExtraConfig'} _ValueMap={ 'Reference':1, 'Original':2, 'Auto':3, 'ExtraConfig':4} Reference=1 Original=2 Auto=3 ExtraConfig=4 class GraphicsControllerType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=GraphicsControllerType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,GraphicsControllerType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,GraphicsControllerType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return GraphicsControllerType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Null',1:'VBoxVGA'} _ValueMap={ 'Null':0, 'VBoxVGA':1} Null=0 VBoxVGA=1 class CleanupMode: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=CleanupMode._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,CleanupMode): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,CleanupMode): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return CleanupMode._NameMap[self.handle] def __int__(self): return self.handle _NameMap={1:'UnregisterOnly',2:'DetachAllReturnNone',3:'DetachAllReturnHardDisksOnly',4:'Full'} _ValueMap={ 'UnregisterOnly':1, 'DetachAllReturnNone':2, 'DetachAllReturnHardDisksOnly':3, 'Full':4} UnregisterOnly=1 DetachAllReturnNone=2 DetachAllReturnHardDisksOnly=3 Full=4 class CloneMode: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=CloneMode._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,CloneMode): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,CloneMode): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return CloneMode._NameMap[self.handle] def __int__(self): return self.handle _NameMap={1:'MachineState',2:'MachineAndChildStates',3:'AllStates'} _ValueMap={ 'MachineState':1, 'MachineAndChildStates':2, 'AllStates':3} MachineState=1 MachineAndChildStates=2 AllStates=3 class CloneOptions: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=CloneOptions._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,CloneOptions): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,CloneOptions): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return CloneOptions._NameMap[self.handle] def __int__(self): return self.handle _NameMap={1:'Link',2:'KeepAllMACs',3:'KeepNATMACs',4:'KeepDiskNames'} _ValueMap={ 'Link':1, 'KeepAllMACs':2, 'KeepNATMACs':3, 'KeepDiskNames':4} Link=1 KeepAllMACs=2 KeepNATMACs=3 KeepDiskNames=4 class AutostopType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=AutostopType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,AutostopType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,AutostopType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return AutostopType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={1:'Disabled',2:'SaveState',3:'PowerOff',4:'AcpiShutdown'} _ValueMap={ 'Disabled':1, 'SaveState':2, 'PowerOff':3, 'AcpiShutdown':4} Disabled=1 SaveState=2 PowerOff=3 AcpiShutdown=4 class HostNetworkInterfaceMediumType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=HostNetworkInterfaceMediumType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,HostNetworkInterfaceMediumType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,HostNetworkInterfaceMediumType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return HostNetworkInterfaceMediumType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Unknown',1:'Ethernet',2:'PPP',3:'SLIP'} _ValueMap={ 'Unknown':0, 'Ethernet':1, 'PPP':2, 'SLIP':3} Unknown=0 Ethernet=1 PPP=2 SLIP=3 class HostNetworkInterfaceStatus: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=HostNetworkInterfaceStatus._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,HostNetworkInterfaceStatus): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,HostNetworkInterfaceStatus): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return HostNetworkInterfaceStatus._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Unknown',1:'Up',2:'Down'} _ValueMap={ 'Unknown':0, 'Up':1, 'Down':2} Unknown=0 Up=1 Down=2 class HostNetworkInterfaceType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=HostNetworkInterfaceType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,HostNetworkInterfaceType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,HostNetworkInterfaceType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return HostNetworkInterfaceType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={1:'Bridged',2:'HostOnly'} _ValueMap={ 'Bridged':1, 'HostOnly':2} Bridged=1 HostOnly=2 class AdditionsFacilityType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=AdditionsFacilityType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,AdditionsFacilityType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,AdditionsFacilityType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return AdditionsFacilityType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'None',20:'VBoxGuestDriver',90:'AutoLogon',100:'VBoxService',101:'VBoxTrayClient',1000:'Seamless',1100:'Graphics',2147483646:'All'} _ValueMap={ 'None':0, 'VBoxGuestDriver':20, 'AutoLogon':90, 'VBoxService':100, 'VBoxTrayClient':101, 'Seamless':1000, 'Graphics':1100, 'All':2147483646} _None=0 VBoxGuestDriver=20 AutoLogon=90 VBoxService=100 VBoxTrayClient=101 Seamless=1000 Graphics=1100 All=2147483646 class AdditionsFacilityClass: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=AdditionsFacilityClass._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,AdditionsFacilityClass): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,AdditionsFacilityClass): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return AdditionsFacilityClass._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'None',10:'Driver',30:'Service',50:'Program',100:'Feature',999:'ThirdParty',2147483646:'All'} _ValueMap={ 'None':0, 'Driver':10, 'Service':30, 'Program':50, 'Feature':100, 'ThirdParty':999, 'All':2147483646} _None=0 Driver=10 Service=30 Program=50 Feature=100 ThirdParty=999 All=2147483646 class AdditionsFacilityStatus: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=AdditionsFacilityStatus._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,AdditionsFacilityStatus): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,AdditionsFacilityStatus): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return AdditionsFacilityStatus._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Inactive',1:'Paused',20:'PreInit',30:'Init',50:'Active',100:'Terminating',101:'Terminated',800:'Failed',999:'Unknown'} _ValueMap={ 'Inactive':0, 'Paused':1, 'PreInit':20, 'Init':30, 'Active':50, 'Terminating':100, 'Terminated':101, 'Failed':800, 'Unknown':999} Inactive=0 Paused=1 PreInit=20 Init=30 Active=50 Terminating=100 Terminated=101 Failed=800 Unknown=999 class AdditionsRunLevelType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=AdditionsRunLevelType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,AdditionsRunLevelType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,AdditionsRunLevelType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return AdditionsRunLevelType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'None',1:'System',2:'Userland',3:'Desktop'} _ValueMap={ 'None':0, 'System':1, 'Userland':2, 'Desktop':3} _None=0 System=1 Userland=2 Desktop=3 class AdditionsUpdateFlag: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=AdditionsUpdateFlag._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,AdditionsUpdateFlag): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,AdditionsUpdateFlag): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return AdditionsUpdateFlag._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'None',1:'WaitForUpdateStartOnly'} _ValueMap={ 'None':0, 'WaitForUpdateStartOnly':1} _None=0 WaitForUpdateStartOnly=1 class GuestSessionStatus: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=GuestSessionStatus._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,GuestSessionStatus): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,GuestSessionStatus): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return GuestSessionStatus._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Undefined',10:'Starting',100:'Started',480:'Terminating',500:'Terminated',512:'TimedOutKilled',513:'TimedOutAbnormally',600:'Down',800:'Error'} _ValueMap={ 'Undefined':0, 'Starting':10, 'Started':100, 'Terminating':480, 'Terminated':500, 'TimedOutKilled':512, 'TimedOutAbnormally':513, 'Down':600, 'Error':800} Undefined=0 Starting=10 Started=100 Terminating=480 Terminated=500 TimedOutKilled=512 TimedOutAbnormally=513 Down=600 Error=800 class GuestSessionWaitForFlag: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=GuestSessionWaitForFlag._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,GuestSessionWaitForFlag): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,GuestSessionWaitForFlag): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return GuestSessionWaitForFlag._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'None',1:'Start',2:'Terminate',4:'Status'} _ValueMap={ 'None':0, 'Start':1, 'Terminate':2, 'Status':4} _None=0 Start=1 Terminate=2 Status=4 class GuestSessionWaitResult: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=GuestSessionWaitResult._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,GuestSessionWaitResult): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,GuestSessionWaitResult): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return GuestSessionWaitResult._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'None',1:'Start',2:'Terminate',3:'Status',4:'Error',5:'Timeout',6:'WaitFlagNotSupported'} _ValueMap={ 'None':0, 'Start':1, 'Terminate':2, 'Status':3, 'Error':4, 'Timeout':5, 'WaitFlagNotSupported':6} _None=0 Start=1 Terminate=2 Status=3 Error=4 Timeout=5 WaitFlagNotSupported=6 class GuestUserState: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=GuestUserState._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,GuestUserState): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,GuestUserState): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return GuestUserState._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Unknown',1:'LoggedIn',2:'LoggedOut',3:'Locked',4:'Unlocked',5:'Disabled',6:'Idle',7:'InUse',8:'Created',9:'Deleted',10:'SessionChanged',11:'CredentialsChanged',12:'RoleChanged',13:'GroupAdded',14:'GroupRemoved',15:'Elevated'} _ValueMap={ 'Unknown':0, 'LoggedIn':1, 'LoggedOut':2, 'Locked':3, 'Unlocked':4, 'Disabled':5, 'Idle':6, 'InUse':7, 'Created':8, 'Deleted':9, 'SessionChanged':10, 'CredentialsChanged':11, 'RoleChanged':12, 'GroupAdded':13, 'GroupRemoved':14, 'Elevated':15} Unknown=0 LoggedIn=1 LoggedOut=2 Locked=3 Unlocked=4 Disabled=5 Idle=6 InUse=7 Created=8 Deleted=9 SessionChanged=10 CredentialsChanged=11 RoleChanged=12 GroupAdded=13 GroupRemoved=14 Elevated=15 class FileSeekType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=FileSeekType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,FileSeekType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,FileSeekType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return FileSeekType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Set',1:'Current'} _ValueMap={ 'Set':0, 'Current':1} Set=0 Current=1 class ProcessInputFlag: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=ProcessInputFlag._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,ProcessInputFlag): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,ProcessInputFlag): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return ProcessInputFlag._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'None',1:'EndOfFile'} _ValueMap={ 'None':0, 'EndOfFile':1} _None=0 EndOfFile=1 class ProcessOutputFlag: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=ProcessOutputFlag._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,ProcessOutputFlag): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,ProcessOutputFlag): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return ProcessOutputFlag._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'None',1:'StdErr'} _ValueMap={ 'None':0, 'StdErr':1} _None=0 StdErr=1 class ProcessWaitForFlag: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=ProcessWaitForFlag._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,ProcessWaitForFlag): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,ProcessWaitForFlag): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return ProcessWaitForFlag._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'None',1:'Start',2:'Terminate',4:'StdIn',8:'StdOut',16:'StdErr'} _ValueMap={ 'None':0, 'Start':1, 'Terminate':2, 'StdIn':4, 'StdOut':8, 'StdErr':16} _None=0 Start=1 Terminate=2 StdIn=4 StdOut=8 StdErr=16 class ProcessWaitResult: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=ProcessWaitResult._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,ProcessWaitResult): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,ProcessWaitResult): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return ProcessWaitResult._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'None',1:'Start',2:'Terminate',3:'Status',4:'Error',5:'Timeout',6:'StdIn',7:'StdOut',8:'StdErr',9:'WaitFlagNotSupported'} _ValueMap={ 'None':0, 'Start':1, 'Terminate':2, 'Status':3, 'Error':4, 'Timeout':5, 'StdIn':6, 'StdOut':7, 'StdErr':8, 'WaitFlagNotSupported':9} _None=0 Start=1 Terminate=2 Status=3 Error=4 Timeout=5 StdIn=6 StdOut=7 StdErr=8 WaitFlagNotSupported=9 class CopyFileFlag: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=CopyFileFlag._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,CopyFileFlag): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,CopyFileFlag): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return CopyFileFlag._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'None',1:'Recursive',2:'Update',4:'FollowLinks'} _ValueMap={ 'None':0, 'Recursive':1, 'Update':2, 'FollowLinks':4} _None=0 Recursive=1 Update=2 FollowLinks=4 class DirectoryCreateFlag: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=DirectoryCreateFlag._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,DirectoryCreateFlag): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,DirectoryCreateFlag): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return DirectoryCreateFlag._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'None',1:'Parents'} _ValueMap={ 'None':0, 'Parents':1} _None=0 Parents=1 class DirectoryRemoveRecFlag: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=DirectoryRemoveRecFlag._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,DirectoryRemoveRecFlag): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,DirectoryRemoveRecFlag): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return DirectoryRemoveRecFlag._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'None',1:'ContentAndDir',2:'ContentOnly'} _ValueMap={ 'None':0, 'ContentAndDir':1, 'ContentOnly':2} _None=0 ContentAndDir=1 ContentOnly=2 class PathRenameFlag: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=PathRenameFlag._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,PathRenameFlag): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,PathRenameFlag): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return PathRenameFlag._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'None',1:'NoReplace',2:'Replace',4:'NoSymlinks'} _ValueMap={ 'None':0, 'NoReplace':1, 'Replace':2, 'NoSymlinks':4} _None=0 NoReplace=1 Replace=2 NoSymlinks=4 class ProcessCreateFlag: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=ProcessCreateFlag._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,ProcessCreateFlag): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,ProcessCreateFlag): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return ProcessCreateFlag._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'None',1:'WaitForProcessStartOnly',2:'IgnoreOrphanedProcesses',4:'Hidden',8:'NoProfile',16:'WaitForStdOut',32:'WaitForStdErr',64:'ExpandArguments'} _ValueMap={ 'None':0, 'WaitForProcessStartOnly':1, 'IgnoreOrphanedProcesses':2, 'Hidden':4, 'NoProfile':8, 'WaitForStdOut':16, 'WaitForStdErr':32, 'ExpandArguments':64} _None=0 WaitForProcessStartOnly=1 IgnoreOrphanedProcesses=2 Hidden=4 NoProfile=8 WaitForStdOut=16 WaitForStdErr=32 ExpandArguments=64 class ProcessPriority: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=ProcessPriority._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,ProcessPriority): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,ProcessPriority): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return ProcessPriority._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Invalid',1:'Default'} _ValueMap={ 'Invalid':0, 'Default':1} Invalid=0 Default=1 class SymlinkType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=SymlinkType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,SymlinkType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,SymlinkType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return SymlinkType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Unknown',1:'Directory',2:'File'} _ValueMap={ 'Unknown':0, 'Directory':1, 'File':2} Unknown=0 Directory=1 File=2 class SymlinkReadFlag: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=SymlinkReadFlag._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,SymlinkReadFlag): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,SymlinkReadFlag): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return SymlinkReadFlag._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'None',1:'NoSymlinks'} _ValueMap={ 'None':0, 'NoSymlinks':1} _None=0 NoSymlinks=1 class ProcessStatus: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=ProcessStatus._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,ProcessStatus): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,ProcessStatus): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return ProcessStatus._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Undefined',10:'Starting',100:'Started',110:'Paused',480:'Terminating',500:'TerminatedNormally',510:'TerminatedSignal',511:'TerminatedAbnormally',512:'TimedOutKilled',513:'TimedOutAbnormally',600:'Down',800:'Error'} _ValueMap={ 'Undefined':0, 'Starting':10, 'Started':100, 'Paused':110, 'Terminating':480, 'TerminatedNormally':500, 'TerminatedSignal':510, 'TerminatedAbnormally':511, 'TimedOutKilled':512, 'TimedOutAbnormally':513, 'Down':600, 'Error':800} Undefined=0 Starting=10 Started=100 Paused=110 Terminating=480 TerminatedNormally=500 TerminatedSignal=510 TerminatedAbnormally=511 TimedOutKilled=512 TimedOutAbnormally=513 Down=600 Error=800 class ProcessInputStatus: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=ProcessInputStatus._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,ProcessInputStatus): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,ProcessInputStatus): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return ProcessInputStatus._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Undefined',1:'Broken',10:'Available',50:'Written',100:'Overflow'} _ValueMap={ 'Undefined':0, 'Broken':1, 'Available':10, 'Written':50, 'Overflow':100} Undefined=0 Broken=1 Available=10 Written=50 Overflow=100 class FileStatus: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=FileStatus._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,FileStatus): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,FileStatus): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return FileStatus._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Undefined',10:'Opening',100:'Open',150:'Closing',200:'Closed',600:'Down',800:'Error'} _ValueMap={ 'Undefined':0, 'Opening':10, 'Open':100, 'Closing':150, 'Closed':200, 'Down':600, 'Error':800} Undefined=0 Opening=10 Open=100 Closing=150 Closed=200 Down=600 Error=800 class FsObjType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=FsObjType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,FsObjType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,FsObjType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return FsObjType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Undefined',1:'FIFO',10:'DevChar',11:'DevBlock',50:'Directory',80:'File',100:'Symlink',200:'Socket',400:'Whiteout'} _ValueMap={ 'Undefined':0, 'FIFO':1, 'DevChar':10, 'DevBlock':11, 'Directory':50, 'File':80, 'Symlink':100, 'Socket':200, 'Whiteout':400} Undefined=0 FIFO=1 DevChar=10 DevBlock=11 Directory=50 File=80 Symlink=100 Socket=200 Whiteout=400 class DragAndDropAction: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=DragAndDropAction._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,DragAndDropAction): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,DragAndDropAction): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return DragAndDropAction._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Ignore',1:'Copy',2:'Move',3:'Link'} _ValueMap={ 'Ignore':0, 'Copy':1, 'Move':2, 'Link':3} Ignore=0 Copy=1 Move=2 Link=3 class DirectoryOpenFlag: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=DirectoryOpenFlag._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,DirectoryOpenFlag): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,DirectoryOpenFlag): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return DirectoryOpenFlag._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'None',1:'NoSymlinks'} _ValueMap={ 'None':0, 'NoSymlinks':1} _None=0 NoSymlinks=1 class MediumState: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=MediumState._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,MediumState): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,MediumState): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return MediumState._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'NotCreated',1:'Created',2:'LockedRead',3:'LockedWrite',4:'Inaccessible',5:'Creating',6:'Deleting'} _ValueMap={ 'NotCreated':0, 'Created':1, 'LockedRead':2, 'LockedWrite':3, 'Inaccessible':4, 'Creating':5, 'Deleting':6} NotCreated=0 Created=1 LockedRead=2 LockedWrite=3 Inaccessible=4 Creating=5 Deleting=6 class MediumType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=MediumType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,MediumType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,MediumType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return MediumType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Normal',1:'Immutable',2:'Writethrough',3:'Shareable',4:'Readonly',5:'MultiAttach'} _ValueMap={ 'Normal':0, 'Immutable':1, 'Writethrough':2, 'Shareable':3, 'Readonly':4, 'MultiAttach':5} Normal=0 Immutable=1 Writethrough=2 Shareable=3 Readonly=4 MultiAttach=5 class MediumVariant: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=MediumVariant._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,MediumVariant): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,MediumVariant): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return MediumVariant._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Standard',0x01:'VmdkSplit2G',0x02:'VmdkRawDisk',0x04:'VmdkStreamOptimized',0x08:'VmdkESX',0x10000:'Fixed',0x20000:'Diff',0x40000000:'NoCreateDir'} _ValueMap={ 'Standard':0, 'VmdkSplit2G':0x01, 'VmdkRawDisk':0x02, 'VmdkStreamOptimized':0x04, 'VmdkESX':0x08, 'Fixed':0x10000, 'Diff':0x20000, 'NoCreateDir':0x40000000} Standard=0 VmdkSplit2G=0x01 VmdkRawDisk=0x02 VmdkStreamOptimized=0x04 VmdkESX=0x08 Fixed=0x10000 Diff=0x20000 NoCreateDir=0x40000000 class DataType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=DataType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,DataType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,DataType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return DataType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Int32',1:'Int8',2:'String'} _ValueMap={ 'Int32':0, 'Int8':1, 'String':2} Int32=0 Int8=1 String=2 class DataFlags: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=DataFlags._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,DataFlags): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,DataFlags): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return DataFlags._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0x00:'None',0x01:'Mandatory',0x02:'Expert',0x04:'Array',0x07:'FlagMask'} _ValueMap={ 'None':0x00, 'Mandatory':0x01, 'Expert':0x02, 'Array':0x04, 'FlagMask':0x07} _None=0x00 Mandatory=0x01 Expert=0x02 Array=0x04 FlagMask=0x07 class MediumFormatCapabilities: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=MediumFormatCapabilities._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,MediumFormatCapabilities): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,MediumFormatCapabilities): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return MediumFormatCapabilities._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0x01:'Uuid',0x02:'CreateFixed',0x04:'CreateDynamic',0x08:'CreateSplit2G',0x10:'Differencing',0x20:'Asynchronous',0x40:'File',0x80:'Properties',0x100:'TcpNetworking',0x200:'VFS',0x3FF:'CapabilityMask'} _ValueMap={ 'Uuid':0x01, 'CreateFixed':0x02, 'CreateDynamic':0x04, 'CreateSplit2G':0x08, 'Differencing':0x10, 'Asynchronous':0x20, 'File':0x40, 'Properties':0x80, 'TcpNetworking':0x100, 'VFS':0x200, 'CapabilityMask':0x3FF} Uuid=0x01 CreateFixed=0x02 CreateDynamic=0x04 CreateSplit2G=0x08 Differencing=0x10 Asynchronous=0x20 File=0x40 Properties=0x80 TcpNetworking=0x100 VFS=0x200 CapabilityMask=0x3FF class MouseButtonState: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=MouseButtonState._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,MouseButtonState): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,MouseButtonState): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return MouseButtonState._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0x01:'LeftButton',0x02:'RightButton',0x04:'MiddleButton',0x08:'WheelUp',0x10:'WheelDown',0x20:'XButton1',0x40:'XButton2',0x7F:'MouseStateMask'} _ValueMap={ 'LeftButton':0x01, 'RightButton':0x02, 'MiddleButton':0x04, 'WheelUp':0x08, 'WheelDown':0x10, 'XButton1':0x20, 'XButton2':0x40, 'MouseStateMask':0x7F} LeftButton=0x01 RightButton=0x02 MiddleButton=0x04 WheelUp=0x08 WheelDown=0x10 XButton1=0x20 XButton2=0x40 MouseStateMask=0x7F class TouchContactState: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=TouchContactState._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,TouchContactState): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,TouchContactState): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return TouchContactState._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0x00:'None',0x01:'InContact',0x02:'InRange',0x03:'ContactStateMask'} _ValueMap={ 'None':0x00, 'InContact':0x01, 'InRange':0x02, 'ContactStateMask':0x03} _None=0x00 InContact=0x01 InRange=0x02 ContactStateMask=0x03 class FramebufferPixelFormat: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=FramebufferPixelFormat._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,FramebufferPixelFormat): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,FramebufferPixelFormat): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return FramebufferPixelFormat._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Opaque',0x32424752:'FOURCC_RGB'} _ValueMap={ 'Opaque':0, 'FOURCC_RGB':0x32424752} Opaque=0 FOURCC_RGB=0x32424752 class NetworkAttachmentType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=NetworkAttachmentType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,NetworkAttachmentType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,NetworkAttachmentType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return NetworkAttachmentType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Null',1:'NAT',2:'Bridged',3:'Internal',4:'HostOnly',5:'Generic',6:'NATNetwork'} _ValueMap={ 'Null':0, 'NAT':1, 'Bridged':2, 'Internal':3, 'HostOnly':4, 'Generic':5, 'NATNetwork':6} Null=0 NAT=1 Bridged=2 Internal=3 HostOnly=4 Generic=5 NATNetwork=6 class NetworkAdapterType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=NetworkAdapterType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,NetworkAdapterType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,NetworkAdapterType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return NetworkAdapterType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Null',1:'Am79C970A',2:'Am79C973',3:'I82540EM',4:'I82543GC',5:'I82545EM',6:'Virtio'} _ValueMap={ 'Null':0, 'Am79C970A':1, 'Am79C973':2, 'I82540EM':3, 'I82543GC':4, 'I82545EM':5, 'Virtio':6} Null=0 Am79C970A=1 Am79C973=2 I82540EM=3 I82543GC=4 I82545EM=5 Virtio=6 class NetworkAdapterPromiscModePolicy: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=NetworkAdapterPromiscModePolicy._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,NetworkAdapterPromiscModePolicy): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,NetworkAdapterPromiscModePolicy): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return NetworkAdapterPromiscModePolicy._NameMap[self.handle] def __int__(self): return self.handle _NameMap={1:'Deny',2:'AllowNetwork',3:'AllowAll'} _ValueMap={ 'Deny':1, 'AllowNetwork':2, 'AllowAll':3} Deny=1 AllowNetwork=2 AllowAll=3 class PortMode: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=PortMode._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,PortMode): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,PortMode): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return PortMode._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Disconnected',1:'HostPipe',2:'HostDevice',3:'RawFile'} _ValueMap={ 'Disconnected':0, 'HostPipe':1, 'HostDevice':2, 'RawFile':3} Disconnected=0 HostPipe=1 HostDevice=2 RawFile=3 class USBControllerType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=USBControllerType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,USBControllerType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,USBControllerType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return USBControllerType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Null',1:'OHCI',2:'EHCI',3:'Last'} _ValueMap={ 'Null':0, 'OHCI':1, 'EHCI':2, 'Last':3} Null=0 OHCI=1 EHCI=2 Last=3 class USBDeviceState: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=USBDeviceState._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,USBDeviceState): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,USBDeviceState): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return USBDeviceState._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'NotSupported',1:'Unavailable',2:'Busy',3:'Available',4:'Held',5:'Captured'} _ValueMap={ 'NotSupported':0, 'Unavailable':1, 'Busy':2, 'Available':3, 'Held':4, 'Captured':5} NotSupported=0 Unavailable=1 Busy=2 Available=3 Held=4 Captured=5 class USBDeviceFilterAction: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=USBDeviceFilterAction._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,USBDeviceFilterAction): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,USBDeviceFilterAction): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return USBDeviceFilterAction._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Null',1:'Ignore',2:'Hold'} _ValueMap={ 'Null':0, 'Ignore':1, 'Hold':2} Null=0 Ignore=1 Hold=2 class AudioDriverType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=AudioDriverType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,AudioDriverType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,AudioDriverType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return AudioDriverType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Null',1:'WinMM',2:'OSS',3:'ALSA',4:'DirectSound',5:'CoreAudio',6:'MMPM',7:'Pulse',8:'SolAudio'} _ValueMap={ 'Null':0, 'WinMM':1, 'OSS':2, 'ALSA':3, 'DirectSound':4, 'CoreAudio':5, 'MMPM':6, 'Pulse':7, 'SolAudio':8} Null=0 WinMM=1 OSS=2 ALSA=3 DirectSound=4 CoreAudio=5 MMPM=6 Pulse=7 SolAudio=8 class AudioControllerType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=AudioControllerType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,AudioControllerType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,AudioControllerType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return AudioControllerType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'AC97',1:'SB16',2:'HDA'} _ValueMap={ 'AC97':0, 'SB16':1, 'HDA':2} AC97=0 SB16=1 HDA=2 class AuthType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=AuthType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,AuthType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,AuthType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return AuthType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Null',1:'External',2:'Guest'} _ValueMap={ 'Null':0, 'External':1, 'Guest':2} Null=0 External=1 Guest=2 class Reason: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=Reason._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,Reason): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,Reason): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return Reason._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Unspecified',1:'HostSuspend',2:'HostResume',3:'HostBatteryLow'} _ValueMap={ 'Unspecified':0, 'HostSuspend':1, 'HostResume':2, 'HostBatteryLow':3} Unspecified=0 HostSuspend=1 HostResume=2 HostBatteryLow=3 class StorageBus: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=StorageBus._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,StorageBus): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,StorageBus): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return StorageBus._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Null',1:'IDE',2:'SATA',3:'SCSI',4:'Floppy',5:'SAS'} _ValueMap={ 'Null':0, 'IDE':1, 'SATA':2, 'SCSI':3, 'Floppy':4, 'SAS':5} Null=0 IDE=1 SATA=2 SCSI=3 Floppy=4 SAS=5 class StorageControllerType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=StorageControllerType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,StorageControllerType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,StorageControllerType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return StorageControllerType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Null',1:'LsiLogic',2:'BusLogic',3:'IntelAhci',4:'PIIX3',5:'PIIX4',6:'ICH6',7:'I82078',8:'LsiLogicSas'} _ValueMap={ 'Null':0, 'LsiLogic':1, 'BusLogic':2, 'IntelAhci':3, 'PIIX3':4, 'PIIX4':5, 'ICH6':6, 'I82078':7, 'LsiLogicSas':8} Null=0 LsiLogic=1 BusLogic=2 IntelAhci=3 PIIX3=4 PIIX4=5 ICH6=6 I82078=7 LsiLogicSas=8 class ChipsetType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=ChipsetType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,ChipsetType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,ChipsetType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return ChipsetType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Null',1:'PIIX3',2:'ICH9'} _ValueMap={ 'Null':0, 'PIIX3':1, 'ICH9':2} Null=0 PIIX3=1 ICH9=2 class NATAliasMode: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=NATAliasMode._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,NATAliasMode): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,NATAliasMode): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return NATAliasMode._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0x1:'AliasLog',0x02:'AliasProxyOnly',0x04:'AliasUseSamePorts'} _ValueMap={ 'AliasLog':0x1, 'AliasProxyOnly':0x02, 'AliasUseSamePorts':0x04} AliasLog=0x1 AliasProxyOnly=0x02 AliasUseSamePorts=0x04 class NATProtocol: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=NATProtocol._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,NATProtocol): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,NATProtocol): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return NATProtocol._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'UDP',1:'TCP'} _ValueMap={ 'UDP':0, 'TCP':1} UDP=0 TCP=1 class BandwidthGroupType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=BandwidthGroupType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,BandwidthGroupType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,BandwidthGroupType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return BandwidthGroupType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Null',1:'Disk',2:'Network'} _ValueMap={ 'Null':0, 'Disk':1, 'Network':2} Null=0 Disk=1 Network=2 class VBoxEventType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=VBoxEventType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,VBoxEventType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,VBoxEventType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return VBoxEventType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Invalid',1:'Any',2:'Vetoable',3:'MachineEvent',4:'SnapshotEvent',5:'InputEvent',31:'LastWildcard',32:'OnMachineStateChanged',33:'OnMachineDataChanged',34:'OnExtraDataChanged',35:'OnExtraDataCanChange',36:'OnMediumRegistered',37:'OnMachineRegistered',38:'OnSessionStateChanged',39:'OnSnapshotTaken',40:'OnSnapshotDeleted',41:'OnSnapshotChanged',42:'OnGuestPropertyChanged',43:'OnMousePointerShapeChanged',44:'OnMouseCapabilityChanged',45:'OnKeyboardLedsChanged',46:'OnStateChanged',47:'OnAdditionsStateChanged',48:'OnNetworkAdapterChanged',49:'OnSerialPortChanged',50:'OnParallelPortChanged',51:'OnStorageControllerChanged',52:'OnMediumChanged',53:'OnVRDEServerChanged',54:'OnUSBControllerChanged',55:'OnUSBDeviceStateChanged',56:'OnSharedFolderChanged',57:'OnRuntimeError',58:'OnCanShowWindow',59:'OnShowWindow',60:'OnCPUChanged',61:'OnVRDEServerInfoChanged',62:'OnEventSourceChanged',63:'OnCPUExecutionCapChanged',64:'OnGuestKeyboard',65:'OnGuestMouse',66:'OnNATRedirect',67:'OnHostPCIDevicePlug',68:'OnVBoxSVCAvailabilityChanged',69:'OnBandwidthGroupChanged',70:'OnGuestMonitorChanged',71:'OnStorageDeviceChanged',72:'OnClipboardModeChanged',73:'OnDragAndDropModeChanged',74:'OnNATNetworkChanged',75:'OnNATNetworkStartStop',76:'OnNATNetworkAlter',77:'OnNATNetworkCreationDeletion',78:'OnNATNetworkSetting',79:'OnNATNetworkPortForward',80:'OnGuestSessionStateChanged',81:'OnGuestSessionRegistered',82:'OnGuestProcessRegistered',83:'OnGuestProcessStateChanged',84:'OnGuestProcessInputNotify',85:'OnGuestProcessOutput',86:'OnGuestFileRegistered',87:'OnGuestFileStateChanged',88:'OnGuestFileOffsetChanged',89:'OnGuestFileRead',90:'OnGuestFileWrite',91:'OnVideoCaptureChanged',92:'OnGuestUserStateChanged',93:'OnGuestMultiTouch',94:'OnHostNameResolutionConfigurationChange',95:'Last'} _ValueMap={ 'Invalid':0, 'Any':1, 'Vetoable':2, 'MachineEvent':3, 'SnapshotEvent':4, 'InputEvent':5, 'LastWildcard':31, 'OnMachineStateChanged':32, 'OnMachineDataChanged':33, 'OnExtraDataChanged':34, 'OnExtraDataCanChange':35, 'OnMediumRegistered':36, 'OnMachineRegistered':37, 'OnSessionStateChanged':38, 'OnSnapshotTaken':39, 'OnSnapshotDeleted':40, 'OnSnapshotChanged':41, 'OnGuestPropertyChanged':42, 'OnMousePointerShapeChanged':43, 'OnMouseCapabilityChanged':44, 'OnKeyboardLedsChanged':45, 'OnStateChanged':46, 'OnAdditionsStateChanged':47, 'OnNetworkAdapterChanged':48, 'OnSerialPortChanged':49, 'OnParallelPortChanged':50, 'OnStorageControllerChanged':51, 'OnMediumChanged':52, 'OnVRDEServerChanged':53, 'OnUSBControllerChanged':54, 'OnUSBDeviceStateChanged':55, 'OnSharedFolderChanged':56, 'OnRuntimeError':57, 'OnCanShowWindow':58, 'OnShowWindow':59, 'OnCPUChanged':60, 'OnVRDEServerInfoChanged':61, 'OnEventSourceChanged':62, 'OnCPUExecutionCapChanged':63, 'OnGuestKeyboard':64, 'OnGuestMouse':65, 'OnNATRedirect':66, 'OnHostPCIDevicePlug':67, 'OnVBoxSVCAvailabilityChanged':68, 'OnBandwidthGroupChanged':69, 'OnGuestMonitorChanged':70, 'OnStorageDeviceChanged':71, 'OnClipboardModeChanged':72, 'OnDragAndDropModeChanged':73, 'OnNATNetworkChanged':74, 'OnNATNetworkStartStop':75, 'OnNATNetworkAlter':76, 'OnNATNetworkCreationDeletion':77, 'OnNATNetworkSetting':78, 'OnNATNetworkPortForward':79, 'OnGuestSessionStateChanged':80, 'OnGuestSessionRegistered':81, 'OnGuestProcessRegistered':82, 'OnGuestProcessStateChanged':83, 'OnGuestProcessInputNotify':84, 'OnGuestProcessOutput':85, 'OnGuestFileRegistered':86, 'OnGuestFileStateChanged':87, 'OnGuestFileOffsetChanged':88, 'OnGuestFileRead':89, 'OnGuestFileWrite':90, 'OnVideoCaptureChanged':91, 'OnGuestUserStateChanged':92, 'OnGuestMultiTouch':93, 'OnHostNameResolutionConfigurationChange':94, 'Last':95} Invalid=0 Any=1 Vetoable=2 MachineEvent=3 SnapshotEvent=4 InputEvent=5 LastWildcard=31 OnMachineStateChanged=32 OnMachineDataChanged=33 OnExtraDataChanged=34 OnExtraDataCanChange=35 OnMediumRegistered=36 OnMachineRegistered=37 OnSessionStateChanged=38 OnSnapshotTaken=39 OnSnapshotDeleted=40 OnSnapshotChanged=41 OnGuestPropertyChanged=42 OnMousePointerShapeChanged=43 OnMouseCapabilityChanged=44 OnKeyboardLedsChanged=45 OnStateChanged=46 OnAdditionsStateChanged=47 OnNetworkAdapterChanged=48 OnSerialPortChanged=49 OnParallelPortChanged=50 OnStorageControllerChanged=51 OnMediumChanged=52 OnVRDEServerChanged=53 OnUSBControllerChanged=54 OnUSBDeviceStateChanged=55 OnSharedFolderChanged=56 OnRuntimeError=57 OnCanShowWindow=58 OnShowWindow=59 OnCPUChanged=60 OnVRDEServerInfoChanged=61 OnEventSourceChanged=62 OnCPUExecutionCapChanged=63 OnGuestKeyboard=64 OnGuestMouse=65 OnNATRedirect=66 OnHostPCIDevicePlug=67 OnVBoxSVCAvailabilityChanged=68 OnBandwidthGroupChanged=69 OnGuestMonitorChanged=70 OnStorageDeviceChanged=71 OnClipboardModeChanged=72 OnDragAndDropModeChanged=73 OnNATNetworkChanged=74 OnNATNetworkStartStop=75 OnNATNetworkAlter=76 OnNATNetworkCreationDeletion=77 OnNATNetworkSetting=78 OnNATNetworkPortForward=79 OnGuestSessionStateChanged=80 OnGuestSessionRegistered=81 OnGuestProcessRegistered=82 OnGuestProcessStateChanged=83 OnGuestProcessInputNotify=84 OnGuestProcessOutput=85 OnGuestFileRegistered=86 OnGuestFileStateChanged=87 OnGuestFileOffsetChanged=88 OnGuestFileRead=89 OnGuestFileWrite=90 OnVideoCaptureChanged=91 OnGuestUserStateChanged=92 OnGuestMultiTouch=93 OnHostNameResolutionConfigurationChange=94 Last=95 class GuestMouseEventMode: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=GuestMouseEventMode._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,GuestMouseEventMode): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,GuestMouseEventMode): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return GuestMouseEventMode._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Relative',1:'Absolute'} _ValueMap={ 'Relative':0, 'Absolute':1} Relative=0 Absolute=1 class GuestMonitorChangedEventType: def __init__(self,mgr,handle): self.mgr=mgr if isinstance(handle,basestring): self.handle=GuestMonitorChangedEventType._ValueMap[handle] else: self.handle=handle def __eq__(self,other): if isinstance(other,GuestMonitorChangedEventType): return self.handle == other.handle if isinstance(other,int): return self.handle == other if isinstance(other,basestring): return str(self) == other return False def __ne__(self,other): if isinstance(other,GuestMonitorChangedEventType): return self.handle != other.handle if isinstance(other,int): return self.handle != other if isinstance(other,basestring): return str(self) != other return True def __str__(self): return GuestMonitorChangedEventType._NameMap[self.handle] def __int__(self): return self.handle _NameMap={0:'Enabled',1:'Disabled',2:'NewOrigin'} _ValueMap={ 'Enabled':0, 'Disabled':1, 'NewOrigin':2} Enabled=0 Disabled=1 NewOrigin=2 import base64 class IWebsessionManager2(IWebsessionManager): def __init__(self, url): self.url = url self.port = None self.handle = None self.mgr = self def getPort(self): if self.port is None: try: self.port = vboxServiceLocator().getvboxPortType(self.url) except: self.port = vboxServiceLocator().getvboxServicePort(self.url) return self.port def decodebase64(self, str): return base64.decodestring(str) def encodebase64(self, str): return base64.encodestring(str)
558,662
154,473
12,171
7f4193f4a4b777b443dfcde644be10002291cc29
2,602
py
Python
member/migrations/0002_auto_20161225_2216.py
kaqfa/supervise_backend
0d3e57648f96c943e6f5f2da1276386acdc95b3f
[ "Apache-2.0" ]
null
null
null
member/migrations/0002_auto_20161225_2216.py
kaqfa/supervise_backend
0d3e57648f96c943e6f5f2da1276386acdc95b3f
[ "Apache-2.0" ]
null
null
null
member/migrations/0002_auto_20161225_2216.py
kaqfa/supervise_backend
0d3e57648f96c943e6f5f2da1276386acdc95b3f
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2016-12-25 15:16 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion
36.647887
144
0.578401
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2016-12-25 15:16 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('member', '0001_initial'), ] operations = [ migrations.CreateModel( name='StudentProposal', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('status', models.CharField(choices=[('p', 'menunggu'), ('a', 'diterima'), ('r', 'ditolak')], max_length=1)), ('propose_date', models.DateTimeField()), ('response_date', models.DateTimeField()), ], ), migrations.AlterField( model_name='member', name='address', field=models.TextField(blank=True, null=True), ), migrations.AlterField( model_name='member', name='expertise', field=models.ManyToManyField(blank=True, to='member.Expertise'), ), migrations.AlterField( model_name='member', name='level', field=models.CharField(choices=[('st', 'mahasiswa'), ('sp', 'pembimbing')], max_length=2), ), migrations.AlterField( model_name='member', name='nim', field=models.CharField(blank=True, max_length=20, null=True), ), migrations.AlterField( model_name='member', name='npp', field=models.CharField(blank=True, max_length=20, null=True), ), migrations.AlterField( model_name='member', name='phone', field=models.CharField(blank=True, max_length=20, null=True), ), migrations.AlterField( model_name='member', name='supervisor', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='member.Member'), ), migrations.AddField( model_name='studentproposal', name='student', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='studentproposal_student', to='member.Member'), ), migrations.AddField( model_name='studentproposal', name='supervisor', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='studentproposal_supervisor', to='member.Member'), ), ]
0
2,390
23
81549e03d091f7c52002d88965685cd29b30b2d6
3,884
py
Python
alerta/common/mail.py
MailOnline/alerta
225da305485c43c49d6803f740d36cbf1bfb42be
[ "Apache-2.0" ]
null
null
null
alerta/common/mail.py
MailOnline/alerta
225da305485c43c49d6803f740d36cbf1bfb42be
[ "Apache-2.0" ]
null
null
null
alerta/common/mail.py
MailOnline/alerta
225da305485c43c49d6803f740d36cbf1bfb42be
[ "Apache-2.0" ]
null
null
null
import os import sys import smtplib import socket import urllib2 import datetime from email.mime.text import MIMEText from email.mime.image import MIMEImage from email.mime.multipart import MIMEMultipart from alerta.common import log as logging from alerta.common import config LOG = logging.getLogger(__name__) CONF = config.CONF
32.915254
120
0.567199
import os import sys import smtplib import socket import urllib2 import datetime from email.mime.text import MIMEText from email.mime.image import MIMEImage from email.mime.multipart import MIMEMultipart from alerta.common import log as logging from alerta.common import config LOG = logging.getLogger(__name__) CONF = config.CONF class Mailer(object): mailer_opt = { 'smtp_host': 'smtp', 'smtp_port': 25, 'mail_user': 'alerta@guardian.co.uk', 'mail_list': 'websys@guardian.co.uk', } def __init__(self, alert): config.register_opts(Mailer.mailer_opt) self.subject = alert.summary self.text = "-" * 60 + "\n" self.text += "[%s] %s\n" % (alert.status, alert.summary) self.text += "-" * 60 + "\n\n" self.text += "Alert Details\n\n" self.text += "Alert ID: %s\n" % alert.get_id() self.text += "Create Time: %s\n" % alert.get_create_time() self.text += "Environment: %s\n" % ", ".join(alert.environment) self.text += "Service: %s\n" % ", ".join(alert.service) self.text += "Resource: %s\n" % alert.resource self.text += "Event: %s\n" % alert.event self.text += "Group: %s\n" % alert.group self.text += "Value: %s\n" % alert.value self.text += "Severity: %s -> %s\n" % (alert.previous_severity, alert.severity) self.text += "Status: %s\n" % alert.status self.text += "Text: %s\n" % alert.text self.text += "Threshold Info: %s\n" % alert.threshold_info self.text += "Duplicate Count: %s\n" % alert.duplicate_count self.text += "Origin: %s\n" % alert.origin self.text += "Tags: %s\n" % ", ".join(alert.tags) self.text += "More Info: %s\n\n" % alert.more_info if hasattr(alert, 'graph_urls'): self.text += "Graphs\n\n" for graph in alert.graph_urls: self.text += '%s\n' % graph self.text += "\n" if CONF.debug: self.text += "Raw Alert\n\n" self.text += "%s\n\n" % alert.get_body() self.text += "To acknowledge this alert visit this URL:\n" self.text += "http://%s:%s/alerta/widgets/v2/details?id=%s\n\n" % (CONF.api_host, CONF.api_port, alert.get_id()) self.text += "Generated by %s on %s at %s\n" % ( os.path.basename(sys.argv[0]), os.uname()[1], datetime.datetime.now().strftime("%a %d %b %H:%M:%S")) LOG.debug('Email Text: %s', self.text) self.graph_urls = alert.graph_urls if hasattr(alert, 'graph_urls') else None def send(self, mail_to=None): LOG.debug('mail_to = %s', mail_to) msg = MIMEMultipart('related') msg['Subject'] = self.subject msg['From'] = CONF.mail_user msg['To'] = ", ".join(mail_to) msg.preamble = self.subject msg_text = MIMEText(self.text, 'plain', 'utf-8') msg.attach(msg_text) for graph in self.graph_urls: try: img = MIMEImage(urllib2.urlopen(graph).read()) msg.attach(img) except Exception, e: LOG.warning('Unknown exception raised while attaching graphs to email: %s', e) pass try: mx = smtplib.SMTP(CONF.smtp_host) except (socket.error, socket.herror, socket.gaierror), e: LOG.error('Mail server connection error: %s', e) return try: if CONF.debug: mx.set_debuglevel(True) mx.sendmail(CONF.mail_user, mail_to, msg.as_string()) mx.quit() except AttributeError, e: LOG.error('Problem with mail attributes: %s', e) except smtplib.SMTPException, e: LOG.error('Failed to send mail to %s on %s:%s : %s', ", ".join(mail_to), CONF.mail_host, CONF.mail_port, e)
3,296
226
23
bb0cf19e041e8f340d5b5f83af9ff437756dc102
1,906
py
Python
Chinese-Handbook/Sec01-Elasticity/example-01-plate-unixial-tensile/example-01-plate-unixial-tensile.py
polossk/Peridynamics-Example-Using-HMSolver
cc13a96db0257f9db19ec32131cc72ff43bda3b8
[ "MIT" ]
2
2021-05-10T05:57:59.000Z
2021-05-10T09:50:06.000Z
Chinese-Handbook/Sec01-Elasticity/example-01-plate-unixial-tensile/example-01-plate-unixial-tensile.py
polossk/Peridynamics-Example-Using-HMSolver
cc13a96db0257f9db19ec32131cc72ff43bda3b8
[ "MIT" ]
null
null
null
Chinese-Handbook/Sec01-Elasticity/example-01-plate-unixial-tensile/example-01-plate-unixial-tensile.py
polossk/Peridynamics-Example-Using-HMSolver
cc13a96db0257f9db19ec32131cc72ff43bda3b8
[ "MIT" ]
null
null
null
import numpy as np import time from hmsolver.meshgrid import Zone2d from hmsolver.meshgrid import Mesh2d from hmsolver.material import Material2d from hmsolver.femcore import point_criteria from hmsolver.femcore import segment_criteria from hmsolver.femcore import boundary_cond2d as _bc_ # abbreviation from hmsolver.femcore import BoundaryConds2d from hmsolver.app import Simulation2d from hmsolver.basis import Quad4Node from hmsolver.utils import formatting_time if __name__ == '__main__': t0 = time.time() # tic # 几何区域 zone_xl, zone_xr = 0, 1 zone_yl, zone_yr = 0, 1 zone_xmid = 0.5 * (zone_xl + zone_xr) zone_ymid = 0.5 * (zone_yl + zone_yr) grid_num, grid_size = 50, 0.02 zone = Zone2d(zone_xl, zone_xr, zone_yl, zone_yr) mesh2d = zone.meshgrid_zone_safe(Mesh2d, grid_num) n_nodes, n_elements = mesh2d.n_nodes, mesh2d.n_elements # 输出网格基本信息 print(f"Mesh contains {n_nodes} nodes and {n_elements} elements.") print(f"Average Grid Size= {grid_size:.8f}") # 建立材料实例 material2d = Material2d(300, 0.25) # 边界条件 stretch = 0.02 boundary_0 = point_criteria(zone_xmid, zone_yl) boundary_1 = segment_criteria(zone_xl, zone_yl, zone_xr, zone_yl) boundary_2 = segment_criteria(zone_xl, zone_yr, zone_xr, zone_yr) boundarys = BoundaryConds2d( _bc_("point", boundary_0, "fixed", None, None), _bc_("segment", boundary_1, "set_uy", "constant", 0), _bc_("segment", boundary_2, "set_uy", "constant", +stretch)) boundarys.manually_verify() # 建立模拟实例 app = Simulation2d(mesh2d, material2d, boundarys) app.app_name = "example-01-plate-unixial-tensile" app.apply_basis(Quad4Node()) app.parallelized = True # 开启并行多线程 app.check_engine() # 输出模拟结果 app.export_to_tecplot("elasticity", *app.provied_solutions) print(f"Total time cost: {formatting_time(time.time() - t0)}")
34.654545
70
0.71511
import numpy as np import time from hmsolver.meshgrid import Zone2d from hmsolver.meshgrid import Mesh2d from hmsolver.material import Material2d from hmsolver.femcore import point_criteria from hmsolver.femcore import segment_criteria from hmsolver.femcore import boundary_cond2d as _bc_ # abbreviation from hmsolver.femcore import BoundaryConds2d from hmsolver.app import Simulation2d from hmsolver.basis import Quad4Node from hmsolver.utils import formatting_time if __name__ == '__main__': t0 = time.time() # tic # 几何区域 zone_xl, zone_xr = 0, 1 zone_yl, zone_yr = 0, 1 zone_xmid = 0.5 * (zone_xl + zone_xr) zone_ymid = 0.5 * (zone_yl + zone_yr) grid_num, grid_size = 50, 0.02 zone = Zone2d(zone_xl, zone_xr, zone_yl, zone_yr) mesh2d = zone.meshgrid_zone_safe(Mesh2d, grid_num) n_nodes, n_elements = mesh2d.n_nodes, mesh2d.n_elements # 输出网格基本信息 print(f"Mesh contains {n_nodes} nodes and {n_elements} elements.") print(f"Average Grid Size= {grid_size:.8f}") # 建立材料实例 material2d = Material2d(300, 0.25) # 边界条件 stretch = 0.02 boundary_0 = point_criteria(zone_xmid, zone_yl) boundary_1 = segment_criteria(zone_xl, zone_yl, zone_xr, zone_yl) boundary_2 = segment_criteria(zone_xl, zone_yr, zone_xr, zone_yr) boundarys = BoundaryConds2d( _bc_("point", boundary_0, "fixed", None, None), _bc_("segment", boundary_1, "set_uy", "constant", 0), _bc_("segment", boundary_2, "set_uy", "constant", +stretch)) boundarys.manually_verify() # 建立模拟实例 app = Simulation2d(mesh2d, material2d, boundarys) app.app_name = "example-01-plate-unixial-tensile" app.apply_basis(Quad4Node()) app.parallelized = True # 开启并行多线程 app.check_engine() # 输出模拟结果 app.export_to_tecplot("elasticity", *app.provied_solutions) print(f"Total time cost: {formatting_time(time.time() - t0)}")
0
0
0
349da6effb28af25ebc223f09810153ec14e1cd7
97,080
py
Python
pysnmp-with-texts/RUCKUS-ZD-WLAN-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
8
2019-05-09T17:04:00.000Z
2021-06-09T06:50:51.000Z
pysnmp-with-texts/RUCKUS-ZD-WLAN-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
4
2019-05-31T16:42:59.000Z
2020-01-31T21:57:17.000Z
pysnmp-with-texts/RUCKUS-ZD-WLAN-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
10
2019-04-30T05:51:36.000Z
2022-02-16T03:33:41.000Z
# # PySNMP MIB module RUCKUS-ZD-WLAN-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/RUCKUS-ZD-WLAN-MIB # Produced by pysmi-0.3.4 at Wed May 1 14:59:17 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueRangeConstraint, ConstraintsUnion, SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsUnion", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsIntersection") IANAifType, = mibBuilder.importSymbols("IANAifType-MIB", "IANAifType") ifIndex, InterfaceIndex = mibBuilder.importSymbols("IF-MIB", "ifIndex", "InterfaceIndex") ruckusZDWLANModule, = mibBuilder.importSymbols("RUCKUS-ROOT-MIB", "ruckusZDWLANModule") RuckusRadioMode, RuckusAdminStatus, RuckusSSID, RuckusRateLimiting, RuckusdB = mibBuilder.importSymbols("RUCKUS-TC-MIB", "RuckusRadioMode", "RuckusAdminStatus", "RuckusSSID", "RuckusRateLimiting", "RuckusdB") NotificationGroup, ModuleCompliance, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance", "ObjectGroup") TimeTicks, Unsigned32, IpAddress, Gauge32, ObjectIdentity, Counter32, Integer32, iso, ModuleIdentity, MibIdentifier, Bits, NotificationType, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter64 = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "Unsigned32", "IpAddress", "Gauge32", "ObjectIdentity", "Counter32", "Integer32", "iso", "ModuleIdentity", "MibIdentifier", "Bits", "NotificationType", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter64") TextualConvention, DisplayString, TruthValue, PhysAddress, RowStatus, MacAddress = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "TruthValue", "PhysAddress", "RowStatus", "MacAddress") ruckusZDWLANMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1)) if mibBuilder.loadTexts: ruckusZDWLANMIB.setLastUpdated('201010150800Z') if mibBuilder.loadTexts: ruckusZDWLANMIB.setOrganization('Ruckus Wireless, Inc.') if mibBuilder.loadTexts: ruckusZDWLANMIB.setContactInfo('Ruckus Wireless, Inc. Postal: 880 W Maude Ave Sunnyvale, CA 94085 USA EMail: support@ruckuswireless.com Phone: +1-650-265-4200') if mibBuilder.loadTexts: ruckusZDWLANMIB.setDescription('Ruckus ZD WLAN mib') ruckusZDWLANObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1)) ruckusZDWLANInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1)) ruckusZDWLANTable = MibTable((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1), ) if mibBuilder.loadTexts: ruckusZDWLANTable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANTable.setDescription('ZD WLAN table.') ruckusZDWLANEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: ruckusZDWLANEntry.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANEntry.setDescription('Specifies each ZD WLAN entry.') ruckusZDWLANSSID = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 1), RuckusSSID()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANSSID.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANSSID.setDescription('SSID.') ruckusZDWLANDescription = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANDescription.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANDescription.setDescription('WLAN description.') ruckusZDWLANAuthentication = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAuthentication.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAuthentication.setDescription('Authentication method.') ruckusZDWLANEncryption = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANEncryption.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANEncryption.setDescription('Encryption method.') ruckusZDWLANIsGuest = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 5), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANIsGuest.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANIsGuest.setDescription('This WLAN is for guest access.') ruckusZDWLANSSIDBcastDisable = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 6), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANSSIDBcastDisable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANSSIDBcastDisable.setDescription('Hide SSID.') ruckusZDWLANVlanID = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVlanID.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVlanID.setDescription('Specifies the VLAN ID of the WLAN. If VLAN ID is 1, packets from this WLAN will be untagged.') ruckusZDWLANRateLimitingUp = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 8), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 10))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRateLimitingUp.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRateLimitingUp.setDescription('Rate limiting of uplink.') ruckusZDWLANRateLimitingDown = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 9), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 10))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRateLimitingDown.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRateLimitingDown.setDescription('Rate limiting of downlink.') ruckusZDWLANTunnelWLAN = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 10), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANTunnelWLAN.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANTunnelWLAN.setDescription('Tunnel WLAN.') ruckusZDWLANNumVAP = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 11), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANNumVAP.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANNumVAP.setDescription('Number of APs.') ruckusZDWLANNumSta = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 12), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANNumSta.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANNumSta.setDescription('Number of client devices.') ruckusZDWLANRxPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 13), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRxPkts.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRxPkts.setDescription('Received packets.') ruckusZDWLANRxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 14), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRxBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRxBytes.setDescription('Received bytes.') ruckusZDWLANTxPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 15), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANTxPkts.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANTxPkts.setDescription('Transmitted packets.') ruckusZDWLANTxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 16), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANTxBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANTxBytes.setDescription('Transmitted bytes.') ruckusZDWLANAuthTotal = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 26), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAuthTotal.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAuthTotal.setDescription('Accumulated total number of attempt to authenticate by wireless terminals on this WLAN, or Authentication request.') ruckusZDWLANAuthResp = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 27), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAuthResp.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAuthResp.setDescription('Authentication response.') ruckusZDWLANAuthSuccessTotal = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 28), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAuthSuccessTotal.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAuthSuccessTotal.setDescription('Accumulated total number of success out of Wireless authentication attempts.') ruckusZDWLANAuthFail = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 29), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAuthFail.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAuthFail.setDescription('Authentication fail.') ruckusZDWLANAssocTotal = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 30), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAssocTotal.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAssocTotal.setDescription('Accumulated total number of access of wireless terminal on this WLAN, or Association request.') ruckusZDWLANAssocResp = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 31), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAssocResp.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAssocResp.setDescription('Association response.') ruckusZDWLANReassocReq = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 32), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANReassocReq.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANReassocReq.setDescription('Reassociation request.') ruckusZDWLANReassocResp = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 33), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANReassocResp.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANReassocResp.setDescription('Reassociation response.') ruckusZDWLANAssocSuccess = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 34), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAssocSuccess.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAssocSuccess.setDescription('Association success.') ruckusZDWLANAssocFail = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 35), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAssocFail.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAssocFail.setDescription('Association fail.') ruckusZDWLANAssocDenied = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 36), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAssocDenied.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAssocDenied.setDescription('Association denied.') ruckusZDWLANDiassocAbnormal = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 37), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANDiassocAbnormal.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANDiassocAbnormal.setDescription('Disassociation request due to abnormal causes.') ruckusZDWLANDiassocCapacity = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 38), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANDiassocCapacity.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANDiassocCapacity.setDescription('Disassociation request due to device capacity.') ruckusZDWLANDiassocLeave = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 39), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANDiassocLeave.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANDiassocLeave.setDescription('Disassociation request due to client leave.') ruckusZDWLANDiassocMisc = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 40), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANDiassocMisc.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANDiassocMisc.setDescription('Disassociation request due to other reasons.') ruckusZDWLANRxByteRate = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 41), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRxByteRate.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRxByteRate.setDescription('Received rate byte/s in last 5 minutes .') ruckusZDWLANTxByteRate = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 42), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANTxByteRate.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANTxByteRate.setDescription('Transmitted rate byte/s in last 5 minutes .') ruckusZDWLANRxDataFrameOnLan = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 43), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRxDataFrameOnLan.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRxDataFrameOnLan.setDescription('Received Data Frame Number on Lan interface .') ruckusZDWLANRxByteOnLan = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 44), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRxByteOnLan.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRxByteOnLan.setDescription('Received Data Bytes on Lan interface .') ruckusZDWLANTxByteOnLan = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 45), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANTxByteOnLan.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANTxByteOnLan.setDescription('Transmitted Data Bytes on Lan interface .') ruckusZDWLANDownDropFrame = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 46), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANDownDropFrame.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANDownDropFrame.setDescription('Drop Frame Number on Downlink of Wireless.') ruckusZDWLANDownRetxFrame = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 47), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANDownRetxFrame.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANDownRetxFrame.setDescription('Retransmitted Frame Number on Downlink of Wireless.') ruckusZDWLANDownTotalFrame = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 48), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANDownTotalFrame.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANDownTotalFrame.setDescription('Total Frame Number on Downlink of Wireless.') ruckusZDWLANDownTotalErrFrame = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 49), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANDownTotalErrFrame.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANDownTotalErrFrame.setDescription('Total Error Frame Number on Downlink of Wireless.') ruckusZDWLANUpTotalFrame = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 50), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANUpTotalFrame.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANUpTotalFrame.setDescription('Total Frame Number on Uplink of Wireless.') ruckusZDWLANUpDropFrame = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 51), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANUpDropFrame.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANUpDropFrame.setDescription('Drop Frame Number on Uplink of Wireless.') ruckusZDWLANUpRetxFrame = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 52), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANUpRetxFrame.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANUpRetxFrame.setDescription('Retransmitted Frame Number on Uplink of Wireless.') ruckusZDWLANNAME = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 108), RuckusSSID()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANNAME.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANNAME.setDescription('WLAN NAME.') ruckusZDWLANAPInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2)) ruckusZDWLANAPTable = MibTable((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1), ) if mibBuilder.loadTexts: ruckusZDWLANAPTable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPTable.setDescription('ZD WLAN AP table.') ruckusZDWLANAPEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1), ).setIndexNames((0, "RUCKUS-ZD-WLAN-MIB", "ruckusZDWLANAPMacAddr")) if mibBuilder.loadTexts: ruckusZDWLANAPEntry.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPEntry.setDescription('Specifies each ZD WLAN AP entry.') ruckusZDWLANAPMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 1), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPMacAddr.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPMacAddr.setDescription('MAC address.') ruckusZDWLANAPDescription = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPDescription.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPDescription.setDescription('Description.') ruckusZDWLANAPStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("disconnected", 0), ("connected", 1), ("approvalPending", 2), ("upgradingFirmware", 3), ("provisioning", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPStatus.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPStatus.setDescription('The connection status with ZD.') ruckusZDWLANAPModel = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPModel.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPModel.setDescription('Model name.') ruckusZDWLANAPSerialNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPSerialNumber.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPSerialNumber.setDescription('Serial number.') ruckusZDWLANAPUptime = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 6), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPUptime.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPUptime.setDescription('Up time.') ruckusZDWLANAPSWversion = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPSWversion.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPSWversion.setDescription('Software version.') ruckusZDWLANAPHWversion = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 8), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPHWversion.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPHWversion.setDescription('Hardware version.') ruckusZDWLANAPIPAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 10), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIPAddr.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIPAddr.setDescription('IP address.') ruckusZDWLANAPNumRadios = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 13), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPNumRadios.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPNumRadios.setDescription('Number of radios.') ruckusZDWLANAPNumVAP = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 14), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPNumVAP.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPNumVAP.setDescription('Number of APs.') ruckusZDWLANAPNumSta = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 15), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPNumSta.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPNumSta.setDescription('Total number of authenticated terminal which is using currently on this AP.') ruckusZDWLANAPNumRogues = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 16), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPNumRogues.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPNumRogues.setDescription('Number of rogue devices.') ruckusZDWLANAPConnectionMode = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("layer2", 0), ("layer3", 1)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPConnectionMode.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPConnectionMode.setDescription('The connection mode with ZD.') ruckusZDWLANAPMeshEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 18), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPMeshEnable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPMeshEnable.setDescription('Mesh enable.') ruckusZDWLANAPMeshHops = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 19), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPMeshHops.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPMeshHops.setDescription('Number of mesh hops.') ruckusZDWLANAPMeshType = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("unknown", 0), ("root", 1), ("mesh", 2), ("forming", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPMeshType.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPMeshType.setDescription('Mesh type.') ruckusZDWLANAPLANStatsRXByte = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXByte.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXByte.setDescription('Bytes received on LAN port.') ruckusZDWLANAPLANStatsRXPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXPkt.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXPkt.setDescription('Packets received on LAN port.') ruckusZDWLANAPLANStatsRXPktErr = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 23), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXPktErr.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXPktErr.setDescription('Packets received erroneously on LAN port.') ruckusZDWLANAPLANStatsRXPKTSucc = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 24), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXPKTSucc.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXPKTSucc.setDescription('Packets received successfully on LAN port.') ruckusZDWLANAPLANStatsTXByte = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 25), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsTXByte.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsTXByte.setDescription('Bytes transmitted on LAN port.') ruckusZDWLANAPLANStatsTXPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 26), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsTXPkt.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsTXPkt.setDescription('Packets transmitted on LAN port.') ruckusZDWLANAPMemUtil = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 27), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPMemUtil.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPMemUtil.setDescription('Memory utilization percentage.') ruckusZDWLANAPMemTotal = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 28), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPMemTotal.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPMemTotal.setDescription('Total memory in KB.') ruckusZDWLANAPCPUUtil = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 29), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPCPUUtil.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPCPUUtil.setDescription('CPU utilization percentage.') ruckusZDWLANAPFWSize = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 30), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPFWSize.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPFWSize.setDescription('Firmware partition size in byte.') ruckusZDWLANAPFWAvail = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 31), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPFWAvail.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPFWAvail.setDescription('Firmware partition available size in byte.') ruckusZDWLANAPMultipleVlanCapability = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 32), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPMultipleVlanCapability.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPMultipleVlanCapability.setDescription('AP support multiple vlan capability.') ruckusZDWLANAP11bCapable = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 36), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAP11bCapable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAP11bCapable.setDescription('Support 802.11b.') ruckusZDWLANAP11gCapable = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 37), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAP11gCapable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAP11gCapable.setDescription('Support 802.11g.') ruckusZDWLANAPMultiModeAccessStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 38), TruthValue().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("false", 0), ("true", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ruckusZDWLANAPMultiModeAccessStatus.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPMultiModeAccessStatus.setDescription('Support simutaneously connections from 11a/b/g clients.') ruckusZDWLANAPEthStateChange = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 39), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPEthStateChange.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPEthStateChange.setDescription('Ethernet port up/down count.') ruckusZDWLANAPSyncConf = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 41), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPSyncConf.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPSyncConf.setDescription('Manually push configuration to this AP.') ruckusZDWLANAPUpgrade = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 42), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPUpgrade.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPUpgrade.setDescription('Upgrade this AP.') ruckusZDWLANAPFirstJoinTime = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 43), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPFirstJoinTime.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPFirstJoinTime.setDescription('Time of first join.') ruckusZDWLANAPLastBootTime = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 44), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLastBootTime.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLastBootTime.setDescription('Time of last boot.') ruckusZDWLANAPLastUpgradeTime = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 45), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLastUpgradeTime.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLastUpgradeTime.setDescription('Time of last firmware upgrade.') ruckusZDWLANAPLastConfSyncTime = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 46), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLastConfSyncTime.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLastConfSyncTime.setDescription('Time of last configuration synchronization.') ruckusZDWLANAPLANStatsRXPKTBcast = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 47), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXPKTBcast.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXPKTBcast.setDescription('Broadcast packets received successfully on LAN port.') ruckusZDWLANAPLANStatsRXPKTMcast = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 48), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXPKTMcast.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXPKTMcast.setDescription('Multicast packets received successfully on LAN port.') ruckusZDWLANAPLANStatsRXPKTUcast = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 49), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXPKTUcast.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXPKTUcast.setDescription('Unicast packets received successfully on LAN port.') ruckusZDWLANAPLANStatsTXPKTBcast = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 50), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsTXPKTBcast.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsTXPKTBcast.setDescription('Broadcast packets transmitted successfully on LAN port.') ruckusZDWLANAPLANStatsTXPKTMcast = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 51), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsTXPKTMcast.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsTXPKTMcast.setDescription('Multicast packets transmitted successfully on LAN port.') ruckusZDWLANAPLANStatsTXPKTUcast = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 52), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsTXPKTUcast.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsTXPKTUcast.setDescription('Unicast packets transmitted successfully on LAN port.') ruckusZDWLANAPLANStatsDropped = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 53), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsDropped.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsDropped.setDescription('Number of packets dropped on LAN port.') ruckusZDWLANAPMeshUpPortCntUpdown = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 54), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPMeshUpPortCntUpdown.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPMeshUpPortCntUpdown.setDescription('updown count of AP as a up port node in mesh mode.') ruckusZDWLANAPMeshDownPortCntUpdown = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 55), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPMeshDownPortCntUpdown.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPMeshDownPortCntUpdown.setDescription('updown count of AP as a down port node in mesh mode.') ruckusZDWLANAPTxFrameDropped = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 57), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPTxFrameDropped.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPTxFrameDropped.setDescription('Droped Frame count of AP wireless transmitted.') ruckusZDWLANAPTxFrameError = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 58), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPTxFrameError.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPTxFrameError.setDescription('Error Frame count of AP wireless transmitted.') ruckusZDWLANAPCoverageTech = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 59), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("indoor", 1), ("indoor-distribute", 2), ("outdoor", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPCoverageTech.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPCoverageTech.setDescription("AP's coverage technology.") ruckusZDWLANAPStaTxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 61), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPStaTxBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPStaTxBytes.setDescription('Client send data to this AP.(kbytes) ') ruckusZDWLANAPStaRxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 62), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPStaRxBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPStaRxBytes.setDescription('Client receive data from this AP.(kbytes)') ruckusZDWLANAPNetmask = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 100), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPNetmask.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPNetmask.setDescription('Netmask address.') ruckusZDWLANAPGateway = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 101), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPGateway.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPGateway.setDescription('Gateway address.') ruckusZDWLANAPDNS1 = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 105), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPDNS1.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPDNS1.setDescription('Primary DNS address.') ruckusZDWLANAPDNS2 = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 106), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPDNS2.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPDNS2.setDescription('Sencond DNS address.') ruckusZDWLANAPTotalUser = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 110), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPTotalUser.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPTotalUser.setDescription('Total number of concurrent users on this AP.') ruckusZDWLANAPLANStatsRXByteRate = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 111), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXByteRate.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXByteRate.setDescription('Bytes rate received on LAN port each 90s.') ruckusZDWLANAPLANStatsTXByteRate = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 112), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsTXByteRate.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsTXByteRate.setDescription('Bytes rate transmitted on LAN port each 90s.') ruckusZDWLANAPRadioStatsTable = MibTable((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2), ) if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTable.setDescription('ZD WLAN AP Radio table.') ruckusZDWLANAPRadioStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1), ).setIndexNames((0, "RUCKUS-ZD-WLAN-MIB", "ruckusZDWLANAPRadioStatsAPMacAddr"), (0, "RUCKUS-ZD-WLAN-MIB", "ruckusZDWLANAPRadioStatsRadioIndex")) if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsEntry.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsEntry.setDescription('Specifies each ZD WLAN AP Radio entry.') ruckusZDWLANAPRadioStatsAPMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 1), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAPMacAddr.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAPMacAddr.setDescription('AP MAC address.') ruckusZDWLANAPRadioStatsRadioIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 2), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRadioIndex.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRadioIndex.setDescription('Radio index of the AP.') ruckusZDWLANAPRadioStatsRadioType = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("radio11bg", 0), ("radio11a", 1), ("radio11ng", 2), ("radio11na", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRadioType.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRadioType.setDescription('Radio type.') ruckusZDWLANAPRadioStatsChannel = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 4), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsChannel.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsChannel.setDescription('Radio channel.') ruckusZDWLANAPRadioStatsTxPower = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("full", 0), ("half", 1), ("quarter", 2), ("eighth", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxPower.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxPower.setDescription('Transmit power of radio.') ruckusZDWLANAPRadioStatsMeshEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 6), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsMeshEnable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsMeshEnable.setDescription('Mesh enable.') ruckusZDWLANAPRadioStatsNumVAP = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 7), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsNumVAP.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsNumVAP.setDescription('Number of APs.') ruckusZDWLANAPRadioStatsNumSta = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 8), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsNumSta.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsNumSta.setDescription('Number of stations.') ruckusZDWLANAPRadioStatsAvgStaRSSI = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAvgStaRSSI.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAvgStaRSSI.setDescription('Average client RSSI.') ruckusZDWLANAPRadioStatsRxPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 10), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRxPkts.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRxPkts.setDescription('Received packets.') ruckusZDWLANAPRadioStatsRxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 11), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRxBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRxBytes.setDescription('Received bytes.') ruckusZDWLANAPRadioStatsRxMulticast = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 12), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRxMulticast.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRxMulticast.setDescription('Received multicast packets.') ruckusZDWLANAPRadioStatsTxPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 13), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxPkts.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxPkts.setDescription('Transmitted packets.') ruckusZDWLANAPRadioStatsTxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 14), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxBytes.setDescription('Transmitted bytes.') ruckusZDWLANAPRadioStatsTxMulticast = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 15), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxMulticast.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxMulticast.setDescription('Transmitted multicast packets.') ruckusZDWLANAPRadioStatsTxFail = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 16), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxFail.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxFail.setDescription('Transmitted fail packets.') ruckusZDWLANAPRadioStatsTxRetries = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 17), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxRetries.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxRetries.setDescription('Transmitted retry packets.') ruckusZDWLANAPRadioStatsPowerMgmt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 18), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsPowerMgmt.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsPowerMgmt.setDescription('Power management enable.') ruckusZDWLANAPRadioStatsMaxSta = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 19), Unsigned32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsMaxSta.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsMaxSta.setDescription('Number of max stations allowed.') ruckusZDWLANAPRadioStatsFrameErrorRate = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 20), Unsigned32()).setUnits('1/10000').setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsFrameErrorRate.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsFrameErrorRate.setDescription('Frame error rate.') ruckusZDWLANAPRadioStatsFrameRetryRate = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 21), Unsigned32()).setUnits('1/10000').setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsFrameRetryRate.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsFrameRetryRate.setDescription('Frame retry rate.') ruckusZDWLANAPRadioStatsMonitoredTime = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 22), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsMonitoredTime.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsMonitoredTime.setDescription('Monitored time.') ruckusZDWLANAPRadioStatsTotalAssocTime = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 24), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTotalAssocTime.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTotalAssocTime.setDescription('Client total association time.') ruckusZDWLANAPRadioStatsAuthReq = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 25), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAuthReq.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAuthReq.setDescription('Authentication request.') ruckusZDWLANAPRadioStatsAuthResp = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 26), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAuthResp.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAuthResp.setDescription('Authentication response.') ruckusZDWLANAPRadioStatsAuthSuccess = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 27), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAuthSuccess.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAuthSuccess.setDescription('Authentication success.') ruckusZDWLANAPRadioStatsAuthFail = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 28), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAuthFail.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAuthFail.setDescription('Authentication fail.') ruckusZDWLANAPRadioStatsAssocReq = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 29), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAssocReq.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAssocReq.setDescription('Association request.') ruckusZDWLANAPRadioStatsAssocResp = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 30), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAssocResp.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAssocResp.setDescription('Association response.') ruckusZDWLANAPRadioStatsReassocReq = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 31), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsReassocReq.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsReassocReq.setDescription('Reassociation request.') ruckusZDWLANAPRadioStatsReassocResp = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 32), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsReassocResp.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsReassocResp.setDescription('Reassociation response.') ruckusZDWLANAPRadioStatsAssocSuccess = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 33), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAssocSuccess.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAssocSuccess.setDescription('Association success.') ruckusZDWLANAPRadioStatsAssocFail = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 34), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAssocFail.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAssocFail.setDescription('Association fail.') ruckusZDWLANAPRadioStatsAssocDenied = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 35), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAssocDenied.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAssocDenied.setDescription('Association denied.') ruckusZDWLANAPRadioStatsDiassocAbnormal = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 36), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsDiassocAbnormal.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsDiassocAbnormal.setDescription('Disassociation request due to abnormal causes.') ruckusZDWLANAPRadioStatsDiassocCapacity = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 37), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsDiassocCapacity.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsDiassocCapacity.setDescription('Disassociation request due to device capacity.') ruckusZDWLANAPRadioStatsDiassocLeave = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 38), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsDiassocLeave.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsDiassocLeave.setDescription('Disassociation request due to client leave.') ruckusZDWLANAPRadioStatsDiassocMisc = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 39), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsDiassocMisc.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsDiassocMisc.setDescription('Disassociation request due to other reasons.') ruckusZDWLANAPRadioStatsResourceUtil = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 40), Unsigned32()).setUnits('percentage').setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsResourceUtil.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsResourceUtil.setDescription('Resource utilization.') ruckusZDWLANAPRadioStatsRxSignalFrm = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 41), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRxSignalFrm.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRxSignalFrm.setDescription('Received signal frames.') ruckusZDWLANAPRadioStatsTxSignalFrm = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 42), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxSignalFrm.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxSignalFrm.setDescription('Transmitted signal frames.') ruckusZDWLANAPRadioStatsTotalSignalFrm = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 43), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTotalSignalFrm.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTotalSignalFrm.setDescription('Total signal frames.') ruckusZDWLANAPRadioStatsAntennaGain = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 44), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAntennaGain.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAntennaGain.setDescription('Get antenna gain.') ruckusZDWLANAPRadioStatsBeaconPeriod = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 45), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsBeaconPeriod.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsBeaconPeriod.setDescription('Get beacon period.') ruckusZDWLANAPRadioStatsRTSThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 46), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRTSThreshold.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRTSThreshold.setDescription('Get RTS threshold.') ruckusZDWLANAPRadioStatsFragThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 47), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsFragThreshold.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsFragThreshold.setDescription('Get fragment threshold.') ruckusZDWLANStaInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3)) ruckusZDWLANStaTable = MibTable((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1), ) if mibBuilder.loadTexts: ruckusZDWLANStaTable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaTable.setDescription('ZD WLAN Station table.') ruckusZDWLANStaEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1), ).setIndexNames((0, "RUCKUS-ZD-WLAN-MIB", "ruckusZDWLANStaMacAddr")) if mibBuilder.loadTexts: ruckusZDWLANStaEntry.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaEntry.setDescription('Specifies each ZD WLAN Station entry.') ruckusZDWLANStaMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 1), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaMacAddr.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaMacAddr.setDescription("The station's MAC Address.") ruckusZDWLANStaAPMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 2), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaAPMacAddr.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaAPMacAddr.setDescription('The MAC address of the associated AP.') ruckusZDWLANStaBSSID = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 3), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaBSSID.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaBSSID.setDescription('BSSID of WLAN.') ruckusZDWLANStaSSID = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 4), RuckusSSID()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaSSID.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaSSID.setDescription('SSID.') ruckusZDWLANStaUser = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaUser.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaUser.setDescription('Logined username of the client.') ruckusZDWLANStaRadioType = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("radio11a", 0), ("radio11b", 1), ("radio11g", 2), ("radio11ng", 3), ("radio11na", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaRadioType.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaRadioType.setDescription('Radio type.') ruckusZDWLANStaChannel = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 7), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaChannel.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaChannel.setDescription('Radio channel.') ruckusZDWLANStaIPAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 8), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaIPAddr.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaIPAddr.setDescription('IP address.') ruckusZDWLANStaAvgRSSI = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaAvgRSSI.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaAvgRSSI.setDescription('Averaged RSSI.') ruckusZDWLANStaRxPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaRxPkts.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaRxPkts.setDescription('Received packets.') ruckusZDWLANStaRxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 11), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaRxBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaRxBytes.setDescription('Received bytes.') ruckusZDWLANStaTxPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaTxPkts.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaTxPkts.setDescription('Transmitted packets.') ruckusZDWLANStaTxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 13), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaTxBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaTxBytes.setDescription('Transmitted bytes.') ruckusZDWLANStaRetries = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaRetries.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaRetries.setDescription('Transmitted retries.') ruckusZDWLANStaAssocTime = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 15), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaAssocTime.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaAssocTime.setDescription('The time client has been associated.') ruckusZDWLANStaRxError = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaRxError.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaRxError.setDescription('Received error packets.') ruckusZDWLANStaTxSuccess = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaTxSuccess.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaTxSuccess.setDescription('Successful transmitted packets.') ruckusZDWLANSta11bgReassoc = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANSta11bgReassoc.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANSta11bgReassoc.setDescription('Reassociate count on B/G RF.') ruckusZDWLANStaAssocTimestamp = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 19), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaAssocTimestamp.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaAssocTimestamp.setDescription('The timestamp client associated.') ruckusZDWLANStaRetryBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaRetryBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaRetryBytes.setDescription('Transmitted retry bytes.') ruckusZDWLANStaSNR = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 21), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaSNR.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaSNR.setDescription("Station's Signal to Noise Ratio.") ruckusZDWLANStaRxDrop = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaRxDrop.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaRxDrop.setDescription('Drop transmitted packets.') ruckusZDWLANStaTxDrop = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 23), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaTxDrop.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaTxDrop.setDescription('Drop received packets.') ruckusZDWLANStaTxError = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 24), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaTxError.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaTxError.setDescription('Transmitted error packets.') ruckusZDWLANStaVlanID = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 30), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaVlanID.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaVlanID.setDescription('VLAN ID of the station. 1 for not specified.') ruckusZDWLANStaAuthMode = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 80), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaAuthMode.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaAuthMode.setDescription('Authentication mode of authenticated terminal.') ruckusZDWLANStaSignalStrength = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 81), Integer32()).setUnits('dBm').setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaSignalStrength.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaSignalStrength.setDescription('Signal strength') ruckusZDWLANRogueInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 4)) ruckusZDWLANRogueTable = MibTable((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 4, 1), ) if mibBuilder.loadTexts: ruckusZDWLANRogueTable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRogueTable.setDescription('ZD WLAN rogue device table.') ruckusZDWLANRogueEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 4, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: ruckusZDWLANRogueEntry.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRogueEntry.setDescription('Specifies each ZD WLAN rogue device entry.') ruckusZDWLANRogueMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 4, 1, 1, 1), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRogueMacAddr.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRogueMacAddr.setDescription("Rogue device's MAC Address.") ruckusZDWLANRogueSSID = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 4, 1, 1, 2), RuckusSSID()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRogueSSID.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRogueSSID.setDescription('SSID.') ruckusZDWLANRogueRadioType = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 4, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("radio11bg", 0), ("radio11a", 1), ("radio11ng", 2), ("radio11na", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRogueRadioType.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRogueRadioType.setDescription('Radio type.') ruckusZDWLANRogueChannel = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 4, 1, 1, 4), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRogueChannel.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRogueChannel.setDescription('Radio channel.') ruckusZDWLANRogueRSSI = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 4, 1, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRogueRSSI.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRogueRSSI.setDescription('RSSI.') ruckusZDWLANRogueType = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 4, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("ap", 0), ("ad-hoc", 1)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRogueType.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRogueType.setDescription('The type of the rogue device.') ruckusZDWLANRogueEncrypted = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 4, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("open", 0), ("encrypted", 1)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRogueEncrypted.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRogueEncrypted.setDescription('Encryption mode.') ruckusZDWLANRogueSignalStrength = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 4, 1, 1, 11), Integer32()).setUnits('dBm').setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRogueSignalStrength.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRogueSignalStrength.setDescription('Signal strength') ruckusZDWLANVapTable = MibTable((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3), ) if mibBuilder.loadTexts: ruckusZDWLANVapTable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapTable.setDescription('ZD WLAN AP table per each WLAN.') ruckusZDWLANVapEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1), ).setIndexNames((0, "RUCKUS-ZD-WLAN-MIB", "ruckusZDWLANVapBSSID")) if mibBuilder.loadTexts: ruckusZDWLANVapEntry.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapEntry.setDescription('Specifies each ZD WLAN vap entry.') ruckusZDWLANVapBSSID = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 1), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapBSSID.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapBSSID.setDescription("The VAP's BSSID ,it is a MAC Address.") ruckusZDWLANVapPAPAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 2), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapPAPAddr.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapPAPAddr.setDescription("The MAC address of the Parent's AP.") ruckusZDWLANVapSSID = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 3), RuckusSSID()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapSSID.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapSSID.setDescription('SSID of VAP.') ruckusZDWLANVapLanRxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 6), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapLanRxBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapLanRxBytes.setDescription('Received bytes on LAN in VAP .') ruckusZDWLANVapLanTxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 7), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapLanTxBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapLanTxBytes.setDescription('Transmitted bytes on LAN in VAP.') ruckusZDWLANVapWlanRxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 8), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapWlanRxBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapWlanRxBytes.setDescription('Received bytes on WLAN in VAP .') ruckusZDWLANVapWlanTxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 9), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapWlanTxBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapWlanTxBytes.setDescription('Transmitted bytes on WLAN in VAP.') ruckusZDWLANVapWlanRxErrorPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 11), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapWlanRxErrorPkt.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapWlanRxErrorPkt.setDescription('Receiveed error packet on WLAN in VAP.') ruckusZDWLANVapWlanRxUnicastPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 12), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapWlanRxUnicastPkt.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapWlanRxUnicastPkt.setDescription('Receiveed unicast packet on WLAN in VAP.') ruckusZDWLANVapWlanTxUnicastPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 13), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapWlanTxUnicastPkt.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapWlanTxUnicastPkt.setDescription('Transmitted unicast packet on WLAN in VAP.') ruckusZDWLANVapWlanRxPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 14), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapWlanRxPkt.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapWlanRxPkt.setDescription('Received packet on WLAN in VAP.') ruckusZDWLANVapWlanRxDropPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 15), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapWlanRxDropPkt.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapWlanRxDropPkt.setDescription('Received dropped packet on WLAN in VAP.') ruckusZDWLANVapWlanTxErrPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 16), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapWlanTxErrPkt.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapWlanTxErrPkt.setDescription('Transmitted error packet on WLAN in VAP.') ruckusZDWLANVapWlanTxPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 17), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapWlanTxPkt.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapWlanTxPkt.setDescription('Transmitted packet on WLAN in VAP.') ruckusZDWLANVapWlanTxDropPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 18), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapWlanTxDropPkt.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapWlanTxDropPkt.setDescription('Transmitted dropped packet on WLAN in VAP.') ruckusZDWLANIfTable = MibTable((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4), ) if mibBuilder.loadTexts: ruckusZDWLANIfTable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANIfTable.setDescription('ZD WLAN AP Interface table per each AP.') ruckusZDWLANIfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1), ).setIndexNames((0, "RUCKUS-ZD-WLAN-MIB", "ruckusZDWLANAPMac"), (0, "RUCKUS-ZD-WLAN-MIB", "ruckusZDWLANAPIfIndex")) if mibBuilder.loadTexts: ruckusZDWLANIfEntry.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANIfEntry.setDescription('Specifies each ZD WLAN vap entry.') ruckusZDWLANAPMac = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 1), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPMac.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPMac.setDescription("The AP's Mac Address.") ruckusZDWLANAPIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 2), InterfaceIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfIndex.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfIndex.setDescription('The index of Interface in AP .') ruckusZDWLANAPIfDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfDescr.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfDescr.setDescription('The Description information for this interface.') ruckusZDWLANAPIfType = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 4), IANAifType()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfType.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfType.setDescription('The type of interface.') ruckusZDWLANAPIfMtu = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfMtu.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfMtu.setDescription('The size of the largest packet which can be sent/received.') ruckusZDWLANAPIfSpeed = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfSpeed.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfSpeed.setDescription("An estimate of the interface's current bandwidth in bits.") ruckusZDWLANAPIfPhysAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfPhysAddress.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfPhysAddress.setDescription("The interface's mac address.") ruckusZDWLANAPIfAdminStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("testing", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfAdminStatus.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfAdminStatus.setDescription('The desired state of the interface: up(1), down(2) ,testing(3) .') ruckusZDWLANAPIfOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("testing", 3), ("unknown", 4), ("dormant", 5), ("notPresent", 6), ("lowerLayerDown", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfOperStatus.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfOperStatus.setDescription('The current operational state of the interface: up(1), down(2), testing(3), unknown(4), dormant(5) , notPresent(6), lowerLayerDown(7).') ruckusZDWLANAPIfInOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfInOctets.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfInOctets.setDescription('The total number of octets received on the interface.') ruckusZDWLANAPIfInUcastPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfInUcastPkts.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfInUcastPkts.setDescription('The total number of unicast packets received on the interface.') ruckusZDWLANAPIfInNUcastPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfInNUcastPkts.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfInNUcastPkts.setDescription('The total number of multicast and broadcast packets received on the interface.') ruckusZDWLANAPIfInDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfInDiscards.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfInDiscards.setDescription('The number of inbound packets which were chosen to be discarded even though no errors had been detected .') ruckusZDWLANAPIfInErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfInErrors.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfInErrors.setDescription('The number of inbound packets that contained errors.') ruckusZDWLANAPIfInUnknownProtos = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfInUnknownProtos.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfInUnknownProtos.setDescription('The number of packets received via the interface which were discarded because of an unknown or unsupported protocol.') ruckusZDWLANAPIfOutOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfOutOctets.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfOutOctets.setDescription('The total number of octets transmitted out of the interface.') ruckusZDWLANAPIfOutUcastPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfOutUcastPkts.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfOutUcastPkts.setDescription('The total number of unicast packets transmitted out of the interface.') ruckusZDWLANAPIfOutNUcastPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfOutNUcastPkts.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfOutNUcastPkts.setDescription('The total number of multicast and broadcast packets transmitted out of the interface.') ruckusZDWLANAPIfOutDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfOutDiscards.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfOutDiscards.setDescription('The number of outbound packets which were chosen to be discarded even though no errors had been detected.') ruckusZDWLANAPIfOutErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfOutErrors.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfOutErrors.setDescription('The number of outbound packets that could not be transmitted because of errors.') ruckusZDWLANAPIfName = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 21), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfName.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfName.setDescription('The name of interface.') ruckusZDWLANAPIfNameDefined = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 22), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfNameDefined.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfNameDefined.setDescription('The alias of interface.') ruckusZDWLANAPEthStatusTable = MibTable((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 8), ) if mibBuilder.loadTexts: ruckusZDWLANAPEthStatusTable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPEthStatusTable.setDescription('ZD WLAN AP Ethernet Interface status table per each AP.') ruckusZDWLANAPEthStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 8, 1), ).setIndexNames((0, "RUCKUS-ZD-WLAN-MIB", "ruckusZDWLANAPMacAddress"), (0, "RUCKUS-ZD-WLAN-MIB", "ruckusZDWLANAPEthPortId")) if mibBuilder.loadTexts: ruckusZDWLANAPEthStatusEntry.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPEthStatusEntry.setDescription('Specifies each ZD WLAN AP ethernet interface status entry.') ruckusZDWLANAPMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 8, 1, 1), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPMacAddress.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPMacAddress.setDescription("The AP's Mac Address.") ruckusZDWLANAPEthPortId = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 8, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPEthPortId.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPEthPortId.setDescription('The ap ethernet port id.') ruckusZDWLANAPEthIfname = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 8, 1, 5), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPEthIfname.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPEthIfname.setDescription('The name of interface.') ruckusZDWLANAPEthDot1xStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 8, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("auth", 1), ("supp", 2), ("none", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPEthDot1xStatus.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPEthDot1xStatus.setDescription('The ap ethernet port Dot1xStatus.') ruckusZDWLANAPEthLogicalStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 8, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("up", 1), ("down", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPEthLogicalStatus.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPEthLogicalStatus.setDescription('The ap ethernet port logical status.') ruckusZDWLANAPEthPhyStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 8, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("up", 1), ("down", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPEthPhyStatus.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPEthPhyStatus.setDescription('The ap ethernet port physical status.') ruckusZDWLANAPEthPhyIfSpeed = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 8, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPEthPhyIfSpeed.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPEthPhyIfSpeed.setDescription("The ap ethernet interface's current bandwidth in Mbits,.") ruckusZDWLANAPEthPhyLinkStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 8, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("full", 1), ("half", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPEthPhyLinkStatus.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPEthPhyLinkStatus.setDescription('The ap ethernet port physical link status.') ruckusZDWLANAPEthLabel = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 8, 1, 11), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPEthLabel.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPEthLabel.setDescription('The ap ethernet port label.') mibBuilder.exportSymbols("RUCKUS-ZD-WLAN-MIB", ruckusZDWLANAPRadioStatsTxPkts=ruckusZDWLANAPRadioStatsTxPkts, ruckusZDWLANTxBytes=ruckusZDWLANTxBytes, ruckusZDWLANAPTxFrameDropped=ruckusZDWLANAPTxFrameDropped, ruckusZDWLANAPLANStatsRXPkt=ruckusZDWLANAPLANStatsRXPkt, ruckusZDWLANStaBSSID=ruckusZDWLANStaBSSID, ruckusZDWLANAPNetmask=ruckusZDWLANAPNetmask, ruckusZDWLANStaTable=ruckusZDWLANStaTable, ruckusZDWLANAssocFail=ruckusZDWLANAssocFail, ruckusZDWLANIfTable=ruckusZDWLANIfTable, ruckusZDWLANAPRadioStatsDiassocLeave=ruckusZDWLANAPRadioStatsDiassocLeave, ruckusZDWLANAPRadioStatsNumSta=ruckusZDWLANAPRadioStatsNumSta, ruckusZDWLANStaSignalStrength=ruckusZDWLANStaSignalStrength, ruckusZDWLANAPMeshUpPortCntUpdown=ruckusZDWLANAPMeshUpPortCntUpdown, ruckusZDWLANAP11bCapable=ruckusZDWLANAP11bCapable, ruckusZDWLANAPUptime=ruckusZDWLANAPUptime, ruckusZDWLANDescription=ruckusZDWLANDescription, ruckusZDWLANSta11bgReassoc=ruckusZDWLANSta11bgReassoc, ruckusZDWLANSSIDBcastDisable=ruckusZDWLANSSIDBcastDisable, ruckusZDWLANAPLastConfSyncTime=ruckusZDWLANAPLastConfSyncTime, ruckusZDWLANAPMacAddr=ruckusZDWLANAPMacAddr, ruckusZDWLANAPStaRxBytes=ruckusZDWLANAPStaRxBytes, ruckusZDWLANAPRadioStatsTable=ruckusZDWLANAPRadioStatsTable, ruckusZDWLANAPRadioStatsAuthResp=ruckusZDWLANAPRadioStatsAuthResp, ruckusZDWLANDiassocCapacity=ruckusZDWLANDiassocCapacity, ruckusZDWLANAPRadioStatsRxMulticast=ruckusZDWLANAPRadioStatsRxMulticast, ruckusZDWLANStaEntry=ruckusZDWLANStaEntry, ruckusZDWLANNAME=ruckusZDWLANNAME, ruckusZDWLANStaRxPkts=ruckusZDWLANStaRxPkts, ruckusZDWLANStaRxBytes=ruckusZDWLANStaRxBytes, ruckusZDWLANAPRadioStatsRxPkts=ruckusZDWLANAPRadioStatsRxPkts, ruckusZDWLANAPModel=ruckusZDWLANAPModel, ruckusZDWLANAPLANStatsRXByte=ruckusZDWLANAPLANStatsRXByte, ruckusZDWLANAPEthLogicalStatus=ruckusZDWLANAPEthLogicalStatus, ruckusZDWLANAPRadioStatsAntennaGain=ruckusZDWLANAPRadioStatsAntennaGain, ruckusZDWLANStaRxDrop=ruckusZDWLANStaRxDrop, ruckusZDWLANStaTxError=ruckusZDWLANStaTxError, ruckusZDWLANAPEthDot1xStatus=ruckusZDWLANAPEthDot1xStatus, ruckusZDWLANAuthentication=ruckusZDWLANAuthentication, ruckusZDWLANAPRadioStatsAssocReq=ruckusZDWLANAPRadioStatsAssocReq, ruckusZDWLANRogueRadioType=ruckusZDWLANRogueRadioType, ruckusZDWLANAPIfIndex=ruckusZDWLANAPIfIndex, ruckusZDWLANAPMeshHops=ruckusZDWLANAPMeshHops, ruckusZDWLANMIB=ruckusZDWLANMIB, ruckusZDWLANAPRadioStatsMaxSta=ruckusZDWLANAPRadioStatsMaxSta, ruckusZDWLANVapEntry=ruckusZDWLANVapEntry, ruckusZDWLANAPMemTotal=ruckusZDWLANAPMemTotal, ruckusZDWLANAPRadioStatsFrameRetryRate=ruckusZDWLANAPRadioStatsFrameRetryRate, ruckusZDWLANIfEntry=ruckusZDWLANIfEntry, ruckusZDWLANAPCoverageTech=ruckusZDWLANAPCoverageTech, ruckusZDWLANAPRadioStatsTxMulticast=ruckusZDWLANAPRadioStatsTxMulticast, ruckusZDWLANRogueEntry=ruckusZDWLANRogueEntry, ruckusZDWLANAPIfOutDiscards=ruckusZDWLANAPIfOutDiscards, ruckusZDWLANAPRadioStatsRadioType=ruckusZDWLANAPRadioStatsRadioType, ruckusZDWLANAPEthLabel=ruckusZDWLANAPEthLabel, ruckusZDWLANStaUser=ruckusZDWLANStaUser, ruckusZDWLANAPUpgrade=ruckusZDWLANAPUpgrade, ruckusZDWLANAPIfAdminStatus=ruckusZDWLANAPIfAdminStatus, ruckusZDWLANAPIfMtu=ruckusZDWLANAPIfMtu, ruckusZDWLANVapBSSID=ruckusZDWLANVapBSSID, ruckusZDWLANAPIfOutOctets=ruckusZDWLANAPIfOutOctets, ruckusZDWLANAPMac=ruckusZDWLANAPMac, ruckusZDWLANAPMeshDownPortCntUpdown=ruckusZDWLANAPMeshDownPortCntUpdown, ruckusZDWLANAPLANStatsTXPkt=ruckusZDWLANAPLANStatsTXPkt, ruckusZDWLANDiassocAbnormal=ruckusZDWLANDiassocAbnormal, ruckusZDWLANIsGuest=ruckusZDWLANIsGuest, ruckusZDWLANAPDNS1=ruckusZDWLANAPDNS1, ruckusZDWLANAP11gCapable=ruckusZDWLANAP11gCapable, ruckusZDWLANAPLastUpgradeTime=ruckusZDWLANAPLastUpgradeTime, ruckusZDWLANRxByteRate=ruckusZDWLANRxByteRate, ruckusZDWLANRogueEncrypted=ruckusZDWLANRogueEncrypted, ruckusZDWLANDiassocMisc=ruckusZDWLANDiassocMisc, ruckusZDWLANAPRadioStatsRadioIndex=ruckusZDWLANAPRadioStatsRadioIndex, ruckusZDWLANRxPkts=ruckusZDWLANRxPkts, ruckusZDWLANVapWlanTxBytes=ruckusZDWLANVapWlanTxBytes, ruckusZDWLANAPNumRadios=ruckusZDWLANAPNumRadios, ruckusZDWLANAPEthStatusEntry=ruckusZDWLANAPEthStatusEntry, ruckusZDWLANStaRetries=ruckusZDWLANStaRetries, ruckusZDWLANAPStaTxBytes=ruckusZDWLANAPStaTxBytes, ruckusZDWLANRxDataFrameOnLan=ruckusZDWLANRxDataFrameOnLan, ruckusZDWLANAPLANStatsRXPKTUcast=ruckusZDWLANAPLANStatsRXPKTUcast, ruckusZDWLANVapWlanTxPkt=ruckusZDWLANVapWlanTxPkt, ruckusZDWLANAPRadioStatsAvgStaRSSI=ruckusZDWLANAPRadioStatsAvgStaRSSI, ruckusZDWLANAPRadioStatsTxRetries=ruckusZDWLANAPRadioStatsTxRetries, ruckusZDWLANAPRadioStatsAssocResp=ruckusZDWLANAPRadioStatsAssocResp, ruckusZDWLANAPRadioStatsAssocFail=ruckusZDWLANAPRadioStatsAssocFail, ruckusZDWLANRateLimitingUp=ruckusZDWLANRateLimitingUp, ruckusZDWLANTunnelWLAN=ruckusZDWLANTunnelWLAN, ruckusZDWLANAPEthStatusTable=ruckusZDWLANAPEthStatusTable, ruckusZDWLANStaAPMacAddr=ruckusZDWLANStaAPMacAddr, ruckusZDWLANAPRadioStatsTxPower=ruckusZDWLANAPRadioStatsTxPower, ruckusZDWLANDiassocLeave=ruckusZDWLANDiassocLeave, ruckusZDWLANAPInfo=ruckusZDWLANAPInfo, ruckusZDWLANAPIfDescr=ruckusZDWLANAPIfDescr, ruckusZDWLANAPLANStatsDropped=ruckusZDWLANAPLANStatsDropped, ruckusZDWLANAPRadioStatsBeaconPeriod=ruckusZDWLANAPRadioStatsBeaconPeriod, ruckusZDWLANDownDropFrame=ruckusZDWLANDownDropFrame, ruckusZDWLANVapWlanRxDropPkt=ruckusZDWLANVapWlanRxDropPkt, ruckusZDWLANAPRadioStatsReassocReq=ruckusZDWLANAPRadioStatsReassocReq, ruckusZDWLANAPIfInNUcastPkts=ruckusZDWLANAPIfInNUcastPkts, ruckusZDWLANAPLANStatsTXByte=ruckusZDWLANAPLANStatsTXByte, ruckusZDWLANAPEthPhyStatus=ruckusZDWLANAPEthPhyStatus, ruckusZDWLANAPCPUUtil=ruckusZDWLANAPCPUUtil, ruckusZDWLANStaInfo=ruckusZDWLANStaInfo, ruckusZDWLANAssocResp=ruckusZDWLANAssocResp, ruckusZDWLANAPStatus=ruckusZDWLANAPStatus, ruckusZDWLANAPRadioStatsAPMacAddr=ruckusZDWLANAPRadioStatsAPMacAddr, ruckusZDWLANAPNumSta=ruckusZDWLANAPNumSta, ruckusZDWLANAPRadioStatsPowerMgmt=ruckusZDWLANAPRadioStatsPowerMgmt, ruckusZDWLANAPIfSpeed=ruckusZDWLANAPIfSpeed, ruckusZDWLANUpDropFrame=ruckusZDWLANUpDropFrame, ruckusZDWLANAPEntry=ruckusZDWLANAPEntry, ruckusZDWLANStaSSID=ruckusZDWLANStaSSID, ruckusZDWLANAPRadioStatsAuthFail=ruckusZDWLANAPRadioStatsAuthFail, ruckusZDWLANAPRadioStatsTxBytes=ruckusZDWLANAPRadioStatsTxBytes, ruckusZDWLANAPRadioStatsMeshEnable=ruckusZDWLANAPRadioStatsMeshEnable, ruckusZDWLANAPIfOperStatus=ruckusZDWLANAPIfOperStatus, ruckusZDWLANAPIfOutNUcastPkts=ruckusZDWLANAPIfOutNUcastPkts, ruckusZDWLANAPEthPortId=ruckusZDWLANAPEthPortId, ruckusZDWLANRogueMacAddr=ruckusZDWLANRogueMacAddr, ruckusZDWLANStaChannel=ruckusZDWLANStaChannel, ruckusZDWLANDownRetxFrame=ruckusZDWLANDownRetxFrame, ruckusZDWLANDownTotalFrame=ruckusZDWLANDownTotalFrame, ruckusZDWLANStaMacAddr=ruckusZDWLANStaMacAddr, ruckusZDWLANUpTotalFrame=ruckusZDWLANUpTotalFrame, ruckusZDWLANTxPkts=ruckusZDWLANTxPkts, ruckusZDWLANRogueType=ruckusZDWLANRogueType, ruckusZDWLANAPIfOutUcastPkts=ruckusZDWLANAPIfOutUcastPkts, ruckusZDWLANRxBytes=ruckusZDWLANRxBytes, ruckusZDWLANAPRadioStatsFragThreshold=ruckusZDWLANAPRadioStatsFragThreshold, ruckusZDWLANStaVlanID=ruckusZDWLANStaVlanID, ruckusZDWLANAPFirstJoinTime=ruckusZDWLANAPFirstJoinTime, ruckusZDWLANAPHWversion=ruckusZDWLANAPHWversion, ruckusZDWLANAPIPAddr=ruckusZDWLANAPIPAddr, ruckusZDWLANStaRxError=ruckusZDWLANStaRxError, ruckusZDWLANAPGateway=ruckusZDWLANAPGateway, ruckusZDWLANAPIfName=ruckusZDWLANAPIfName, ruckusZDWLANRogueSSID=ruckusZDWLANRogueSSID, ruckusZDWLANAPNumVAP=ruckusZDWLANAPNumVAP, ruckusZDWLANEncryption=ruckusZDWLANEncryption, ruckusZDWLANVapSSID=ruckusZDWLANVapSSID, ruckusZDWLANAPSerialNumber=ruckusZDWLANAPSerialNumber, ruckusZDWLANAPRadioStatsAssocDenied=ruckusZDWLANAPRadioStatsAssocDenied, ruckusZDWLANStaRadioType=ruckusZDWLANStaRadioType, ruckusZDWLANAPIfInDiscards=ruckusZDWLANAPIfInDiscards, ruckusZDWLANDownTotalErrFrame=ruckusZDWLANDownTotalErrFrame, ruckusZDWLANAPEthStateChange=ruckusZDWLANAPEthStateChange, ruckusZDWLANAPRadioStatsEntry=ruckusZDWLANAPRadioStatsEntry, ruckusZDWLANEntry=ruckusZDWLANEntry, ruckusZDWLANStaSNR=ruckusZDWLANStaSNR, ruckusZDWLANAPRadioStatsDiassocCapacity=ruckusZDWLANAPRadioStatsDiassocCapacity, ruckusZDWLANAssocTotal=ruckusZDWLANAssocTotal, ruckusZDWLANAPSyncConf=ruckusZDWLANAPSyncConf, ruckusZDWLANVapPAPAddr=ruckusZDWLANVapPAPAddr, ruckusZDWLANStaAvgRSSI=ruckusZDWLANStaAvgRSSI, ruckusZDWLANAuthTotal=ruckusZDWLANAuthTotal, ruckusZDWLANAPRadioStatsTxFail=ruckusZDWLANAPRadioStatsTxFail, ruckusZDWLANAPEthPhyIfSpeed=ruckusZDWLANAPEthPhyIfSpeed, ruckusZDWLANRogueInfo=ruckusZDWLANRogueInfo, ruckusZDWLANAPRadioStatsTotalAssocTime=ruckusZDWLANAPRadioStatsTotalAssocTime, ruckusZDWLANAPLANStatsTXByteRate=ruckusZDWLANAPLANStatsTXByteRate, ruckusZDWLANAPRadioStatsDiassocAbnormal=ruckusZDWLANAPRadioStatsDiassocAbnormal, ruckusZDWLANAPLastBootTime=ruckusZDWLANAPLastBootTime, ruckusZDWLANVapLanTxBytes=ruckusZDWLANVapLanTxBytes, ruckusZDWLANAPRadioStatsRxSignalFrm=ruckusZDWLANAPRadioStatsRxSignalFrm, ruckusZDWLANAPRadioStatsTotalSignalFrm=ruckusZDWLANAPRadioStatsTotalSignalFrm, ruckusZDWLANVapWlanRxErrorPkt=ruckusZDWLANVapWlanRxErrorPkt, ruckusZDWLANAPIfPhysAddress=ruckusZDWLANAPIfPhysAddress, ruckusZDWLANAssocDenied=ruckusZDWLANAssocDenied, ruckusZDWLANStaAssocTimestamp=ruckusZDWLANStaAssocTimestamp, ruckusZDWLANAuthResp=ruckusZDWLANAuthResp, ruckusZDWLANAPLANStatsRXPKTMcast=ruckusZDWLANAPLANStatsRXPKTMcast, ruckusZDWLANReassocResp=ruckusZDWLANReassocResp, ruckusZDWLANVlanID=ruckusZDWLANVlanID, ruckusZDWLANAPDNS2=ruckusZDWLANAPDNS2, ruckusZDWLANAuthFail=ruckusZDWLANAuthFail, ruckusZDWLANAPRadioStatsChannel=ruckusZDWLANAPRadioStatsChannel, ruckusZDWLANNumVAP=ruckusZDWLANNumVAP, ruckusZDWLANTxByteOnLan=ruckusZDWLANTxByteOnLan, ruckusZDWLANStaIPAddr=ruckusZDWLANStaIPAddr, ruckusZDWLANStaTxPkts=ruckusZDWLANStaTxPkts, ruckusZDWLANStaRetryBytes=ruckusZDWLANStaRetryBytes, ruckusZDWLANAPIfNameDefined=ruckusZDWLANAPIfNameDefined, ruckusZDWLANRogueRSSI=ruckusZDWLANRogueRSSI, ruckusZDWLANRxByteOnLan=ruckusZDWLANRxByteOnLan, ruckusZDWLANNumSta=ruckusZDWLANNumSta, ruckusZDWLANAPRadioStatsResourceUtil=ruckusZDWLANAPRadioStatsResourceUtil, ruckusZDWLANVapWlanRxPkt=ruckusZDWLANVapWlanRxPkt, ruckusZDWLANAPRadioStatsMonitoredTime=ruckusZDWLANAPRadioStatsMonitoredTime, ruckusZDWLANAPMeshEnable=ruckusZDWLANAPMeshEnable, PYSNMP_MODULE_ID=ruckusZDWLANMIB, ruckusZDWLANAPRadioStatsAssocSuccess=ruckusZDWLANAPRadioStatsAssocSuccess, ruckusZDWLANAPRadioStatsNumVAP=ruckusZDWLANAPRadioStatsNumVAP, ruckusZDWLANAPLANStatsRXPKTBcast=ruckusZDWLANAPLANStatsRXPKTBcast, ruckusZDWLANAPRadioStatsTxSignalFrm=ruckusZDWLANAPRadioStatsTxSignalFrm, ruckusZDWLANSSID=ruckusZDWLANSSID, ruckusZDWLANAPFWSize=ruckusZDWLANAPFWSize, ruckusZDWLANAuthSuccessTotal=ruckusZDWLANAuthSuccessTotal, ruckusZDWLANStaTxSuccess=ruckusZDWLANStaTxSuccess, ruckusZDWLANVapWlanTxErrPkt=ruckusZDWLANVapWlanTxErrPkt, ruckusZDWLANStaAssocTime=ruckusZDWLANStaAssocTime, ruckusZDWLANAPTotalUser=ruckusZDWLANAPTotalUser, ruckusZDWLANAPLANStatsTXPKTBcast=ruckusZDWLANAPLANStatsTXPKTBcast, ruckusZDWLANVapWlanRxBytes=ruckusZDWLANVapWlanRxBytes, ruckusZDWLANAPEthIfname=ruckusZDWLANAPEthIfname, ruckusZDWLANAPMultiModeAccessStatus=ruckusZDWLANAPMultiModeAccessStatus, ruckusZDWLANAPRadioStatsFrameErrorRate=ruckusZDWLANAPRadioStatsFrameErrorRate, ruckusZDWLANRogueSignalStrength=ruckusZDWLANRogueSignalStrength, ruckusZDWLANAPDescription=ruckusZDWLANAPDescription, ruckusZDWLANAPIfInUcastPkts=ruckusZDWLANAPIfInUcastPkts, ruckusZDWLANTxByteRate=ruckusZDWLANTxByteRate, ruckusZDWLANAPRadioStatsAuthSuccess=ruckusZDWLANAPRadioStatsAuthSuccess, ruckusZDWLANAPRadioStatsDiassocMisc=ruckusZDWLANAPRadioStatsDiassocMisc, ruckusZDWLANAPLANStatsRXPktErr=ruckusZDWLANAPLANStatsRXPktErr, ruckusZDWLANRateLimitingDown=ruckusZDWLANRateLimitingDown, ruckusZDWLANAPTable=ruckusZDWLANAPTable, ruckusZDWLANAPConnectionMode=ruckusZDWLANAPConnectionMode, ruckusZDWLANAPRadioStatsAuthReq=ruckusZDWLANAPRadioStatsAuthReq, ruckusZDWLANAPMultipleVlanCapability=ruckusZDWLANAPMultipleVlanCapability, ruckusZDWLANObjects=ruckusZDWLANObjects, ruckusZDWLANAPRadioStatsRxBytes=ruckusZDWLANAPRadioStatsRxBytes, ruckusZDWLANAPLANStatsRXByteRate=ruckusZDWLANAPLANStatsRXByteRate, ruckusZDWLANStaTxBytes=ruckusZDWLANStaTxBytes, ruckusZDWLANUpRetxFrame=ruckusZDWLANUpRetxFrame, ruckusZDWLANAPFWAvail=ruckusZDWLANAPFWAvail, ruckusZDWLANAPMeshType=ruckusZDWLANAPMeshType, ruckusZDWLANVapLanRxBytes=ruckusZDWLANVapLanRxBytes, ruckusZDWLANAPIfInOctets=ruckusZDWLANAPIfInOctets, ruckusZDWLANStaAuthMode=ruckusZDWLANStaAuthMode, ruckusZDWLANAPMacAddress=ruckusZDWLANAPMacAddress, ruckusZDWLANVapWlanRxUnicastPkt=ruckusZDWLANVapWlanRxUnicastPkt, ruckusZDWLANStaTxDrop=ruckusZDWLANStaTxDrop, ruckusZDWLANVapWlanTxDropPkt=ruckusZDWLANVapWlanTxDropPkt, ruckusZDWLANAPSWversion=ruckusZDWLANAPSWversion, ruckusZDWLANAPNumRogues=ruckusZDWLANAPNumRogues, ruckusZDWLANAPIfInErrors=ruckusZDWLANAPIfInErrors, ruckusZDWLANAPRadioStatsRTSThreshold=ruckusZDWLANAPRadioStatsRTSThreshold, ruckusZDWLANRogueChannel=ruckusZDWLANRogueChannel, ruckusZDWLANAPRadioStatsReassocResp=ruckusZDWLANAPRadioStatsReassocResp, ruckusZDWLANInfo=ruckusZDWLANInfo, ruckusZDWLANTable=ruckusZDWLANTable, ruckusZDWLANAssocSuccess=ruckusZDWLANAssocSuccess, ruckusZDWLANAPEthPhyLinkStatus=ruckusZDWLANAPEthPhyLinkStatus, ruckusZDWLANRogueTable=ruckusZDWLANRogueTable, ruckusZDWLANAPIfOutErrors=ruckusZDWLANAPIfOutErrors, ruckusZDWLANAPLANStatsRXPKTSucc=ruckusZDWLANAPLANStatsRXPKTSucc, ruckusZDWLANVapTable=ruckusZDWLANVapTable, ruckusZDWLANAPIfType=ruckusZDWLANAPIfType, ruckusZDWLANReassocReq=ruckusZDWLANReassocReq, ruckusZDWLANAPMemUtil=ruckusZDWLANAPMemUtil, ruckusZDWLANAPIfInUnknownProtos=ruckusZDWLANAPIfInUnknownProtos, ruckusZDWLANAPTxFrameError=ruckusZDWLANAPTxFrameError, ruckusZDWLANVapWlanTxUnicastPkt=ruckusZDWLANVapWlanTxUnicastPkt, ruckusZDWLANAPLANStatsTXPKTUcast=ruckusZDWLANAPLANStatsTXPKTUcast, ruckusZDWLANAPLANStatsTXPKTMcast=ruckusZDWLANAPLANStatsTXPKTMcast) mibBuilder.exportSymbols("RUCKUS-ZD-WLAN-MIB", )
125.914397
13,859
0.792707
# # PySNMP MIB module RUCKUS-ZD-WLAN-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/RUCKUS-ZD-WLAN-MIB # Produced by pysmi-0.3.4 at Wed May 1 14:59:17 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueRangeConstraint, ConstraintsUnion, SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsUnion", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsIntersection") IANAifType, = mibBuilder.importSymbols("IANAifType-MIB", "IANAifType") ifIndex, InterfaceIndex = mibBuilder.importSymbols("IF-MIB", "ifIndex", "InterfaceIndex") ruckusZDWLANModule, = mibBuilder.importSymbols("RUCKUS-ROOT-MIB", "ruckusZDWLANModule") RuckusRadioMode, RuckusAdminStatus, RuckusSSID, RuckusRateLimiting, RuckusdB = mibBuilder.importSymbols("RUCKUS-TC-MIB", "RuckusRadioMode", "RuckusAdminStatus", "RuckusSSID", "RuckusRateLimiting", "RuckusdB") NotificationGroup, ModuleCompliance, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance", "ObjectGroup") TimeTicks, Unsigned32, IpAddress, Gauge32, ObjectIdentity, Counter32, Integer32, iso, ModuleIdentity, MibIdentifier, Bits, NotificationType, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter64 = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "Unsigned32", "IpAddress", "Gauge32", "ObjectIdentity", "Counter32", "Integer32", "iso", "ModuleIdentity", "MibIdentifier", "Bits", "NotificationType", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter64") TextualConvention, DisplayString, TruthValue, PhysAddress, RowStatus, MacAddress = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "TruthValue", "PhysAddress", "RowStatus", "MacAddress") ruckusZDWLANMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1)) if mibBuilder.loadTexts: ruckusZDWLANMIB.setLastUpdated('201010150800Z') if mibBuilder.loadTexts: ruckusZDWLANMIB.setOrganization('Ruckus Wireless, Inc.') if mibBuilder.loadTexts: ruckusZDWLANMIB.setContactInfo('Ruckus Wireless, Inc. Postal: 880 W Maude Ave Sunnyvale, CA 94085 USA EMail: support@ruckuswireless.com Phone: +1-650-265-4200') if mibBuilder.loadTexts: ruckusZDWLANMIB.setDescription('Ruckus ZD WLAN mib') ruckusZDWLANObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1)) ruckusZDWLANInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1)) ruckusZDWLANTable = MibTable((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1), ) if mibBuilder.loadTexts: ruckusZDWLANTable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANTable.setDescription('ZD WLAN table.') ruckusZDWLANEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: ruckusZDWLANEntry.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANEntry.setDescription('Specifies each ZD WLAN entry.') ruckusZDWLANSSID = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 1), RuckusSSID()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANSSID.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANSSID.setDescription('SSID.') ruckusZDWLANDescription = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANDescription.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANDescription.setDescription('WLAN description.') ruckusZDWLANAuthentication = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAuthentication.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAuthentication.setDescription('Authentication method.') ruckusZDWLANEncryption = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANEncryption.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANEncryption.setDescription('Encryption method.') ruckusZDWLANIsGuest = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 5), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANIsGuest.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANIsGuest.setDescription('This WLAN is for guest access.') ruckusZDWLANSSIDBcastDisable = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 6), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANSSIDBcastDisable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANSSIDBcastDisable.setDescription('Hide SSID.') ruckusZDWLANVlanID = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVlanID.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVlanID.setDescription('Specifies the VLAN ID of the WLAN. If VLAN ID is 1, packets from this WLAN will be untagged.') ruckusZDWLANRateLimitingUp = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 8), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 10))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRateLimitingUp.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRateLimitingUp.setDescription('Rate limiting of uplink.') ruckusZDWLANRateLimitingDown = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 9), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 10))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRateLimitingDown.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRateLimitingDown.setDescription('Rate limiting of downlink.') ruckusZDWLANTunnelWLAN = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 10), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANTunnelWLAN.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANTunnelWLAN.setDescription('Tunnel WLAN.') ruckusZDWLANNumVAP = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 11), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANNumVAP.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANNumVAP.setDescription('Number of APs.') ruckusZDWLANNumSta = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 12), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANNumSta.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANNumSta.setDescription('Number of client devices.') ruckusZDWLANRxPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 13), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRxPkts.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRxPkts.setDescription('Received packets.') ruckusZDWLANRxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 14), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRxBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRxBytes.setDescription('Received bytes.') ruckusZDWLANTxPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 15), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANTxPkts.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANTxPkts.setDescription('Transmitted packets.') ruckusZDWLANTxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 16), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANTxBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANTxBytes.setDescription('Transmitted bytes.') ruckusZDWLANAuthTotal = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 26), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAuthTotal.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAuthTotal.setDescription('Accumulated total number of attempt to authenticate by wireless terminals on this WLAN, or Authentication request.') ruckusZDWLANAuthResp = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 27), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAuthResp.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAuthResp.setDescription('Authentication response.') ruckusZDWLANAuthSuccessTotal = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 28), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAuthSuccessTotal.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAuthSuccessTotal.setDescription('Accumulated total number of success out of Wireless authentication attempts.') ruckusZDWLANAuthFail = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 29), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAuthFail.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAuthFail.setDescription('Authentication fail.') ruckusZDWLANAssocTotal = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 30), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAssocTotal.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAssocTotal.setDescription('Accumulated total number of access of wireless terminal on this WLAN, or Association request.') ruckusZDWLANAssocResp = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 31), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAssocResp.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAssocResp.setDescription('Association response.') ruckusZDWLANReassocReq = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 32), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANReassocReq.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANReassocReq.setDescription('Reassociation request.') ruckusZDWLANReassocResp = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 33), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANReassocResp.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANReassocResp.setDescription('Reassociation response.') ruckusZDWLANAssocSuccess = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 34), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAssocSuccess.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAssocSuccess.setDescription('Association success.') ruckusZDWLANAssocFail = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 35), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAssocFail.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAssocFail.setDescription('Association fail.') ruckusZDWLANAssocDenied = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 36), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAssocDenied.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAssocDenied.setDescription('Association denied.') ruckusZDWLANDiassocAbnormal = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 37), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANDiassocAbnormal.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANDiassocAbnormal.setDescription('Disassociation request due to abnormal causes.') ruckusZDWLANDiassocCapacity = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 38), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANDiassocCapacity.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANDiassocCapacity.setDescription('Disassociation request due to device capacity.') ruckusZDWLANDiassocLeave = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 39), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANDiassocLeave.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANDiassocLeave.setDescription('Disassociation request due to client leave.') ruckusZDWLANDiassocMisc = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 40), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANDiassocMisc.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANDiassocMisc.setDescription('Disassociation request due to other reasons.') ruckusZDWLANRxByteRate = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 41), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRxByteRate.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRxByteRate.setDescription('Received rate byte/s in last 5 minutes .') ruckusZDWLANTxByteRate = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 42), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANTxByteRate.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANTxByteRate.setDescription('Transmitted rate byte/s in last 5 minutes .') ruckusZDWLANRxDataFrameOnLan = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 43), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRxDataFrameOnLan.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRxDataFrameOnLan.setDescription('Received Data Frame Number on Lan interface .') ruckusZDWLANRxByteOnLan = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 44), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRxByteOnLan.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRxByteOnLan.setDescription('Received Data Bytes on Lan interface .') ruckusZDWLANTxByteOnLan = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 45), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANTxByteOnLan.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANTxByteOnLan.setDescription('Transmitted Data Bytes on Lan interface .') ruckusZDWLANDownDropFrame = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 46), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANDownDropFrame.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANDownDropFrame.setDescription('Drop Frame Number on Downlink of Wireless.') ruckusZDWLANDownRetxFrame = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 47), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANDownRetxFrame.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANDownRetxFrame.setDescription('Retransmitted Frame Number on Downlink of Wireless.') ruckusZDWLANDownTotalFrame = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 48), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANDownTotalFrame.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANDownTotalFrame.setDescription('Total Frame Number on Downlink of Wireless.') ruckusZDWLANDownTotalErrFrame = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 49), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANDownTotalErrFrame.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANDownTotalErrFrame.setDescription('Total Error Frame Number on Downlink of Wireless.') ruckusZDWLANUpTotalFrame = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 50), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANUpTotalFrame.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANUpTotalFrame.setDescription('Total Frame Number on Uplink of Wireless.') ruckusZDWLANUpDropFrame = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 51), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANUpDropFrame.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANUpDropFrame.setDescription('Drop Frame Number on Uplink of Wireless.') ruckusZDWLANUpRetxFrame = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 52), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANUpRetxFrame.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANUpRetxFrame.setDescription('Retransmitted Frame Number on Uplink of Wireless.') ruckusZDWLANNAME = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 1, 1, 1, 108), RuckusSSID()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANNAME.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANNAME.setDescription('WLAN NAME.') ruckusZDWLANAPInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2)) ruckusZDWLANAPTable = MibTable((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1), ) if mibBuilder.loadTexts: ruckusZDWLANAPTable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPTable.setDescription('ZD WLAN AP table.') ruckusZDWLANAPEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1), ).setIndexNames((0, "RUCKUS-ZD-WLAN-MIB", "ruckusZDWLANAPMacAddr")) if mibBuilder.loadTexts: ruckusZDWLANAPEntry.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPEntry.setDescription('Specifies each ZD WLAN AP entry.') ruckusZDWLANAPMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 1), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPMacAddr.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPMacAddr.setDescription('MAC address.') ruckusZDWLANAPDescription = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPDescription.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPDescription.setDescription('Description.') ruckusZDWLANAPStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("disconnected", 0), ("connected", 1), ("approvalPending", 2), ("upgradingFirmware", 3), ("provisioning", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPStatus.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPStatus.setDescription('The connection status with ZD.') ruckusZDWLANAPModel = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPModel.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPModel.setDescription('Model name.') ruckusZDWLANAPSerialNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPSerialNumber.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPSerialNumber.setDescription('Serial number.') ruckusZDWLANAPUptime = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 6), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPUptime.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPUptime.setDescription('Up time.') ruckusZDWLANAPSWversion = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPSWversion.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPSWversion.setDescription('Software version.') ruckusZDWLANAPHWversion = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 8), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPHWversion.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPHWversion.setDescription('Hardware version.') ruckusZDWLANAPIPAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 10), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIPAddr.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIPAddr.setDescription('IP address.') ruckusZDWLANAPNumRadios = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 13), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPNumRadios.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPNumRadios.setDescription('Number of radios.') ruckusZDWLANAPNumVAP = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 14), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPNumVAP.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPNumVAP.setDescription('Number of APs.') ruckusZDWLANAPNumSta = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 15), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPNumSta.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPNumSta.setDescription('Total number of authenticated terminal which is using currently on this AP.') ruckusZDWLANAPNumRogues = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 16), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPNumRogues.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPNumRogues.setDescription('Number of rogue devices.') ruckusZDWLANAPConnectionMode = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("layer2", 0), ("layer3", 1)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPConnectionMode.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPConnectionMode.setDescription('The connection mode with ZD.') ruckusZDWLANAPMeshEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 18), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPMeshEnable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPMeshEnable.setDescription('Mesh enable.') ruckusZDWLANAPMeshHops = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 19), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPMeshHops.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPMeshHops.setDescription('Number of mesh hops.') ruckusZDWLANAPMeshType = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("unknown", 0), ("root", 1), ("mesh", 2), ("forming", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPMeshType.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPMeshType.setDescription('Mesh type.') ruckusZDWLANAPLANStatsRXByte = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXByte.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXByte.setDescription('Bytes received on LAN port.') ruckusZDWLANAPLANStatsRXPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXPkt.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXPkt.setDescription('Packets received on LAN port.') ruckusZDWLANAPLANStatsRXPktErr = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 23), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXPktErr.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXPktErr.setDescription('Packets received erroneously on LAN port.') ruckusZDWLANAPLANStatsRXPKTSucc = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 24), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXPKTSucc.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXPKTSucc.setDescription('Packets received successfully on LAN port.') ruckusZDWLANAPLANStatsTXByte = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 25), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsTXByte.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsTXByte.setDescription('Bytes transmitted on LAN port.') ruckusZDWLANAPLANStatsTXPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 26), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsTXPkt.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsTXPkt.setDescription('Packets transmitted on LAN port.') ruckusZDWLANAPMemUtil = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 27), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPMemUtil.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPMemUtil.setDescription('Memory utilization percentage.') ruckusZDWLANAPMemTotal = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 28), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPMemTotal.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPMemTotal.setDescription('Total memory in KB.') ruckusZDWLANAPCPUUtil = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 29), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPCPUUtil.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPCPUUtil.setDescription('CPU utilization percentage.') ruckusZDWLANAPFWSize = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 30), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPFWSize.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPFWSize.setDescription('Firmware partition size in byte.') ruckusZDWLANAPFWAvail = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 31), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPFWAvail.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPFWAvail.setDescription('Firmware partition available size in byte.') ruckusZDWLANAPMultipleVlanCapability = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 32), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPMultipleVlanCapability.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPMultipleVlanCapability.setDescription('AP support multiple vlan capability.') ruckusZDWLANAP11bCapable = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 36), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAP11bCapable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAP11bCapable.setDescription('Support 802.11b.') ruckusZDWLANAP11gCapable = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 37), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAP11gCapable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAP11gCapable.setDescription('Support 802.11g.') ruckusZDWLANAPMultiModeAccessStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 38), TruthValue().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("false", 0), ("true", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ruckusZDWLANAPMultiModeAccessStatus.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPMultiModeAccessStatus.setDescription('Support simutaneously connections from 11a/b/g clients.') ruckusZDWLANAPEthStateChange = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 39), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPEthStateChange.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPEthStateChange.setDescription('Ethernet port up/down count.') ruckusZDWLANAPSyncConf = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 41), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPSyncConf.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPSyncConf.setDescription('Manually push configuration to this AP.') ruckusZDWLANAPUpgrade = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 42), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPUpgrade.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPUpgrade.setDescription('Upgrade this AP.') ruckusZDWLANAPFirstJoinTime = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 43), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPFirstJoinTime.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPFirstJoinTime.setDescription('Time of first join.') ruckusZDWLANAPLastBootTime = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 44), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLastBootTime.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLastBootTime.setDescription('Time of last boot.') ruckusZDWLANAPLastUpgradeTime = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 45), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLastUpgradeTime.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLastUpgradeTime.setDescription('Time of last firmware upgrade.') ruckusZDWLANAPLastConfSyncTime = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 46), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLastConfSyncTime.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLastConfSyncTime.setDescription('Time of last configuration synchronization.') ruckusZDWLANAPLANStatsRXPKTBcast = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 47), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXPKTBcast.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXPKTBcast.setDescription('Broadcast packets received successfully on LAN port.') ruckusZDWLANAPLANStatsRXPKTMcast = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 48), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXPKTMcast.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXPKTMcast.setDescription('Multicast packets received successfully on LAN port.') ruckusZDWLANAPLANStatsRXPKTUcast = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 49), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXPKTUcast.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXPKTUcast.setDescription('Unicast packets received successfully on LAN port.') ruckusZDWLANAPLANStatsTXPKTBcast = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 50), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsTXPKTBcast.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsTXPKTBcast.setDescription('Broadcast packets transmitted successfully on LAN port.') ruckusZDWLANAPLANStatsTXPKTMcast = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 51), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsTXPKTMcast.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsTXPKTMcast.setDescription('Multicast packets transmitted successfully on LAN port.') ruckusZDWLANAPLANStatsTXPKTUcast = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 52), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsTXPKTUcast.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsTXPKTUcast.setDescription('Unicast packets transmitted successfully on LAN port.') ruckusZDWLANAPLANStatsDropped = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 53), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsDropped.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsDropped.setDescription('Number of packets dropped on LAN port.') ruckusZDWLANAPMeshUpPortCntUpdown = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 54), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPMeshUpPortCntUpdown.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPMeshUpPortCntUpdown.setDescription('updown count of AP as a up port node in mesh mode.') ruckusZDWLANAPMeshDownPortCntUpdown = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 55), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPMeshDownPortCntUpdown.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPMeshDownPortCntUpdown.setDescription('updown count of AP as a down port node in mesh mode.') ruckusZDWLANAPTxFrameDropped = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 57), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPTxFrameDropped.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPTxFrameDropped.setDescription('Droped Frame count of AP wireless transmitted.') ruckusZDWLANAPTxFrameError = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 58), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPTxFrameError.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPTxFrameError.setDescription('Error Frame count of AP wireless transmitted.') ruckusZDWLANAPCoverageTech = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 59), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("indoor", 1), ("indoor-distribute", 2), ("outdoor", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPCoverageTech.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPCoverageTech.setDescription("AP's coverage technology.") ruckusZDWLANAPStaTxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 61), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPStaTxBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPStaTxBytes.setDescription('Client send data to this AP.(kbytes) ') ruckusZDWLANAPStaRxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 62), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPStaRxBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPStaRxBytes.setDescription('Client receive data from this AP.(kbytes)') ruckusZDWLANAPNetmask = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 100), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPNetmask.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPNetmask.setDescription('Netmask address.') ruckusZDWLANAPGateway = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 101), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPGateway.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPGateway.setDescription('Gateway address.') ruckusZDWLANAPDNS1 = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 105), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPDNS1.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPDNS1.setDescription('Primary DNS address.') ruckusZDWLANAPDNS2 = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 106), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPDNS2.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPDNS2.setDescription('Sencond DNS address.') ruckusZDWLANAPTotalUser = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 110), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPTotalUser.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPTotalUser.setDescription('Total number of concurrent users on this AP.') ruckusZDWLANAPLANStatsRXByteRate = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 111), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXByteRate.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsRXByteRate.setDescription('Bytes rate received on LAN port each 90s.') ruckusZDWLANAPLANStatsTXByteRate = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 1, 1, 112), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsTXByteRate.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPLANStatsTXByteRate.setDescription('Bytes rate transmitted on LAN port each 90s.') ruckusZDWLANAPRadioStatsTable = MibTable((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2), ) if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTable.setDescription('ZD WLAN AP Radio table.') ruckusZDWLANAPRadioStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1), ).setIndexNames((0, "RUCKUS-ZD-WLAN-MIB", "ruckusZDWLANAPRadioStatsAPMacAddr"), (0, "RUCKUS-ZD-WLAN-MIB", "ruckusZDWLANAPRadioStatsRadioIndex")) if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsEntry.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsEntry.setDescription('Specifies each ZD WLAN AP Radio entry.') ruckusZDWLANAPRadioStatsAPMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 1), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAPMacAddr.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAPMacAddr.setDescription('AP MAC address.') ruckusZDWLANAPRadioStatsRadioIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 2), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRadioIndex.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRadioIndex.setDescription('Radio index of the AP.') ruckusZDWLANAPRadioStatsRadioType = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("radio11bg", 0), ("radio11a", 1), ("radio11ng", 2), ("radio11na", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRadioType.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRadioType.setDescription('Radio type.') ruckusZDWLANAPRadioStatsChannel = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 4), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsChannel.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsChannel.setDescription('Radio channel.') ruckusZDWLANAPRadioStatsTxPower = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("full", 0), ("half", 1), ("quarter", 2), ("eighth", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxPower.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxPower.setDescription('Transmit power of radio.') ruckusZDWLANAPRadioStatsMeshEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 6), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsMeshEnable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsMeshEnable.setDescription('Mesh enable.') ruckusZDWLANAPRadioStatsNumVAP = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 7), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsNumVAP.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsNumVAP.setDescription('Number of APs.') ruckusZDWLANAPRadioStatsNumSta = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 8), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsNumSta.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsNumSta.setDescription('Number of stations.') ruckusZDWLANAPRadioStatsAvgStaRSSI = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAvgStaRSSI.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAvgStaRSSI.setDescription('Average client RSSI.') ruckusZDWLANAPRadioStatsRxPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 10), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRxPkts.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRxPkts.setDescription('Received packets.') ruckusZDWLANAPRadioStatsRxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 11), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRxBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRxBytes.setDescription('Received bytes.') ruckusZDWLANAPRadioStatsRxMulticast = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 12), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRxMulticast.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRxMulticast.setDescription('Received multicast packets.') ruckusZDWLANAPRadioStatsTxPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 13), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxPkts.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxPkts.setDescription('Transmitted packets.') ruckusZDWLANAPRadioStatsTxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 14), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxBytes.setDescription('Transmitted bytes.') ruckusZDWLANAPRadioStatsTxMulticast = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 15), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxMulticast.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxMulticast.setDescription('Transmitted multicast packets.') ruckusZDWLANAPRadioStatsTxFail = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 16), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxFail.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxFail.setDescription('Transmitted fail packets.') ruckusZDWLANAPRadioStatsTxRetries = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 17), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxRetries.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxRetries.setDescription('Transmitted retry packets.') ruckusZDWLANAPRadioStatsPowerMgmt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 18), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsPowerMgmt.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsPowerMgmt.setDescription('Power management enable.') ruckusZDWLANAPRadioStatsMaxSta = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 19), Unsigned32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsMaxSta.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsMaxSta.setDescription('Number of max stations allowed.') ruckusZDWLANAPRadioStatsFrameErrorRate = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 20), Unsigned32()).setUnits('1/10000').setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsFrameErrorRate.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsFrameErrorRate.setDescription('Frame error rate.') ruckusZDWLANAPRadioStatsFrameRetryRate = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 21), Unsigned32()).setUnits('1/10000').setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsFrameRetryRate.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsFrameRetryRate.setDescription('Frame retry rate.') ruckusZDWLANAPRadioStatsMonitoredTime = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 22), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsMonitoredTime.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsMonitoredTime.setDescription('Monitored time.') ruckusZDWLANAPRadioStatsTotalAssocTime = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 24), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTotalAssocTime.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTotalAssocTime.setDescription('Client total association time.') ruckusZDWLANAPRadioStatsAuthReq = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 25), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAuthReq.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAuthReq.setDescription('Authentication request.') ruckusZDWLANAPRadioStatsAuthResp = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 26), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAuthResp.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAuthResp.setDescription('Authentication response.') ruckusZDWLANAPRadioStatsAuthSuccess = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 27), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAuthSuccess.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAuthSuccess.setDescription('Authentication success.') ruckusZDWLANAPRadioStatsAuthFail = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 28), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAuthFail.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAuthFail.setDescription('Authentication fail.') ruckusZDWLANAPRadioStatsAssocReq = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 29), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAssocReq.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAssocReq.setDescription('Association request.') ruckusZDWLANAPRadioStatsAssocResp = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 30), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAssocResp.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAssocResp.setDescription('Association response.') ruckusZDWLANAPRadioStatsReassocReq = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 31), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsReassocReq.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsReassocReq.setDescription('Reassociation request.') ruckusZDWLANAPRadioStatsReassocResp = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 32), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsReassocResp.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsReassocResp.setDescription('Reassociation response.') ruckusZDWLANAPRadioStatsAssocSuccess = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 33), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAssocSuccess.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAssocSuccess.setDescription('Association success.') ruckusZDWLANAPRadioStatsAssocFail = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 34), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAssocFail.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAssocFail.setDescription('Association fail.') ruckusZDWLANAPRadioStatsAssocDenied = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 35), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAssocDenied.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAssocDenied.setDescription('Association denied.') ruckusZDWLANAPRadioStatsDiassocAbnormal = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 36), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsDiassocAbnormal.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsDiassocAbnormal.setDescription('Disassociation request due to abnormal causes.') ruckusZDWLANAPRadioStatsDiassocCapacity = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 37), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsDiassocCapacity.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsDiassocCapacity.setDescription('Disassociation request due to device capacity.') ruckusZDWLANAPRadioStatsDiassocLeave = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 38), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsDiassocLeave.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsDiassocLeave.setDescription('Disassociation request due to client leave.') ruckusZDWLANAPRadioStatsDiassocMisc = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 39), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsDiassocMisc.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsDiassocMisc.setDescription('Disassociation request due to other reasons.') ruckusZDWLANAPRadioStatsResourceUtil = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 40), Unsigned32()).setUnits('percentage').setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsResourceUtil.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsResourceUtil.setDescription('Resource utilization.') ruckusZDWLANAPRadioStatsRxSignalFrm = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 41), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRxSignalFrm.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRxSignalFrm.setDescription('Received signal frames.') ruckusZDWLANAPRadioStatsTxSignalFrm = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 42), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxSignalFrm.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTxSignalFrm.setDescription('Transmitted signal frames.') ruckusZDWLANAPRadioStatsTotalSignalFrm = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 43), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTotalSignalFrm.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsTotalSignalFrm.setDescription('Total signal frames.') ruckusZDWLANAPRadioStatsAntennaGain = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 44), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAntennaGain.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsAntennaGain.setDescription('Get antenna gain.') ruckusZDWLANAPRadioStatsBeaconPeriod = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 45), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsBeaconPeriod.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsBeaconPeriod.setDescription('Get beacon period.') ruckusZDWLANAPRadioStatsRTSThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 46), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRTSThreshold.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsRTSThreshold.setDescription('Get RTS threshold.') ruckusZDWLANAPRadioStatsFragThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 2, 1, 47), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsFragThreshold.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPRadioStatsFragThreshold.setDescription('Get fragment threshold.') ruckusZDWLANStaInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3)) ruckusZDWLANStaTable = MibTable((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1), ) if mibBuilder.loadTexts: ruckusZDWLANStaTable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaTable.setDescription('ZD WLAN Station table.') ruckusZDWLANStaEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1), ).setIndexNames((0, "RUCKUS-ZD-WLAN-MIB", "ruckusZDWLANStaMacAddr")) if mibBuilder.loadTexts: ruckusZDWLANStaEntry.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaEntry.setDescription('Specifies each ZD WLAN Station entry.') ruckusZDWLANStaMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 1), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaMacAddr.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaMacAddr.setDescription("The station's MAC Address.") ruckusZDWLANStaAPMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 2), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaAPMacAddr.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaAPMacAddr.setDescription('The MAC address of the associated AP.') ruckusZDWLANStaBSSID = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 3), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaBSSID.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaBSSID.setDescription('BSSID of WLAN.') ruckusZDWLANStaSSID = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 4), RuckusSSID()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaSSID.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaSSID.setDescription('SSID.') ruckusZDWLANStaUser = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaUser.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaUser.setDescription('Logined username of the client.') ruckusZDWLANStaRadioType = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("radio11a", 0), ("radio11b", 1), ("radio11g", 2), ("radio11ng", 3), ("radio11na", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaRadioType.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaRadioType.setDescription('Radio type.') ruckusZDWLANStaChannel = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 7), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaChannel.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaChannel.setDescription('Radio channel.') ruckusZDWLANStaIPAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 8), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaIPAddr.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaIPAddr.setDescription('IP address.') ruckusZDWLANStaAvgRSSI = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaAvgRSSI.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaAvgRSSI.setDescription('Averaged RSSI.') ruckusZDWLANStaRxPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaRxPkts.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaRxPkts.setDescription('Received packets.') ruckusZDWLANStaRxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 11), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaRxBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaRxBytes.setDescription('Received bytes.') ruckusZDWLANStaTxPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaTxPkts.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaTxPkts.setDescription('Transmitted packets.') ruckusZDWLANStaTxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 13), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaTxBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaTxBytes.setDescription('Transmitted bytes.') ruckusZDWLANStaRetries = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaRetries.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaRetries.setDescription('Transmitted retries.') ruckusZDWLANStaAssocTime = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 15), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaAssocTime.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaAssocTime.setDescription('The time client has been associated.') ruckusZDWLANStaRxError = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaRxError.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaRxError.setDescription('Received error packets.') ruckusZDWLANStaTxSuccess = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaTxSuccess.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaTxSuccess.setDescription('Successful transmitted packets.') ruckusZDWLANSta11bgReassoc = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANSta11bgReassoc.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANSta11bgReassoc.setDescription('Reassociate count on B/G RF.') ruckusZDWLANStaAssocTimestamp = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 19), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaAssocTimestamp.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaAssocTimestamp.setDescription('The timestamp client associated.') ruckusZDWLANStaRetryBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaRetryBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaRetryBytes.setDescription('Transmitted retry bytes.') ruckusZDWLANStaSNR = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 21), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaSNR.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaSNR.setDescription("Station's Signal to Noise Ratio.") ruckusZDWLANStaRxDrop = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaRxDrop.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaRxDrop.setDescription('Drop transmitted packets.') ruckusZDWLANStaTxDrop = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 23), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaTxDrop.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaTxDrop.setDescription('Drop received packets.') ruckusZDWLANStaTxError = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 24), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaTxError.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaTxError.setDescription('Transmitted error packets.') ruckusZDWLANStaVlanID = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 30), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaVlanID.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaVlanID.setDescription('VLAN ID of the station. 1 for not specified.') ruckusZDWLANStaAuthMode = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 80), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaAuthMode.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaAuthMode.setDescription('Authentication mode of authenticated terminal.') ruckusZDWLANStaSignalStrength = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 3, 1, 1, 81), Integer32()).setUnits('dBm').setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANStaSignalStrength.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANStaSignalStrength.setDescription('Signal strength') ruckusZDWLANRogueInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 4)) ruckusZDWLANRogueTable = MibTable((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 4, 1), ) if mibBuilder.loadTexts: ruckusZDWLANRogueTable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRogueTable.setDescription('ZD WLAN rogue device table.') ruckusZDWLANRogueEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 4, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: ruckusZDWLANRogueEntry.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRogueEntry.setDescription('Specifies each ZD WLAN rogue device entry.') ruckusZDWLANRogueMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 4, 1, 1, 1), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRogueMacAddr.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRogueMacAddr.setDescription("Rogue device's MAC Address.") ruckusZDWLANRogueSSID = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 4, 1, 1, 2), RuckusSSID()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRogueSSID.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRogueSSID.setDescription('SSID.') ruckusZDWLANRogueRadioType = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 4, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("radio11bg", 0), ("radio11a", 1), ("radio11ng", 2), ("radio11na", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRogueRadioType.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRogueRadioType.setDescription('Radio type.') ruckusZDWLANRogueChannel = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 4, 1, 1, 4), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRogueChannel.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRogueChannel.setDescription('Radio channel.') ruckusZDWLANRogueRSSI = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 4, 1, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRogueRSSI.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRogueRSSI.setDescription('RSSI.') ruckusZDWLANRogueType = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 4, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("ap", 0), ("ad-hoc", 1)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRogueType.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRogueType.setDescription('The type of the rogue device.') ruckusZDWLANRogueEncrypted = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 4, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("open", 0), ("encrypted", 1)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRogueEncrypted.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRogueEncrypted.setDescription('Encryption mode.') ruckusZDWLANRogueSignalStrength = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 4, 1, 1, 11), Integer32()).setUnits('dBm').setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANRogueSignalStrength.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANRogueSignalStrength.setDescription('Signal strength') ruckusZDWLANVapTable = MibTable((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3), ) if mibBuilder.loadTexts: ruckusZDWLANVapTable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapTable.setDescription('ZD WLAN AP table per each WLAN.') ruckusZDWLANVapEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1), ).setIndexNames((0, "RUCKUS-ZD-WLAN-MIB", "ruckusZDWLANVapBSSID")) if mibBuilder.loadTexts: ruckusZDWLANVapEntry.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapEntry.setDescription('Specifies each ZD WLAN vap entry.') ruckusZDWLANVapBSSID = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 1), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapBSSID.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapBSSID.setDescription("The VAP's BSSID ,it is a MAC Address.") ruckusZDWLANVapPAPAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 2), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapPAPAddr.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapPAPAddr.setDescription("The MAC address of the Parent's AP.") ruckusZDWLANVapSSID = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 3), RuckusSSID()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapSSID.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapSSID.setDescription('SSID of VAP.') ruckusZDWLANVapLanRxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 6), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapLanRxBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapLanRxBytes.setDescription('Received bytes on LAN in VAP .') ruckusZDWLANVapLanTxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 7), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapLanTxBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapLanTxBytes.setDescription('Transmitted bytes on LAN in VAP.') ruckusZDWLANVapWlanRxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 8), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapWlanRxBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapWlanRxBytes.setDescription('Received bytes on WLAN in VAP .') ruckusZDWLANVapWlanTxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 9), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapWlanTxBytes.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapWlanTxBytes.setDescription('Transmitted bytes on WLAN in VAP.') ruckusZDWLANVapWlanRxErrorPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 11), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapWlanRxErrorPkt.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapWlanRxErrorPkt.setDescription('Receiveed error packet on WLAN in VAP.') ruckusZDWLANVapWlanRxUnicastPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 12), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapWlanRxUnicastPkt.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapWlanRxUnicastPkt.setDescription('Receiveed unicast packet on WLAN in VAP.') ruckusZDWLANVapWlanTxUnicastPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 13), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapWlanTxUnicastPkt.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapWlanTxUnicastPkt.setDescription('Transmitted unicast packet on WLAN in VAP.') ruckusZDWLANVapWlanRxPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 14), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapWlanRxPkt.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapWlanRxPkt.setDescription('Received packet on WLAN in VAP.') ruckusZDWLANVapWlanRxDropPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 15), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapWlanRxDropPkt.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapWlanRxDropPkt.setDescription('Received dropped packet on WLAN in VAP.') ruckusZDWLANVapWlanTxErrPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 16), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapWlanTxErrPkt.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapWlanTxErrPkt.setDescription('Transmitted error packet on WLAN in VAP.') ruckusZDWLANVapWlanTxPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 17), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapWlanTxPkt.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapWlanTxPkt.setDescription('Transmitted packet on WLAN in VAP.') ruckusZDWLANVapWlanTxDropPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 3, 1, 18), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANVapWlanTxDropPkt.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANVapWlanTxDropPkt.setDescription('Transmitted dropped packet on WLAN in VAP.') ruckusZDWLANIfTable = MibTable((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4), ) if mibBuilder.loadTexts: ruckusZDWLANIfTable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANIfTable.setDescription('ZD WLAN AP Interface table per each AP.') ruckusZDWLANIfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1), ).setIndexNames((0, "RUCKUS-ZD-WLAN-MIB", "ruckusZDWLANAPMac"), (0, "RUCKUS-ZD-WLAN-MIB", "ruckusZDWLANAPIfIndex")) if mibBuilder.loadTexts: ruckusZDWLANIfEntry.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANIfEntry.setDescription('Specifies each ZD WLAN vap entry.') ruckusZDWLANAPMac = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 1), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPMac.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPMac.setDescription("The AP's Mac Address.") ruckusZDWLANAPIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 2), InterfaceIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfIndex.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfIndex.setDescription('The index of Interface in AP .') ruckusZDWLANAPIfDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfDescr.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfDescr.setDescription('The Description information for this interface.') ruckusZDWLANAPIfType = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 4), IANAifType()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfType.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfType.setDescription('The type of interface.') ruckusZDWLANAPIfMtu = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfMtu.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfMtu.setDescription('The size of the largest packet which can be sent/received.') ruckusZDWLANAPIfSpeed = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfSpeed.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfSpeed.setDescription("An estimate of the interface's current bandwidth in bits.") ruckusZDWLANAPIfPhysAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfPhysAddress.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfPhysAddress.setDescription("The interface's mac address.") ruckusZDWLANAPIfAdminStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("testing", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfAdminStatus.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfAdminStatus.setDescription('The desired state of the interface: up(1), down(2) ,testing(3) .') ruckusZDWLANAPIfOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("testing", 3), ("unknown", 4), ("dormant", 5), ("notPresent", 6), ("lowerLayerDown", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfOperStatus.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfOperStatus.setDescription('The current operational state of the interface: up(1), down(2), testing(3), unknown(4), dormant(5) , notPresent(6), lowerLayerDown(7).') ruckusZDWLANAPIfInOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfInOctets.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfInOctets.setDescription('The total number of octets received on the interface.') ruckusZDWLANAPIfInUcastPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfInUcastPkts.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfInUcastPkts.setDescription('The total number of unicast packets received on the interface.') ruckusZDWLANAPIfInNUcastPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfInNUcastPkts.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfInNUcastPkts.setDescription('The total number of multicast and broadcast packets received on the interface.') ruckusZDWLANAPIfInDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfInDiscards.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfInDiscards.setDescription('The number of inbound packets which were chosen to be discarded even though no errors had been detected .') ruckusZDWLANAPIfInErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfInErrors.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfInErrors.setDescription('The number of inbound packets that contained errors.') ruckusZDWLANAPIfInUnknownProtos = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfInUnknownProtos.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfInUnknownProtos.setDescription('The number of packets received via the interface which were discarded because of an unknown or unsupported protocol.') ruckusZDWLANAPIfOutOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfOutOctets.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfOutOctets.setDescription('The total number of octets transmitted out of the interface.') ruckusZDWLANAPIfOutUcastPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfOutUcastPkts.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfOutUcastPkts.setDescription('The total number of unicast packets transmitted out of the interface.') ruckusZDWLANAPIfOutNUcastPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfOutNUcastPkts.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfOutNUcastPkts.setDescription('The total number of multicast and broadcast packets transmitted out of the interface.') ruckusZDWLANAPIfOutDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfOutDiscards.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfOutDiscards.setDescription('The number of outbound packets which were chosen to be discarded even though no errors had been detected.') ruckusZDWLANAPIfOutErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfOutErrors.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfOutErrors.setDescription('The number of outbound packets that could not be transmitted because of errors.') ruckusZDWLANAPIfName = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 21), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfName.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfName.setDescription('The name of interface.') ruckusZDWLANAPIfNameDefined = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 4, 1, 22), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPIfNameDefined.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPIfNameDefined.setDescription('The alias of interface.') ruckusZDWLANAPEthStatusTable = MibTable((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 8), ) if mibBuilder.loadTexts: ruckusZDWLANAPEthStatusTable.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPEthStatusTable.setDescription('ZD WLAN AP Ethernet Interface status table per each AP.') ruckusZDWLANAPEthStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 8, 1), ).setIndexNames((0, "RUCKUS-ZD-WLAN-MIB", "ruckusZDWLANAPMacAddress"), (0, "RUCKUS-ZD-WLAN-MIB", "ruckusZDWLANAPEthPortId")) if mibBuilder.loadTexts: ruckusZDWLANAPEthStatusEntry.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPEthStatusEntry.setDescription('Specifies each ZD WLAN AP ethernet interface status entry.') ruckusZDWLANAPMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 8, 1, 1), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPMacAddress.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPMacAddress.setDescription("The AP's Mac Address.") ruckusZDWLANAPEthPortId = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 8, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPEthPortId.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPEthPortId.setDescription('The ap ethernet port id.') ruckusZDWLANAPEthIfname = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 8, 1, 5), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPEthIfname.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPEthIfname.setDescription('The name of interface.') ruckusZDWLANAPEthDot1xStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 8, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("auth", 1), ("supp", 2), ("none", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPEthDot1xStatus.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPEthDot1xStatus.setDescription('The ap ethernet port Dot1xStatus.') ruckusZDWLANAPEthLogicalStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 8, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("up", 1), ("down", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPEthLogicalStatus.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPEthLogicalStatus.setDescription('The ap ethernet port logical status.') ruckusZDWLANAPEthPhyStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 8, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("up", 1), ("down", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPEthPhyStatus.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPEthPhyStatus.setDescription('The ap ethernet port physical status.') ruckusZDWLANAPEthPhyIfSpeed = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 8, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPEthPhyIfSpeed.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPEthPhyIfSpeed.setDescription("The ap ethernet interface's current bandwidth in Mbits,.") ruckusZDWLANAPEthPhyLinkStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 8, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("full", 1), ("half", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPEthPhyLinkStatus.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPEthPhyLinkStatus.setDescription('The ap ethernet port physical link status.') ruckusZDWLANAPEthLabel = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 2, 2, 1, 1, 2, 8, 1, 11), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ruckusZDWLANAPEthLabel.setStatus('current') if mibBuilder.loadTexts: ruckusZDWLANAPEthLabel.setDescription('The ap ethernet port label.') mibBuilder.exportSymbols("RUCKUS-ZD-WLAN-MIB", ruckusZDWLANAPRadioStatsTxPkts=ruckusZDWLANAPRadioStatsTxPkts, ruckusZDWLANTxBytes=ruckusZDWLANTxBytes, ruckusZDWLANAPTxFrameDropped=ruckusZDWLANAPTxFrameDropped, ruckusZDWLANAPLANStatsRXPkt=ruckusZDWLANAPLANStatsRXPkt, ruckusZDWLANStaBSSID=ruckusZDWLANStaBSSID, ruckusZDWLANAPNetmask=ruckusZDWLANAPNetmask, ruckusZDWLANStaTable=ruckusZDWLANStaTable, ruckusZDWLANAssocFail=ruckusZDWLANAssocFail, ruckusZDWLANIfTable=ruckusZDWLANIfTable, ruckusZDWLANAPRadioStatsDiassocLeave=ruckusZDWLANAPRadioStatsDiassocLeave, ruckusZDWLANAPRadioStatsNumSta=ruckusZDWLANAPRadioStatsNumSta, ruckusZDWLANStaSignalStrength=ruckusZDWLANStaSignalStrength, ruckusZDWLANAPMeshUpPortCntUpdown=ruckusZDWLANAPMeshUpPortCntUpdown, ruckusZDWLANAP11bCapable=ruckusZDWLANAP11bCapable, ruckusZDWLANAPUptime=ruckusZDWLANAPUptime, ruckusZDWLANDescription=ruckusZDWLANDescription, ruckusZDWLANSta11bgReassoc=ruckusZDWLANSta11bgReassoc, ruckusZDWLANSSIDBcastDisable=ruckusZDWLANSSIDBcastDisable, ruckusZDWLANAPLastConfSyncTime=ruckusZDWLANAPLastConfSyncTime, ruckusZDWLANAPMacAddr=ruckusZDWLANAPMacAddr, ruckusZDWLANAPStaRxBytes=ruckusZDWLANAPStaRxBytes, ruckusZDWLANAPRadioStatsTable=ruckusZDWLANAPRadioStatsTable, ruckusZDWLANAPRadioStatsAuthResp=ruckusZDWLANAPRadioStatsAuthResp, ruckusZDWLANDiassocCapacity=ruckusZDWLANDiassocCapacity, ruckusZDWLANAPRadioStatsRxMulticast=ruckusZDWLANAPRadioStatsRxMulticast, ruckusZDWLANStaEntry=ruckusZDWLANStaEntry, ruckusZDWLANNAME=ruckusZDWLANNAME, ruckusZDWLANStaRxPkts=ruckusZDWLANStaRxPkts, ruckusZDWLANStaRxBytes=ruckusZDWLANStaRxBytes, ruckusZDWLANAPRadioStatsRxPkts=ruckusZDWLANAPRadioStatsRxPkts, ruckusZDWLANAPModel=ruckusZDWLANAPModel, ruckusZDWLANAPLANStatsRXByte=ruckusZDWLANAPLANStatsRXByte, ruckusZDWLANAPEthLogicalStatus=ruckusZDWLANAPEthLogicalStatus, ruckusZDWLANAPRadioStatsAntennaGain=ruckusZDWLANAPRadioStatsAntennaGain, ruckusZDWLANStaRxDrop=ruckusZDWLANStaRxDrop, ruckusZDWLANStaTxError=ruckusZDWLANStaTxError, ruckusZDWLANAPEthDot1xStatus=ruckusZDWLANAPEthDot1xStatus, ruckusZDWLANAuthentication=ruckusZDWLANAuthentication, ruckusZDWLANAPRadioStatsAssocReq=ruckusZDWLANAPRadioStatsAssocReq, ruckusZDWLANRogueRadioType=ruckusZDWLANRogueRadioType, ruckusZDWLANAPIfIndex=ruckusZDWLANAPIfIndex, ruckusZDWLANAPMeshHops=ruckusZDWLANAPMeshHops, ruckusZDWLANMIB=ruckusZDWLANMIB, ruckusZDWLANAPRadioStatsMaxSta=ruckusZDWLANAPRadioStatsMaxSta, ruckusZDWLANVapEntry=ruckusZDWLANVapEntry, ruckusZDWLANAPMemTotal=ruckusZDWLANAPMemTotal, ruckusZDWLANAPRadioStatsFrameRetryRate=ruckusZDWLANAPRadioStatsFrameRetryRate, ruckusZDWLANIfEntry=ruckusZDWLANIfEntry, ruckusZDWLANAPCoverageTech=ruckusZDWLANAPCoverageTech, ruckusZDWLANAPRadioStatsTxMulticast=ruckusZDWLANAPRadioStatsTxMulticast, ruckusZDWLANRogueEntry=ruckusZDWLANRogueEntry, ruckusZDWLANAPIfOutDiscards=ruckusZDWLANAPIfOutDiscards, ruckusZDWLANAPRadioStatsRadioType=ruckusZDWLANAPRadioStatsRadioType, ruckusZDWLANAPEthLabel=ruckusZDWLANAPEthLabel, ruckusZDWLANStaUser=ruckusZDWLANStaUser, ruckusZDWLANAPUpgrade=ruckusZDWLANAPUpgrade, ruckusZDWLANAPIfAdminStatus=ruckusZDWLANAPIfAdminStatus, ruckusZDWLANAPIfMtu=ruckusZDWLANAPIfMtu, ruckusZDWLANVapBSSID=ruckusZDWLANVapBSSID, ruckusZDWLANAPIfOutOctets=ruckusZDWLANAPIfOutOctets, ruckusZDWLANAPMac=ruckusZDWLANAPMac, ruckusZDWLANAPMeshDownPortCntUpdown=ruckusZDWLANAPMeshDownPortCntUpdown, ruckusZDWLANAPLANStatsTXPkt=ruckusZDWLANAPLANStatsTXPkt, ruckusZDWLANDiassocAbnormal=ruckusZDWLANDiassocAbnormal, ruckusZDWLANIsGuest=ruckusZDWLANIsGuest, ruckusZDWLANAPDNS1=ruckusZDWLANAPDNS1, ruckusZDWLANAP11gCapable=ruckusZDWLANAP11gCapable, ruckusZDWLANAPLastUpgradeTime=ruckusZDWLANAPLastUpgradeTime, ruckusZDWLANRxByteRate=ruckusZDWLANRxByteRate, ruckusZDWLANRogueEncrypted=ruckusZDWLANRogueEncrypted, ruckusZDWLANDiassocMisc=ruckusZDWLANDiassocMisc, ruckusZDWLANAPRadioStatsRadioIndex=ruckusZDWLANAPRadioStatsRadioIndex, ruckusZDWLANRxPkts=ruckusZDWLANRxPkts, ruckusZDWLANVapWlanTxBytes=ruckusZDWLANVapWlanTxBytes, ruckusZDWLANAPNumRadios=ruckusZDWLANAPNumRadios, ruckusZDWLANAPEthStatusEntry=ruckusZDWLANAPEthStatusEntry, ruckusZDWLANStaRetries=ruckusZDWLANStaRetries, ruckusZDWLANAPStaTxBytes=ruckusZDWLANAPStaTxBytes, ruckusZDWLANRxDataFrameOnLan=ruckusZDWLANRxDataFrameOnLan, ruckusZDWLANAPLANStatsRXPKTUcast=ruckusZDWLANAPLANStatsRXPKTUcast, ruckusZDWLANVapWlanTxPkt=ruckusZDWLANVapWlanTxPkt, ruckusZDWLANAPRadioStatsAvgStaRSSI=ruckusZDWLANAPRadioStatsAvgStaRSSI, ruckusZDWLANAPRadioStatsTxRetries=ruckusZDWLANAPRadioStatsTxRetries, ruckusZDWLANAPRadioStatsAssocResp=ruckusZDWLANAPRadioStatsAssocResp, ruckusZDWLANAPRadioStatsAssocFail=ruckusZDWLANAPRadioStatsAssocFail, ruckusZDWLANRateLimitingUp=ruckusZDWLANRateLimitingUp, ruckusZDWLANTunnelWLAN=ruckusZDWLANTunnelWLAN, ruckusZDWLANAPEthStatusTable=ruckusZDWLANAPEthStatusTable, ruckusZDWLANStaAPMacAddr=ruckusZDWLANStaAPMacAddr, ruckusZDWLANAPRadioStatsTxPower=ruckusZDWLANAPRadioStatsTxPower, ruckusZDWLANDiassocLeave=ruckusZDWLANDiassocLeave, ruckusZDWLANAPInfo=ruckusZDWLANAPInfo, ruckusZDWLANAPIfDescr=ruckusZDWLANAPIfDescr, ruckusZDWLANAPLANStatsDropped=ruckusZDWLANAPLANStatsDropped, ruckusZDWLANAPRadioStatsBeaconPeriod=ruckusZDWLANAPRadioStatsBeaconPeriod, ruckusZDWLANDownDropFrame=ruckusZDWLANDownDropFrame, ruckusZDWLANVapWlanRxDropPkt=ruckusZDWLANVapWlanRxDropPkt, ruckusZDWLANAPRadioStatsReassocReq=ruckusZDWLANAPRadioStatsReassocReq, ruckusZDWLANAPIfInNUcastPkts=ruckusZDWLANAPIfInNUcastPkts, ruckusZDWLANAPLANStatsTXByte=ruckusZDWLANAPLANStatsTXByte, ruckusZDWLANAPEthPhyStatus=ruckusZDWLANAPEthPhyStatus, ruckusZDWLANAPCPUUtil=ruckusZDWLANAPCPUUtil, ruckusZDWLANStaInfo=ruckusZDWLANStaInfo, ruckusZDWLANAssocResp=ruckusZDWLANAssocResp, ruckusZDWLANAPStatus=ruckusZDWLANAPStatus, ruckusZDWLANAPRadioStatsAPMacAddr=ruckusZDWLANAPRadioStatsAPMacAddr, ruckusZDWLANAPNumSta=ruckusZDWLANAPNumSta, ruckusZDWLANAPRadioStatsPowerMgmt=ruckusZDWLANAPRadioStatsPowerMgmt, ruckusZDWLANAPIfSpeed=ruckusZDWLANAPIfSpeed, ruckusZDWLANUpDropFrame=ruckusZDWLANUpDropFrame, ruckusZDWLANAPEntry=ruckusZDWLANAPEntry, ruckusZDWLANStaSSID=ruckusZDWLANStaSSID, ruckusZDWLANAPRadioStatsAuthFail=ruckusZDWLANAPRadioStatsAuthFail, ruckusZDWLANAPRadioStatsTxBytes=ruckusZDWLANAPRadioStatsTxBytes, ruckusZDWLANAPRadioStatsMeshEnable=ruckusZDWLANAPRadioStatsMeshEnable, ruckusZDWLANAPIfOperStatus=ruckusZDWLANAPIfOperStatus, ruckusZDWLANAPIfOutNUcastPkts=ruckusZDWLANAPIfOutNUcastPkts, ruckusZDWLANAPEthPortId=ruckusZDWLANAPEthPortId, ruckusZDWLANRogueMacAddr=ruckusZDWLANRogueMacAddr, ruckusZDWLANStaChannel=ruckusZDWLANStaChannel, ruckusZDWLANDownRetxFrame=ruckusZDWLANDownRetxFrame, ruckusZDWLANDownTotalFrame=ruckusZDWLANDownTotalFrame, ruckusZDWLANStaMacAddr=ruckusZDWLANStaMacAddr, ruckusZDWLANUpTotalFrame=ruckusZDWLANUpTotalFrame, ruckusZDWLANTxPkts=ruckusZDWLANTxPkts, ruckusZDWLANRogueType=ruckusZDWLANRogueType, ruckusZDWLANAPIfOutUcastPkts=ruckusZDWLANAPIfOutUcastPkts, ruckusZDWLANRxBytes=ruckusZDWLANRxBytes, ruckusZDWLANAPRadioStatsFragThreshold=ruckusZDWLANAPRadioStatsFragThreshold, ruckusZDWLANStaVlanID=ruckusZDWLANStaVlanID, ruckusZDWLANAPFirstJoinTime=ruckusZDWLANAPFirstJoinTime, ruckusZDWLANAPHWversion=ruckusZDWLANAPHWversion, ruckusZDWLANAPIPAddr=ruckusZDWLANAPIPAddr, ruckusZDWLANStaRxError=ruckusZDWLANStaRxError, ruckusZDWLANAPGateway=ruckusZDWLANAPGateway, ruckusZDWLANAPIfName=ruckusZDWLANAPIfName, ruckusZDWLANRogueSSID=ruckusZDWLANRogueSSID, ruckusZDWLANAPNumVAP=ruckusZDWLANAPNumVAP, ruckusZDWLANEncryption=ruckusZDWLANEncryption, ruckusZDWLANVapSSID=ruckusZDWLANVapSSID, ruckusZDWLANAPSerialNumber=ruckusZDWLANAPSerialNumber, ruckusZDWLANAPRadioStatsAssocDenied=ruckusZDWLANAPRadioStatsAssocDenied, ruckusZDWLANStaRadioType=ruckusZDWLANStaRadioType, ruckusZDWLANAPIfInDiscards=ruckusZDWLANAPIfInDiscards, ruckusZDWLANDownTotalErrFrame=ruckusZDWLANDownTotalErrFrame, ruckusZDWLANAPEthStateChange=ruckusZDWLANAPEthStateChange, ruckusZDWLANAPRadioStatsEntry=ruckusZDWLANAPRadioStatsEntry, ruckusZDWLANEntry=ruckusZDWLANEntry, ruckusZDWLANStaSNR=ruckusZDWLANStaSNR, ruckusZDWLANAPRadioStatsDiassocCapacity=ruckusZDWLANAPRadioStatsDiassocCapacity, ruckusZDWLANAssocTotal=ruckusZDWLANAssocTotal, ruckusZDWLANAPSyncConf=ruckusZDWLANAPSyncConf, ruckusZDWLANVapPAPAddr=ruckusZDWLANVapPAPAddr, ruckusZDWLANStaAvgRSSI=ruckusZDWLANStaAvgRSSI, ruckusZDWLANAuthTotal=ruckusZDWLANAuthTotal, ruckusZDWLANAPRadioStatsTxFail=ruckusZDWLANAPRadioStatsTxFail, ruckusZDWLANAPEthPhyIfSpeed=ruckusZDWLANAPEthPhyIfSpeed, ruckusZDWLANRogueInfo=ruckusZDWLANRogueInfo, ruckusZDWLANAPRadioStatsTotalAssocTime=ruckusZDWLANAPRadioStatsTotalAssocTime, ruckusZDWLANAPLANStatsTXByteRate=ruckusZDWLANAPLANStatsTXByteRate, ruckusZDWLANAPRadioStatsDiassocAbnormal=ruckusZDWLANAPRadioStatsDiassocAbnormal, ruckusZDWLANAPLastBootTime=ruckusZDWLANAPLastBootTime, ruckusZDWLANVapLanTxBytes=ruckusZDWLANVapLanTxBytes, ruckusZDWLANAPRadioStatsRxSignalFrm=ruckusZDWLANAPRadioStatsRxSignalFrm, ruckusZDWLANAPRadioStatsTotalSignalFrm=ruckusZDWLANAPRadioStatsTotalSignalFrm, ruckusZDWLANVapWlanRxErrorPkt=ruckusZDWLANVapWlanRxErrorPkt, ruckusZDWLANAPIfPhysAddress=ruckusZDWLANAPIfPhysAddress, ruckusZDWLANAssocDenied=ruckusZDWLANAssocDenied, ruckusZDWLANStaAssocTimestamp=ruckusZDWLANStaAssocTimestamp, ruckusZDWLANAuthResp=ruckusZDWLANAuthResp, ruckusZDWLANAPLANStatsRXPKTMcast=ruckusZDWLANAPLANStatsRXPKTMcast, ruckusZDWLANReassocResp=ruckusZDWLANReassocResp, ruckusZDWLANVlanID=ruckusZDWLANVlanID, ruckusZDWLANAPDNS2=ruckusZDWLANAPDNS2, ruckusZDWLANAuthFail=ruckusZDWLANAuthFail, ruckusZDWLANAPRadioStatsChannel=ruckusZDWLANAPRadioStatsChannel, ruckusZDWLANNumVAP=ruckusZDWLANNumVAP, ruckusZDWLANTxByteOnLan=ruckusZDWLANTxByteOnLan, ruckusZDWLANStaIPAddr=ruckusZDWLANStaIPAddr, ruckusZDWLANStaTxPkts=ruckusZDWLANStaTxPkts, ruckusZDWLANStaRetryBytes=ruckusZDWLANStaRetryBytes, ruckusZDWLANAPIfNameDefined=ruckusZDWLANAPIfNameDefined, ruckusZDWLANRogueRSSI=ruckusZDWLANRogueRSSI, ruckusZDWLANRxByteOnLan=ruckusZDWLANRxByteOnLan, ruckusZDWLANNumSta=ruckusZDWLANNumSta, ruckusZDWLANAPRadioStatsResourceUtil=ruckusZDWLANAPRadioStatsResourceUtil, ruckusZDWLANVapWlanRxPkt=ruckusZDWLANVapWlanRxPkt, ruckusZDWLANAPRadioStatsMonitoredTime=ruckusZDWLANAPRadioStatsMonitoredTime, ruckusZDWLANAPMeshEnable=ruckusZDWLANAPMeshEnable, PYSNMP_MODULE_ID=ruckusZDWLANMIB, ruckusZDWLANAPRadioStatsAssocSuccess=ruckusZDWLANAPRadioStatsAssocSuccess, ruckusZDWLANAPRadioStatsNumVAP=ruckusZDWLANAPRadioStatsNumVAP, ruckusZDWLANAPLANStatsRXPKTBcast=ruckusZDWLANAPLANStatsRXPKTBcast, ruckusZDWLANAPRadioStatsTxSignalFrm=ruckusZDWLANAPRadioStatsTxSignalFrm, ruckusZDWLANSSID=ruckusZDWLANSSID, ruckusZDWLANAPFWSize=ruckusZDWLANAPFWSize, ruckusZDWLANAuthSuccessTotal=ruckusZDWLANAuthSuccessTotal, ruckusZDWLANStaTxSuccess=ruckusZDWLANStaTxSuccess, ruckusZDWLANVapWlanTxErrPkt=ruckusZDWLANVapWlanTxErrPkt, ruckusZDWLANStaAssocTime=ruckusZDWLANStaAssocTime, ruckusZDWLANAPTotalUser=ruckusZDWLANAPTotalUser, ruckusZDWLANAPLANStatsTXPKTBcast=ruckusZDWLANAPLANStatsTXPKTBcast, ruckusZDWLANVapWlanRxBytes=ruckusZDWLANVapWlanRxBytes, ruckusZDWLANAPEthIfname=ruckusZDWLANAPEthIfname, ruckusZDWLANAPMultiModeAccessStatus=ruckusZDWLANAPMultiModeAccessStatus, ruckusZDWLANAPRadioStatsFrameErrorRate=ruckusZDWLANAPRadioStatsFrameErrorRate, ruckusZDWLANRogueSignalStrength=ruckusZDWLANRogueSignalStrength, ruckusZDWLANAPDescription=ruckusZDWLANAPDescription, ruckusZDWLANAPIfInUcastPkts=ruckusZDWLANAPIfInUcastPkts, ruckusZDWLANTxByteRate=ruckusZDWLANTxByteRate, ruckusZDWLANAPRadioStatsAuthSuccess=ruckusZDWLANAPRadioStatsAuthSuccess, ruckusZDWLANAPRadioStatsDiassocMisc=ruckusZDWLANAPRadioStatsDiassocMisc, ruckusZDWLANAPLANStatsRXPktErr=ruckusZDWLANAPLANStatsRXPktErr, ruckusZDWLANRateLimitingDown=ruckusZDWLANRateLimitingDown, ruckusZDWLANAPTable=ruckusZDWLANAPTable, ruckusZDWLANAPConnectionMode=ruckusZDWLANAPConnectionMode, ruckusZDWLANAPRadioStatsAuthReq=ruckusZDWLANAPRadioStatsAuthReq, ruckusZDWLANAPMultipleVlanCapability=ruckusZDWLANAPMultipleVlanCapability, ruckusZDWLANObjects=ruckusZDWLANObjects, ruckusZDWLANAPRadioStatsRxBytes=ruckusZDWLANAPRadioStatsRxBytes, ruckusZDWLANAPLANStatsRXByteRate=ruckusZDWLANAPLANStatsRXByteRate, ruckusZDWLANStaTxBytes=ruckusZDWLANStaTxBytes, ruckusZDWLANUpRetxFrame=ruckusZDWLANUpRetxFrame, ruckusZDWLANAPFWAvail=ruckusZDWLANAPFWAvail, ruckusZDWLANAPMeshType=ruckusZDWLANAPMeshType, ruckusZDWLANVapLanRxBytes=ruckusZDWLANVapLanRxBytes, ruckusZDWLANAPIfInOctets=ruckusZDWLANAPIfInOctets, ruckusZDWLANStaAuthMode=ruckusZDWLANStaAuthMode, ruckusZDWLANAPMacAddress=ruckusZDWLANAPMacAddress, ruckusZDWLANVapWlanRxUnicastPkt=ruckusZDWLANVapWlanRxUnicastPkt, ruckusZDWLANStaTxDrop=ruckusZDWLANStaTxDrop, ruckusZDWLANVapWlanTxDropPkt=ruckusZDWLANVapWlanTxDropPkt, ruckusZDWLANAPSWversion=ruckusZDWLANAPSWversion, ruckusZDWLANAPNumRogues=ruckusZDWLANAPNumRogues, ruckusZDWLANAPIfInErrors=ruckusZDWLANAPIfInErrors, ruckusZDWLANAPRadioStatsRTSThreshold=ruckusZDWLANAPRadioStatsRTSThreshold, ruckusZDWLANRogueChannel=ruckusZDWLANRogueChannel, ruckusZDWLANAPRadioStatsReassocResp=ruckusZDWLANAPRadioStatsReassocResp, ruckusZDWLANInfo=ruckusZDWLANInfo, ruckusZDWLANTable=ruckusZDWLANTable, ruckusZDWLANAssocSuccess=ruckusZDWLANAssocSuccess, ruckusZDWLANAPEthPhyLinkStatus=ruckusZDWLANAPEthPhyLinkStatus, ruckusZDWLANRogueTable=ruckusZDWLANRogueTable, ruckusZDWLANAPIfOutErrors=ruckusZDWLANAPIfOutErrors, ruckusZDWLANAPLANStatsRXPKTSucc=ruckusZDWLANAPLANStatsRXPKTSucc, ruckusZDWLANVapTable=ruckusZDWLANVapTable, ruckusZDWLANAPIfType=ruckusZDWLANAPIfType, ruckusZDWLANReassocReq=ruckusZDWLANReassocReq, ruckusZDWLANAPMemUtil=ruckusZDWLANAPMemUtil, ruckusZDWLANAPIfInUnknownProtos=ruckusZDWLANAPIfInUnknownProtos, ruckusZDWLANAPTxFrameError=ruckusZDWLANAPTxFrameError, ruckusZDWLANVapWlanTxUnicastPkt=ruckusZDWLANVapWlanTxUnicastPkt, ruckusZDWLANAPLANStatsTXPKTUcast=ruckusZDWLANAPLANStatsTXPKTUcast, ruckusZDWLANAPLANStatsTXPKTMcast=ruckusZDWLANAPLANStatsTXPKTMcast) mibBuilder.exportSymbols("RUCKUS-ZD-WLAN-MIB", )
0
0
0
99756af1d67067b357efba2fbb42c19e774d8cbd
1,115
py
Python
lcutil/util_db.py
lcordier/lcutil
65f9d31d9e4c52411b42e39f987eecfa8a67c571
[ "MIT" ]
null
null
null
lcutil/util_db.py
lcordier/lcutil
65f9d31d9e4c52411b42e39f987eecfa8a67c571
[ "MIT" ]
null
null
null
lcutil/util_db.py
lcordier/lcutil
65f9d31d9e4c52411b42e39f987eecfa8a67c571
[ "MIT" ]
null
null
null
""" General database functions. Should work with DB API 2.0 cursors, tested with psycopg2. https://www.python.org/dev/peps/pep-0249/ """ def as_dicts(cursor): """ Return a list of dictionaries from a result-set. """ fields = [k[0] for k in cursor.description] result = [] rows = cursor.fetchall() for row in rows: result.append(dict(zip(fields, row))) return(result) def dict_iter(cursor): """ A generator of result-set dictionaries. Use this function when the result-set don't fit into memory. """ fields = [k[0] for k in cursor.description] row = cursor.fetchone() while row: yield dict(zip(fields, row)) row = cursor.fetchone() def insert_record(cursor, table, record): """ Insert a given record into the table specified. cursor.commit() should be preformed outside this function. """ fields = ', '.join(record.keys()) values = ', '.join(['%%(%s)s' % field for field in record.keys()]) sql = "INSERT into %s (%s) VALUES (%s);" % (table, fields, values) cursor.execute(sql, record)
26.547619
70
0.623318
""" General database functions. Should work with DB API 2.0 cursors, tested with psycopg2. https://www.python.org/dev/peps/pep-0249/ """ def as_dicts(cursor): """ Return a list of dictionaries from a result-set. """ fields = [k[0] for k in cursor.description] result = [] rows = cursor.fetchall() for row in rows: result.append(dict(zip(fields, row))) return(result) def dict_iter(cursor): """ A generator of result-set dictionaries. Use this function when the result-set don't fit into memory. """ fields = [k[0] for k in cursor.description] row = cursor.fetchone() while row: yield dict(zip(fields, row)) row = cursor.fetchone() def insert_record(cursor, table, record): """ Insert a given record into the table specified. cursor.commit() should be preformed outside this function. """ fields = ', '.join(record.keys()) values = ', '.join(['%%(%s)s' % field for field in record.keys()]) sql = "INSERT into %s (%s) VALUES (%s);" % (table, fields, values) cursor.execute(sql, record)
0
0
0
c48d259de39d6732fbcdafc30f98a066cc31010e
5,772
py
Python
example.py
ktanushree/sdk-python
e11c4f84c68ce2c30ad9fa5feac76696eaf7dfaa
[ "MIT" ]
24
2017-12-20T18:46:09.000Z
2021-07-01T07:37:10.000Z
example.py
ktanushree/sdk-python
e11c4f84c68ce2c30ad9fa5feac76696eaf7dfaa
[ "MIT" ]
7
2018-02-09T23:26:43.000Z
2021-11-02T01:27:09.000Z
example.py
ktanushree/sdk-python
e11c4f84c68ce2c30ad9fa5feac76696eaf7dfaa
[ "MIT" ]
8
2020-10-13T01:41:44.000Z
2022-01-24T22:14:50.000Z
#!/usr/bin/env python """ CGNX API -> list sites, example proof of concept. **Author:** CloudGenix **Copyright:** (c) 2017-2021 CloudGenix, Inc **License:** MIT """ __author__ = "CloudGenix Developer Support <developers@cloudgenix.com>" __email__ = "developers@cloudgenix.com" __copyright__ = "Copyright (c) 2017-2021 CloudGenix, Inc" __license__ = """ MIT License Copyright (c) 2017-2021 CloudGenix, Inc Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ # standard modules import argparse import logging # CloudGenix Python SDK import cloudgenix # alias JSON pretty printer (jd), and JSON Detailed pretty printer (jd_detailed) from cloudgenix SDK. jd = cloudgenix.jd jd_detailed = cloudgenix.jd_detailed # Global Vars SDK_VERSION = cloudgenix.version SCRIPT_NAME = 'CloudGenix Python SDK demo' # Set logging to use function name logger = logging.getLogger(__name__) ############################################################################ # Begin Script, parse arguments. ############################################################################ # Parse arguments parser = argparse.ArgumentParser(description="{0}.".format(SCRIPT_NAME)) # Allow Controller modification and debug level sets. controller_group = parser.add_argument_group('API', 'These options change how this program connects to the API.') controller_group.add_argument("--controller", "-C", help="Controller URI, ex. https://api.cloudgenix.com:8443", default=None) controller_group.add_argument("--insecure", "-I", help="Disable SSL certificate and hostname verification", dest='verify', action='store_false', default=True) login_group = parser.add_argument_group('Login', 'These options allow skipping of interactive login') login_group.add_argument("--email", "-E", help="Use this email as User Name instead of prompting", default=None) login_group.add_argument("--pass", "-PW", help="Use this Password instead of prompting", default=None) debug_group = parser.add_argument_group('Debug', 'These options enable debugging output') debug_group.add_argument("--debug", "-D", help="Verbose Debug info, levels 0-2", type=int, default=0) args = vars(parser.parse_args()) if args['debug'] == 1: logging.basicConfig(level=logging.INFO, format="%(levelname)s [%(name)s.%(funcName)s:%(lineno)d] %(message)s") logger.setLevel(logging.INFO) elif args['debug'] >= 2: logging.basicConfig(level=logging.DEBUG, format="%(levelname)s [%(name)s.%(funcName)s:%(lineno)d] %(message)s") logger.setLevel(logging.DEBUG) else: # Remove all handlers for handler in logging.root.handlers[:]: logging.root.removeHandler(handler) # set logging level to default logger.setLevel(logging.WARNING) ############################################################################ # Instantiate API ############################################################################ sdk = cloudgenix.API(controller=args["controller"], ssl_verify=args["verify"]) # set debug sdk.set_debug(args["debug"]) ############################################################################ # Draw Interactive login banner, run interactive login including args above. ############################################################################ print("{0} v{1} ({2})\n".format(SCRIPT_NAME, SDK_VERSION, sdk.controller)) # interactive or cmd-line specified initial login while sdk.tenant_name is None: sdk.interactive.login(args["email"], args["pass"]) ############################################################################ # End Login handling, begin script.. ############################################################################ # Get list of sites. response = sdk.get.sites() # status is a boolean based on success/failure. If success, print raw dictionary if response.cgx_status: # Can Print as formatted JSON using json module using commented code below. # raw_sites_dict = response.cgx_content # print(json.dumps(raw_sites_dict, indent=4)) # But CloudGenix has a built-in pretty printer, can just use that on native response as a shortcut. # Output is the same as code above. jd(response) # else, let user know something didn't work. else: print("ERROR: ") # the jd_detailed builtin pretty-printer will dump all request/response info, and also attempt to hide sensitive # cookies/headers (AUTH_TOKEN, X-Auth-Token, etc.) to be safe for log messages/etc. jd_detailed(response) # end of script, run logout to clear session. print(sdk.get.logout().cgx_content)
39
116
0.636694
#!/usr/bin/env python """ CGNX API -> list sites, example proof of concept. **Author:** CloudGenix **Copyright:** (c) 2017-2021 CloudGenix, Inc **License:** MIT """ __author__ = "CloudGenix Developer Support <developers@cloudgenix.com>" __email__ = "developers@cloudgenix.com" __copyright__ = "Copyright (c) 2017-2021 CloudGenix, Inc" __license__ = """ MIT License Copyright (c) 2017-2021 CloudGenix, Inc Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ # standard modules import argparse import logging # CloudGenix Python SDK import cloudgenix # alias JSON pretty printer (jd), and JSON Detailed pretty printer (jd_detailed) from cloudgenix SDK. jd = cloudgenix.jd jd_detailed = cloudgenix.jd_detailed # Global Vars SDK_VERSION = cloudgenix.version SCRIPT_NAME = 'CloudGenix Python SDK demo' # Set logging to use function name logger = logging.getLogger(__name__) ############################################################################ # Begin Script, parse arguments. ############################################################################ # Parse arguments parser = argparse.ArgumentParser(description="{0}.".format(SCRIPT_NAME)) # Allow Controller modification and debug level sets. controller_group = parser.add_argument_group('API', 'These options change how this program connects to the API.') controller_group.add_argument("--controller", "-C", help="Controller URI, ex. https://api.cloudgenix.com:8443", default=None) controller_group.add_argument("--insecure", "-I", help="Disable SSL certificate and hostname verification", dest='verify', action='store_false', default=True) login_group = parser.add_argument_group('Login', 'These options allow skipping of interactive login') login_group.add_argument("--email", "-E", help="Use this email as User Name instead of prompting", default=None) login_group.add_argument("--pass", "-PW", help="Use this Password instead of prompting", default=None) debug_group = parser.add_argument_group('Debug', 'These options enable debugging output') debug_group.add_argument("--debug", "-D", help="Verbose Debug info, levels 0-2", type=int, default=0) args = vars(parser.parse_args()) if args['debug'] == 1: logging.basicConfig(level=logging.INFO, format="%(levelname)s [%(name)s.%(funcName)s:%(lineno)d] %(message)s") logger.setLevel(logging.INFO) elif args['debug'] >= 2: logging.basicConfig(level=logging.DEBUG, format="%(levelname)s [%(name)s.%(funcName)s:%(lineno)d] %(message)s") logger.setLevel(logging.DEBUG) else: # Remove all handlers for handler in logging.root.handlers[:]: logging.root.removeHandler(handler) # set logging level to default logger.setLevel(logging.WARNING) ############################################################################ # Instantiate API ############################################################################ sdk = cloudgenix.API(controller=args["controller"], ssl_verify=args["verify"]) # set debug sdk.set_debug(args["debug"]) ############################################################################ # Draw Interactive login banner, run interactive login including args above. ############################################################################ print("{0} v{1} ({2})\n".format(SCRIPT_NAME, SDK_VERSION, sdk.controller)) # interactive or cmd-line specified initial login while sdk.tenant_name is None: sdk.interactive.login(args["email"], args["pass"]) ############################################################################ # End Login handling, begin script.. ############################################################################ # Get list of sites. response = sdk.get.sites() # status is a boolean based on success/failure. If success, print raw dictionary if response.cgx_status: # Can Print as formatted JSON using json module using commented code below. # raw_sites_dict = response.cgx_content # print(json.dumps(raw_sites_dict, indent=4)) # But CloudGenix has a built-in pretty printer, can just use that on native response as a shortcut. # Output is the same as code above. jd(response) # else, let user know something didn't work. else: print("ERROR: ") # the jd_detailed builtin pretty-printer will dump all request/response info, and also attempt to hide sensitive # cookies/headers (AUTH_TOKEN, X-Auth-Token, etc.) to be safe for log messages/etc. jd_detailed(response) # end of script, run logout to clear session. print(sdk.get.logout().cgx_content)
0
0
0