content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
# -*- coding: utf-8 -*- """ Created on Thu Aug 27 04:40:43 2020 @author: Abhishek Mukherjee """ class Solution: def decodeString(self, s: str) -> str: tempNum=[] tempAlpha=[] tempPrime=[] temp3=[] flagPrime=1 tempNum1="" for i in s: if i.isdigit() and flagPrime==1: tempNum1=tempNum1+i flagPrime=1 continue if tempNum1!="": tempNum.append(tempNum1) tempNum1="" if i=='[' or i.isalpha(): tempAlpha.append(i) if i==']': temp1=tempNum.pop() temp3=[] while True: temp2=tempAlpha.pop() if temp2=='[': break else: temp3.append(temp2) for i in range(int(temp1)): tempAlpha.extend(temp3[::-1]) return ''.join(tempAlpha)
""" Created on Thu Aug 27 04:40:43 2020 @author: Abhishek Mukherjee """ class Solution: def decode_string(self, s: str) -> str: temp_num = [] temp_alpha = [] temp_prime = [] temp3 = [] flag_prime = 1 temp_num1 = '' for i in s: if i.isdigit() and flagPrime == 1: temp_num1 = tempNum1 + i flag_prime = 1 continue if tempNum1 != '': tempNum.append(tempNum1) temp_num1 = '' if i == '[' or i.isalpha(): tempAlpha.append(i) if i == ']': temp1 = tempNum.pop() temp3 = [] while True: temp2 = tempAlpha.pop() if temp2 == '[': break else: temp3.append(temp2) for i in range(int(temp1)): tempAlpha.extend(temp3[::-1]) return ''.join(tempAlpha)
def process_blok(x0_x1_y0_y1_z0_z1_): x0_, x1_, y0_, y1_, z0_, z1_ = x0_x1_y0_y1_z0_z1_ print('Setting number of threads in process_blok to %d.\n' %nthread) os.environ['MKL_NUM_THREADS'] = str(nthread) # load and dilate initial voxel peak positions voxl_peaklidx_blok = np.zeros_like(bimage_peak_fine.value) voxl_peaklidx_blok[x0_:x1_, y0_:y1_, z0_:z1_] = 1 voxl_peaklidx_blok *= bimage_peak_fine.value voxl_valdlidx_blok = morphology.binary_dilation(voxl_peaklidx_blok, cell_ball) voxl_position_peak = np.argwhere(voxl_peaklidx_blok) voxl_position = np.argwhere(voxl_valdlidx_blok) voxl_peakaidx = np.nonzero(voxl_peaklidx_blok[voxl_valdlidx_blok])[0] x0, y0, z0 = voxl_position.min(0) x1, y1, z1 = voxl_position.max(0) + 1 voxl_timesers_blok = [None] * lt tic = time.time() for ti in range(lt): image_name_hdf = image_dir(image_names[ti], frame_i) + 'image_aligned.hdf5' with h5py.File(image_name_hdf, 'r') as file_handle: voxl_timesers_blok[ti] = file_handle['V3D'][z0:z1, y0:y1, x0:x1].T print('Load data time: %.1f minutes.\n' %((time.time() - tic) / 60)) voxl_timesers_blok = np.transpose(voxl_timesers_blok, (1, 2, 3, 0)) voxl_timesers = voxl_timesers_blok[voxl_valdlidx_blok[x0:x1, y0:y1, z0:z1]] del voxl_timesers_blok # perform slice-time correction, if there is more than one slice if lz > 1: for i in range(len(voxl_position)): # get timepoints of midpoint and zi plane for interpolation zi = voxl_position[i, 2] # number of plane timepoints_zi = np.arange(lt) * 1000.0 / freq_stack + zi * t_exposure timepoints_zm = np.arange(lt) * 1000.0 / freq_stack + (lz / 2) * t_exposure # make spline interpolator and interpolate timeseries spline_interpolator_xyzi = \ interpolate.InterpolatedUnivariateSpline(timepoints_zi, voxl_timesers[i]) voxl_timesers[i] = spline_interpolator_xyzi(timepoints_zm) def normalize_rank_timesers(timesers): #for i, time_i in enumerate(timesers): # timesers[i] = stats.rankdata(time_i) mn = timesers.mean(1) sd = timesers.std(1, ddof=1) return (timesers - mn[:, None]) / (sd[:, None] * np.sqrt(lt - 1)) # get voxel connectivity from proximities (distances) and similarities (correlations) voxl_position_peak_phys = voxl_position_peak * [resn_x * ds, resn_y * ds, resn_z] voxl_timesers_peak_rank = normalize_rank_timesers(voxl_timesers[voxl_peakaidx]) # connectivity is given by the combination of high proximity and high similarity voxl_conn_peak = np.zeros((len(voxl_peakaidx), len(voxl_peakaidx)), dtype=bool) idx = np.linspace(0, len(voxl_peakaidx), 11, dtype=int) for i in range(len(idx) - 1): idx_i = np.r_[idx[i]:idx[i + 1]] voxl_dist_peak_i = np.sqrt( np.square(voxl_position_peak_phys[idx_i, 0:1] - voxl_position_peak_phys[:, 0:1].T) + np.square(voxl_position_peak_phys[idx_i, 1:2] - voxl_position_peak_phys[:, 1:2].T) + np.square(voxl_position_peak_phys[idx_i, 2:3] - voxl_position_peak_phys[:, 2:3].T)) voxl_corr_peak_i = np.dot(voxl_timesers_peak_rank[idx_i], voxl_timesers_peak_rank.T) voxl_neib_peak_i = voxl_dist_peak_i < cell_diam voxl_neib_simi_i = np.array([corr_ij > np.median(corr_ij[neib_ij]) for neib_ij, corr_ij in zip(voxl_neib_peak_i, voxl_corr_peak_i)]) voxl_conn_peak[idx_i] = (voxl_neib_peak_i & voxl_neib_simi_i) voxl_conn_peak = voxl_conn_peak | voxl_conn_peak.T voxl_powr_peak = np.mean(np.square(voxl_timesers[voxl_peakaidx]), 1) del voxl_timesers_peak_rank return (voxl_position, voxl_timesers, voxl_peakaidx, voxl_position_peak, voxl_position_peak_phys, voxl_conn_peak, voxl_powr_peak) def blok_cell_detection(blok_i_blok_xyz_01): '''Detect individual cells using the sparse NMF algorithm''' blok_i, blok_xyz_01 = blok_i_blok_xyz_01 print('Setting number of threads in blok_cell_detection to %d.\n' %nthread) os.environ['MKL_NUM_THREADS'] = str(nthread) (voxl_position, voxl_timesers, voxl_peakaidx, voxl_position_peak, voxl_position_peak_phys, voxl_conn_peak, voxl_powr_peak) = process_blok(blok_xyz_01) blok_voxl_nmbr = len(voxl_position) # number of voxels in blok peak_valdlidx = np.arange(len(voxl_position_peak)) voxl_fraction = 100 # decremented if nnmf fails for iter_i in range(128): # 0.95**31 = 0.2 try: # estimate sparseness of each component cmpn_nmbr = np.round(peak_valdlidx.size / (0.5 * cell_voxl_nmbr)).astype(int) print((iter_i, voxl_fraction, cmpn_nmbr)) tic = time.time() cmpn_clusters = \ cluster.AgglomerativeClustering( n_clusters=cmpn_nmbr, connectivity=voxl_conn_peak[peak_valdlidx[:,None],peak_valdlidx[None]], linkage='ward')\ .fit(voxl_position_peak_phys[peak_valdlidx]) cmpn_labl = cmpn_clusters.labels_ print('Hierarchical Clustering time: %.1f minutes.\n' %((time.time() - tic) / 60)) # initialize spatial component properties cmpn_spceinit = np.zeros((blok_voxl_nmbr, cmpn_nmbr + 1)) cmpn_neibhood = np.zeros((blok_voxl_nmbr, cmpn_nmbr + 1), dtype=bool) cmpn_sparsity = np.zeros(cmpn_nmbr + 1) cmpn_percentl = np.zeros(cmpn_nmbr + 1) for cmpn_i in range(cmpn_nmbr): # initialize spatial component cmpn_spceinit[voxl_peakaidx[peak_valdlidx], cmpn_i] = (cmpn_labl == cmpn_i) # get neighborhood of component cmpn_centroid_phys_i = \ np.median(voxl_position_peak_phys[peak_valdlidx][cmpn_labl == cmpn_i], 0) dist_from_centroid_to_peak = \ np.sqrt( np.square((cmpn_centroid_phys_i[0] - voxl_position_peak_phys[peak_valdlidx, 0])) + np.square((cmpn_centroid_phys_i[1] - voxl_position_peak_phys[peak_valdlidx, 1])) + np.square((cmpn_centroid_phys_i[2] - voxl_position_peak_phys[peak_valdlidx, 2])) ) cmpn_midpoint_i = voxl_position_peak[peak_valdlidx][np.argmin(dist_from_centroid_to_peak)] cmpn_neibaidx_i = cmpn_midpoint_i + (np.argwhere(cell_ball) - cell_ball_midpoint) cmpn_neibaidx_i = cmpn_neibaidx_i[(cmpn_neibaidx_i >= 0).all(1)] cmpn_neibaidx_i = cmpn_neibaidx_i[(cmpn_neibaidx_i < [lx//ds, ly//ds, lz]).all(1)] def relative_indx(ni): return np.nonzero(np.all(voxl_position == ni, 1))[0][0] cmpn_neibridx_i = np.array([relative_indx(ni) for ni in cmpn_neibaidx_i]) cmpn_neibhood[cmpn_neibridx_i, cmpn_i] = 1 cmpn_vect_i = np.zeros(len(cmpn_neibridx_i)) cmpn_vect_i[:cell_voxl_nmbr] = 1 cmpn_sparsity[cmpn_i] = sparseness(cmpn_vect_i) cmpn_percentl[cmpn_i] = 100 * (1 - np.mean(cmpn_vect_i)) voxl_valdlidx = cmpn_neibhood.any(1) voxl_position_vald = voxl_position[voxl_valdlidx] voxl_timesers_vald = voxl_timesers[voxl_valdlidx] cmpn_spceinit_vald = cmpn_spceinit[voxl_valdlidx] cmpn_neibhood_vald = cmpn_neibhood[voxl_valdlidx] # initialize background component cmpn_spceinit_vald[:, -1] = 1 cmpn_neibhood_vald[:, -1] = 1 tic = time.time() cmpn_spcesers_vald, cmpn_timesers_vald, d = nnmf_sparse( voxl_timesers_vald, voxl_position_vald, cmpn_spceinit_vald, cmpn_neibhood_vald, cmpn_sparsity, cmpn_percentl, miniter=10, maxiter=100, tolfun=1e-3) detection_success = 1 print('NMF time: %.1f minutes.\n' %((time.time() - tic) / 60)) break except ValueError: detection_success = 0 voxl_fraction *= 0.97 thr_powr_peak = np.percentile(voxl_powr_peak, 100 - voxl_fraction) peak_valdlidx = np.where(voxl_powr_peak > thr_powr_peak)[0] # get cell positions and timeseries, and save cell data with h5py.File(cell_dir + '/Block' + str(blok_i).zfill(5) + '.hdf5', 'w') as file_handle: if detection_success: for cmpn_i in range(cmpn_nmbr): cmpn_lidx_i = np.nonzero(cmpn_spcesers_vald[:, cmpn_i])[0] cmpn_position_i = voxl_position_vald[cmpn_lidx_i] cmpn_spcesers_i = cmpn_spcesers_vald[cmpn_lidx_i, cmpn_i] mean_spcevoxl_i = bimage_mean.value[list(zip(*cmpn_position_i))] mean_i = np.sum(mean_spcevoxl_i * cmpn_spcesers_i) / np.sum(cmpn_spcesers_i) cmpn_timesers_i = cmpn_timesers_vald[cmpn_i] cmpn_timesers_i = cmpn_timesers_i * mean_i / np.mean(cmpn_timesers_i) hdf5_dir = '/cmpn/' + str(cmpn_i).zfill(5) file_handle[hdf5_dir + '/cmpn_position'] = cmpn_position_i file_handle[hdf5_dir + '/cmpn_spcesers'] = cmpn_spcesers_i file_handle[hdf5_dir + '/cmpn_timesers'] = cmpn_timesers_i file_handle['cmpn_nmbr'] = cmpn_nmbr file_handle['success'] = 1 def nnmf_sparse(V0, XYZ0, W0, B0, Sparsity0, Percentl0, tolfun=1e-4, miniter=10, maxiter=100, verbosity=1, time_mean=1.0): print('Setting number of threads in nnmf_sparse to %d.\n' %nthread) os.environ['MKL_NUM_THREADS'] = str(nthread) # CAUTION: Input variable is modified to save memory V0 *= (time_mean / V0.mean(1)[:, None]) # normalize voxel timeseries V = V0[:, dt_range].astype(float) # copy input signal XYZ = XYZ0.astype(int) W = W0.astype(float) B = B0.astype(bool) Sparsity = Sparsity0.copy() Percentl = Percentl0.copy() # get dimensions n, t = V.shape n_, c = W.shape assert(n_ == n) H = np.zeros((c, t)) # zero timeseries array dnorm_prev = np.full(2, np.inf) # last two d-norms for iter_i in range(maxiter): # save current states H_ = H.copy() # Alternate least squares with regularization H = np.maximum(linalg.lstsq(W, V)[0], 0) H *= (time_mean / H.mean(1)[:, None]) # normalize component timeseries W = np.maximum(linalg.lstsq(V.T, H.T)[0], 0) W[np.logical_not(B)] = 0 # restrict component boundaries for ci in range(c): W_ci = W[B[:, ci], ci] if any(W_ci) & ((Sparsity[ci] > 0) | (Percentl[ci] > 0)): # get relative dimensions of component XYZ_ci = XYZ[B[:, ci]] - XYZ[B[:, ci]].min(0) # enforce component sparsity and percentile threshold W_ci = projection(W_ci, Sparsity[ci], at_least_as_sparse=True) # W_ci[W_ci <= np.percentile(W_ci, Percentl[ci])] = 0 # retain component of maximal size L_ci = np.zeros(np.ptp(XYZ_ci, 0) + 1, dtype=bool) L_ci[list(zip(*XYZ_ci))] = W_ci > 0 L_ci = measure.label(L_ci, connectivity=3) lci_size = np.bincount(L_ci[L_ci.nonzero()]) W_ci[L_ci[list(zip(*XYZ_ci))] != np.argmax(lci_size)] = 0 W[B[:, ci], ci] = W_ci # Get norm of difference and check for convergence dnorm = np.sqrt(np.mean(np.square(V - W.dot(H)))) / time_mean diffh = np.sqrt(np.mean(np.square(H - H_ ))) / time_mean if ((dnorm_prev.max(0) - dnorm) < tolfun) & (diffh < tolfun): if (iter_i >= miniter): break dnorm_prev[1] = dnorm_prev[0] dnorm_prev[0] = dnorm if verbosity: print((iter_i, dnorm, diffh)) # Perform final regression on full input timeseries H = np.maximum(linalg.lstsq(W, V0)[0], 0) H *= (time_mean / H.mean(1)[:, None]) # normalize component timeseries return (W, H, dnorm) def projection(Si, s, at_least_as_sparse=False): assert(Si.ndim == 1) S = np.copy(Si) # copy input signal if s <= 0: return np.maximum(S, 0) # enforce nonnegativity d = S.size L2 = np.sqrt(np.sum(np.square(S))) # fixed l2-norm L1 = L2 * (np.sqrt(d) * (1 - s) + s) # desired l1-norm # quit if at_least_sparse=True and original exceeds target sparsity if at_least_as_sparse: if L1 >= np.sum(np.abs(S)): return S # initialize components with negative values Z = np.zeros(S.shape, dtype=bool) negatives = True while negatives: # Fix components with negative values at 0 Z = Z | (S < 0) S[Z] = 0 # Project to the sum-constraint hyperplane S += (L1 - np.sum(S)) / (d - np.sum(Z)) S[Z] = 0 # Get midpoints of hyperplane, M M = np.tile(L1 / (d - np.sum(Z)), d) M[Z] = 0 P = S - M # Solve for Alph, L2 = l2[M + Alph*(S-M)] = l2[P*Alph + M], # where L2 is defined above, and l2 is the l2-norm operator. # For convenience, we square both sides and find the roots, # 0 = (l2[P*Alph + M])^2 - (L2)^2 # 0 = sum((P*Alph)^2) + sum(2*P*M*Alph) + sum(M^2) - L2^2 A = np.sum(P * P) B = 2 * np.sum(P * M) C = np.sum(M * M) - L2**2 Alph = (-B + np.real(np.sqrt(B**2 - 4 * A * C))) / (2 * A) # Project within the sum-constraint hyperplane to match L2 S = M + Alph * P # Check for negative values in solution negatives = np.any(S < 0) return S
def process_blok(x0_x1_y0_y1_z0_z1_): (x0_, x1_, y0_, y1_, z0_, z1_) = x0_x1_y0_y1_z0_z1_ print('Setting number of threads in process_blok to %d.\n' % nthread) os.environ['MKL_NUM_THREADS'] = str(nthread) voxl_peaklidx_blok = np.zeros_like(bimage_peak_fine.value) voxl_peaklidx_blok[x0_:x1_, y0_:y1_, z0_:z1_] = 1 voxl_peaklidx_blok *= bimage_peak_fine.value voxl_valdlidx_blok = morphology.binary_dilation(voxl_peaklidx_blok, cell_ball) voxl_position_peak = np.argwhere(voxl_peaklidx_blok) voxl_position = np.argwhere(voxl_valdlidx_blok) voxl_peakaidx = np.nonzero(voxl_peaklidx_blok[voxl_valdlidx_blok])[0] (x0, y0, z0) = voxl_position.min(0) (x1, y1, z1) = voxl_position.max(0) + 1 voxl_timesers_blok = [None] * lt tic = time.time() for ti in range(lt): image_name_hdf = image_dir(image_names[ti], frame_i) + 'image_aligned.hdf5' with h5py.File(image_name_hdf, 'r') as file_handle: voxl_timesers_blok[ti] = file_handle['V3D'][z0:z1, y0:y1, x0:x1].T print('Load data time: %.1f minutes.\n' % ((time.time() - tic) / 60)) voxl_timesers_blok = np.transpose(voxl_timesers_blok, (1, 2, 3, 0)) voxl_timesers = voxl_timesers_blok[voxl_valdlidx_blok[x0:x1, y0:y1, z0:z1]] del voxl_timesers_blok if lz > 1: for i in range(len(voxl_position)): zi = voxl_position[i, 2] timepoints_zi = np.arange(lt) * 1000.0 / freq_stack + zi * t_exposure timepoints_zm = np.arange(lt) * 1000.0 / freq_stack + lz / 2 * t_exposure spline_interpolator_xyzi = interpolate.InterpolatedUnivariateSpline(timepoints_zi, voxl_timesers[i]) voxl_timesers[i] = spline_interpolator_xyzi(timepoints_zm) def normalize_rank_timesers(timesers): mn = timesers.mean(1) sd = timesers.std(1, ddof=1) return (timesers - mn[:, None]) / (sd[:, None] * np.sqrt(lt - 1)) voxl_position_peak_phys = voxl_position_peak * [resn_x * ds, resn_y * ds, resn_z] voxl_timesers_peak_rank = normalize_rank_timesers(voxl_timesers[voxl_peakaidx]) voxl_conn_peak = np.zeros((len(voxl_peakaidx), len(voxl_peakaidx)), dtype=bool) idx = np.linspace(0, len(voxl_peakaidx), 11, dtype=int) for i in range(len(idx) - 1): idx_i = np.r_[idx[i]:idx[i + 1]] voxl_dist_peak_i = np.sqrt(np.square(voxl_position_peak_phys[idx_i, 0:1] - voxl_position_peak_phys[:, 0:1].T) + np.square(voxl_position_peak_phys[idx_i, 1:2] - voxl_position_peak_phys[:, 1:2].T) + np.square(voxl_position_peak_phys[idx_i, 2:3] - voxl_position_peak_phys[:, 2:3].T)) voxl_corr_peak_i = np.dot(voxl_timesers_peak_rank[idx_i], voxl_timesers_peak_rank.T) voxl_neib_peak_i = voxl_dist_peak_i < cell_diam voxl_neib_simi_i = np.array([corr_ij > np.median(corr_ij[neib_ij]) for (neib_ij, corr_ij) in zip(voxl_neib_peak_i, voxl_corr_peak_i)]) voxl_conn_peak[idx_i] = voxl_neib_peak_i & voxl_neib_simi_i voxl_conn_peak = voxl_conn_peak | voxl_conn_peak.T voxl_powr_peak = np.mean(np.square(voxl_timesers[voxl_peakaidx]), 1) del voxl_timesers_peak_rank return (voxl_position, voxl_timesers, voxl_peakaidx, voxl_position_peak, voxl_position_peak_phys, voxl_conn_peak, voxl_powr_peak) def blok_cell_detection(blok_i_blok_xyz_01): """Detect individual cells using the sparse NMF algorithm""" (blok_i, blok_xyz_01) = blok_i_blok_xyz_01 print('Setting number of threads in blok_cell_detection to %d.\n' % nthread) os.environ['MKL_NUM_THREADS'] = str(nthread) (voxl_position, voxl_timesers, voxl_peakaidx, voxl_position_peak, voxl_position_peak_phys, voxl_conn_peak, voxl_powr_peak) = process_blok(blok_xyz_01) blok_voxl_nmbr = len(voxl_position) peak_valdlidx = np.arange(len(voxl_position_peak)) voxl_fraction = 100 for iter_i in range(128): try: cmpn_nmbr = np.round(peak_valdlidx.size / (0.5 * cell_voxl_nmbr)).astype(int) print((iter_i, voxl_fraction, cmpn_nmbr)) tic = time.time() cmpn_clusters = cluster.AgglomerativeClustering(n_clusters=cmpn_nmbr, connectivity=voxl_conn_peak[peak_valdlidx[:, None], peak_valdlidx[None]], linkage='ward').fit(voxl_position_peak_phys[peak_valdlidx]) cmpn_labl = cmpn_clusters.labels_ print('Hierarchical Clustering time: %.1f minutes.\n' % ((time.time() - tic) / 60)) cmpn_spceinit = np.zeros((blok_voxl_nmbr, cmpn_nmbr + 1)) cmpn_neibhood = np.zeros((blok_voxl_nmbr, cmpn_nmbr + 1), dtype=bool) cmpn_sparsity = np.zeros(cmpn_nmbr + 1) cmpn_percentl = np.zeros(cmpn_nmbr + 1) for cmpn_i in range(cmpn_nmbr): cmpn_spceinit[voxl_peakaidx[peak_valdlidx], cmpn_i] = cmpn_labl == cmpn_i cmpn_centroid_phys_i = np.median(voxl_position_peak_phys[peak_valdlidx][cmpn_labl == cmpn_i], 0) dist_from_centroid_to_peak = np.sqrt(np.square(cmpn_centroid_phys_i[0] - voxl_position_peak_phys[peak_valdlidx, 0]) + np.square(cmpn_centroid_phys_i[1] - voxl_position_peak_phys[peak_valdlidx, 1]) + np.square(cmpn_centroid_phys_i[2] - voxl_position_peak_phys[peak_valdlidx, 2])) cmpn_midpoint_i = voxl_position_peak[peak_valdlidx][np.argmin(dist_from_centroid_to_peak)] cmpn_neibaidx_i = cmpn_midpoint_i + (np.argwhere(cell_ball) - cell_ball_midpoint) cmpn_neibaidx_i = cmpn_neibaidx_i[(cmpn_neibaidx_i >= 0).all(1)] cmpn_neibaidx_i = cmpn_neibaidx_i[(cmpn_neibaidx_i < [lx // ds, ly // ds, lz]).all(1)] def relative_indx(ni): return np.nonzero(np.all(voxl_position == ni, 1))[0][0] cmpn_neibridx_i = np.array([relative_indx(ni) for ni in cmpn_neibaidx_i]) cmpn_neibhood[cmpn_neibridx_i, cmpn_i] = 1 cmpn_vect_i = np.zeros(len(cmpn_neibridx_i)) cmpn_vect_i[:cell_voxl_nmbr] = 1 cmpn_sparsity[cmpn_i] = sparseness(cmpn_vect_i) cmpn_percentl[cmpn_i] = 100 * (1 - np.mean(cmpn_vect_i)) voxl_valdlidx = cmpn_neibhood.any(1) voxl_position_vald = voxl_position[voxl_valdlidx] voxl_timesers_vald = voxl_timesers[voxl_valdlidx] cmpn_spceinit_vald = cmpn_spceinit[voxl_valdlidx] cmpn_neibhood_vald = cmpn_neibhood[voxl_valdlidx] cmpn_spceinit_vald[:, -1] = 1 cmpn_neibhood_vald[:, -1] = 1 tic = time.time() (cmpn_spcesers_vald, cmpn_timesers_vald, d) = nnmf_sparse(voxl_timesers_vald, voxl_position_vald, cmpn_spceinit_vald, cmpn_neibhood_vald, cmpn_sparsity, cmpn_percentl, miniter=10, maxiter=100, tolfun=0.001) detection_success = 1 print('NMF time: %.1f minutes.\n' % ((time.time() - tic) / 60)) break except ValueError: detection_success = 0 voxl_fraction *= 0.97 thr_powr_peak = np.percentile(voxl_powr_peak, 100 - voxl_fraction) peak_valdlidx = np.where(voxl_powr_peak > thr_powr_peak)[0] with h5py.File(cell_dir + '/Block' + str(blok_i).zfill(5) + '.hdf5', 'w') as file_handle: if detection_success: for cmpn_i in range(cmpn_nmbr): cmpn_lidx_i = np.nonzero(cmpn_spcesers_vald[:, cmpn_i])[0] cmpn_position_i = voxl_position_vald[cmpn_lidx_i] cmpn_spcesers_i = cmpn_spcesers_vald[cmpn_lidx_i, cmpn_i] mean_spcevoxl_i = bimage_mean.value[list(zip(*cmpn_position_i))] mean_i = np.sum(mean_spcevoxl_i * cmpn_spcesers_i) / np.sum(cmpn_spcesers_i) cmpn_timesers_i = cmpn_timesers_vald[cmpn_i] cmpn_timesers_i = cmpn_timesers_i * mean_i / np.mean(cmpn_timesers_i) hdf5_dir = '/cmpn/' + str(cmpn_i).zfill(5) file_handle[hdf5_dir + '/cmpn_position'] = cmpn_position_i file_handle[hdf5_dir + '/cmpn_spcesers'] = cmpn_spcesers_i file_handle[hdf5_dir + '/cmpn_timesers'] = cmpn_timesers_i file_handle['cmpn_nmbr'] = cmpn_nmbr file_handle['success'] = 1 def nnmf_sparse(V0, XYZ0, W0, B0, Sparsity0, Percentl0, tolfun=0.0001, miniter=10, maxiter=100, verbosity=1, time_mean=1.0): print('Setting number of threads in nnmf_sparse to %d.\n' % nthread) os.environ['MKL_NUM_THREADS'] = str(nthread) v0 *= time_mean / V0.mean(1)[:, None] v = V0[:, dt_range].astype(float) xyz = XYZ0.astype(int) w = W0.astype(float) b = B0.astype(bool) sparsity = Sparsity0.copy() percentl = Percentl0.copy() (n, t) = V.shape (n_, c) = W.shape assert n_ == n h = np.zeros((c, t)) dnorm_prev = np.full(2, np.inf) for iter_i in range(maxiter): h_ = H.copy() h = np.maximum(linalg.lstsq(W, V)[0], 0) h *= time_mean / H.mean(1)[:, None] w = np.maximum(linalg.lstsq(V.T, H.T)[0], 0) W[np.logical_not(B)] = 0 for ci in range(c): w_ci = W[B[:, ci], ci] if any(W_ci) & ((Sparsity[ci] > 0) | (Percentl[ci] > 0)): xyz_ci = XYZ[B[:, ci]] - XYZ[B[:, ci]].min(0) w_ci = projection(W_ci, Sparsity[ci], at_least_as_sparse=True) l_ci = np.zeros(np.ptp(XYZ_ci, 0) + 1, dtype=bool) L_ci[list(zip(*XYZ_ci))] = W_ci > 0 l_ci = measure.label(L_ci, connectivity=3) lci_size = np.bincount(L_ci[L_ci.nonzero()]) W_ci[L_ci[list(zip(*XYZ_ci))] != np.argmax(lci_size)] = 0 W[B[:, ci], ci] = W_ci dnorm = np.sqrt(np.mean(np.square(V - W.dot(H)))) / time_mean diffh = np.sqrt(np.mean(np.square(H - H_))) / time_mean if (dnorm_prev.max(0) - dnorm < tolfun) & (diffh < tolfun): if iter_i >= miniter: break dnorm_prev[1] = dnorm_prev[0] dnorm_prev[0] = dnorm if verbosity: print((iter_i, dnorm, diffh)) h = np.maximum(linalg.lstsq(W, V0)[0], 0) h *= time_mean / H.mean(1)[:, None] return (W, H, dnorm) def projection(Si, s, at_least_as_sparse=False): assert Si.ndim == 1 s = np.copy(Si) if s <= 0: return np.maximum(S, 0) d = S.size l2 = np.sqrt(np.sum(np.square(S))) l1 = L2 * (np.sqrt(d) * (1 - s) + s) if at_least_as_sparse: if L1 >= np.sum(np.abs(S)): return S z = np.zeros(S.shape, dtype=bool) negatives = True while negatives: z = Z | (S < 0) S[Z] = 0 s += (L1 - np.sum(S)) / (d - np.sum(Z)) S[Z] = 0 m = np.tile(L1 / (d - np.sum(Z)), d) M[Z] = 0 p = S - M a = np.sum(P * P) b = 2 * np.sum(P * M) c = np.sum(M * M) - L2 ** 2 alph = (-B + np.real(np.sqrt(B ** 2 - 4 * A * C))) / (2 * A) s = M + Alph * P negatives = np.any(S < 0) return S
def defaultify(value,default): """Return `default` if `value` is `None`. Otherwise, return `value`""" if None == value: return default else: return value def defaultifyDict(dictionary,key,default): """Return `default` if either `key` is not in `dictionary`, or `dictionary[key]` is `None`. Otherwise, return `dictionary[key]`""" if key in dictionary: return defaultify(dictionary[key],default) else: return default
def defaultify(value, default): """Return `default` if `value` is `None`. Otherwise, return `value`""" if None == value: return default else: return value def defaultify_dict(dictionary, key, default): """Return `default` if either `key` is not in `dictionary`, or `dictionary[key]` is `None`. Otherwise, return `dictionary[key]`""" if key in dictionary: return defaultify(dictionary[key], default) else: return default
add_library('video') c=None w=640.0 h=480.0 darkmode=False def setup(): global c,cx,cy size(640,480) background(0 if darkmode else 255) stroke(23,202,230) imageMode(CENTER) c=Capture(this,640,480) c.start(); def genart(): line(dx,cy-h/2,dx,cy+h/2) def draw(): cx=width/2 cy=height/2 image(c,cx,cy,w,h) #genart() def captureEvent(cpt): cpt.read() def keyPressed(): global darkmode if key=='d': darkmode=not darkmode background(0 if darkmode else 255)
add_library('video') c = None w = 640.0 h = 480.0 darkmode = False def setup(): global c, cx, cy size(640, 480) background(0 if darkmode else 255) stroke(23, 202, 230) image_mode(CENTER) c = capture(this, 640, 480) c.start() def genart(): line(dx, cy - h / 2, dx, cy + h / 2) def draw(): cx = width / 2 cy = height / 2 image(c, cx, cy, w, h) def capture_event(cpt): cpt.read() def key_pressed(): global darkmode if key == 'd': darkmode = not darkmode background(0 if darkmode else 255)
# # PySNMP MIB module CLNS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CLNS-MIB # Produced by pysmi-0.3.4 at Wed May 1 12:25:07 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, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, ValueRangeConstraint, ConstraintsUnion, ValueSizeConstraint, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ValueRangeConstraint", "ConstraintsUnion", "ValueSizeConstraint", "SingleValueConstraint") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") Counter32, experimental, TimeTicks, iso, ModuleIdentity, MibIdentifier, ObjectIdentity, Counter64, NotificationType, Unsigned32, Bits, Gauge32, Integer32, IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "experimental", "TimeTicks", "iso", "ModuleIdentity", "MibIdentifier", "ObjectIdentity", "Counter64", "NotificationType", "Unsigned32", "Bits", "Gauge32", "Integer32", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn") DisplayString, TextualConvention, PhysAddress = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention", "PhysAddress") clns = MibIdentifier((1, 3, 6, 1, 3, 1)) class ClnpAddress(OctetString): subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(1, 21) clnp = MibIdentifier((1, 3, 6, 1, 3, 1, 1)) error = MibIdentifier((1, 3, 6, 1, 3, 1, 2)) echo = MibIdentifier((1, 3, 6, 1, 3, 1, 3)) es_is = MibIdentifier((1, 3, 6, 1, 3, 1, 4)).setLabel("es-is") clnpForwarding = MibScalar((1, 3, 6, 1, 3, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("is", 1), ("es", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: clnpForwarding.setStatus('mandatory') if mibBuilder.loadTexts: clnpForwarding.setDescription('The indication of whether this entity is active as an intermediate or end system. Only intermediate systems will forward PDUs onward that are not addressed to them.') clnpDefaultLifeTime = MibScalar((1, 3, 6, 1, 3, 1, 1, 2), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: clnpDefaultLifeTime.setStatus('mandatory') if mibBuilder.loadTexts: clnpDefaultLifeTime.setDescription('The default value inserted into the Lifetime field of the CLNP PDU header of PDUs sourced by this entity.') clnpInReceives = MibScalar((1, 3, 6, 1, 3, 1, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInReceives.setStatus('mandatory') if mibBuilder.loadTexts: clnpInReceives.setDescription('The total number of input PDUs received from all connected network interfaces running CLNP, including errors.') clnpInHdrErrors = MibScalar((1, 3, 6, 1, 3, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInHdrErrors.setStatus('mandatory') if mibBuilder.loadTexts: clnpInHdrErrors.setDescription('The number of input PDUs discarded due to errors in the CLNP header, including bad checksums, version mismatch, lifetime exceeded, errors discovered in processing options, etc.') clnpInAddrErrors = MibScalar((1, 3, 6, 1, 3, 1, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInAddrErrors.setStatus('mandatory') if mibBuilder.loadTexts: clnpInAddrErrors.setDescription("The number of input PDUs discarded because the NSAP address in the CLNP header's destination field was not a valid NSAP to be received at this entity. This count includes addresses not understood. For end systems, this is a count of PDUs which arrived with a destination NSAP which was not local.") clnpForwPDUs = MibScalar((1, 3, 6, 1, 3, 1, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpForwPDUs.setStatus('mandatory') if mibBuilder.loadTexts: clnpForwPDUs.setDescription('The number of input PDUs for which this entity was not the final destination and which an attempt was made to forward them onward.') clnpInUnknownNLPs = MibScalar((1, 3, 6, 1, 3, 1, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInUnknownNLPs.setStatus('mandatory') if mibBuilder.loadTexts: clnpInUnknownNLPs.setDescription('The number of locally-addressed PDUs successfully received but discarded because the network layer protocol was unknown or unsupported (e.g., not CLNP or ES-IS).') clnpInUnknownULPs = MibScalar((1, 3, 6, 1, 3, 1, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInUnknownULPs.setStatus('mandatory') if mibBuilder.loadTexts: clnpInUnknownULPs.setDescription('The number of locally-addressed PDUs successfully received but discarded because the upper layer protocol was unknown or unsupported (e.g., not TP4).') clnpInDiscards = MibScalar((1, 3, 6, 1, 3, 1, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInDiscards.setStatus('mandatory') if mibBuilder.loadTexts: clnpInDiscards.setDescription('The number of input CLNP PDUs for which no problems were encountered to prevent their continued processing, but were discarded (e.g., for lack of buffer space). Note that this counter does not include any PDUs discarded while awaiting re-assembly.') clnpInDelivers = MibScalar((1, 3, 6, 1, 3, 1, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInDelivers.setStatus('mandatory') if mibBuilder.loadTexts: clnpInDelivers.setDescription('The total number of input PDUs successfully delivered to the CLNS transport user.') clnpOutRequests = MibScalar((1, 3, 6, 1, 3, 1, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutRequests.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutRequests.setDescription('The total number of CLNP PDUs which local CLNS user protocols supplied to CLNP for transmission requests. This counter does not include any PDUs counted in clnpForwPDUs.') clnpOutDiscards = MibScalar((1, 3, 6, 1, 3, 1, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutDiscards.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutDiscards.setDescription('The number of output CLNP PDUs for which no other problem was encountered to prevent their transmission but were discarded (e.g., for lack of buffer space). Note this counter includes PDUs counted in clnpForwPDUs.') clnpOutNoRoutes = MibScalar((1, 3, 6, 1, 3, 1, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutNoRoutes.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutNoRoutes.setDescription('The number of CLNP PDUs discarded because no route could be found to transmit them to their destination. This counter includes any PDUs counted in clnpForwPDUs.') clnpReasmTimeout = MibScalar((1, 3, 6, 1, 3, 1, 1, 14), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpReasmTimeout.setStatus('mandatory') if mibBuilder.loadTexts: clnpReasmTimeout.setDescription('The maximum number of seconds which received segments are held while they are awaiting reassembly at this entity.') clnpReasmReqds = MibScalar((1, 3, 6, 1, 3, 1, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpReasmReqds.setStatus('mandatory') if mibBuilder.loadTexts: clnpReasmReqds.setDescription('The number of CLNP segments received which needed to be reassembled at this entity.') clnpReasmOKs = MibScalar((1, 3, 6, 1, 3, 1, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpReasmOKs.setStatus('mandatory') if mibBuilder.loadTexts: clnpReasmOKs.setDescription('The number of CLNP PDUs successfully re-assembled at this entity.') clnpReasmFails = MibScalar((1, 3, 6, 1, 3, 1, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpReasmFails.setStatus('mandatory') if mibBuilder.loadTexts: clnpReasmFails.setDescription('The number of failures detected by the CLNP reassembly algorithm (for any reason: timed out, buffer size, etc).') clnpSegOKs = MibScalar((1, 3, 6, 1, 3, 1, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpSegOKs.setStatus('mandatory') if mibBuilder.loadTexts: clnpSegOKs.setDescription('The number of CLNP PDUs that have been successfully segmented at this entity.') clnpSegFails = MibScalar((1, 3, 6, 1, 3, 1, 1, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpSegFails.setStatus('mandatory') if mibBuilder.loadTexts: clnpSegFails.setDescription('The number of CLNP PDUs that have been discarded because they needed to be fragmented at this entity but could not.') clnpSegCreates = MibScalar((1, 3, 6, 1, 3, 1, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpSegCreates.setStatus('mandatory') if mibBuilder.loadTexts: clnpSegCreates.setDescription('The number of CLNP PDU segments that have been generated as a result of segmentation at this entity.') clnpInOpts = MibScalar((1, 3, 6, 1, 3, 1, 1, 25), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInOpts.setStatus('mandatory') if mibBuilder.loadTexts: clnpInOpts.setDescription('The number of CLNP PDU segments that have been input with options at this entity.') clnpOutOpts = MibScalar((1, 3, 6, 1, 3, 1, 1, 26), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutOpts.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutOpts.setDescription('The number of CLNP PDU segments that have been generated with options by this entity.') clnpRoutingDiscards = MibScalar((1, 3, 6, 1, 3, 1, 1, 27), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpRoutingDiscards.setStatus('mandatory') if mibBuilder.loadTexts: clnpRoutingDiscards.setDescription('The number of routing entries which were chosen to be discarded even though they are valid. One possible reason for discarding such an entry could be to free-up buffer space for other routing entries.') clnpAddrTable = MibTable((1, 3, 6, 1, 3, 1, 1, 21), ) if mibBuilder.loadTexts: clnpAddrTable.setStatus('mandatory') if mibBuilder.loadTexts: clnpAddrTable.setDescription("The table of addressing information relevant to this entity's CLNP addresses. ") clnpAddrEntry = MibTableRow((1, 3, 6, 1, 3, 1, 1, 21, 1), ).setIndexNames((0, "CLNS-MIB", "clnpAdEntAddr")) if mibBuilder.loadTexts: clnpAddrEntry.setStatus('mandatory') if mibBuilder.loadTexts: clnpAddrEntry.setDescription("The addressing information for one of this entity's CLNP addresses.") clnpAdEntAddr = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 21, 1, 1), ClnpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpAdEntAddr.setStatus('mandatory') if mibBuilder.loadTexts: clnpAdEntAddr.setDescription("The CLNP address to which this entry's addressing information pertains.") clnpAdEntIfIndex = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 21, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpAdEntIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: clnpAdEntIfIndex.setDescription('The index value which uniquely identifies the interface to which this entry is applicable. The interface identified by a particular value of this index is the same interface as identified by the same value of ifIndex.') clnpAdEntReasmMaxSize = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 21, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpAdEntReasmMaxSize.setStatus('mandatory') if mibBuilder.loadTexts: clnpAdEntReasmMaxSize.setDescription('The size of the largest CLNP PDU which this entity can re-assemble from incoming CLNP segmented PDUs received on this interface.') clnpRoutingTable = MibTable((1, 3, 6, 1, 3, 1, 1, 22), ) if mibBuilder.loadTexts: clnpRoutingTable.setStatus('mandatory') if mibBuilder.loadTexts: clnpRoutingTable.setDescription("This entity's CLNP routing table.") clnpRouteEntry = MibTableRow((1, 3, 6, 1, 3, 1, 1, 22, 1), ).setIndexNames((0, "CLNS-MIB", "clnpRouteDest")) if mibBuilder.loadTexts: clnpRouteEntry.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteEntry.setDescription('A route to a particular destination.') clnpRouteDest = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 22, 1, 1), ClnpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: clnpRouteDest.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteDest.setDescription('The destination CLNP address of this route.') clnpRouteIfIndex = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 22, 1, 2), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: clnpRouteIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteIfIndex.setDescription('The index value which uniquely identifies the local interface through which the next hop of this route should be reached. The interface identified by a particular value of this index is the same as identified by the same value of ifIndex.') clnpRouteMetric1 = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 22, 1, 3), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: clnpRouteMetric1.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteMetric1.setDescription("The primary routing metric for this route. The semantics of this metric are determined by the routing-protocol specified in the route's clnpRouteProto value. If this metric is not used, its value should be set to -1.") clnpRouteMetric2 = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 22, 1, 4), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: clnpRouteMetric2.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteMetric2.setDescription("An alternate routing metric for this route. The semantics of this metric are determined by the routing-protocol specified in the route's clnpRouteProto value. If this metric is not used, its value should be set to -1.") clnpRouteMetric3 = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 22, 1, 5), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: clnpRouteMetric3.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteMetric3.setDescription("An alternate routing metric for this route. The semantics of this metric are determined by the routing-protocol specified in the route's clnpRouteProto value. If this metric is not used, its value should be set to -1.") clnpRouteMetric4 = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 22, 1, 6), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: clnpRouteMetric4.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteMetric4.setDescription("An alternate routing metric for this route. The semantics of this metric are determined by the routing-protocol specified in the route's clnpRouteProto value. If this metric is not used, its value should be set to -1.") clnpRouteNextHop = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 22, 1, 7), ClnpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: clnpRouteNextHop.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteNextHop.setDescription('The CLNP address of the next hop of this route.') clnpRouteType = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 22, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("other", 1), ("invalid", 2), ("direct", 3), ("remote", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: clnpRouteType.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteType.setDescription('The type of route. Setting this object to the value invalid(2) has the effect of invaliding the corresponding entry in the clnpRoutingTable. That is, it effectively dissasociates the destination identified with said entry from the route identified with said entry. It is an implementation-specific matter as to whether the agent removes an invalidated entry from the table. Accordingly, management stations must be prepared to receive tabular information from agents that corresponds to entries not currently in use. Proper interpretation of such entries requires examination of the relevant clnpRouteType object.') clnpRouteProto = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 22, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 9, 11, 12, 13, 14))).clone(namedValues=NamedValues(("other", 1), ("local", 2), ("netmgmt", 3), ("is-is", 9), ("ciscoIgrp", 11), ("bbnSpfIgp", 12), ("ospf", 13), ("bgp", 14)))).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpRouteProto.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteProto.setDescription('The routing mechanism via which this route was learned. Inclusion of values for gateway routing protocols is not intended to imply that hosts should support those protocols.') clnpRouteAge = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 22, 1, 10), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: clnpRouteAge.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteAge.setDescription("The number of seconds since this route was last updated or otherwise determined to be correct. Note that no semantics of `too old' can be implied except through knowledge of the routing protocol by which the route was learned.") clnpRouteMetric5 = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 22, 1, 11), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: clnpRouteMetric5.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteMetric5.setDescription("An alternate routing metric for this route. The semantics of this metric are determined by the routing-protocol specified in the route's clnpRouteProto value. If this metric is not used, its value should be set to -1.") clnpRouteInfo = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 22, 1, 12), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpRouteInfo.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteInfo.setDescription("A reference to MIB definitions specific to the particular routing protocol which is responsible for this route, as determined by the value specified in the route's clnpRouteProto value. If this information is not present, its value should be set to the OBJECT IDENTIFIER { 0 0 }, which is a syntatically valid object identifier, and any conformant implementation of ASN.1 and BER must be able to generate and recognize this value.") clnpNetToMediaTable = MibTable((1, 3, 6, 1, 3, 1, 1, 23), ) if mibBuilder.loadTexts: clnpNetToMediaTable.setStatus('mandatory') if mibBuilder.loadTexts: clnpNetToMediaTable.setDescription('The CLNP Address Translation table used for mapping from CLNP addresses to physical addresses.') clnpNetToMediaEntry = MibTableRow((1, 3, 6, 1, 3, 1, 1, 23, 1), ).setIndexNames((0, "CLNS-MIB", "clnpNetToMediaIfIndex"), (0, "CLNS-MIB", "clnpNetToMediaNetAddress")) if mibBuilder.loadTexts: clnpNetToMediaEntry.setStatus('mandatory') if mibBuilder.loadTexts: clnpNetToMediaEntry.setDescription("Each entry contains one CLNP address to `physical' address equivalence.") clnpNetToMediaIfIndex = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 23, 1, 1), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: clnpNetToMediaIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: clnpNetToMediaIfIndex.setDescription("The interface on which this entry's equivalence is effective. The interface identified by a particular value of this index is the same interface as identified by the same value of ifIndex.") clnpNetToMediaPhysAddress = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 23, 1, 2), PhysAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: clnpNetToMediaPhysAddress.setStatus('mandatory') if mibBuilder.loadTexts: clnpNetToMediaPhysAddress.setDescription("The media-dependent `physical' address.") clnpNetToMediaNetAddress = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 23, 1, 3), ClnpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: clnpNetToMediaNetAddress.setStatus('mandatory') if mibBuilder.loadTexts: clnpNetToMediaNetAddress.setDescription("The CLNP address corresponding to the media- dependent `physical' address.") clnpNetToMediaType = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 23, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("other", 1), ("invalid", 2), ("dynamic", 3), ("static", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: clnpNetToMediaType.setStatus('mandatory') if mibBuilder.loadTexts: clnpNetToMediaType.setDescription('The type of mapping. Setting this object to the value invalid(2) has the effect of invalidating the corresponding entry in the clnpNetToMediaTable. That is, it effectively dissassociates the interface identified with said entry from the mapping identified with said entry. It is an implementation-specific matter as to whether the agent removes an invalidated entry from the table. Accordingly, management stations must be prepared to receive tabular information from agents that corresponds to entries not currently in use. Proper interpretation of such entries requires examination of the relevant clnpNetToMediaType object.') clnpNetToMediaAge = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 23, 1, 5), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: clnpNetToMediaAge.setStatus('mandatory') if mibBuilder.loadTexts: clnpNetToMediaAge.setDescription("The number of seconds since this entry was last updated or otherwise determined to be correct. Note that no semantics of `too old' can be implied except through knowledge of the type of entry.") clnpNetToMediaHoldTime = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 23, 1, 6), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: clnpNetToMediaHoldTime.setStatus('mandatory') if mibBuilder.loadTexts: clnpNetToMediaHoldTime.setDescription('The time in seconds this entry will be valid. Static entries should always report this field as -1.') clnpMediaToNetTable = MibTable((1, 3, 6, 1, 3, 1, 1, 24), ) if mibBuilder.loadTexts: clnpMediaToNetTable.setStatus('mandatory') if mibBuilder.loadTexts: clnpMediaToNetTable.setDescription('The CLNP Address Translation table used for mapping from physical addresses to CLNP addresses.') clnpMediaToNetEntry = MibTableRow((1, 3, 6, 1, 3, 1, 1, 24, 1), ).setIndexNames((0, "CLNS-MIB", "clnpMediaToNetIfIndex"), (0, "CLNS-MIB", "clnpMediaToNetPhysAddress")) if mibBuilder.loadTexts: clnpMediaToNetEntry.setStatus('mandatory') if mibBuilder.loadTexts: clnpMediaToNetEntry.setDescription("Each entry contains on ClnpAddress to `physical' address equivalence.") clnpMediaToNetIfIndex = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 24, 1, 1), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: clnpMediaToNetIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: clnpMediaToNetIfIndex.setDescription("The interface on which this entry's equivalence is effective. The interface identified by a particular value of this index is the same interface as identified by the same value of ifIndex.") clnpMediaToNetAddress = MibScalar((1, 3, 6, 1, 3, 1, 1, 24, 1, 2), ClnpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: clnpMediaToNetAddress.setStatus('mandatory') if mibBuilder.loadTexts: clnpMediaToNetAddress.setDescription("The ClnpAddress corresponding to the media- dependent `physical' address.") clnpMediaToNetPhysAddress = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 24, 1, 3), PhysAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: clnpMediaToNetPhysAddress.setStatus('mandatory') if mibBuilder.loadTexts: clnpMediaToNetPhysAddress.setDescription("The media-dependent `physical' address.") clnpMediaToNetType = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 24, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("other", 1), ("invalid", 2), ("dynamic", 3), ("static", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: clnpMediaToNetType.setStatus('mandatory') if mibBuilder.loadTexts: clnpMediaToNetType.setDescription('The type of mapping. Setting this object to the value invalid(2) has the effect of invalidating the corresponding entry in the clnpMediaToNetTable. That is, it effectively dissassociates the interface identified with said entry from the mapping identified with said entry. It is an implementation-specific matter as to whether the agent removes an invalidated entry from the table. Accordingly, management stations must be prepared to receive tabular information from agents that corresponds to entries not currently in use. Proper interpretation of such entries requires examination of the relevant clnpMediaToNetType object.') clnpMediaToNetAge = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 24, 1, 5), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: clnpMediaToNetAge.setStatus('mandatory') if mibBuilder.loadTexts: clnpMediaToNetAge.setDescription("The number of seconds since this entry was last updated or otherwise determined to be correct. Note that no semantics of `too old' can be implied except through knowledge of the type of entry.") clnpMediaToNetHoldTime = MibTableColumn((1, 3, 6, 1, 3, 1, 1, 24, 1, 6), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: clnpMediaToNetHoldTime.setStatus('mandatory') if mibBuilder.loadTexts: clnpMediaToNetHoldTime.setDescription('The time in seconds this entry will be valid. Static entries should always report this field as -1.') clnpInErrors = MibScalar((1, 3, 6, 1, 3, 1, 2, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInErrors.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrors.setDescription('The number of CLNP Error PDUs received by this entity.') clnpOutErrors = MibScalar((1, 3, 6, 1, 3, 1, 2, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutErrors.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrors.setDescription('The number of CLNP Error PDUs sent by this entity.') clnpInErrUnspecs = MibScalar((1, 3, 6, 1, 3, 1, 2, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInErrUnspecs.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrUnspecs.setDescription('The number of unspecified CLNP Error PDUs received by this entity.') clnpInErrProcs = MibScalar((1, 3, 6, 1, 3, 1, 2, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInErrProcs.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrProcs.setDescription('The number of protocol procedure CLNP Error PDUs received by this entity.') clnpInErrCksums = MibScalar((1, 3, 6, 1, 3, 1, 2, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInErrCksums.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrCksums.setDescription('The number of checksum CLNP Error PDUs received by this entity.') clnpInErrCongests = MibScalar((1, 3, 6, 1, 3, 1, 2, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInErrCongests.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrCongests.setDescription('The number of congestion drop CLNP Error PDUs received by this entity.') clnpInErrHdrs = MibScalar((1, 3, 6, 1, 3, 1, 2, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInErrHdrs.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrHdrs.setDescription('The number of header syntax CLNP Error PDUs received by this entity.') clnpInErrSegs = MibScalar((1, 3, 6, 1, 3, 1, 2, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInErrSegs.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrSegs.setDescription('The number of segmentation disallowed CLNP Error PDUs received by this entity.') clnpInErrIncomps = MibScalar((1, 3, 6, 1, 3, 1, 2, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInErrIncomps.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrIncomps.setDescription('The number of incomplete PDU CLNP Error PDUs received by this entity.') clnpInErrDups = MibScalar((1, 3, 6, 1, 3, 1, 2, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInErrDups.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrDups.setDescription('The number of duplicate option CLNP Error PDUs received by this entity.') clnpInErrUnreachDsts = MibScalar((1, 3, 6, 1, 3, 1, 2, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInErrUnreachDsts.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrUnreachDsts.setDescription('The number of unreachable destination CLNP Error PDUs received by this entity.') clnpInErrUnknownDsts = MibScalar((1, 3, 6, 1, 3, 1, 2, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInErrUnknownDsts.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrUnknownDsts.setDescription('The number of unknown destination CLNP Error PDUs received by this entity.') clnpInErrSRUnspecs = MibScalar((1, 3, 6, 1, 3, 1, 2, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInErrSRUnspecs.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrSRUnspecs.setDescription('The number of unspecified source route CLNP Error PDUs received by this entity.') clnpInErrSRSyntaxes = MibScalar((1, 3, 6, 1, 3, 1, 2, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInErrSRSyntaxes.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrSRSyntaxes.setDescription('The number of source route syntax CLNP Error PDUs received by this entity.') clnpInErrSRUnkAddrs = MibScalar((1, 3, 6, 1, 3, 1, 2, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInErrSRUnkAddrs.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrSRUnkAddrs.setDescription('The number of source route unknown address CLNP Error PDUs received by this entity.') clnpInErrSRBadPaths = MibScalar((1, 3, 6, 1, 3, 1, 2, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInErrSRBadPaths.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrSRBadPaths.setDescription('The number of source route bad path CLNP Error PDUs received by this entity.') clnpInErrHops = MibScalar((1, 3, 6, 1, 3, 1, 2, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInErrHops.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrHops.setDescription('The number of hop count exceeded CLNP Error PDUs received by this entity.') clnpInErrHopReassms = MibScalar((1, 3, 6, 1, 3, 1, 2, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInErrHopReassms.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrHopReassms.setDescription('The number of hop count exceeded while reassembling CLNP Error PDUs received by this entity.') clnpInErrUnsOptions = MibScalar((1, 3, 6, 1, 3, 1, 2, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInErrUnsOptions.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrUnsOptions.setDescription('The number of unsupported option CLNP Error PDUs received by this entity.') clnpInErrUnsVersions = MibScalar((1, 3, 6, 1, 3, 1, 2, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInErrUnsVersions.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrUnsVersions.setDescription('The number of version mismatch CLNP Error PDUs received by this entity.') clnpInErrUnsSecurities = MibScalar((1, 3, 6, 1, 3, 1, 2, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInErrUnsSecurities.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrUnsSecurities.setDescription('The number of unsupported security option CLNP Error PDUs received by this entity.') clnpInErrUnsSRs = MibScalar((1, 3, 6, 1, 3, 1, 2, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInErrUnsSRs.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrUnsSRs.setDescription('The number of unsupported source route option CLNP Error PDUs received by this entity.') clnpInErrUnsRRs = MibScalar((1, 3, 6, 1, 3, 1, 2, 23), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInErrUnsRRs.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrUnsRRs.setDescription('The number of unsupported record route option CLNP Error PDUs received by this entity.') clnpInErrInterferences = MibScalar((1, 3, 6, 1, 3, 1, 2, 24), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpInErrInterferences.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrInterferences.setDescription('The number of reassembly interference CLNP Error PDUs received by this entity.') clnpOutErrUnspecs = MibScalar((1, 3, 6, 1, 3, 1, 2, 25), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutErrUnspecs.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrUnspecs.setDescription('The number of unspecified CLNP Error PDUs sent by this entity.') clnpOutErrProcs = MibScalar((1, 3, 6, 1, 3, 1, 2, 26), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutErrProcs.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrProcs.setDescription('The number of protocol procedure CLNP Error PDUs sent by this entity.') clnpOutErrCksums = MibScalar((1, 3, 6, 1, 3, 1, 2, 27), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutErrCksums.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrCksums.setDescription('The number of checksum CLNP Error PDUs sent by this entity.') clnpOutErrCongests = MibScalar((1, 3, 6, 1, 3, 1, 2, 28), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutErrCongests.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrCongests.setDescription('The number of congestion drop CLNP Error PDUs sent by this entity.') clnpOutErrHdrs = MibScalar((1, 3, 6, 1, 3, 1, 2, 29), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutErrHdrs.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrHdrs.setDescription('The number of header syntax CLNP Error PDUs sent by this entity.') clnpOutErrSegs = MibScalar((1, 3, 6, 1, 3, 1, 2, 30), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutErrSegs.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrSegs.setDescription('The number of segmentation disallowed CLNP Error PDUs sent by this entity.') clnpOutErrIncomps = MibScalar((1, 3, 6, 1, 3, 1, 2, 31), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutErrIncomps.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrIncomps.setDescription('The number of incomplete PDU CLNP Error PDUs sent by this entity.') clnpOutErrDups = MibScalar((1, 3, 6, 1, 3, 1, 2, 32), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutErrDups.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrDups.setDescription('The number of duplicate option CLNP Error PDUs sent by this entity.') clnpOutErrUnreachDsts = MibScalar((1, 3, 6, 1, 3, 1, 2, 33), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutErrUnreachDsts.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrUnreachDsts.setDescription('The number of unreachable destination CLNP Error PDUs sent by this entity.') clnpOutErrUnknownDsts = MibScalar((1, 3, 6, 1, 3, 1, 2, 34), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutErrUnknownDsts.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrUnknownDsts.setDescription('The number of unknown destination CLNP Error PDUs sent by this entity.') clnpOutErrSRUnspecs = MibScalar((1, 3, 6, 1, 3, 1, 2, 35), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutErrSRUnspecs.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrSRUnspecs.setDescription('The number of unspecified source route CLNP Error PDUs sent by this entity.') clnpOutErrSRSyntaxes = MibScalar((1, 3, 6, 1, 3, 1, 2, 36), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutErrSRSyntaxes.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrSRSyntaxes.setDescription('The number of source route syntax CLNP Error PDUs sent by this entity.') clnpOutErrSRUnkAddrs = MibScalar((1, 3, 6, 1, 3, 1, 2, 37), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutErrSRUnkAddrs.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrSRUnkAddrs.setDescription('The number of source route unknown address CLNP Error PDUs sent by this entity.') clnpOutErrSRBadPaths = MibScalar((1, 3, 6, 1, 3, 1, 2, 38), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutErrSRBadPaths.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrSRBadPaths.setDescription('The number of source route bad path CLNP Error PDUs sent by this entity.') clnpOutErrHops = MibScalar((1, 3, 6, 1, 3, 1, 2, 39), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutErrHops.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrHops.setDescription('The number of hop count exceeded CLNP Error PDUs sent by this entity.') clnpOutErrHopReassms = MibScalar((1, 3, 6, 1, 3, 1, 2, 40), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutErrHopReassms.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrHopReassms.setDescription('The number of hop count exceeded while reassembling CLNP Error PDUs sent by this entity.') clnpOutErrUnsOptions = MibScalar((1, 3, 6, 1, 3, 1, 2, 41), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutErrUnsOptions.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrUnsOptions.setDescription('The number of unsupported option CLNP Error PDUs sent by this entity.') clnpOutErrUnsVersions = MibScalar((1, 3, 6, 1, 3, 1, 2, 42), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutErrUnsVersions.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrUnsVersions.setDescription('The number of version mismatch CLNP Error PDUs sent by this entity.') clnpOutErrUnsSecurities = MibScalar((1, 3, 6, 1, 3, 1, 2, 43), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutErrUnsSecurities.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrUnsSecurities.setDescription('The number of unsupported security option CLNP Error PDUs sent by this entity.') clnpOutErrUnsSRs = MibScalar((1, 3, 6, 1, 3, 1, 2, 44), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutErrUnsSRs.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrUnsSRs.setDescription('The number of unsupported source route option CLNP Error PDUs sent by this entity.') clnpOutErrUnsRRs = MibScalar((1, 3, 6, 1, 3, 1, 2, 45), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutErrUnsRRs.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrUnsRRs.setDescription('The number of unsupported record route option CLNP Error PDUs sent by this entity.') clnpOutErrInterferences = MibScalar((1, 3, 6, 1, 3, 1, 2, 46), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: clnpOutErrInterferences.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrInterferences.setDescription('The number of reassembly interference CLNP Error PDUs sent by this entity.') esisESHins = MibScalar((1, 3, 6, 1, 3, 1, 4, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: esisESHins.setStatus('mandatory') if mibBuilder.loadTexts: esisESHins.setDescription('The number of ESH PDUs received by this entity.') esisESHouts = MibScalar((1, 3, 6, 1, 3, 1, 4, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: esisESHouts.setStatus('mandatory') if mibBuilder.loadTexts: esisESHouts.setDescription('The number of ESH PDUs sent by this entity.') esisISHins = MibScalar((1, 3, 6, 1, 3, 1, 4, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: esisISHins.setStatus('mandatory') if mibBuilder.loadTexts: esisISHins.setDescription('The number of ISH PDUs received by this entity.') esisISHouts = MibScalar((1, 3, 6, 1, 3, 1, 4, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: esisISHouts.setStatus('mandatory') if mibBuilder.loadTexts: esisISHouts.setDescription('The number of ISH PDUs sent by this entity.') esisRDUins = MibScalar((1, 3, 6, 1, 3, 1, 4, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: esisRDUins.setStatus('mandatory') if mibBuilder.loadTexts: esisRDUins.setDescription('The number of RDU PDUs received by this entity.') esisRDUouts = MibScalar((1, 3, 6, 1, 3, 1, 4, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: esisRDUouts.setStatus('mandatory') if mibBuilder.loadTexts: esisRDUouts.setDescription('The number of RDU PDUs sent by this entity.') mibBuilder.exportSymbols("CLNS-MIB", clnpInErrSRBadPaths=clnpInErrSRBadPaths, clnpNetToMediaEntry=clnpNetToMediaEntry, esisESHouts=esisESHouts, clnpInOpts=clnpInOpts, clnpInErrProcs=clnpInErrProcs, clnpInHdrErrors=clnpInHdrErrors, clnpAdEntAddr=clnpAdEntAddr, clnpMediaToNetHoldTime=clnpMediaToNetHoldTime, clnpOutErrIncomps=clnpOutErrIncomps, clnpOutErrCksums=clnpOutErrCksums, clnpOutErrHopReassms=clnpOutErrHopReassms, clnpForwarding=clnpForwarding, clnpInErrUnsSRs=clnpInErrUnsSRs, clnpInErrUnsRRs=clnpInErrUnsRRs, clnpInErrSegs=clnpInErrSegs, clnpInErrHops=clnpInErrHops, clnpNetToMediaIfIndex=clnpNetToMediaIfIndex, clnpAdEntReasmMaxSize=clnpAdEntReasmMaxSize, clnpInErrSRSyntaxes=clnpInErrSRSyntaxes, clnpInDiscards=clnpInDiscards, clnpOutErrSRUnkAddrs=clnpOutErrSRUnkAddrs, clnpRouteEntry=clnpRouteEntry, clnpInErrUnsOptions=clnpInErrUnsOptions, clnpOutErrInterferences=clnpOutErrInterferences, clnpAddrTable=clnpAddrTable, clnpOutErrSRBadPaths=clnpOutErrSRBadPaths, clnpDefaultLifeTime=clnpDefaultLifeTime, clnpInErrUnknownDsts=clnpInErrUnknownDsts, clnpForwPDUs=clnpForwPDUs, clnpOutDiscards=clnpOutDiscards, clnpReasmOKs=clnpReasmOKs, clnpReasmReqds=clnpReasmReqds, clnpInErrUnsVersions=clnpInErrUnsVersions, error=error, clnpInErrInterferences=clnpInErrInterferences, clnpOutErrProcs=clnpOutErrProcs, clnpOutErrCongests=clnpOutErrCongests, clnpInUnknownNLPs=clnpInUnknownNLPs, clnpNetToMediaPhysAddress=clnpNetToMediaPhysAddress, clnpMediaToNetTable=clnpMediaToNetTable, clnpMediaToNetAddress=clnpMediaToNetAddress, clnpInErrCksums=clnpInErrCksums, clnpInErrors=clnpInErrors, clnpOutRequests=clnpOutRequests, clnpNetToMediaAge=clnpNetToMediaAge, clnpInErrHdrs=clnpInErrHdrs, clnpRouteMetric2=clnpRouteMetric2, clnpInErrHopReassms=clnpInErrHopReassms, clnpNetToMediaTable=clnpNetToMediaTable, clnpInDelivers=clnpInDelivers, clnpInErrUnsSecurities=clnpInErrUnsSecurities, clnpRouteMetric5=clnpRouteMetric5, clnpMediaToNetType=clnpMediaToNetType, clnpOutErrSRSyntaxes=clnpOutErrSRSyntaxes, clnpRouteAge=clnpRouteAge, clnpOutErrUnsSRs=clnpOutErrUnsSRs, clnpMediaToNetEntry=clnpMediaToNetEntry, clnpOutErrUnknownDsts=clnpOutErrUnknownDsts, clnpOutOpts=clnpOutOpts, clnpInAddrErrors=clnpInAddrErrors, ClnpAddress=ClnpAddress, clnpOutErrHops=clnpOutErrHops, clnpInErrSRUnspecs=clnpInErrSRUnspecs, clnpAdEntIfIndex=clnpAdEntIfIndex, clnpRoutingTable=clnpRoutingTable, clnpRouteIfIndex=clnpRouteIfIndex, clnpInErrCongests=clnpInErrCongests, clnpOutErrSegs=clnpOutErrSegs, clnpOutErrUnreachDsts=clnpOutErrUnreachDsts, clnpRouteType=clnpRouteType, clnpInErrIncomps=clnpInErrIncomps, esisISHouts=esisISHouts, clnpRouteInfo=clnpRouteInfo, clnpOutErrHdrs=clnpOutErrHdrs, esisRDUins=esisRDUins, esisISHins=esisISHins, clnpInErrUnspecs=clnpInErrUnspecs, clnp=clnp, clnpMediaToNetPhysAddress=clnpMediaToNetPhysAddress, clnpRouteProto=clnpRouteProto, clnpNetToMediaHoldTime=clnpNetToMediaHoldTime, esisESHins=esisESHins, clnpAddrEntry=clnpAddrEntry, clnpOutErrSRUnspecs=clnpOutErrSRUnspecs, clnpOutErrors=clnpOutErrors, clnpOutErrUnsRRs=clnpOutErrUnsRRs, clnpReasmTimeout=clnpReasmTimeout, clnpReasmFails=clnpReasmFails, clnpRoutingDiscards=clnpRoutingDiscards, clns=clns, clnpNetToMediaType=clnpNetToMediaType, es_is=es_is, esisRDUouts=esisRDUouts, clnpInUnknownULPs=clnpInUnknownULPs, clnpOutErrDups=clnpOutErrDups, clnpInErrSRUnkAddrs=clnpInErrSRUnkAddrs, clnpSegOKs=clnpSegOKs, clnpRouteMetric3=clnpRouteMetric3, clnpRouteNextHop=clnpRouteNextHop, clnpOutErrUnsOptions=clnpOutErrUnsOptions, clnpOutErrUnsSecurities=clnpOutErrUnsSecurities, clnpRouteMetric1=clnpRouteMetric1, echo=echo, clnpRouteMetric4=clnpRouteMetric4, clnpNetToMediaNetAddress=clnpNetToMediaNetAddress, clnpOutNoRoutes=clnpOutNoRoutes, clnpOutErrUnsVersions=clnpOutErrUnsVersions, clnpInReceives=clnpInReceives, clnpOutErrUnspecs=clnpOutErrUnspecs, clnpSegFails=clnpSegFails, clnpInErrDups=clnpInErrDups, clnpInErrUnreachDsts=clnpInErrUnreachDsts, clnpMediaToNetAge=clnpMediaToNetAge, clnpRouteDest=clnpRouteDest, clnpMediaToNetIfIndex=clnpMediaToNetIfIndex, clnpSegCreates=clnpSegCreates)
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, value_range_constraint, constraints_union, value_size_constraint, single_value_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'ValueRangeConstraint', 'ConstraintsUnion', 'ValueSizeConstraint', 'SingleValueConstraint') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (counter32, experimental, time_ticks, iso, module_identity, mib_identifier, object_identity, counter64, notification_type, unsigned32, bits, gauge32, integer32, ip_address, mib_scalar, mib_table, mib_table_row, mib_table_column) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter32', 'experimental', 'TimeTicks', 'iso', 'ModuleIdentity', 'MibIdentifier', 'ObjectIdentity', 'Counter64', 'NotificationType', 'Unsigned32', 'Bits', 'Gauge32', 'Integer32', 'IpAddress', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn') (display_string, textual_convention, phys_address) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention', 'PhysAddress') clns = mib_identifier((1, 3, 6, 1, 3, 1)) class Clnpaddress(OctetString): subtype_spec = OctetString.subtypeSpec + value_size_constraint(1, 21) clnp = mib_identifier((1, 3, 6, 1, 3, 1, 1)) error = mib_identifier((1, 3, 6, 1, 3, 1, 2)) echo = mib_identifier((1, 3, 6, 1, 3, 1, 3)) es_is = mib_identifier((1, 3, 6, 1, 3, 1, 4)).setLabel('es-is') clnp_forwarding = mib_scalar((1, 3, 6, 1, 3, 1, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('is', 1), ('es', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: clnpForwarding.setStatus('mandatory') if mibBuilder.loadTexts: clnpForwarding.setDescription('The indication of whether this entity is active as an intermediate or end system. Only intermediate systems will forward PDUs onward that are not addressed to them.') clnp_default_life_time = mib_scalar((1, 3, 6, 1, 3, 1, 1, 2), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: clnpDefaultLifeTime.setStatus('mandatory') if mibBuilder.loadTexts: clnpDefaultLifeTime.setDescription('The default value inserted into the Lifetime field of the CLNP PDU header of PDUs sourced by this entity.') clnp_in_receives = mib_scalar((1, 3, 6, 1, 3, 1, 1, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInReceives.setStatus('mandatory') if mibBuilder.loadTexts: clnpInReceives.setDescription('The total number of input PDUs received from all connected network interfaces running CLNP, including errors.') clnp_in_hdr_errors = mib_scalar((1, 3, 6, 1, 3, 1, 1, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInHdrErrors.setStatus('mandatory') if mibBuilder.loadTexts: clnpInHdrErrors.setDescription('The number of input PDUs discarded due to errors in the CLNP header, including bad checksums, version mismatch, lifetime exceeded, errors discovered in processing options, etc.') clnp_in_addr_errors = mib_scalar((1, 3, 6, 1, 3, 1, 1, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInAddrErrors.setStatus('mandatory') if mibBuilder.loadTexts: clnpInAddrErrors.setDescription("The number of input PDUs discarded because the NSAP address in the CLNP header's destination field was not a valid NSAP to be received at this entity. This count includes addresses not understood. For end systems, this is a count of PDUs which arrived with a destination NSAP which was not local.") clnp_forw_pd_us = mib_scalar((1, 3, 6, 1, 3, 1, 1, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpForwPDUs.setStatus('mandatory') if mibBuilder.loadTexts: clnpForwPDUs.setDescription('The number of input PDUs for which this entity was not the final destination and which an attempt was made to forward them onward.') clnp_in_unknown_nl_ps = mib_scalar((1, 3, 6, 1, 3, 1, 1, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInUnknownNLPs.setStatus('mandatory') if mibBuilder.loadTexts: clnpInUnknownNLPs.setDescription('The number of locally-addressed PDUs successfully received but discarded because the network layer protocol was unknown or unsupported (e.g., not CLNP or ES-IS).') clnp_in_unknown_ul_ps = mib_scalar((1, 3, 6, 1, 3, 1, 1, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInUnknownULPs.setStatus('mandatory') if mibBuilder.loadTexts: clnpInUnknownULPs.setDescription('The number of locally-addressed PDUs successfully received but discarded because the upper layer protocol was unknown or unsupported (e.g., not TP4).') clnp_in_discards = mib_scalar((1, 3, 6, 1, 3, 1, 1, 9), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInDiscards.setStatus('mandatory') if mibBuilder.loadTexts: clnpInDiscards.setDescription('The number of input CLNP PDUs for which no problems were encountered to prevent their continued processing, but were discarded (e.g., for lack of buffer space). Note that this counter does not include any PDUs discarded while awaiting re-assembly.') clnp_in_delivers = mib_scalar((1, 3, 6, 1, 3, 1, 1, 10), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInDelivers.setStatus('mandatory') if mibBuilder.loadTexts: clnpInDelivers.setDescription('The total number of input PDUs successfully delivered to the CLNS transport user.') clnp_out_requests = mib_scalar((1, 3, 6, 1, 3, 1, 1, 11), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutRequests.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutRequests.setDescription('The total number of CLNP PDUs which local CLNS user protocols supplied to CLNP for transmission requests. This counter does not include any PDUs counted in clnpForwPDUs.') clnp_out_discards = mib_scalar((1, 3, 6, 1, 3, 1, 1, 12), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutDiscards.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutDiscards.setDescription('The number of output CLNP PDUs for which no other problem was encountered to prevent their transmission but were discarded (e.g., for lack of buffer space). Note this counter includes PDUs counted in clnpForwPDUs.') clnp_out_no_routes = mib_scalar((1, 3, 6, 1, 3, 1, 1, 13), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutNoRoutes.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutNoRoutes.setDescription('The number of CLNP PDUs discarded because no route could be found to transmit them to their destination. This counter includes any PDUs counted in clnpForwPDUs.') clnp_reasm_timeout = mib_scalar((1, 3, 6, 1, 3, 1, 1, 14), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpReasmTimeout.setStatus('mandatory') if mibBuilder.loadTexts: clnpReasmTimeout.setDescription('The maximum number of seconds which received segments are held while they are awaiting reassembly at this entity.') clnp_reasm_reqds = mib_scalar((1, 3, 6, 1, 3, 1, 1, 15), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpReasmReqds.setStatus('mandatory') if mibBuilder.loadTexts: clnpReasmReqds.setDescription('The number of CLNP segments received which needed to be reassembled at this entity.') clnp_reasm_o_ks = mib_scalar((1, 3, 6, 1, 3, 1, 1, 16), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpReasmOKs.setStatus('mandatory') if mibBuilder.loadTexts: clnpReasmOKs.setDescription('The number of CLNP PDUs successfully re-assembled at this entity.') clnp_reasm_fails = mib_scalar((1, 3, 6, 1, 3, 1, 1, 17), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpReasmFails.setStatus('mandatory') if mibBuilder.loadTexts: clnpReasmFails.setDescription('The number of failures detected by the CLNP reassembly algorithm (for any reason: timed out, buffer size, etc).') clnp_seg_o_ks = mib_scalar((1, 3, 6, 1, 3, 1, 1, 18), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpSegOKs.setStatus('mandatory') if mibBuilder.loadTexts: clnpSegOKs.setDescription('The number of CLNP PDUs that have been successfully segmented at this entity.') clnp_seg_fails = mib_scalar((1, 3, 6, 1, 3, 1, 1, 19), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpSegFails.setStatus('mandatory') if mibBuilder.loadTexts: clnpSegFails.setDescription('The number of CLNP PDUs that have been discarded because they needed to be fragmented at this entity but could not.') clnp_seg_creates = mib_scalar((1, 3, 6, 1, 3, 1, 1, 20), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpSegCreates.setStatus('mandatory') if mibBuilder.loadTexts: clnpSegCreates.setDescription('The number of CLNP PDU segments that have been generated as a result of segmentation at this entity.') clnp_in_opts = mib_scalar((1, 3, 6, 1, 3, 1, 1, 25), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInOpts.setStatus('mandatory') if mibBuilder.loadTexts: clnpInOpts.setDescription('The number of CLNP PDU segments that have been input with options at this entity.') clnp_out_opts = mib_scalar((1, 3, 6, 1, 3, 1, 1, 26), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutOpts.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutOpts.setDescription('The number of CLNP PDU segments that have been generated with options by this entity.') clnp_routing_discards = mib_scalar((1, 3, 6, 1, 3, 1, 1, 27), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpRoutingDiscards.setStatus('mandatory') if mibBuilder.loadTexts: clnpRoutingDiscards.setDescription('The number of routing entries which were chosen to be discarded even though they are valid. One possible reason for discarding such an entry could be to free-up buffer space for other routing entries.') clnp_addr_table = mib_table((1, 3, 6, 1, 3, 1, 1, 21)) if mibBuilder.loadTexts: clnpAddrTable.setStatus('mandatory') if mibBuilder.loadTexts: clnpAddrTable.setDescription("The table of addressing information relevant to this entity's CLNP addresses. ") clnp_addr_entry = mib_table_row((1, 3, 6, 1, 3, 1, 1, 21, 1)).setIndexNames((0, 'CLNS-MIB', 'clnpAdEntAddr')) if mibBuilder.loadTexts: clnpAddrEntry.setStatus('mandatory') if mibBuilder.loadTexts: clnpAddrEntry.setDescription("The addressing information for one of this entity's CLNP addresses.") clnp_ad_ent_addr = mib_table_column((1, 3, 6, 1, 3, 1, 1, 21, 1, 1), clnp_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpAdEntAddr.setStatus('mandatory') if mibBuilder.loadTexts: clnpAdEntAddr.setDescription("The CLNP address to which this entry's addressing information pertains.") clnp_ad_ent_if_index = mib_table_column((1, 3, 6, 1, 3, 1, 1, 21, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpAdEntIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: clnpAdEntIfIndex.setDescription('The index value which uniquely identifies the interface to which this entry is applicable. The interface identified by a particular value of this index is the same interface as identified by the same value of ifIndex.') clnp_ad_ent_reasm_max_size = mib_table_column((1, 3, 6, 1, 3, 1, 1, 21, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpAdEntReasmMaxSize.setStatus('mandatory') if mibBuilder.loadTexts: clnpAdEntReasmMaxSize.setDescription('The size of the largest CLNP PDU which this entity can re-assemble from incoming CLNP segmented PDUs received on this interface.') clnp_routing_table = mib_table((1, 3, 6, 1, 3, 1, 1, 22)) if mibBuilder.loadTexts: clnpRoutingTable.setStatus('mandatory') if mibBuilder.loadTexts: clnpRoutingTable.setDescription("This entity's CLNP routing table.") clnp_route_entry = mib_table_row((1, 3, 6, 1, 3, 1, 1, 22, 1)).setIndexNames((0, 'CLNS-MIB', 'clnpRouteDest')) if mibBuilder.loadTexts: clnpRouteEntry.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteEntry.setDescription('A route to a particular destination.') clnp_route_dest = mib_table_column((1, 3, 6, 1, 3, 1, 1, 22, 1, 1), clnp_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: clnpRouteDest.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteDest.setDescription('The destination CLNP address of this route.') clnp_route_if_index = mib_table_column((1, 3, 6, 1, 3, 1, 1, 22, 1, 2), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: clnpRouteIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteIfIndex.setDescription('The index value which uniquely identifies the local interface through which the next hop of this route should be reached. The interface identified by a particular value of this index is the same as identified by the same value of ifIndex.') clnp_route_metric1 = mib_table_column((1, 3, 6, 1, 3, 1, 1, 22, 1, 3), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: clnpRouteMetric1.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteMetric1.setDescription("The primary routing metric for this route. The semantics of this metric are determined by the routing-protocol specified in the route's clnpRouteProto value. If this metric is not used, its value should be set to -1.") clnp_route_metric2 = mib_table_column((1, 3, 6, 1, 3, 1, 1, 22, 1, 4), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: clnpRouteMetric2.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteMetric2.setDescription("An alternate routing metric for this route. The semantics of this metric are determined by the routing-protocol specified in the route's clnpRouteProto value. If this metric is not used, its value should be set to -1.") clnp_route_metric3 = mib_table_column((1, 3, 6, 1, 3, 1, 1, 22, 1, 5), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: clnpRouteMetric3.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteMetric3.setDescription("An alternate routing metric for this route. The semantics of this metric are determined by the routing-protocol specified in the route's clnpRouteProto value. If this metric is not used, its value should be set to -1.") clnp_route_metric4 = mib_table_column((1, 3, 6, 1, 3, 1, 1, 22, 1, 6), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: clnpRouteMetric4.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteMetric4.setDescription("An alternate routing metric for this route. The semantics of this metric are determined by the routing-protocol specified in the route's clnpRouteProto value. If this metric is not used, its value should be set to -1.") clnp_route_next_hop = mib_table_column((1, 3, 6, 1, 3, 1, 1, 22, 1, 7), clnp_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: clnpRouteNextHop.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteNextHop.setDescription('The CLNP address of the next hop of this route.') clnp_route_type = mib_table_column((1, 3, 6, 1, 3, 1, 1, 22, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('other', 1), ('invalid', 2), ('direct', 3), ('remote', 4)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: clnpRouteType.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteType.setDescription('The type of route. Setting this object to the value invalid(2) has the effect of invaliding the corresponding entry in the clnpRoutingTable. That is, it effectively dissasociates the destination identified with said entry from the route identified with said entry. It is an implementation-specific matter as to whether the agent removes an invalidated entry from the table. Accordingly, management stations must be prepared to receive tabular information from agents that corresponds to entries not currently in use. Proper interpretation of such entries requires examination of the relevant clnpRouteType object.') clnp_route_proto = mib_table_column((1, 3, 6, 1, 3, 1, 1, 22, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 9, 11, 12, 13, 14))).clone(namedValues=named_values(('other', 1), ('local', 2), ('netmgmt', 3), ('is-is', 9), ('ciscoIgrp', 11), ('bbnSpfIgp', 12), ('ospf', 13), ('bgp', 14)))).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpRouteProto.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteProto.setDescription('The routing mechanism via which this route was learned. Inclusion of values for gateway routing protocols is not intended to imply that hosts should support those protocols.') clnp_route_age = mib_table_column((1, 3, 6, 1, 3, 1, 1, 22, 1, 10), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: clnpRouteAge.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteAge.setDescription("The number of seconds since this route was last updated or otherwise determined to be correct. Note that no semantics of `too old' can be implied except through knowledge of the routing protocol by which the route was learned.") clnp_route_metric5 = mib_table_column((1, 3, 6, 1, 3, 1, 1, 22, 1, 11), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: clnpRouteMetric5.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteMetric5.setDescription("An alternate routing metric for this route. The semantics of this metric are determined by the routing-protocol specified in the route's clnpRouteProto value. If this metric is not used, its value should be set to -1.") clnp_route_info = mib_table_column((1, 3, 6, 1, 3, 1, 1, 22, 1, 12), object_identifier()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpRouteInfo.setStatus('mandatory') if mibBuilder.loadTexts: clnpRouteInfo.setDescription("A reference to MIB definitions specific to the particular routing protocol which is responsible for this route, as determined by the value specified in the route's clnpRouteProto value. If this information is not present, its value should be set to the OBJECT IDENTIFIER { 0 0 }, which is a syntatically valid object identifier, and any conformant implementation of ASN.1 and BER must be able to generate and recognize this value.") clnp_net_to_media_table = mib_table((1, 3, 6, 1, 3, 1, 1, 23)) if mibBuilder.loadTexts: clnpNetToMediaTable.setStatus('mandatory') if mibBuilder.loadTexts: clnpNetToMediaTable.setDescription('The CLNP Address Translation table used for mapping from CLNP addresses to physical addresses.') clnp_net_to_media_entry = mib_table_row((1, 3, 6, 1, 3, 1, 1, 23, 1)).setIndexNames((0, 'CLNS-MIB', 'clnpNetToMediaIfIndex'), (0, 'CLNS-MIB', 'clnpNetToMediaNetAddress')) if mibBuilder.loadTexts: clnpNetToMediaEntry.setStatus('mandatory') if mibBuilder.loadTexts: clnpNetToMediaEntry.setDescription("Each entry contains one CLNP address to `physical' address equivalence.") clnp_net_to_media_if_index = mib_table_column((1, 3, 6, 1, 3, 1, 1, 23, 1, 1), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: clnpNetToMediaIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: clnpNetToMediaIfIndex.setDescription("The interface on which this entry's equivalence is effective. The interface identified by a particular value of this index is the same interface as identified by the same value of ifIndex.") clnp_net_to_media_phys_address = mib_table_column((1, 3, 6, 1, 3, 1, 1, 23, 1, 2), phys_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: clnpNetToMediaPhysAddress.setStatus('mandatory') if mibBuilder.loadTexts: clnpNetToMediaPhysAddress.setDescription("The media-dependent `physical' address.") clnp_net_to_media_net_address = mib_table_column((1, 3, 6, 1, 3, 1, 1, 23, 1, 3), clnp_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: clnpNetToMediaNetAddress.setStatus('mandatory') if mibBuilder.loadTexts: clnpNetToMediaNetAddress.setDescription("The CLNP address corresponding to the media- dependent `physical' address.") clnp_net_to_media_type = mib_table_column((1, 3, 6, 1, 3, 1, 1, 23, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('other', 1), ('invalid', 2), ('dynamic', 3), ('static', 4)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: clnpNetToMediaType.setStatus('mandatory') if mibBuilder.loadTexts: clnpNetToMediaType.setDescription('The type of mapping. Setting this object to the value invalid(2) has the effect of invalidating the corresponding entry in the clnpNetToMediaTable. That is, it effectively dissassociates the interface identified with said entry from the mapping identified with said entry. It is an implementation-specific matter as to whether the agent removes an invalidated entry from the table. Accordingly, management stations must be prepared to receive tabular information from agents that corresponds to entries not currently in use. Proper interpretation of such entries requires examination of the relevant clnpNetToMediaType object.') clnp_net_to_media_age = mib_table_column((1, 3, 6, 1, 3, 1, 1, 23, 1, 5), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: clnpNetToMediaAge.setStatus('mandatory') if mibBuilder.loadTexts: clnpNetToMediaAge.setDescription("The number of seconds since this entry was last updated or otherwise determined to be correct. Note that no semantics of `too old' can be implied except through knowledge of the type of entry.") clnp_net_to_media_hold_time = mib_table_column((1, 3, 6, 1, 3, 1, 1, 23, 1, 6), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: clnpNetToMediaHoldTime.setStatus('mandatory') if mibBuilder.loadTexts: clnpNetToMediaHoldTime.setDescription('The time in seconds this entry will be valid. Static entries should always report this field as -1.') clnp_media_to_net_table = mib_table((1, 3, 6, 1, 3, 1, 1, 24)) if mibBuilder.loadTexts: clnpMediaToNetTable.setStatus('mandatory') if mibBuilder.loadTexts: clnpMediaToNetTable.setDescription('The CLNP Address Translation table used for mapping from physical addresses to CLNP addresses.') clnp_media_to_net_entry = mib_table_row((1, 3, 6, 1, 3, 1, 1, 24, 1)).setIndexNames((0, 'CLNS-MIB', 'clnpMediaToNetIfIndex'), (0, 'CLNS-MIB', 'clnpMediaToNetPhysAddress')) if mibBuilder.loadTexts: clnpMediaToNetEntry.setStatus('mandatory') if mibBuilder.loadTexts: clnpMediaToNetEntry.setDescription("Each entry contains on ClnpAddress to `physical' address equivalence.") clnp_media_to_net_if_index = mib_table_column((1, 3, 6, 1, 3, 1, 1, 24, 1, 1), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: clnpMediaToNetIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: clnpMediaToNetIfIndex.setDescription("The interface on which this entry's equivalence is effective. The interface identified by a particular value of this index is the same interface as identified by the same value of ifIndex.") clnp_media_to_net_address = mib_scalar((1, 3, 6, 1, 3, 1, 1, 24, 1, 2), clnp_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: clnpMediaToNetAddress.setStatus('mandatory') if mibBuilder.loadTexts: clnpMediaToNetAddress.setDescription("The ClnpAddress corresponding to the media- dependent `physical' address.") clnp_media_to_net_phys_address = mib_table_column((1, 3, 6, 1, 3, 1, 1, 24, 1, 3), phys_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: clnpMediaToNetPhysAddress.setStatus('mandatory') if mibBuilder.loadTexts: clnpMediaToNetPhysAddress.setDescription("The media-dependent `physical' address.") clnp_media_to_net_type = mib_table_column((1, 3, 6, 1, 3, 1, 1, 24, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('other', 1), ('invalid', 2), ('dynamic', 3), ('static', 4)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: clnpMediaToNetType.setStatus('mandatory') if mibBuilder.loadTexts: clnpMediaToNetType.setDescription('The type of mapping. Setting this object to the value invalid(2) has the effect of invalidating the corresponding entry in the clnpMediaToNetTable. That is, it effectively dissassociates the interface identified with said entry from the mapping identified with said entry. It is an implementation-specific matter as to whether the agent removes an invalidated entry from the table. Accordingly, management stations must be prepared to receive tabular information from agents that corresponds to entries not currently in use. Proper interpretation of such entries requires examination of the relevant clnpMediaToNetType object.') clnp_media_to_net_age = mib_table_column((1, 3, 6, 1, 3, 1, 1, 24, 1, 5), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: clnpMediaToNetAge.setStatus('mandatory') if mibBuilder.loadTexts: clnpMediaToNetAge.setDescription("The number of seconds since this entry was last updated or otherwise determined to be correct. Note that no semantics of `too old' can be implied except through knowledge of the type of entry.") clnp_media_to_net_hold_time = mib_table_column((1, 3, 6, 1, 3, 1, 1, 24, 1, 6), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: clnpMediaToNetHoldTime.setStatus('mandatory') if mibBuilder.loadTexts: clnpMediaToNetHoldTime.setDescription('The time in seconds this entry will be valid. Static entries should always report this field as -1.') clnp_in_errors = mib_scalar((1, 3, 6, 1, 3, 1, 2, 1), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInErrors.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrors.setDescription('The number of CLNP Error PDUs received by this entity.') clnp_out_errors = mib_scalar((1, 3, 6, 1, 3, 1, 2, 2), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutErrors.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrors.setDescription('The number of CLNP Error PDUs sent by this entity.') clnp_in_err_unspecs = mib_scalar((1, 3, 6, 1, 3, 1, 2, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInErrUnspecs.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrUnspecs.setDescription('The number of unspecified CLNP Error PDUs received by this entity.') clnp_in_err_procs = mib_scalar((1, 3, 6, 1, 3, 1, 2, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInErrProcs.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrProcs.setDescription('The number of protocol procedure CLNP Error PDUs received by this entity.') clnp_in_err_cksums = mib_scalar((1, 3, 6, 1, 3, 1, 2, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInErrCksums.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrCksums.setDescription('The number of checksum CLNP Error PDUs received by this entity.') clnp_in_err_congests = mib_scalar((1, 3, 6, 1, 3, 1, 2, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInErrCongests.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrCongests.setDescription('The number of congestion drop CLNP Error PDUs received by this entity.') clnp_in_err_hdrs = mib_scalar((1, 3, 6, 1, 3, 1, 2, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInErrHdrs.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrHdrs.setDescription('The number of header syntax CLNP Error PDUs received by this entity.') clnp_in_err_segs = mib_scalar((1, 3, 6, 1, 3, 1, 2, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInErrSegs.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrSegs.setDescription('The number of segmentation disallowed CLNP Error PDUs received by this entity.') clnp_in_err_incomps = mib_scalar((1, 3, 6, 1, 3, 1, 2, 9), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInErrIncomps.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrIncomps.setDescription('The number of incomplete PDU CLNP Error PDUs received by this entity.') clnp_in_err_dups = mib_scalar((1, 3, 6, 1, 3, 1, 2, 10), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInErrDups.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrDups.setDescription('The number of duplicate option CLNP Error PDUs received by this entity.') clnp_in_err_unreach_dsts = mib_scalar((1, 3, 6, 1, 3, 1, 2, 11), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInErrUnreachDsts.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrUnreachDsts.setDescription('The number of unreachable destination CLNP Error PDUs received by this entity.') clnp_in_err_unknown_dsts = mib_scalar((1, 3, 6, 1, 3, 1, 2, 12), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInErrUnknownDsts.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrUnknownDsts.setDescription('The number of unknown destination CLNP Error PDUs received by this entity.') clnp_in_err_sr_unspecs = mib_scalar((1, 3, 6, 1, 3, 1, 2, 13), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInErrSRUnspecs.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrSRUnspecs.setDescription('The number of unspecified source route CLNP Error PDUs received by this entity.') clnp_in_err_sr_syntaxes = mib_scalar((1, 3, 6, 1, 3, 1, 2, 14), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInErrSRSyntaxes.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrSRSyntaxes.setDescription('The number of source route syntax CLNP Error PDUs received by this entity.') clnp_in_err_sr_unk_addrs = mib_scalar((1, 3, 6, 1, 3, 1, 2, 15), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInErrSRUnkAddrs.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrSRUnkAddrs.setDescription('The number of source route unknown address CLNP Error PDUs received by this entity.') clnp_in_err_sr_bad_paths = mib_scalar((1, 3, 6, 1, 3, 1, 2, 16), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInErrSRBadPaths.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrSRBadPaths.setDescription('The number of source route bad path CLNP Error PDUs received by this entity.') clnp_in_err_hops = mib_scalar((1, 3, 6, 1, 3, 1, 2, 17), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInErrHops.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrHops.setDescription('The number of hop count exceeded CLNP Error PDUs received by this entity.') clnp_in_err_hop_reassms = mib_scalar((1, 3, 6, 1, 3, 1, 2, 18), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInErrHopReassms.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrHopReassms.setDescription('The number of hop count exceeded while reassembling CLNP Error PDUs received by this entity.') clnp_in_err_uns_options = mib_scalar((1, 3, 6, 1, 3, 1, 2, 19), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInErrUnsOptions.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrUnsOptions.setDescription('The number of unsupported option CLNP Error PDUs received by this entity.') clnp_in_err_uns_versions = mib_scalar((1, 3, 6, 1, 3, 1, 2, 20), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInErrUnsVersions.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrUnsVersions.setDescription('The number of version mismatch CLNP Error PDUs received by this entity.') clnp_in_err_uns_securities = mib_scalar((1, 3, 6, 1, 3, 1, 2, 21), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInErrUnsSecurities.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrUnsSecurities.setDescription('The number of unsupported security option CLNP Error PDUs received by this entity.') clnp_in_err_uns_s_rs = mib_scalar((1, 3, 6, 1, 3, 1, 2, 22), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInErrUnsSRs.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrUnsSRs.setDescription('The number of unsupported source route option CLNP Error PDUs received by this entity.') clnp_in_err_uns_r_rs = mib_scalar((1, 3, 6, 1, 3, 1, 2, 23), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInErrUnsRRs.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrUnsRRs.setDescription('The number of unsupported record route option CLNP Error PDUs received by this entity.') clnp_in_err_interferences = mib_scalar((1, 3, 6, 1, 3, 1, 2, 24), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpInErrInterferences.setStatus('mandatory') if mibBuilder.loadTexts: clnpInErrInterferences.setDescription('The number of reassembly interference CLNP Error PDUs received by this entity.') clnp_out_err_unspecs = mib_scalar((1, 3, 6, 1, 3, 1, 2, 25), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutErrUnspecs.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrUnspecs.setDescription('The number of unspecified CLNP Error PDUs sent by this entity.') clnp_out_err_procs = mib_scalar((1, 3, 6, 1, 3, 1, 2, 26), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutErrProcs.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrProcs.setDescription('The number of protocol procedure CLNP Error PDUs sent by this entity.') clnp_out_err_cksums = mib_scalar((1, 3, 6, 1, 3, 1, 2, 27), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutErrCksums.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrCksums.setDescription('The number of checksum CLNP Error PDUs sent by this entity.') clnp_out_err_congests = mib_scalar((1, 3, 6, 1, 3, 1, 2, 28), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutErrCongests.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrCongests.setDescription('The number of congestion drop CLNP Error PDUs sent by this entity.') clnp_out_err_hdrs = mib_scalar((1, 3, 6, 1, 3, 1, 2, 29), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutErrHdrs.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrHdrs.setDescription('The number of header syntax CLNP Error PDUs sent by this entity.') clnp_out_err_segs = mib_scalar((1, 3, 6, 1, 3, 1, 2, 30), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutErrSegs.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrSegs.setDescription('The number of segmentation disallowed CLNP Error PDUs sent by this entity.') clnp_out_err_incomps = mib_scalar((1, 3, 6, 1, 3, 1, 2, 31), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutErrIncomps.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrIncomps.setDescription('The number of incomplete PDU CLNP Error PDUs sent by this entity.') clnp_out_err_dups = mib_scalar((1, 3, 6, 1, 3, 1, 2, 32), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutErrDups.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrDups.setDescription('The number of duplicate option CLNP Error PDUs sent by this entity.') clnp_out_err_unreach_dsts = mib_scalar((1, 3, 6, 1, 3, 1, 2, 33), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutErrUnreachDsts.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrUnreachDsts.setDescription('The number of unreachable destination CLNP Error PDUs sent by this entity.') clnp_out_err_unknown_dsts = mib_scalar((1, 3, 6, 1, 3, 1, 2, 34), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutErrUnknownDsts.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrUnknownDsts.setDescription('The number of unknown destination CLNP Error PDUs sent by this entity.') clnp_out_err_sr_unspecs = mib_scalar((1, 3, 6, 1, 3, 1, 2, 35), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutErrSRUnspecs.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrSRUnspecs.setDescription('The number of unspecified source route CLNP Error PDUs sent by this entity.') clnp_out_err_sr_syntaxes = mib_scalar((1, 3, 6, 1, 3, 1, 2, 36), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutErrSRSyntaxes.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrSRSyntaxes.setDescription('The number of source route syntax CLNP Error PDUs sent by this entity.') clnp_out_err_sr_unk_addrs = mib_scalar((1, 3, 6, 1, 3, 1, 2, 37), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutErrSRUnkAddrs.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrSRUnkAddrs.setDescription('The number of source route unknown address CLNP Error PDUs sent by this entity.') clnp_out_err_sr_bad_paths = mib_scalar((1, 3, 6, 1, 3, 1, 2, 38), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutErrSRBadPaths.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrSRBadPaths.setDescription('The number of source route bad path CLNP Error PDUs sent by this entity.') clnp_out_err_hops = mib_scalar((1, 3, 6, 1, 3, 1, 2, 39), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutErrHops.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrHops.setDescription('The number of hop count exceeded CLNP Error PDUs sent by this entity.') clnp_out_err_hop_reassms = mib_scalar((1, 3, 6, 1, 3, 1, 2, 40), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutErrHopReassms.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrHopReassms.setDescription('The number of hop count exceeded while reassembling CLNP Error PDUs sent by this entity.') clnp_out_err_uns_options = mib_scalar((1, 3, 6, 1, 3, 1, 2, 41), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutErrUnsOptions.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrUnsOptions.setDescription('The number of unsupported option CLNP Error PDUs sent by this entity.') clnp_out_err_uns_versions = mib_scalar((1, 3, 6, 1, 3, 1, 2, 42), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutErrUnsVersions.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrUnsVersions.setDescription('The number of version mismatch CLNP Error PDUs sent by this entity.') clnp_out_err_uns_securities = mib_scalar((1, 3, 6, 1, 3, 1, 2, 43), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutErrUnsSecurities.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrUnsSecurities.setDescription('The number of unsupported security option CLNP Error PDUs sent by this entity.') clnp_out_err_uns_s_rs = mib_scalar((1, 3, 6, 1, 3, 1, 2, 44), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutErrUnsSRs.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrUnsSRs.setDescription('The number of unsupported source route option CLNP Error PDUs sent by this entity.') clnp_out_err_uns_r_rs = mib_scalar((1, 3, 6, 1, 3, 1, 2, 45), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutErrUnsRRs.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrUnsRRs.setDescription('The number of unsupported record route option CLNP Error PDUs sent by this entity.') clnp_out_err_interferences = mib_scalar((1, 3, 6, 1, 3, 1, 2, 46), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: clnpOutErrInterferences.setStatus('mandatory') if mibBuilder.loadTexts: clnpOutErrInterferences.setDescription('The number of reassembly interference CLNP Error PDUs sent by this entity.') esis_es_hins = mib_scalar((1, 3, 6, 1, 3, 1, 4, 1), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: esisESHins.setStatus('mandatory') if mibBuilder.loadTexts: esisESHins.setDescription('The number of ESH PDUs received by this entity.') esis_es_houts = mib_scalar((1, 3, 6, 1, 3, 1, 4, 2), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: esisESHouts.setStatus('mandatory') if mibBuilder.loadTexts: esisESHouts.setDescription('The number of ESH PDUs sent by this entity.') esis_is_hins = mib_scalar((1, 3, 6, 1, 3, 1, 4, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: esisISHins.setStatus('mandatory') if mibBuilder.loadTexts: esisISHins.setDescription('The number of ISH PDUs received by this entity.') esis_is_houts = mib_scalar((1, 3, 6, 1, 3, 1, 4, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: esisISHouts.setStatus('mandatory') if mibBuilder.loadTexts: esisISHouts.setDescription('The number of ISH PDUs sent by this entity.') esis_rd_uins = mib_scalar((1, 3, 6, 1, 3, 1, 4, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: esisRDUins.setStatus('mandatory') if mibBuilder.loadTexts: esisRDUins.setDescription('The number of RDU PDUs received by this entity.') esis_rd_uouts = mib_scalar((1, 3, 6, 1, 3, 1, 4, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: esisRDUouts.setStatus('mandatory') if mibBuilder.loadTexts: esisRDUouts.setDescription('The number of RDU PDUs sent by this entity.') mibBuilder.exportSymbols('CLNS-MIB', clnpInErrSRBadPaths=clnpInErrSRBadPaths, clnpNetToMediaEntry=clnpNetToMediaEntry, esisESHouts=esisESHouts, clnpInOpts=clnpInOpts, clnpInErrProcs=clnpInErrProcs, clnpInHdrErrors=clnpInHdrErrors, clnpAdEntAddr=clnpAdEntAddr, clnpMediaToNetHoldTime=clnpMediaToNetHoldTime, clnpOutErrIncomps=clnpOutErrIncomps, clnpOutErrCksums=clnpOutErrCksums, clnpOutErrHopReassms=clnpOutErrHopReassms, clnpForwarding=clnpForwarding, clnpInErrUnsSRs=clnpInErrUnsSRs, clnpInErrUnsRRs=clnpInErrUnsRRs, clnpInErrSegs=clnpInErrSegs, clnpInErrHops=clnpInErrHops, clnpNetToMediaIfIndex=clnpNetToMediaIfIndex, clnpAdEntReasmMaxSize=clnpAdEntReasmMaxSize, clnpInErrSRSyntaxes=clnpInErrSRSyntaxes, clnpInDiscards=clnpInDiscards, clnpOutErrSRUnkAddrs=clnpOutErrSRUnkAddrs, clnpRouteEntry=clnpRouteEntry, clnpInErrUnsOptions=clnpInErrUnsOptions, clnpOutErrInterferences=clnpOutErrInterferences, clnpAddrTable=clnpAddrTable, clnpOutErrSRBadPaths=clnpOutErrSRBadPaths, clnpDefaultLifeTime=clnpDefaultLifeTime, clnpInErrUnknownDsts=clnpInErrUnknownDsts, clnpForwPDUs=clnpForwPDUs, clnpOutDiscards=clnpOutDiscards, clnpReasmOKs=clnpReasmOKs, clnpReasmReqds=clnpReasmReqds, clnpInErrUnsVersions=clnpInErrUnsVersions, error=error, clnpInErrInterferences=clnpInErrInterferences, clnpOutErrProcs=clnpOutErrProcs, clnpOutErrCongests=clnpOutErrCongests, clnpInUnknownNLPs=clnpInUnknownNLPs, clnpNetToMediaPhysAddress=clnpNetToMediaPhysAddress, clnpMediaToNetTable=clnpMediaToNetTable, clnpMediaToNetAddress=clnpMediaToNetAddress, clnpInErrCksums=clnpInErrCksums, clnpInErrors=clnpInErrors, clnpOutRequests=clnpOutRequests, clnpNetToMediaAge=clnpNetToMediaAge, clnpInErrHdrs=clnpInErrHdrs, clnpRouteMetric2=clnpRouteMetric2, clnpInErrHopReassms=clnpInErrHopReassms, clnpNetToMediaTable=clnpNetToMediaTable, clnpInDelivers=clnpInDelivers, clnpInErrUnsSecurities=clnpInErrUnsSecurities, clnpRouteMetric5=clnpRouteMetric5, clnpMediaToNetType=clnpMediaToNetType, clnpOutErrSRSyntaxes=clnpOutErrSRSyntaxes, clnpRouteAge=clnpRouteAge, clnpOutErrUnsSRs=clnpOutErrUnsSRs, clnpMediaToNetEntry=clnpMediaToNetEntry, clnpOutErrUnknownDsts=clnpOutErrUnknownDsts, clnpOutOpts=clnpOutOpts, clnpInAddrErrors=clnpInAddrErrors, ClnpAddress=ClnpAddress, clnpOutErrHops=clnpOutErrHops, clnpInErrSRUnspecs=clnpInErrSRUnspecs, clnpAdEntIfIndex=clnpAdEntIfIndex, clnpRoutingTable=clnpRoutingTable, clnpRouteIfIndex=clnpRouteIfIndex, clnpInErrCongests=clnpInErrCongests, clnpOutErrSegs=clnpOutErrSegs, clnpOutErrUnreachDsts=clnpOutErrUnreachDsts, clnpRouteType=clnpRouteType, clnpInErrIncomps=clnpInErrIncomps, esisISHouts=esisISHouts, clnpRouteInfo=clnpRouteInfo, clnpOutErrHdrs=clnpOutErrHdrs, esisRDUins=esisRDUins, esisISHins=esisISHins, clnpInErrUnspecs=clnpInErrUnspecs, clnp=clnp, clnpMediaToNetPhysAddress=clnpMediaToNetPhysAddress, clnpRouteProto=clnpRouteProto, clnpNetToMediaHoldTime=clnpNetToMediaHoldTime, esisESHins=esisESHins, clnpAddrEntry=clnpAddrEntry, clnpOutErrSRUnspecs=clnpOutErrSRUnspecs, clnpOutErrors=clnpOutErrors, clnpOutErrUnsRRs=clnpOutErrUnsRRs, clnpReasmTimeout=clnpReasmTimeout, clnpReasmFails=clnpReasmFails, clnpRoutingDiscards=clnpRoutingDiscards, clns=clns, clnpNetToMediaType=clnpNetToMediaType, es_is=es_is, esisRDUouts=esisRDUouts, clnpInUnknownULPs=clnpInUnknownULPs, clnpOutErrDups=clnpOutErrDups, clnpInErrSRUnkAddrs=clnpInErrSRUnkAddrs, clnpSegOKs=clnpSegOKs, clnpRouteMetric3=clnpRouteMetric3, clnpRouteNextHop=clnpRouteNextHop, clnpOutErrUnsOptions=clnpOutErrUnsOptions, clnpOutErrUnsSecurities=clnpOutErrUnsSecurities, clnpRouteMetric1=clnpRouteMetric1, echo=echo, clnpRouteMetric4=clnpRouteMetric4, clnpNetToMediaNetAddress=clnpNetToMediaNetAddress, clnpOutNoRoutes=clnpOutNoRoutes, clnpOutErrUnsVersions=clnpOutErrUnsVersions, clnpInReceives=clnpInReceives, clnpOutErrUnspecs=clnpOutErrUnspecs, clnpSegFails=clnpSegFails, clnpInErrDups=clnpInErrDups, clnpInErrUnreachDsts=clnpInErrUnreachDsts, clnpMediaToNetAge=clnpMediaToNetAge, clnpRouteDest=clnpRouteDest, clnpMediaToNetIfIndex=clnpMediaToNetIfIndex, clnpSegCreates=clnpSegCreates)
VERSION = (0, 2, 2, '', 1) if VERSION[3] and VERSION[4]: VERSION_TEXT = '{0}.{1}.{2}{3}{4}'.format(*VERSION) else: VERSION_TEXT = '{0}.{1}.{2}'.format(*VERSION[0:3]) VERSION_EXTRA = '' LICENSE = 'MIT License'
version = (0, 2, 2, '', 1) if VERSION[3] and VERSION[4]: version_text = '{0}.{1}.{2}{3}{4}'.format(*VERSION) else: version_text = '{0}.{1}.{2}'.format(*VERSION[0:3]) version_extra = '' license = 'MIT License'
def selection_sort(array): """Program for selection sort Inplace sorting Space Complexity O(1) only constant number of variables is used Time complexity O(n^2) >>> arr = [1, 5, 0, -3, 5, 7, 2, 0, 9, 1] >>> print(arr) [1, 5, 0, -3, 5, 7, 2, 0, 9, 1] >>> selection_sort(arr) >>> print(arr) [-3, 0, 0, 1, 1, 2, 5, 5, 7, 9] """ n = len(array) for i in range(n - 1): minimum = array[i] min_index = i # find the minimum element in array[i+1..n-1] for j in range(i + 1, n): if array[j] < minimum: minimum = array[j] min_index = j # swap array[i] with minimum element found after i array[i], array[min_index] = array[min_index], array[i] arr = [1, 5, 0, -3, 5, 7, 2, 0, 9, 1] print(arr) selection_sort(arr) print(arr)
def selection_sort(array): """Program for selection sort Inplace sorting Space Complexity O(1) only constant number of variables is used Time complexity O(n^2) >>> arr = [1, 5, 0, -3, 5, 7, 2, 0, 9, 1] >>> print(arr) [1, 5, 0, -3, 5, 7, 2, 0, 9, 1] >>> selection_sort(arr) >>> print(arr) [-3, 0, 0, 1, 1, 2, 5, 5, 7, 9] """ n = len(array) for i in range(n - 1): minimum = array[i] min_index = i for j in range(i + 1, n): if array[j] < minimum: minimum = array[j] min_index = j (array[i], array[min_index]) = (array[min_index], array[i]) arr = [1, 5, 0, -3, 5, 7, 2, 0, 9, 1] print(arr) selection_sort(arr) print(arr)
#NOTE: LIST - Secuence of mutable values names = ["Harry", "Hik", "Linkin", "Park"] #ADDS ANOTHER ITEM IN THE LIST names.append("Paramore") #SORT THE LIST IN APLHABETIC ORDER names.sort() #PRINTS THE LIST print(names)
names = ['Harry', 'Hik', 'Linkin', 'Park'] names.append('Paramore') names.sort() print(names)
subor = open("17_1input.txt", "r") r = [x.strip() for x in subor.readlines()] n=6 roz=(n+1)*2+len(r[0]) pole=[[["." for a in range(roz)] for a in range(roz)]for a in range((n+1)*2+1)] #vypisanie pola def vypis(x): for a in x: for b in a: for c in b: print(c,end=" ") print() print() #dopisanie hodnot zo zadania for i in range(len(r)): for j in range(len(r[i])): pole[n+1][n+1+i][n+1+j]=r[i][j] """ vypis(pole) print("--------------") """ def susedia(p,x,y,z): s=0 for a in (-1,0,1): for b in (-1,0,1): for c in (-1,0,1): s+= p[x+a][y+b][z+c]=="#" if p[x][y][z]=="#": return s-1 else: return s def krok(p,i): np=[[["." for a in range(roz)] for a in range(roz)]for a in range(roz)] for a in range(n-i+1,(n+1)*2 -(n-i)): for b in range(n-i+1,roz-(n-i)-1): for c in range(n-i+1,roz-(n-i)-1): #print(a,b,c,p[a][b][c],susedia(p,a,b,c) ) if p[a][b][c]=="." and susedia(p,a,b,c)==3: np[a][b][c]="#" #print("aha") #vypis(np) elif p[a][b][c]=="#" and susedia(p,a,b,c) in (2,3): np[a][b][c]="#" else: np[a][b][c]="." #print("np") #vypis(np) return(np) for i in range(n): pole=krok(pole,i+1) #print(i) #vypis(pole) def zrataj(x): suc=0 for a in x: for b in a: for c in b: suc += c=="#" return suc print(zrataj(pole))
subor = open('17_1input.txt', 'r') r = [x.strip() for x in subor.readlines()] n = 6 roz = (n + 1) * 2 + len(r[0]) pole = [[['.' for a in range(roz)] for a in range(roz)] for a in range((n + 1) * 2 + 1)] def vypis(x): for a in x: for b in a: for c in b: print(c, end=' ') print() print() for i in range(len(r)): for j in range(len(r[i])): pole[n + 1][n + 1 + i][n + 1 + j] = r[i][j] '\nvypis(pole)\nprint("--------------")\n' def susedia(p, x, y, z): s = 0 for a in (-1, 0, 1): for b in (-1, 0, 1): for c in (-1, 0, 1): s += p[x + a][y + b][z + c] == '#' if p[x][y][z] == '#': return s - 1 else: return s def krok(p, i): np = [[['.' for a in range(roz)] for a in range(roz)] for a in range(roz)] for a in range(n - i + 1, (n + 1) * 2 - (n - i)): for b in range(n - i + 1, roz - (n - i) - 1): for c in range(n - i + 1, roz - (n - i) - 1): if p[a][b][c] == '.' and susedia(p, a, b, c) == 3: np[a][b][c] = '#' elif p[a][b][c] == '#' and susedia(p, a, b, c) in (2, 3): np[a][b][c] = '#' else: np[a][b][c] = '.' return np for i in range(n): pole = krok(pole, i + 1) def zrataj(x): suc = 0 for a in x: for b in a: for c in b: suc += c == '#' return suc print(zrataj(pole))
__author__ = "Ian Goodfellow" class Agent(object): pass
__author__ = 'Ian Goodfellow' class Agent(object): pass
def pytest_report_header(): return """ ------------------------ EXECUTING WEB UI TESTS ------------------------ """
def pytest_report_header(): return '\n ------------------------\n EXECUTING WEB UI TESTS\n ------------------------\n '
c = 41 # THE VARIABLE C equals 41 c == 40 # c eqauls 40 which is false becasue of the variable above c != 40 and c <41 #c does not equal 40 is a true statement but the other statement is false, making it a false statement c != 40 or c <41 #True statement in an or statement not c == 40 #this is a true statement not c > 40 #false statement c <= 41 #true not false #true True and false #false false or True #true false or false or false #false True and True and false #false false == 0 #this is a true True == 0 #false True == 1 #this statement
c = 41 c == 40 c != 40 and c < 41 c != 40 or c < 41 not c == 40 not c > 40 c <= 41 not false True and false false or True false or false or false True and True and false false == 0 True == 0 True == 1
dna = 'ACGTN' rna = 'ACGUN' # dictionary nucleotide acronym to full name nuc2name = { 'A': 'Adenosine', 'C': 'Cysteine', 'T': 'Thymine', 'G': 'Guanine', 'U': 'Uracil', 'N': 'Unknown' }
dna = 'ACGTN' rna = 'ACGUN' nuc2name = {'A': 'Adenosine', 'C': 'Cysteine', 'T': 'Thymine', 'G': 'Guanine', 'U': 'Uracil', 'N': 'Unknown'}
print("Checking Imports") import_list = ['signal', 'psutil', 'time', 'pypresence', 'random'] modules = {} for package in import_list: try: modules[package] = __import__(package) except ImportError: print(f"Package: {package} is missing please install") print("Loading CONFIG\n") # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # CONFIG # # Change the client_id to your own if you want to use your own assets and name. # client_id = '808908940993495040' # # The app can update every 15 seconds according to discord tos (https://discord.com/developers/docs/rich-presence/how-to#updating-presence) # However, you can change it to whatever you want at the risk of being Rate-Limited (never have been actualy rate-limited so I dont know the limit. 1 Second works tho) # rpc_limit = 5 # int with 1 second being the min # # These are the default quotes or texts displayed. Change to your liking. # Button is optional # def updateDynamicText(): cpu_per = round(modules["psutil"].cpu_percent(), 1) mem_per = round(modules["psutil"].virtual_memory().percent, 1) text = [ { "name": "CPU / RAM", "line1": f"CPU: {cpu_per}%", "line2": f"RAM: {mem_per}%", }, { "name": "The Welcoming", "line1": f"Yo we pimp", "line2": f"chimping", "button": [{"label": "Misfits", "url": "https://scuffed.store/"}, {"label": "Fitz", "url": "https://fitz.fanfiber.com/"}] }, ] return {"text": text, "size": len(text)} # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Spawn Discord RPC connection RPC = modules["pypresence"].Presence(client_id, pipe=0) RPC.connect() # https://stackoverflow.com/questions/18499497/how-to-process-sigterm-signal-gracefully # Thanks to this thread for safe shutdown class GracefulKiller: kill_now = False def __init__(self): modules["signal"].signal(modules["signal"].SIGINT, self.exit_gracefully) modules["signal"].signal(modules["signal"].SIGTERM, self.exit_gracefully) def exit_gracefully(self): self.kill_now = True if __name__ == '__main__': killer = GracefulKiller() print(f"Client ID: {client_id}") print(f"Updating every: {rpc_limit} seconds") while not killer.kill_now: # Presence text = updateDynamicText() x = modules["random"].randint(0,text["size"]-1) try: text["text"][x]["button"] except KeyError: print(RPC.update(details=text["text"][x]["line1"], state=text["text"][x]["line2"])) else: print(RPC.update(details=text["text"][x]["line1"], state=text["text"][x]["line2"], buttons=text["text"][x]["button"])) # https://discord.com/developers/docs/rich-presence/how-to#updating-presence # Should only update every 15 seconds, however, this is not a limit and it can go as fast as you want it too. # However, you will probabaly get rate-limited and will have to serve a cooldown period if you go too fast. modules["time"].sleep(rpc_limit) print("I was killed") RPC.close()
print('Checking Imports') import_list = ['signal', 'psutil', 'time', 'pypresence', 'random'] modules = {} for package in import_list: try: modules[package] = __import__(package) except ImportError: print(f'Package: {package} is missing please install') print('Loading CONFIG\n') client_id = '808908940993495040' rpc_limit = 5 def update_dynamic_text(): cpu_per = round(modules['psutil'].cpu_percent(), 1) mem_per = round(modules['psutil'].virtual_memory().percent, 1) text = [{'name': 'CPU / RAM', 'line1': f'CPU: {cpu_per}%', 'line2': f'RAM: {mem_per}%'}, {'name': 'The Welcoming', 'line1': f'Yo we pimp', 'line2': f'chimping', 'button': [{'label': 'Misfits', 'url': 'https://scuffed.store/'}, {'label': 'Fitz', 'url': 'https://fitz.fanfiber.com/'}]}] return {'text': text, 'size': len(text)} rpc = modules['pypresence'].Presence(client_id, pipe=0) RPC.connect() class Gracefulkiller: kill_now = False def __init__(self): modules['signal'].signal(modules['signal'].SIGINT, self.exit_gracefully) modules['signal'].signal(modules['signal'].SIGTERM, self.exit_gracefully) def exit_gracefully(self): self.kill_now = True if __name__ == '__main__': killer = graceful_killer() print(f'Client ID: {client_id}') print(f'Updating every: {rpc_limit} seconds') while not killer.kill_now: text = update_dynamic_text() x = modules['random'].randint(0, text['size'] - 1) try: text['text'][x]['button'] except KeyError: print(RPC.update(details=text['text'][x]['line1'], state=text['text'][x]['line2'])) else: print(RPC.update(details=text['text'][x]['line1'], state=text['text'][x]['line2'], buttons=text['text'][x]['button'])) modules['time'].sleep(rpc_limit) print('I was killed') RPC.close()
# A linked list node class Node: def __init__(self, value=None, next=None): self.value = value self.next = next # Helper function to print given linked list def printList(head): ptr = head while ptr: print(ptr.value, end=" -> ") ptr = ptr.next print("None") # Function to remove duplicates from a sorted list def removeDuplicates(head): previous = None current = head # take an empty set to store linked list nodes for future reference s = set() # do till linked list is not empty while current: # if current node is seen before, ignore it if current.value in s: previous.next = current.next # insert current node into the set and proceed to next node else: s.add(current.value) previous = current current = previous.next return head if __name__ == '__main__': # input keys keys = [3,4,3,2,6,1,2,6] # construct linked list head = None for i in reversed(range(len(keys))): head = Node(keys[i], head) removeDuplicates(head) # print linked list printList(head)
class Node: def __init__(self, value=None, next=None): self.value = value self.next = next def print_list(head): ptr = head while ptr: print(ptr.value, end=' -> ') ptr = ptr.next print('None') def remove_duplicates(head): previous = None current = head s = set() while current: if current.value in s: previous.next = current.next else: s.add(current.value) previous = current current = previous.next return head if __name__ == '__main__': keys = [3, 4, 3, 2, 6, 1, 2, 6] head = None for i in reversed(range(len(keys))): head = node(keys[i], head) remove_duplicates(head) print_list(head)
#!/usr/bin/env python3 # https://www.urionlinejudge.com.br/judge/en/problems/view/1014 def main(): X = int(input()) Y = float(input()) CONSUMPTION = X / Y print(format(CONSUMPTION, '.3f'), "km/l") # Start the execution if it's the main script if __name__ == "__main__": main()
def main(): x = int(input()) y = float(input()) consumption = X / Y print(format(CONSUMPTION, '.3f'), 'km/l') if __name__ == '__main__': main()
''' Data Columns - Exercise 1 The file reads the file with neuron lengths (neuron_data.txt) and saves an identical copy of the file. ''' Infile = open('neuron_data.txt') Outfile = open('neuron_data-copy.txt', 'w') for line in Infile: Outfile.write(line) Outfile.close()
""" Data Columns - Exercise 1 The file reads the file with neuron lengths (neuron_data.txt) and saves an identical copy of the file. """ infile = open('neuron_data.txt') outfile = open('neuron_data-copy.txt', 'w') for line in Infile: Outfile.write(line) Outfile.close()
"""In this bite you will work with a list of names. First you will write a function to take out duplicates and title case them. Then you will sort the list in alphabetical descending order by surname and lastly determine what the shortest first name is. For this exercise you can assume there is always one name and one surname. With some handy Python builtins you can write this in a pretty concise way. Get it sorted :)""" NAMES = ['arnold schwarzenegger', 'alec baldwin', 'bob belderbos', 'julian sequeira', 'sandra bullock', 'keanu reeves', 'julbob pybites', 'bob belderbos', 'julian sequeira', 'al pacino', 'brad pitt', 'matt damon', 'brad pitt'] def dedup_and_title_case_names(names): """Should return a list of names, each name appears only once""" names = list(set(NAMES)) func_names = [] for i in names: i = i.title() func_names.append(i) return func_names def sort_by_surname_desc(names): """Returns names list sorted desc by surname""" names = dedup_and_title_case_names(NAMES) name_dict = [] for i in names: i = i.split() name_dict.append({'name':i[0], 'surname': i[1]}) sort_names = list(sorted(name_dict, key=lambda k: k['surname'], reverse=True)) names = [] for a in sort_names: s = str(a['name']) + ' ' + str(a['surname']) names.append(s) return names def shortest_first_name(names): """Returns the shortest first name (str)""" names = dedup_and_title_case_names(names) name_dict = [] for i in names: i = i.split() name_dict.append({'name':i[0], 'surname': i[1]}) short_name_sort = sorted(name_dict, key=lambda k: len(k['name'])) return short_name_sort[0]['name']
"""In this bite you will work with a list of names. First you will write a function to take out duplicates and title case them. Then you will sort the list in alphabetical descending order by surname and lastly determine what the shortest first name is. For this exercise you can assume there is always one name and one surname. With some handy Python builtins you can write this in a pretty concise way. Get it sorted :)""" names = ['arnold schwarzenegger', 'alec baldwin', 'bob belderbos', 'julian sequeira', 'sandra bullock', 'keanu reeves', 'julbob pybites', 'bob belderbos', 'julian sequeira', 'al pacino', 'brad pitt', 'matt damon', 'brad pitt'] def dedup_and_title_case_names(names): """Should return a list of names, each name appears only once""" names = list(set(NAMES)) func_names = [] for i in names: i = i.title() func_names.append(i) return func_names def sort_by_surname_desc(names): """Returns names list sorted desc by surname""" names = dedup_and_title_case_names(NAMES) name_dict = [] for i in names: i = i.split() name_dict.append({'name': i[0], 'surname': i[1]}) sort_names = list(sorted(name_dict, key=lambda k: k['surname'], reverse=True)) names = [] for a in sort_names: s = str(a['name']) + ' ' + str(a['surname']) names.append(s) return names def shortest_first_name(names): """Returns the shortest first name (str)""" names = dedup_and_title_case_names(names) name_dict = [] for i in names: i = i.split() name_dict.append({'name': i[0], 'surname': i[1]}) short_name_sort = sorted(name_dict, key=lambda k: len(k['name'])) return short_name_sort[0]['name']
# coding: utf-8 """***************************************************************************** * Copyright (C) 2018 Microchip Technology Inc. and its subsidiaries. * * Subject to your compliance with these terms, you may use Microchip software * and any derivatives exclusively with Microchip products. It is your * responsibility to comply with third party license terms applicable to your * use of third party software (including open source software) that may * accompany Microchip software. * * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A * PARTICULAR PURPOSE. * * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, * INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND * WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS * BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE * FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN * ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. *****************************************************************************""" ################################################################################ #### Business Logic #### ################################################################################ def genDriverHeaderRootFile(symbol, event): symbol.setEnabled(event["value"]) def genDriverHeaderCommonFile(symbol, event): symbol.setEnabled(event["value"]) ############################################################################ #### Code Generation #### ############################################################################ genDriverCommonFiles = harmonyCoreComponent.createBooleanSymbol("ENABLE_DRV_COMMON", None) genDriverCommonFiles.setLabel("Generate Harmony Driver Common Files") genDriverCommonFiles.setVisible(False) genDriverCommonFiles.setDefaultValue(False) driverHeaderRootFile = harmonyCoreComponent.createFileSymbol("DRIVER_ROOT", None) driverHeaderRootFile.setSourcePath("driver/driver.h") driverHeaderRootFile.setOutputName("driver.h") driverHeaderRootFile.setDestPath("driver/") driverHeaderRootFile.setProjectPath("config/" + configName + "/driver/") driverHeaderRootFile.setType("HEADER") driverHeaderRootFile.setOverwrite(True) driverHeaderRootFile.setEnabled(False) driverHeaderRootFile.setDependencies(genDriverHeaderRootFile, ["ENABLE_DRV_COMMON"]) driverHeaderCommonFile = harmonyCoreComponent.createFileSymbol("DRIVER_COMMON", None) driverHeaderCommonFile.setSourcePath("driver/driver_common.h") driverHeaderCommonFile.setOutputName("driver_common.h") driverHeaderCommonFile.setDestPath("driver/") driverHeaderCommonFile.setProjectPath("config/" + configName + "/driver/") driverHeaderCommonFile.setType("HEADER") driverHeaderCommonFile.setOverwrite(True) driverHeaderCommonFile.setEnabled(False) driverHeaderCommonFile.setDependencies(genDriverHeaderCommonFile, ["ENABLE_DRV_COMMON"])
"""***************************************************************************** * Copyright (C) 2018 Microchip Technology Inc. and its subsidiaries. * * Subject to your compliance with these terms, you may use Microchip software * and any derivatives exclusively with Microchip products. It is your * responsibility to comply with third party license terms applicable to your * use of third party software (including open source software) that may * accompany Microchip software. * * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A * PARTICULAR PURPOSE. * * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, * INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND * WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS * BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE * FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN * ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. *****************************************************************************""" def gen_driver_header_root_file(symbol, event): symbol.setEnabled(event['value']) def gen_driver_header_common_file(symbol, event): symbol.setEnabled(event['value']) gen_driver_common_files = harmonyCoreComponent.createBooleanSymbol('ENABLE_DRV_COMMON', None) genDriverCommonFiles.setLabel('Generate Harmony Driver Common Files') genDriverCommonFiles.setVisible(False) genDriverCommonFiles.setDefaultValue(False) driver_header_root_file = harmonyCoreComponent.createFileSymbol('DRIVER_ROOT', None) driverHeaderRootFile.setSourcePath('driver/driver.h') driverHeaderRootFile.setOutputName('driver.h') driverHeaderRootFile.setDestPath('driver/') driverHeaderRootFile.setProjectPath('config/' + configName + '/driver/') driverHeaderRootFile.setType('HEADER') driverHeaderRootFile.setOverwrite(True) driverHeaderRootFile.setEnabled(False) driverHeaderRootFile.setDependencies(genDriverHeaderRootFile, ['ENABLE_DRV_COMMON']) driver_header_common_file = harmonyCoreComponent.createFileSymbol('DRIVER_COMMON', None) driverHeaderCommonFile.setSourcePath('driver/driver_common.h') driverHeaderCommonFile.setOutputName('driver_common.h') driverHeaderCommonFile.setDestPath('driver/') driverHeaderCommonFile.setProjectPath('config/' + configName + '/driver/') driverHeaderCommonFile.setType('HEADER') driverHeaderCommonFile.setOverwrite(True) driverHeaderCommonFile.setEnabled(False) driverHeaderCommonFile.setDependencies(genDriverHeaderCommonFile, ['ENABLE_DRV_COMMON'])
class Video: def __init__(self, files): self.files = files def setFiles(self, files): self.files = files def getFiles(self): return self.files
class Video: def __init__(self, files): self.files = files def set_files(self, files): self.files = files def get_files(self): return self.files
class JsonUtil: @staticmethod def list_obj_dict(list): new_list = [] for obj in list: new_list.append(obj.__dict__) return new_list
class Jsonutil: @staticmethod def list_obj_dict(list): new_list = [] for obj in list: new_list.append(obj.__dict__) return new_list
# pylint: disable=inconsistent-return-statements def sanitize(value, output_type): """ Handy wrapper function for individual sanitize functions. :param value: Input value to be sanitized :param output_type: Class of required output :type output_type: bool or int """ # pylint: disable=no-else-return if output_type == bool: return sanitize_bool(value) elif output_type == int: return sanitize_int(value) # pylint: enable=no-else-return # unrecognised/unsupported output_type. just return what we got.. return value def sanitize_int(value): """ Sanitize an input value to an integer. :param value: Input value to be sanitized to an integer :return: Integer, or None of the value cannot be sanitized :rtype: int or None """ if isinstance(value, str): try: return int(value) except ValueError: return None elif isinstance(value, int): return value # pylint: enable=inconsistent-return-statements def sanitize_bool(value, strict=False): """ Sanitize an input value to a boolean :param value: Input value to be sanitized to a boolean :param strict: if strict, if the value is not directly recognised as a yes/no bool, we'll return None...if not strict, we'll convert the unknown value to bool() and return True/False :return: Boolean representation of input value. :rtype: bool or NoneType """ if isinstance(value, str): # pylint: disable=no-else-return if value.lower().strip() in {'y', 'yes', 't', 'true', '1'}: return True elif value.lower().strip() in {'n', 'no', 'f', 'false', '0'}: return False else: int_value = sanitize_int(value) if int_value is not None: return int_value > 0 return False # pylint: enable=no-else-return # Bool compare before int compare. This is because True isinstance() check # will relate to 1 which means isinstance(value, int) will result as True, # whilst being a bool. Testing a number against bool will result in False, # therefore order is very important. elif isinstance(value, bool): return value elif isinstance(value, int): return value > 0 if isinstance(value, (list, tuple)) and len(value) == 1: # recurse return sanitize_bool(value[0], strict=strict) if strict: return None return bool(value)
def sanitize(value, output_type): """ Handy wrapper function for individual sanitize functions. :param value: Input value to be sanitized :param output_type: Class of required output :type output_type: bool or int """ if output_type == bool: return sanitize_bool(value) elif output_type == int: return sanitize_int(value) return value def sanitize_int(value): """ Sanitize an input value to an integer. :param value: Input value to be sanitized to an integer :return: Integer, or None of the value cannot be sanitized :rtype: int or None """ if isinstance(value, str): try: return int(value) except ValueError: return None elif isinstance(value, int): return value def sanitize_bool(value, strict=False): """ Sanitize an input value to a boolean :param value: Input value to be sanitized to a boolean :param strict: if strict, if the value is not directly recognised as a yes/no bool, we'll return None...if not strict, we'll convert the unknown value to bool() and return True/False :return: Boolean representation of input value. :rtype: bool or NoneType """ if isinstance(value, str): if value.lower().strip() in {'y', 'yes', 't', 'true', '1'}: return True elif value.lower().strip() in {'n', 'no', 'f', 'false', '0'}: return False else: int_value = sanitize_int(value) if int_value is not None: return int_value > 0 return False elif isinstance(value, bool): return value elif isinstance(value, int): return value > 0 if isinstance(value, (list, tuple)) and len(value) == 1: return sanitize_bool(value[0], strict=strict) if strict: return None return bool(value)
class Solution(object): def findClosestElements(self, arr, k, x): """ :type arr: List[int] :type k: int :type x: int :rtype: List[int] """ start = 0 end = len(arr) - 1 while start < end: mid = (start + end) // 2 if arr[mid] == x: start = mid while arr[start] == x: start = start - 1 end = start + 1 elif arr[mid] < x: start = mid else: end = mid return arr[start:start + k]
class Solution(object): def find_closest_elements(self, arr, k, x): """ :type arr: List[int] :type k: int :type x: int :rtype: List[int] """ start = 0 end = len(arr) - 1 while start < end: mid = (start + end) // 2 if arr[mid] == x: start = mid while arr[start] == x: start = start - 1 end = start + 1 elif arr[mid] < x: start = mid else: end = mid return arr[start:start + k]
# 1 x = float(input("First number: ")) y = float(input("Second number: ")) if x > y: print(f"{x} is greater than {y}") elif x < y: print(f"{x} is less than {y}") else: print(f"{x} is equal to {y}") # bb quiz = float(input("quiz: ")) mid_term = float(input("midterm: ")) final = float(input("final: ")) avg = (quiz + mid_term + final) / 3 if avg > 90: print("Congrats! You got an A") # if else x = 6 if x >=3: y = x-3 else: y = x+3 print("y is",y) # max x = float(input("First number: ")) y = float(input("Second number: ")) print("The larger number is:", x if x > y else y) # max(x, y) can also be used
x = float(input('First number: ')) y = float(input('Second number: ')) if x > y: print(f'{x} is greater than {y}') elif x < y: print(f'{x} is less than {y}') else: print(f'{x} is equal to {y}') quiz = float(input('quiz: ')) mid_term = float(input('midterm: ')) final = float(input('final: ')) avg = (quiz + mid_term + final) / 3 if avg > 90: print('Congrats! You got an A') x = 6 if x >= 3: y = x - 3 else: y = x + 3 print('y is', y) x = float(input('First number: ')) y = float(input('Second number: ')) print('The larger number is:', x if x > y else y)
x = {} print(type(x)) file_counts = {"jpg":10, "txt":14, "csv":2, "py":23} print(file_counts) print(file_counts["txt"]) print("html" in file_counts) #true if found #dictionaries are mutable file_counts["cfg"] = 8 #add item print(file_counts) file_counts["csv"] = 17 #replaces value for already assigned csv print(file_counts) del file_counts["cfg"] print(file_counts) file_counts = {"jpg":10, "txt":14, "csv":2, "py":23} for extension in file_counts: print(extension) for ext, amount in file_counts.items(): #value pairs print("There are {} files with the .{} extension".format(amount, ext)) print(file_counts.keys(), file_counts.values()) cool_beasts = {"octopuses":"tentacles", "dolphins":"fins", "rhinos":"horns"} for keys, values in cool_beasts.items(): print("{} have {}".format(keys, values)) print("Test get: " + cool_beasts.get("octopuses")) def count_letters(text): result = {} for letter in text: if letter not in result: result[letter] = 0 result[letter] += 1 return result count_letters("aaaaa") count_letters("tenant") print(count_letters("lksdajfo;asijnfl;kdnv;oisrnfg;lzknv;oizdfo;hgj")) wardrobe = {"shirt":["red","blue","white"], "jeans":["blue","black"]} for clothes, color in wardrobe.items(): for n in color: print("{} {}".format(n, clothes))
x = {} print(type(x)) file_counts = {'jpg': 10, 'txt': 14, 'csv': 2, 'py': 23} print(file_counts) print(file_counts['txt']) print('html' in file_counts) file_counts['cfg'] = 8 print(file_counts) file_counts['csv'] = 17 print(file_counts) del file_counts['cfg'] print(file_counts) file_counts = {'jpg': 10, 'txt': 14, 'csv': 2, 'py': 23} for extension in file_counts: print(extension) for (ext, amount) in file_counts.items(): print('There are {} files with the .{} extension'.format(amount, ext)) print(file_counts.keys(), file_counts.values()) cool_beasts = {'octopuses': 'tentacles', 'dolphins': 'fins', 'rhinos': 'horns'} for (keys, values) in cool_beasts.items(): print('{} have {}'.format(keys, values)) print('Test get: ' + cool_beasts.get('octopuses')) def count_letters(text): result = {} for letter in text: if letter not in result: result[letter] = 0 result[letter] += 1 return result count_letters('aaaaa') count_letters('tenant') print(count_letters('lksdajfo;asijnfl;kdnv;oisrnfg;lzknv;oizdfo;hgj')) wardrobe = {'shirt': ['red', 'blue', 'white'], 'jeans': ['blue', 'black']} for (clothes, color) in wardrobe.items(): for n in color: print('{} {}'.format(n, clothes))
# Tweepy # Copyright 2010-2021 Joshua Roesslein # See LICENSE for details. def list_to_csv(item_list): if item_list: return ','.join(map(str, item_list))
def list_to_csv(item_list): if item_list: return ','.join(map(str, item_list))
''' Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value. If target is not found in the array, return [-1, -1]. You must write an algorithm with O(log n) runtime complexity ''' class Solution: def searchRange(self, nums: List[int], target: int) -> List[int]: if not nums: return [-1, -1] left, right = -1, len(nums) - 1 while left < right - 1: mid = (left + right) // 2 if nums[mid] < target: left = mid elif nums[mid] >= target: right = mid if nums[right] == target: ans_left = right else: return [-1, -1] left, right = left + 1, len(nums) while left < right - 1: mid = (left + right) // 2 if nums[mid] > target: right = mid elif nums[mid] == target: left = mid ans_right = right - 1 return [ans_left, ans_right]
""" Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value. If target is not found in the array, return [-1, -1]. You must write an algorithm with O(log n) runtime complexity """ class Solution: def search_range(self, nums: List[int], target: int) -> List[int]: if not nums: return [-1, -1] (left, right) = (-1, len(nums) - 1) while left < right - 1: mid = (left + right) // 2 if nums[mid] < target: left = mid elif nums[mid] >= target: right = mid if nums[right] == target: ans_left = right else: return [-1, -1] (left, right) = (left + 1, len(nums)) while left < right - 1: mid = (left + right) // 2 if nums[mid] > target: right = mid elif nums[mid] == target: left = mid ans_right = right - 1 return [ans_left, ans_right]
def knapsack(limit, values, weights): """Returns the maximum value that can be reached using given weights""" n = len(weights) dp = [0]*(limit+1) for i in range(n): for j in range(limit, weights[i]-1, -1): dp[j] = max(dp[j], values[i] + dp[j - weights[i]]) return dp[-1]
def knapsack(limit, values, weights): """Returns the maximum value that can be reached using given weights""" n = len(weights) dp = [0] * (limit + 1) for i in range(n): for j in range(limit, weights[i] - 1, -1): dp[j] = max(dp[j], values[i] + dp[j - weights[i]]) return dp[-1]
_base_ = [ '../_base_/models/resnet50.py', '../_base_/datasets/imagenet_bs32.py', '../_base_/schedules/imagenet_bs256.py', '../_base_/default_runtime.py' ] load_from = "https://download.openmmlab.com/mmclassification/v0/resnet/resnet50_8xb32_in1k_20210831-ea4938fc.pth"
_base_ = ['../_base_/models/resnet50.py', '../_base_/datasets/imagenet_bs32.py', '../_base_/schedules/imagenet_bs256.py', '../_base_/default_runtime.py'] load_from = 'https://download.openmmlab.com/mmclassification/v0/resnet/resnet50_8xb32_in1k_20210831-ea4938fc.pth'
x = int(input("Please enter a number: ")) if x % 2 == 0 : print(x, "is even") else : print(x, "is odd")
x = int(input('Please enter a number: ')) if x % 2 == 0: print(x, 'is even') else: print(x, 'is odd')
class Memoization: allow_attr_memoization = False def _set_attr(obj, attr_name, value_func): setattr(obj, attr_name, value_func()) return getattr(obj, attr_name) def _memoize_attr(obj, attr_name, value_func): if not Memoization.allow_attr_memoization: return value_func() try: return getattr(obj, attr_name) except AttributeError: return _set_attr(obj, attr_name, value_func)
class Memoization: allow_attr_memoization = False def _set_attr(obj, attr_name, value_func): setattr(obj, attr_name, value_func()) return getattr(obj, attr_name) def _memoize_attr(obj, attr_name, value_func): if not Memoization.allow_attr_memoization: return value_func() try: return getattr(obj, attr_name) except AttributeError: return _set_attr(obj, attr_name, value_func)
class BotConfiguration(object): def __init__(self, auth_token, name, avatar): self._auth_token = auth_token self._name = name self._avatar = avatar @property def name(self): return self._name @property def avatar(self): return self._avatar @property def auth_token(self): return self._auth_token
class Botconfiguration(object): def __init__(self, auth_token, name, avatar): self._auth_token = auth_token self._name = name self._avatar = avatar @property def name(self): return self._name @property def avatar(self): return self._avatar @property def auth_token(self): return self._auth_token
#author SANKALP SAXENA # Complete the has_cycle function below. # # For your reference: # # SinglyLinkedListNode: # int data # SinglyLinkedListNode next # # def has_cycle(head): s = set() temp = head while True: if temp.next == None: return False if temp.next not in s: s.add(temp.next) else: return True temp = temp.next return False
def has_cycle(head): s = set() temp = head while True: if temp.next == None: return False if temp.next not in s: s.add(temp.next) else: return True temp = temp.next return False
{ 'targets': [ { 'target_name': 'test_new_target', 'defines': [ 'V8_DEPRECATION_WARNINGS=1' ], 'sources': [ '../entry_point.c', 'test_new_target.c' ] } ] }
{'targets': [{'target_name': 'test_new_target', 'defines': ['V8_DEPRECATION_WARNINGS=1'], 'sources': ['../entry_point.c', 'test_new_target.c']}]}
x = 10 print(x) """ tests here """
x = 10 print(x) '\ntests here\n'
usa = ['atlanta','new york','chicago','baltimore'] uk = ['london','bristol','cambridge'] india = ['mumbai','delhi','banglore'] ''' #(a) i=input("Enter city name: ") if i in usa: print('city is in USA') elif i in uk: print('city is in UK') elif i in india: print('city is in INDIA') else: print('idk the country of the city entered!!') ''' #(b) i=input("Enter 1st city name: ") j=input("Enter 2nd city name: ") if (i in usa and j in usa) or (i in uk and j in uk) or (i in india and j in india): print("Both are in same country!") else: print("Both are in different countries!")
usa = ['atlanta', 'new york', 'chicago', 'baltimore'] uk = ['london', 'bristol', 'cambridge'] india = ['mumbai', 'delhi', 'banglore'] '\n#(a)\ni=input("Enter city name: ")\nif i in usa:\n print(\'city is in USA\')\nelif i in uk:\n print(\'city is in UK\')\nelif i in india:\n print(\'city is in INDIA\')\nelse:\n print(\'idk the country of the city entered!!\')\n' i = input('Enter 1st city name: ') j = input('Enter 2nd city name: ') if i in usa and j in usa or (i in uk and j in uk) or (i in india and j in india): print('Both are in same country!') else: print('Both are in different countries!')
#Base Class, Uses a descriptor to set a value class Descriptor: def __init__(self, name=None, **opts): self.name = name for key, value in opts.items(): setattr( self, key, value) def __set__(self, instance, value): instance.__dict__[self.name] = value #Descriptor for enforcing types class Typed( Descriptor ): expected_type = type( None ) def __set__(self, instance, value): if not isinstance(value, self.expected_type): raise TypeError('expected '+str(self.expected_type ) ) super().__set__(instance, value) #Descriptor for enforcing values class Unsigned(Descriptor): def __set__(self, instance, value): if value < 0: raise ValueError('Expected >=0 ') super().__set__( instance, value ) #Descriptor for enforcing size class MaxSized(Descriptor): def __init__(self, name=None, **opts): if 'size' not in opts: raise TypeError('missing size option') super().__init__(name, **opts ) def __set__(self, instance, value): if len(value) >= self.size: raise ValueError( 'size must be < ' + str( self.size ) ) super().__set__(instance, value) class Integer(Typed): expected_type = int class UnsignedInteger( Integer, Unsigned): pass class Float(Typed): expected_type = float class UnsignedFloat( Float, Unsigned): pass class String(Typed): expected_type = str class SizedString( String, MaxSized): pass #Method 1 class Stock: #Specify constraints name = SizedString('name', size=8) shares = UnsignedInteger('shares') price = UnsignedFloat('price') def __init__(self, name, shares, price): self.name = name self.shares = shares self.price = price print('Method 1') s = Stock('ACME', 50, 91.1) print( s.name ) s.shares = 75 print( s.shares) try: s.shares = -1 except: pass print( s.shares ) try: s.name = 'AAAABBBC' except: pass print( s.name ) ''' There are some techniques that can be used to simplify the specification of constraints in classes. One approach is to use a class decorator ''' #Class decorator to apply constraints def check_attributes(**kwargs ): def decorate( cls ): for key,value in kwargs.items(): if isinstance( value, Descriptor ): value.name = key setattr(cls, key , value) else: setattr(cls, key, value(key) ) return cls return decorate #Example @check_attributes( name=SizedString(size=8), shares=UnsignedInteger, price=UnsignedFloat ) class Stock: def __init__(self, name, shares, price): self.name = name self.shares = shares self.price = price print('Method 2') s = Stock('ACME', 50, 91.1) print( s.name ) s.shares = 75 print( s.shares) try: s.shares = -1 except: pass print( s.shares ) try: s.name = 'AAAABBBC' except: pass print( s.name ) #A metaclass that applies checking Method3 class checkedmeta( type ): def __new__(cls, clsname, bases, methods ): #Attach attribute names to the descriptors for key, value in methods.items(): if isinstance( value, Descriptor ): value.name = key return type.__new__(cls, clsname, bases, methods) # Example class Stock(metaclass=checkedmeta): #default name eq name,better than method1 name = SizedString(size=8) shares = UnsignedInteger() price = UnsignedFloat() def __init__(self, name, shares, price): self.name = name self.shares = shares self.price = price print('Method 3') s = Stock('ACME', 50, 91.1) print( s.name ) s.shares = 75 print( s.shares) try: s.shares = -1 except: pass print( s.shares ) try: s.name = 'AAAABBBC' except: pass print( s.name ) #Normal class Point: x = Integer('x') y = Integer('y') #MetaClass class Point(metaclass=checkedmeta): x = Integer() y = Integer() #use property functions~ TODO:: Change Typed,Unsigned,MaxSized as Method,
class Descriptor: def __init__(self, name=None, **opts): self.name = name for (key, value) in opts.items(): setattr(self, key, value) def __set__(self, instance, value): instance.__dict__[self.name] = value class Typed(Descriptor): expected_type = type(None) def __set__(self, instance, value): if not isinstance(value, self.expected_type): raise type_error('expected ' + str(self.expected_type)) super().__set__(instance, value) class Unsigned(Descriptor): def __set__(self, instance, value): if value < 0: raise value_error('Expected >=0 ') super().__set__(instance, value) class Maxsized(Descriptor): def __init__(self, name=None, **opts): if 'size' not in opts: raise type_error('missing size option') super().__init__(name, **opts) def __set__(self, instance, value): if len(value) >= self.size: raise value_error('size must be < ' + str(self.size)) super().__set__(instance, value) class Integer(Typed): expected_type = int class Unsignedinteger(Integer, Unsigned): pass class Float(Typed): expected_type = float class Unsignedfloat(Float, Unsigned): pass class String(Typed): expected_type = str class Sizedstring(String, MaxSized): pass class Stock: name = sized_string('name', size=8) shares = unsigned_integer('shares') price = unsigned_float('price') def __init__(self, name, shares, price): self.name = name self.shares = shares self.price = price print('Method 1') s = stock('ACME', 50, 91.1) print(s.name) s.shares = 75 print(s.shares) try: s.shares = -1 except: pass print(s.shares) try: s.name = 'AAAABBBC' except: pass print(s.name) '\nThere are some techniques that can be used to simplify the specification of constraints\nin classes. One approach is to use a class decorator\n' def check_attributes(**kwargs): def decorate(cls): for (key, value) in kwargs.items(): if isinstance(value, Descriptor): value.name = key setattr(cls, key, value) else: setattr(cls, key, value(key)) return cls return decorate @check_attributes(name=sized_string(size=8), shares=UnsignedInteger, price=UnsignedFloat) class Stock: def __init__(self, name, shares, price): self.name = name self.shares = shares self.price = price print('Method 2') s = stock('ACME', 50, 91.1) print(s.name) s.shares = 75 print(s.shares) try: s.shares = -1 except: pass print(s.shares) try: s.name = 'AAAABBBC' except: pass print(s.name) class Checkedmeta(type): def __new__(cls, clsname, bases, methods): for (key, value) in methods.items(): if isinstance(value, Descriptor): value.name = key return type.__new__(cls, clsname, bases, methods) class Stock(metaclass=checkedmeta): name = sized_string(size=8) shares = unsigned_integer() price = unsigned_float() def __init__(self, name, shares, price): self.name = name self.shares = shares self.price = price print('Method 3') s = stock('ACME', 50, 91.1) print(s.name) s.shares = 75 print(s.shares) try: s.shares = -1 except: pass print(s.shares) try: s.name = 'AAAABBBC' except: pass print(s.name) class Point: x = integer('x') y = integer('y') class Point(metaclass=checkedmeta): x = integer() y = integer()
{ "targets": [ { "target_name": "napi_test", "sources": [ "napi.test.c" ] }, { "target_name": "napi_arguments", "sources": [ "napi_arguments.c" ] }, { "target_name": "napi_async", "sources": [ "napi_async.cc" ] }, { "target_name": "napi_construct", "sources": [ "napi_construct.c" ] }, { "target_name": "napi_error", "sources": [ "napi_error.c" ] }, { "target_name": "napi_fatal_error", "sources": [ "napi_fatal_error.c" ] }, { "target_name": "napi_make_callback_recurse", "sources": [ "napi_make_callback_recurse.cc" ] }, { "target_name": "napi_make_callback", "sources": [ "napi_make_callback.c" ] }, { "target_name": "napi_object_wrap", "sources": [ "napi_object_wrap.c" ] }, { "target_name": "napi_reference", "sources": [ "napi_reference.c" ] }, { "target_name": "napi_new_target", "sources": [ "napi_new_target.c" ] }, { "target_name": "napi_string", "sources": [ "napi_string.c" ] }, { "target_name": "napi_thread_safe", "sources": [ "napi_thread_safe.c" ] }, { "target_name": "napi_tsfn", "sources": [ "napi_tsfn.c" ] }, { "target_name": "napi_typedarray", "sources": [ "napi_typedarray.c" ] } ] }
{'targets': [{'target_name': 'napi_test', 'sources': ['napi.test.c']}, {'target_name': 'napi_arguments', 'sources': ['napi_arguments.c']}, {'target_name': 'napi_async', 'sources': ['napi_async.cc']}, {'target_name': 'napi_construct', 'sources': ['napi_construct.c']}, {'target_name': 'napi_error', 'sources': ['napi_error.c']}, {'target_name': 'napi_fatal_error', 'sources': ['napi_fatal_error.c']}, {'target_name': 'napi_make_callback_recurse', 'sources': ['napi_make_callback_recurse.cc']}, {'target_name': 'napi_make_callback', 'sources': ['napi_make_callback.c']}, {'target_name': 'napi_object_wrap', 'sources': ['napi_object_wrap.c']}, {'target_name': 'napi_reference', 'sources': ['napi_reference.c']}, {'target_name': 'napi_new_target', 'sources': ['napi_new_target.c']}, {'target_name': 'napi_string', 'sources': ['napi_string.c']}, {'target_name': 'napi_thread_safe', 'sources': ['napi_thread_safe.c']}, {'target_name': 'napi_tsfn', 'sources': ['napi_tsfn.c']}, {'target_name': 'napi_typedarray', 'sources': ['napi_typedarray.c']}]}
__title__ = 'Django Platform Data Service' __version__ = '0.0.4' __author__ = 'Komol Nath Roy' __license__ = 'MIT' __copyright__ = 'Copyright 2020 Komol Nath Roy' VERSION = __version__ default_app_config = 'django_pds.apps.DjangoPdsConfig'
__title__ = 'Django Platform Data Service' __version__ = '0.0.4' __author__ = 'Komol Nath Roy' __license__ = 'MIT' __copyright__ = 'Copyright 2020 Komol Nath Roy' version = __version__ default_app_config = 'django_pds.apps.DjangoPdsConfig'
#!C:\Python27 # For 500,000 mutables, this takes WAY to long. Look for better options orgFile = open('InputList.txt', 'r') newFile = open('SortedList.txt', 'w') unsortedList = [line.strip() for line in orgFile] def bubble_sort(list): for i in reversed(range(len(list))): finished = True for j in range(i): if list[j] > list[j + 1]: list[j], list[j + 1] = list[j + 1], list[j] finished = False if finished: break return list sortedList = bubble_sort(unsortedList) for i in sortedList: newFile.write("%s\n" % i) orgFile.close() newFile.clsoe()
org_file = open('InputList.txt', 'r') new_file = open('SortedList.txt', 'w') unsorted_list = [line.strip() for line in orgFile] def bubble_sort(list): for i in reversed(range(len(list))): finished = True for j in range(i): if list[j] > list[j + 1]: (list[j], list[j + 1]) = (list[j + 1], list[j]) finished = False if finished: break return list sorted_list = bubble_sort(unsortedList) for i in sortedList: newFile.write('%s\n' % i) orgFile.close() newFile.clsoe()
students = [] def displayMenu(): print("What would you like to do?") print("\t(a) Add new student: ") print("\t(v) View students: ") print("\t(q) Quit: ") choice = input("Type one letter (a/v/q): ").strip() return choice #test the function def doAdd(): currentstudent = {} currentstudent["name"]=input("Enter Name: ") currentstudent["modules"]= readmodules() students.append(currentstudent) def readmodules(): modules = [] modulesName = input("\tEnter the first module name (blank to quit): ").strip() while modulesName != "": module = {} module["name"] = modulesName module["grade"] = int(input("Enter Grade: ")) modules.append(module) modulesName = input("\tEnter next module name (blank to quit: )").strip() return modules def displayModules(modules): print("\tName \tGrade") for module in modules: print("\t{}\t{}".format(module["name"], module["grade"])) def doView(): for currentstudent in students: print(currentstudent["name"]) displayModules(currentstudent["modules"]) choice = displayMenu() while (choice != 'q'): if choice == 'a': doAdd() elif choice == 'v': doView() elif choice != 'q': print("\n\nPlease select a, v or q") choice = displayMenu() print(students)
students = [] def display_menu(): print('What would you like to do?') print('\t(a) Add new student: ') print('\t(v) View students: ') print('\t(q) Quit: ') choice = input('Type one letter (a/v/q): ').strip() return choice def do_add(): currentstudent = {} currentstudent['name'] = input('Enter Name: ') currentstudent['modules'] = readmodules() students.append(currentstudent) def readmodules(): modules = [] modules_name = input('\tEnter the first module name (blank to quit): ').strip() while modulesName != '': module = {} module['name'] = modulesName module['grade'] = int(input('Enter Grade: ')) modules.append(module) modules_name = input('\tEnter next module name (blank to quit: )').strip() return modules def display_modules(modules): print('\tName \tGrade') for module in modules: print('\t{}\t{}'.format(module['name'], module['grade'])) def do_view(): for currentstudent in students: print(currentstudent['name']) display_modules(currentstudent['modules']) choice = display_menu() while choice != 'q': if choice == 'a': do_add() elif choice == 'v': do_view() elif choice != 'q': print('\n\nPlease select a, v or q') choice = display_menu() print(students)
def collect(items, item): if item in collecting_items: return collecting_items.append(item) return def drop(items, item): if item in collecting_items: collecting_items.remove(item) return return def combine_items(old, new): if old in collecting_items: for el in collecting_items: if el == old: index_of_el = collecting_items.index(el) collecting_items.insert(index_of_el + 1, new) return return def renew(items, item): if item in collecting_items: collecting_items.remove(item) collecting_items.append(item) return return def split_items(items, item): oldy, newy = item.split(":") return oldy, newy def is_item_in_list(items, item): if item in items: is_item_there = True return is_item_there return collecting_items = input().split(", ") command, item = input().split(" - ") is_item_there = False while command != "Craft!": if command == "Collect": is_item_in_list(collecting_items, command) if not is_item_there: collect(command) if command == "Drop": is_item_in_list(collecting_items, command) if not is_item_there: drop(command) if command == "Combine Items": if not is_item_there: result3, result4 = split_items(item) # splitting the combining items by ":" combine_items(result3, result4) if command == "Renew": is_item_in_list(collecting_items, command) if not is_item_there: renew(command) print(collecting_items) command = input().split(" - ") print(", ".join(collecting_items)) print(*collecting_items, sep=", ") # Iron, Sword, Stone # Drop - Bronze # Combine Items - Sword:Bow # Renew - Iron # Craft!
def collect(items, item): if item in collecting_items: return collecting_items.append(item) return def drop(items, item): if item in collecting_items: collecting_items.remove(item) return return def combine_items(old, new): if old in collecting_items: for el in collecting_items: if el == old: index_of_el = collecting_items.index(el) collecting_items.insert(index_of_el + 1, new) return return def renew(items, item): if item in collecting_items: collecting_items.remove(item) collecting_items.append(item) return return def split_items(items, item): (oldy, newy) = item.split(':') return (oldy, newy) def is_item_in_list(items, item): if item in items: is_item_there = True return is_item_there return collecting_items = input().split(', ') (command, item) = input().split(' - ') is_item_there = False while command != 'Craft!': if command == 'Collect': is_item_in_list(collecting_items, command) if not is_item_there: collect(command) if command == 'Drop': is_item_in_list(collecting_items, command) if not is_item_there: drop(command) if command == 'Combine Items': if not is_item_there: (result3, result4) = split_items(item) combine_items(result3, result4) if command == 'Renew': is_item_in_list(collecting_items, command) if not is_item_there: renew(command) print(collecting_items) command = input().split(' - ') print(', '.join(collecting_items)) print(*collecting_items, sep=', ')
# Make this unique, and don't share it with anybody. SECRET_KEY = '' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME': '', # Or path to database file if using sqlite3. 'USER': '', # Not used with sqlite3. 'PASSWORD': '', # Not used with sqlite3. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. 'PORT': '', # Set to empty string for default. Not used with sqlite3. } } JOBS_NEW_THRESHOLD = 1 JOBS_NOTIFICATION_LIST = [] # list of email addresses GATEKEEPER_ENABLE_AUTOMODERATION = True GATEKEEPER_DEFAULT_STATUS = 0 GATEKEEPER_MODERATOR_LIST = JOBS_NOTIFICATION_LIST
secret_key = '' databases = {'default': {'ENGINE': 'django.db.backends.', 'NAME': '', 'USER': '', 'PASSWORD': '', 'HOST': '', 'PORT': ''}} jobs_new_threshold = 1 jobs_notification_list = [] gatekeeper_enable_automoderation = True gatekeeper_default_status = 0 gatekeeper_moderator_list = JOBS_NOTIFICATION_LIST
#* Asked by Facebook #? Given a list of sorted numbers, build a list of strings displaying numbers, #? Where each string is first and last number of linearly increasing numbers. #! Example: #? Input: [0,1,2,2,5,7,8,9,9,10,11,15] #? Output: ['0 -> 2','5 -> 5','7 -> 11','15 -> 15'] #! Note that numbers will not be lower than 0, also numbers may repeat def truncateList(lst): if len(lst) == 0: return list() num = lst[0] next_num = num+1 start_num = num final_lst = list() i = 1 while i < len(lst): if lst[i] == num or lst[i] == next_num: pass else: final_lst.append(f"{start_num} -> {num}") start_num = lst[i] num = lst[i] next_num = num + 1 i+=1 else: final_lst.append(f"{start_num} -> {num}") return final_lst print(truncateList([0,1,2,2,5,7,8,9,9,10,11,15])) # ['0 -> 2', '5 -> 5', '7 -> 11', '15 -> 15']
def truncate_list(lst): if len(lst) == 0: return list() num = lst[0] next_num = num + 1 start_num = num final_lst = list() i = 1 while i < len(lst): if lst[i] == num or lst[i] == next_num: pass else: final_lst.append(f'{start_num} -> {num}') start_num = lst[i] num = lst[i] next_num = num + 1 i += 1 else: final_lst.append(f'{start_num} -> {num}') return final_lst print(truncate_list([0, 1, 2, 2, 5, 7, 8, 9, 9, 10, 11, 15]))
# Copyright (c) 2018-2019 Arizona Board of Regents # # 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. class FigSize(object): """Helper to compute the size of matplotlib figures. The idea is to perform conversion between absolute margin sizes (and spacing between rows and columns in case of multiple subplots) and their corresponding relative that are needed for matplotlib. Additionnally, there is the possibility to reserve room on a plot to add a color bar. """ SIZE_ALL = 1 SIZE_NO_CBAR = 2 SIZE_AXES = 3 SIZE_AX = 4 SIZE_RATIO_AX = 5 def __init__( self, size_h = None, size_v = None, nrows = 1, ncols = 1, margin_left = None, margin_bottom = None, margin_right = None, margin_top = None ): self.size_h = size_h self.type_h = self.SIZE_ALL self.size_v = size_v self.type_v = self.SIZE_ALL self.nrows = nrows self.ncols = ncols self.margin_left = margin_left self.margin_bottom = margin_bottom self.margin_right = margin_right self.margin_top = margin_top self.spacing_h = None self.spacing_v = None self.cbar_loc = None self.cbar_width = None self.cbar_pad = None def set_size_h( self, size_h, type_h = None ): """Set the horizontal size of the figure. Parameters ---------- size_h : float Horizontal size of the figure in inches, the meaning depends on the value of parameter `type_h`. type_h : int Mode for the horizontal size, one of the SIZE_* constants. - SIZE_ALL: `size_h` is the total size of the figure, including margins and color bar (default) - SIZE_NO_CBAR: `size_h` is the size of the figure, without the potential color bar - SIZE_AXES: `size_h` is the size of the axis region of the figure, without the margins and the potential color bar. - SIZE_AX: `size_h` is the size of one of the axis. - SIZE_RATIO_AX: `size_h` is the ratio of the vertical size of the axis region. """ self.size_h = size_h if not type_h is None: self.type_h = type_h def set_size_v( self, size_v, type_v = None ): """Set the vertical size of the figure. Parameters ---------- size_v : float Vertical size of the figure, the meaning depends on the value of parameter `type_v`. type_v : int Mode for the vertical size, one of the SIZE_* constants. - SIZE_ALL: `size_v` is the total size of the figure, including margins and color bar (default) - SIZE_NO_CBAR: `size_v` is the size of the figure, without the potential color bar - SIZE_AXES: `size_v` is the size of the axis region of the figure, without the margins and the potential color bar. - SIZE_AX: `size_v` is the size of one of the axis. - SIZE_RATIO_AX: `size_v` is the ratio of the horizontal size of the axis region. """ self.size_v = size_v if not type_v is None: self.type_v = type_v def set_nrows( self, nrows ): """Set the number of rows of subplots that will be inserted in the figure This is used to compute the vertical spacing between the rows. Parameters ---------- nrows : int Number of rows of subplots that will be inserted in the figure """ self.nrows = nrows def set_ncols( self, ncols ): """Set the number of columns of subplots that will be inserted in the figure This is used to compute the horizontal spacing between the rows. Parameters ---------- ncols : int Number of columns of subplots that will be inserted in the figure """ self.ncols = ncols def get_margin_left( self ): """Retrieve the left margin""" return self.margin_left def set_margin_left( self, margin_left ): """Set the left margin Parameters ---------- margin_left : float Left margin, in inches """ self.margin_left = margin_left def get_margin_bottom( self ): """Retrieve the bottom margin""" return self.margin_bottom def set_margin_bottom( self, margin_bottom ): """Set the bottom margin Parameters ---------- margin_bottom : float Bottom margin, in inches """ self.margin_bottom = margin_bottom def get_margin_right( self ): """Retrieve the right margin""" return self.margin_right def set_margin_right( self, margin_right ): """Set the right margin Parameters ---------- margin_right : float Right margin, in inches """ self.margin_right = margin_right def get_margin_top( self ): """Retrieve the top margin""" return self.margin_top def set_margin_top( self, margin_top ): """Set the top margin Parameters ---------- margin_top : float Top margin, in inches """ self.margin_top = margin_top def set_spacing_h( self, spacing_h ): """Set the horizontal spacing between panels. By default it is equal to the sum of the left and right margins. Parameters ---------- spacing_h : float or None Horizontal spacing in inches, or None to reset to default. """ self.spacing_h = spacing_h def set_spacing_v( self, spacing_v ): """Set the vertical spacing between panels. By default it is equal to the sum of the top and bottom margins. Parameters ---------- spacing_v : float or None Vertical spacing in inches, or None to reset to default. """ self.spacing_v = spacing_v def set_cbar_loc( self, cbar_loc ): """Set the location of the color bar Parameters ---------- cbar_loc : "left", "bottom", "right" or "top" Location of the color with respect to the plot area, any other value will not reserve any room for the color bar on the figure. """ self.cbar_loc = cbar_loc def set_cbar_width( self, cbar_width ): """Set the width of the color bar Parameters ---------- cbar_width : float Set the width of the color bar plot area, in inches """ self.cbar_width = cbar_width def set_cbar_pad( self, cbar_pad ): """Set the padding between the color bar and the plot area. Parameters ---------- cbar_loc : float Set the width of the color bar axis area, in inches """ self.cbar_pad = cbar_pad def get_figure_size( self ): """Determine the actual size of the figure. This will determine the total size of the figure, including margins and color bar if needed. Returns ------- tuple Horizontal and vertical size of the figure, in inches """ size_h = self.size_h size_v = self.size_v if self.spacing_h is None: spacing_h = self.margin_left + self.margin_right else: spacing_h = self.spacing_h if self.spacing_v is None: spacing_v = self.margin_bottom + self.margin_top else: spacing_v = self.spacing_v if self.type_h == self.SIZE_RATIO_AX: if self.type_v == self.SIZE_RATIO_AX: raise Exception( "type_h and type_v cannot be both SIZE_RATIO_AX at the same time." ) elif self.type_v == self.SIZE_AX: size_h *= size_v elif self.type_v == self.SIZE_AXES: size_h *= ( size_v - spacing_v * ( self.nrows - 1 ) ) / self.nrows elif self.type_v == self.SIZE_NO_CBAR: size_h *= ( size_v - self.margin_bottom - self.margin_top - spacing_v * ( self.nrows - 1 ) ) / self.nrows else: size_h *= ( size_v - ( self.cbar_width + self.cbar_pad if self.cbar_loc == "bottom" or self.cbar_loc == "top" else 0. ) - self.margin_bottom - self.margin_top - spacing_v * ( self.nrows - 1 ) ) / self.nrows if self.type_v == self.SIZE_RATIO_AX: if self.type_h == self.SIZE_RATIO_AX: # Should not happen, but just in case raise Exception( "type_h and type_v cannot be both SIZE_RATIO_AX at the same time." ) elif self.type_h == self.SIZE_AX: size_v *= size_h elif self.type_h == self.SIZE_AXES: size_v *= ( size_h - spacing_h * ( self.ncols - 1 ) ) / self.ncols elif self.type_h == self.SIZE_NO_CBAR: size_v *= ( size_h - self.margin_left - self.margin_right - spacing_h * ( self.ncols - 1 ) ) / self.ncols else: size_v *= ( size_h - ( self.cbar_width + self.cbar_pad if self.cbar_loc == "left" or self.cbar_loc == "right" else 0. ) - self.margin_left - self.margin_right - spacing_h * ( self.ncols - 1 ) ) / self.ncols if self.type_h == self.SIZE_AX or self.type_h == self.SIZE_RATIO_AX: size_h *= self.ncols size_h += spacing_h * ( self.ncols - 1 ) if self.type_v == self.SIZE_AX or self.type_v == self.SIZE_RATIO_AX: size_v *= self.nrows size_v += spacing_v * ( self.nrows - 1 ) if self.type_h == self.SIZE_AXES or self.type_h == self.SIZE_AX or self.type_h == self.SIZE_RATIO_AX: size_h += self.margin_left + self.margin_right if self.type_v == self.SIZE_AXES or self.type_v == self.SIZE_AX or self.type_v == self.SIZE_RATIO_AX: size_v += self.margin_bottom + self.margin_top if ( self.type_h == self.SIZE_NO_CBAR or self.type_h == self.SIZE_AXES or self.type_h == self.SIZE_AX or self.type_h == self.SIZE_RATIO_AX ) and ( self.cbar_loc == "left" or self.cbar_loc == "right" ): size_h += self.cbar_width + self.cbar_pad if ( self.type_v == self.SIZE_NO_CBAR or self.type_v == self.SIZE_AXES or self.type_v == self.SIZE_AX or self.type_v == self.SIZE_RATIO_AX ) and ( self.cbar_loc == "bottom" or self.cbar_loc == "top" ): size_v += self.cbar_width + self.cbar_pad return ( size_h, size_v ) def get_figure_args( self ): """ Get the size arguments for when creating a figure. Returns ------- dict Arguments for the matplotlib.pyplot.figure() function. """ return { "figsize": self.get_figure_size() } def get_subplots_args( self ): """ Get the arguments for the location of the subplots. Returns ------- dict Arguments for the Figure.subplots_adjust() function. """ size_h, size_v = self.get_figure_size() left = self.margin_left bottom = self.margin_bottom right = self.margin_right top = self.margin_top if self.cbar_loc == "left": left += self.cbar_width + self.cbar_pad if self.cbar_loc == "right": right += self.cbar_width + self.cbar_pad if self.cbar_loc == "bottom": bottom += self.cbar_width + self.cbar_pad if self.cbar_loc == "top": top += self.cbar_width + self.cbar_pad if self.spacing_h is None: spacing_h = self.margin_left + self.margin_right else: spacing_h = self.spacing_h if self.spacing_v is None: spacing_v = self.margin_bottom + self.margin_top else: spacing_v = self.spacing_v if self.ncols > 1 and spacing_h > 0.: wspace = self.ncols / ( ( size_h - right - left ) / spacing_h - ( self.ncols - 1 ) ) else: wspace = 0. if self.nrows > 1 and spacing_v > 0.: hspace = self.nrows / ( ( size_v - top - bottom ) / spacing_v - ( self.nrows - 1 ) ) else: hspace = 0. return { "left": left / size_h, "bottom": bottom / size_v, "right": 1. - right / size_h, "top": 1. - top / size_v, "wspace": wspace, "hspace": hspace } def has_cbar( self ): """Retrieve whether room has been reserved for the color bar. Returns ------- bool Whether room is reserved for the color bar. """ return self.cbar_loc == "left" or self.cbar_loc == "right" or self.cbar_loc == "bottom" or self.cbar_loc == "top" def get_cbar_ax_spec( self ): """Retrieve the location of the color bar in the figure. Returns ------- list Location of the area for the color bar, which can be used as an argument to Figure.add_axes(). """ size_h, size_v = self.get_figure_size() if self.cbar_loc == "left": return [ self.margin_left / size_h, self.margin_bottom / size_v, self.cbar_width / size_h, 1. - ( self.margin_bottom + self.margin_top ) / size_v ] if self.cbar_loc == "right": return [ 1. - ( self.cbar_width + self.cbar_pad ) / size_h, self.margin_bottom / size_v, self.cbar_width / size_h, 1. - ( self.margin_bottom + self.margin_top ) / size_v ] if self.cbar_loc == "bottom": return [ self.margin_left / size_h, self.margin_bottom / size_v, 1. - ( self.margin_left + self.margin_right ) / size_h, self.cbar_width / size_v ] if self.cbar_loc == "top": return [ self.margin_left / size_h, 1. - ( self.cbar_width + self.margin_top ) / size_v, 1. - ( self.margin_left + self.margin_right ) / size_h, self.cbar_width / size_v ] return None def get_cbar_orientation( self ): """Retrieve the orientation of the color bar. Returns ------- "vertical", "horizontal" or None Orientation of the color bar, which can be provided as the value of the "orientation" parameter of Figure.colorbar(), or None if disabled. """ if self.cbar_loc == "left" or self.cbar_loc == "right": return "vertical" if self.cbar_loc == "bottom" or self.cbar_loc == "top": return "horizontal" return None
class Figsize(object): """Helper to compute the size of matplotlib figures. The idea is to perform conversion between absolute margin sizes (and spacing between rows and columns in case of multiple subplots) and their corresponding relative that are needed for matplotlib. Additionnally, there is the possibility to reserve room on a plot to add a color bar. """ size_all = 1 size_no_cbar = 2 size_axes = 3 size_ax = 4 size_ratio_ax = 5 def __init__(self, size_h=None, size_v=None, nrows=1, ncols=1, margin_left=None, margin_bottom=None, margin_right=None, margin_top=None): self.size_h = size_h self.type_h = self.SIZE_ALL self.size_v = size_v self.type_v = self.SIZE_ALL self.nrows = nrows self.ncols = ncols self.margin_left = margin_left self.margin_bottom = margin_bottom self.margin_right = margin_right self.margin_top = margin_top self.spacing_h = None self.spacing_v = None self.cbar_loc = None self.cbar_width = None self.cbar_pad = None def set_size_h(self, size_h, type_h=None): """Set the horizontal size of the figure. Parameters ---------- size_h : float Horizontal size of the figure in inches, the meaning depends on the value of parameter `type_h`. type_h : int Mode for the horizontal size, one of the SIZE_* constants. - SIZE_ALL: `size_h` is the total size of the figure, including margins and color bar (default) - SIZE_NO_CBAR: `size_h` is the size of the figure, without the potential color bar - SIZE_AXES: `size_h` is the size of the axis region of the figure, without the margins and the potential color bar. - SIZE_AX: `size_h` is the size of one of the axis. - SIZE_RATIO_AX: `size_h` is the ratio of the vertical size of the axis region. """ self.size_h = size_h if not type_h is None: self.type_h = type_h def set_size_v(self, size_v, type_v=None): """Set the vertical size of the figure. Parameters ---------- size_v : float Vertical size of the figure, the meaning depends on the value of parameter `type_v`. type_v : int Mode for the vertical size, one of the SIZE_* constants. - SIZE_ALL: `size_v` is the total size of the figure, including margins and color bar (default) - SIZE_NO_CBAR: `size_v` is the size of the figure, without the potential color bar - SIZE_AXES: `size_v` is the size of the axis region of the figure, without the margins and the potential color bar. - SIZE_AX: `size_v` is the size of one of the axis. - SIZE_RATIO_AX: `size_v` is the ratio of the horizontal size of the axis region. """ self.size_v = size_v if not type_v is None: self.type_v = type_v def set_nrows(self, nrows): """Set the number of rows of subplots that will be inserted in the figure This is used to compute the vertical spacing between the rows. Parameters ---------- nrows : int Number of rows of subplots that will be inserted in the figure """ self.nrows = nrows def set_ncols(self, ncols): """Set the number of columns of subplots that will be inserted in the figure This is used to compute the horizontal spacing between the rows. Parameters ---------- ncols : int Number of columns of subplots that will be inserted in the figure """ self.ncols = ncols def get_margin_left(self): """Retrieve the left margin""" return self.margin_left def set_margin_left(self, margin_left): """Set the left margin Parameters ---------- margin_left : float Left margin, in inches """ self.margin_left = margin_left def get_margin_bottom(self): """Retrieve the bottom margin""" return self.margin_bottom def set_margin_bottom(self, margin_bottom): """Set the bottom margin Parameters ---------- margin_bottom : float Bottom margin, in inches """ self.margin_bottom = margin_bottom def get_margin_right(self): """Retrieve the right margin""" return self.margin_right def set_margin_right(self, margin_right): """Set the right margin Parameters ---------- margin_right : float Right margin, in inches """ self.margin_right = margin_right def get_margin_top(self): """Retrieve the top margin""" return self.margin_top def set_margin_top(self, margin_top): """Set the top margin Parameters ---------- margin_top : float Top margin, in inches """ self.margin_top = margin_top def set_spacing_h(self, spacing_h): """Set the horizontal spacing between panels. By default it is equal to the sum of the left and right margins. Parameters ---------- spacing_h : float or None Horizontal spacing in inches, or None to reset to default. """ self.spacing_h = spacing_h def set_spacing_v(self, spacing_v): """Set the vertical spacing between panels. By default it is equal to the sum of the top and bottom margins. Parameters ---------- spacing_v : float or None Vertical spacing in inches, or None to reset to default. """ self.spacing_v = spacing_v def set_cbar_loc(self, cbar_loc): """Set the location of the color bar Parameters ---------- cbar_loc : "left", "bottom", "right" or "top" Location of the color with respect to the plot area, any other value will not reserve any room for the color bar on the figure. """ self.cbar_loc = cbar_loc def set_cbar_width(self, cbar_width): """Set the width of the color bar Parameters ---------- cbar_width : float Set the width of the color bar plot area, in inches """ self.cbar_width = cbar_width def set_cbar_pad(self, cbar_pad): """Set the padding between the color bar and the plot area. Parameters ---------- cbar_loc : float Set the width of the color bar axis area, in inches """ self.cbar_pad = cbar_pad def get_figure_size(self): """Determine the actual size of the figure. This will determine the total size of the figure, including margins and color bar if needed. Returns ------- tuple Horizontal and vertical size of the figure, in inches """ size_h = self.size_h size_v = self.size_v if self.spacing_h is None: spacing_h = self.margin_left + self.margin_right else: spacing_h = self.spacing_h if self.spacing_v is None: spacing_v = self.margin_bottom + self.margin_top else: spacing_v = self.spacing_v if self.type_h == self.SIZE_RATIO_AX: if self.type_v == self.SIZE_RATIO_AX: raise exception('type_h and type_v cannot be both SIZE_RATIO_AX at the same time.') elif self.type_v == self.SIZE_AX: size_h *= size_v elif self.type_v == self.SIZE_AXES: size_h *= (size_v - spacing_v * (self.nrows - 1)) / self.nrows elif self.type_v == self.SIZE_NO_CBAR: size_h *= (size_v - self.margin_bottom - self.margin_top - spacing_v * (self.nrows - 1)) / self.nrows else: size_h *= (size_v - (self.cbar_width + self.cbar_pad if self.cbar_loc == 'bottom' or self.cbar_loc == 'top' else 0.0) - self.margin_bottom - self.margin_top - spacing_v * (self.nrows - 1)) / self.nrows if self.type_v == self.SIZE_RATIO_AX: if self.type_h == self.SIZE_RATIO_AX: raise exception('type_h and type_v cannot be both SIZE_RATIO_AX at the same time.') elif self.type_h == self.SIZE_AX: size_v *= size_h elif self.type_h == self.SIZE_AXES: size_v *= (size_h - spacing_h * (self.ncols - 1)) / self.ncols elif self.type_h == self.SIZE_NO_CBAR: size_v *= (size_h - self.margin_left - self.margin_right - spacing_h * (self.ncols - 1)) / self.ncols else: size_v *= (size_h - (self.cbar_width + self.cbar_pad if self.cbar_loc == 'left' or self.cbar_loc == 'right' else 0.0) - self.margin_left - self.margin_right - spacing_h * (self.ncols - 1)) / self.ncols if self.type_h == self.SIZE_AX or self.type_h == self.SIZE_RATIO_AX: size_h *= self.ncols size_h += spacing_h * (self.ncols - 1) if self.type_v == self.SIZE_AX or self.type_v == self.SIZE_RATIO_AX: size_v *= self.nrows size_v += spacing_v * (self.nrows - 1) if self.type_h == self.SIZE_AXES or self.type_h == self.SIZE_AX or self.type_h == self.SIZE_RATIO_AX: size_h += self.margin_left + self.margin_right if self.type_v == self.SIZE_AXES or self.type_v == self.SIZE_AX or self.type_v == self.SIZE_RATIO_AX: size_v += self.margin_bottom + self.margin_top if (self.type_h == self.SIZE_NO_CBAR or self.type_h == self.SIZE_AXES or self.type_h == self.SIZE_AX or (self.type_h == self.SIZE_RATIO_AX)) and (self.cbar_loc == 'left' or self.cbar_loc == 'right'): size_h += self.cbar_width + self.cbar_pad if (self.type_v == self.SIZE_NO_CBAR or self.type_v == self.SIZE_AXES or self.type_v == self.SIZE_AX or (self.type_v == self.SIZE_RATIO_AX)) and (self.cbar_loc == 'bottom' or self.cbar_loc == 'top'): size_v += self.cbar_width + self.cbar_pad return (size_h, size_v) def get_figure_args(self): """ Get the size arguments for when creating a figure. Returns ------- dict Arguments for the matplotlib.pyplot.figure() function. """ return {'figsize': self.get_figure_size()} def get_subplots_args(self): """ Get the arguments for the location of the subplots. Returns ------- dict Arguments for the Figure.subplots_adjust() function. """ (size_h, size_v) = self.get_figure_size() left = self.margin_left bottom = self.margin_bottom right = self.margin_right top = self.margin_top if self.cbar_loc == 'left': left += self.cbar_width + self.cbar_pad if self.cbar_loc == 'right': right += self.cbar_width + self.cbar_pad if self.cbar_loc == 'bottom': bottom += self.cbar_width + self.cbar_pad if self.cbar_loc == 'top': top += self.cbar_width + self.cbar_pad if self.spacing_h is None: spacing_h = self.margin_left + self.margin_right else: spacing_h = self.spacing_h if self.spacing_v is None: spacing_v = self.margin_bottom + self.margin_top else: spacing_v = self.spacing_v if self.ncols > 1 and spacing_h > 0.0: wspace = self.ncols / ((size_h - right - left) / spacing_h - (self.ncols - 1)) else: wspace = 0.0 if self.nrows > 1 and spacing_v > 0.0: hspace = self.nrows / ((size_v - top - bottom) / spacing_v - (self.nrows - 1)) else: hspace = 0.0 return {'left': left / size_h, 'bottom': bottom / size_v, 'right': 1.0 - right / size_h, 'top': 1.0 - top / size_v, 'wspace': wspace, 'hspace': hspace} def has_cbar(self): """Retrieve whether room has been reserved for the color bar. Returns ------- bool Whether room is reserved for the color bar. """ return self.cbar_loc == 'left' or self.cbar_loc == 'right' or self.cbar_loc == 'bottom' or (self.cbar_loc == 'top') def get_cbar_ax_spec(self): """Retrieve the location of the color bar in the figure. Returns ------- list Location of the area for the color bar, which can be used as an argument to Figure.add_axes(). """ (size_h, size_v) = self.get_figure_size() if self.cbar_loc == 'left': return [self.margin_left / size_h, self.margin_bottom / size_v, self.cbar_width / size_h, 1.0 - (self.margin_bottom + self.margin_top) / size_v] if self.cbar_loc == 'right': return [1.0 - (self.cbar_width + self.cbar_pad) / size_h, self.margin_bottom / size_v, self.cbar_width / size_h, 1.0 - (self.margin_bottom + self.margin_top) / size_v] if self.cbar_loc == 'bottom': return [self.margin_left / size_h, self.margin_bottom / size_v, 1.0 - (self.margin_left + self.margin_right) / size_h, self.cbar_width / size_v] if self.cbar_loc == 'top': return [self.margin_left / size_h, 1.0 - (self.cbar_width + self.margin_top) / size_v, 1.0 - (self.margin_left + self.margin_right) / size_h, self.cbar_width / size_v] return None def get_cbar_orientation(self): """Retrieve the orientation of the color bar. Returns ------- "vertical", "horizontal" or None Orientation of the color bar, which can be provided as the value of the "orientation" parameter of Figure.colorbar(), or None if disabled. """ if self.cbar_loc == 'left' or self.cbar_loc == 'right': return 'vertical' if self.cbar_loc == 'bottom' or self.cbar_loc == 'top': return 'horizontal' return None
#!/usr/bin/env python3 """ Advent of Code 2018 Puzzle #2 - 2018-12-02: Find two strings with hamming distance of one # https://adventofcode.com/2018/day/2 Input (via stdin): A series of strings. e.g.: abcdef hijklm uvwxyz azcdef Output: One of two strings that differ by exactly one character, with the matching character excluded. e.g.: acdef """ def find_id_with_hamming_of_one(ids): # We're going to be bad and assume that all IDs are the same length. # It's true in our input, but not explicit in the problem statement. # We're also just going to bruteforce it in a most horrendous manner: for i in range(1, len(list(ids)[0])): split_ids = set() for id in ids: s = id[0:i] + id[i+1:] if s in split_ids: return s split_ids.add(s) if __name__ == "__main__": ids = set() try: while True: ids.add(input()) except EOFError: print(find_id_with_hamming_of_one(ids))
""" Advent of Code 2018 Puzzle #2 - 2018-12-02: Find two strings with hamming distance of one # https://adventofcode.com/2018/day/2 Input (via stdin): A series of strings. e.g.: abcdef hijklm uvwxyz azcdef Output: One of two strings that differ by exactly one character, with the matching character excluded. e.g.: acdef """ def find_id_with_hamming_of_one(ids): for i in range(1, len(list(ids)[0])): split_ids = set() for id in ids: s = id[0:i] + id[i + 1:] if s in split_ids: return s split_ids.add(s) if __name__ == '__main__': ids = set() try: while True: ids.add(input()) except EOFError: print(find_id_with_hamming_of_one(ids))
""" Navigation provides the basic functionality of a page navigation to navigate between sites """ class Navigation: TEMPLATE = 'nav.j2' def __init__(self, env, pages): self._env = env self._pages = pages def render(self, name, current_page, tpl_file=None): if tpl_file is None: tpl_file = self.TEMPLATE # prepare data nodes = [] for page in self._pages: node = { 'href': f"{page['file']}.html", 'name': page['name'], 'is_active': False } if page['name'] == current_page: node['is_active'] = True nodes.append(node) # read template tpl = self._env.get_template(tpl_file) # render return tpl.render(name=name, nodes=nodes)
""" Navigation provides the basic functionality of a page navigation to navigate between sites """ class Navigation: template = 'nav.j2' def __init__(self, env, pages): self._env = env self._pages = pages def render(self, name, current_page, tpl_file=None): if tpl_file is None: tpl_file = self.TEMPLATE nodes = [] for page in self._pages: node = {'href': f"{page['file']}.html", 'name': page['name'], 'is_active': False} if page['name'] == current_page: node['is_active'] = True nodes.append(node) tpl = self._env.get_template(tpl_file) return tpl.render(name=name, nodes=nodes)
expected_output = { "session_type": { "AnyConnect": { "username": { "lee": { "index": { 1: { "assigned_ip": "192.168.246.1", "bytes": {"rx": 4942, "tx": 11079}, "duration": "0h:00m:15s", "encryption": "RC4 AES128", "group_policy": "EngPolicy", "hashing": "SHA1", "inactivity": "0h:00m:00s", "license": "AnyConnect Premium", "login_time": "15:25:13 EST Fri Jan 28 2011", "nac_result": "Unknown", "protocol": "AnyConnect-Parent SSL-Tunnel DTLS-Tunnel", "public_ip": "10.139.1.2", "tunnel_group": "EngGroup", "vlan": "none", "vlan_mapping": "N/A", } } }, "yumi": { "index": { 2: { "assigned_ip": "192.168.246.2", "bytes": {"rx": 6942, "tx": 11055}, "duration": "0h:05m:15s", "encryption": "RC4 AES128", "group_policy": "EngPolicy", "hashing": "SHA1", "inactivity": "0h:00m:00s", "license": "AnyConnect Premium", "login_time": "15:25:13 EST Fri Jan 29 2011", "nac_result": "Unknown", "protocol": "AnyConnect-Parent SSL-Tunnel DTLS-Tunnel", "public_ip": "10.139.1.3", "tunnel_group": "EngGroup", "vlan": "none", "vlan_mapping": "N/A", } } }, } } } }
expected_output = {'session_type': {'AnyConnect': {'username': {'lee': {'index': {1: {'assigned_ip': '192.168.246.1', 'bytes': {'rx': 4942, 'tx': 11079}, 'duration': '0h:00m:15s', 'encryption': 'RC4 AES128', 'group_policy': 'EngPolicy', 'hashing': 'SHA1', 'inactivity': '0h:00m:00s', 'license': 'AnyConnect Premium', 'login_time': '15:25:13 EST Fri Jan 28 2011', 'nac_result': 'Unknown', 'protocol': 'AnyConnect-Parent SSL-Tunnel DTLS-Tunnel', 'public_ip': '10.139.1.2', 'tunnel_group': 'EngGroup', 'vlan': 'none', 'vlan_mapping': 'N/A'}}}, 'yumi': {'index': {2: {'assigned_ip': '192.168.246.2', 'bytes': {'rx': 6942, 'tx': 11055}, 'duration': '0h:05m:15s', 'encryption': 'RC4 AES128', 'group_policy': 'EngPolicy', 'hashing': 'SHA1', 'inactivity': '0h:00m:00s', 'license': 'AnyConnect Premium', 'login_time': '15:25:13 EST Fri Jan 29 2011', 'nac_result': 'Unknown', 'protocol': 'AnyConnect-Parent SSL-Tunnel DTLS-Tunnel', 'public_ip': '10.139.1.3', 'tunnel_group': 'EngGroup', 'vlan': 'none', 'vlan_mapping': 'N/A'}}}}}}}
""" @name: Modules/House/Lighting/Lights/__init__.py @author: D. Brian Kimmel @contact: D.BrianKimmel@gmail.com @copyright: (c) 2020-2020 by D. Brian Kimmel @license: MIT License @note: Created on Feb 5, 2020 """ __updated__ = '2020-02-09' __version_info__ = (20, 2, 9) __version__ = '.'.join(map(str, __version_info__)) CONFIG_NAME = 'lights' class LightInformation: """ This is the information that the user needs to enter to uniquely define a light. """ yaml_tag = u'!light' def __init__(self, Name=None) -> None: self.Name: Union[str, None] = Name self.Comment: Union[str, None] = None self.DeviceType: str = 'Lighting' self.DeviceSubType: str = 'Light' self.Family = None self.Room = None def __repr__(self): """ """ l_ret = '' l_ret += '{}'.format(self.Name) l_ret += '; {}/{}'.format(str(self.DeviceType), str(self.DeviceSubType)) l_ret += '; Family: {}'.format(self.Family.Name) return l_ret # ## END DBK
""" @name: Modules/House/Lighting/Lights/__init__.py @author: D. Brian Kimmel @contact: D.BrianKimmel@gmail.com @copyright: (c) 2020-2020 by D. Brian Kimmel @license: MIT License @note: Created on Feb 5, 2020 """ __updated__ = '2020-02-09' __version_info__ = (20, 2, 9) __version__ = '.'.join(map(str, __version_info__)) config_name = 'lights' class Lightinformation: """ This is the information that the user needs to enter to uniquely define a light. """ yaml_tag = u'!light' def __init__(self, Name=None) -> None: self.Name: Union[str, None] = Name self.Comment: Union[str, None] = None self.DeviceType: str = 'Lighting' self.DeviceSubType: str = 'Light' self.Family = None self.Room = None def __repr__(self): """ """ l_ret = '' l_ret += '{}'.format(self.Name) l_ret += '; {}/{}'.format(str(self.DeviceType), str(self.DeviceSubType)) l_ret += '; Family: {}'.format(self.Family.Name) return l_ret
""" Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of the line i is at (i, ai) and (i, 0). Find two lines, which, together with the x-axis forms a container, such that the container contains the most water. Notice that you may not slant the container. Constraints n = height.length 2 <= n <= 3 * 104 0 <= height[i] <= 3 * 104 https://leetcode.com/problems/container-with-most-water/ """ class Solution: def maxArea(self, height: List[int]) -> int: largestVolume = 0 i = 0 j = len(height) - 1 while j != i: curVolume = (height[i] if height[i] < height[j] else height[j]) * (j - i) if curVolume > largestVolume: largestVolume = curVolume if height[i] >= height[j]: j -= 1 else: i += 1 return largestVolume
""" Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of the line i is at (i, ai) and (i, 0). Find two lines, which, together with the x-axis forms a container, such that the container contains the most water. Notice that you may not slant the container. Constraints n = height.length 2 <= n <= 3 * 104 0 <= height[i] <= 3 * 104 https://leetcode.com/problems/container-with-most-water/ """ class Solution: def max_area(self, height: List[int]) -> int: largest_volume = 0 i = 0 j = len(height) - 1 while j != i: cur_volume = (height[i] if height[i] < height[j] else height[j]) * (j - i) if curVolume > largestVolume: largest_volume = curVolume if height[i] >= height[j]: j -= 1 else: i += 1 return largestVolume
""" A pytest plugin for testing Tornado apps using plain (undecorated) coroutine tests. """ __version_info__ = (0, 6, 0, 'post2') __version__ = '.'.join(map(str, __version_info__))
""" A pytest plugin for testing Tornado apps using plain (undecorated) coroutine tests. """ __version_info__ = (0, 6, 0, 'post2') __version__ = '.'.join(map(str, __version_info__))
class XtbOutputParser: """Class for parsing xtb output""" def __init__(self, output): self.output = output self.lines = output.split('\n') def parse(self): # output variable xtb_output_data = {} # go through lines to find targets for i in range(len(self.lines)): if 'HOMO-LUMO GAP' in self.lines[i]: xtb_output_data['homo_lumo_gap'] = self._extract_homo_lumo_gap(i) if '(HOMO)' in self.lines[i]: xtb_output_data['homo_energy'] = self._extract_homo(i) if '(LUMO)' in self.lines[i]: xtb_output_data['lumo_energy'] = self._extract_lumo(i) if 'TOTAL ENERGY' in self.lines[i]: xtb_output_data['energy'] = self._extract_energy(i) if 'TOTAL ENTHALPY' in self.lines[i]: xtb_output_data['enthalpy'] = self._extract_enthalpy(i) if 'TOTAL FREE ENERGY' in self.lines[i]: xtb_output_data['free_energy'] = self._extract_free_energy(i) if 'molecular dipole:' in self.lines[i]: xtb_output_data['dipole_moment'] = self._extract_dipole_moment(i + 3) if 'partition function' in self.lines[i]: xtb_output_data['heat_capacity'] = self._extract_heat_capacity(i + 6) if 'partition function' in self.lines[i]: xtb_output_data['entropy'] = self._extract_entropy(i + 6) if 'zero point energy' in self.lines[i]: xtb_output_data['zpve'] = self._extract_zpve(i) return xtb_output_data def _extract_homo_lumo_gap(self, start_index: int): line_split = self.lines[start_index].split() return float(line_split[3]) def _extract_dipole_moment(self, start_index: int): line_split = self.lines[start_index].split() return float(line_split[4]) def _extract_enthalpy(self, start_index:int): line_split = self.lines[start_index].split() return float(line_split[3]) def _extract_energy(self, start_index:int): line_split = self.lines[start_index].split() return float(line_split[3]) def _extract_free_energy(self, start_index:int): line_split = self.lines[start_index].split() return float(line_split[4]) def _extract_heat_capacity(self, start_index:int): line_split = self.lines[start_index].split() return float(line_split[2]) def _extract_entropy(self, start_index:int): line_split = self.lines[start_index].split() return float(line_split[3]) def _extract_zpve(self, start_index:int): line_split = self.lines[start_index].split() return float(line_split[4]) def _extract_homo(self, start_index:int): line_split = self.lines[start_index].split() return float(line_split[3]) def _extract_lumo(self, start_index:int): line_split = self.lines[start_index].split() return float(line_split[2])
class Xtboutputparser: """Class for parsing xtb output""" def __init__(self, output): self.output = output self.lines = output.split('\n') def parse(self): xtb_output_data = {} for i in range(len(self.lines)): if 'HOMO-LUMO GAP' in self.lines[i]: xtb_output_data['homo_lumo_gap'] = self._extract_homo_lumo_gap(i) if '(HOMO)' in self.lines[i]: xtb_output_data['homo_energy'] = self._extract_homo(i) if '(LUMO)' in self.lines[i]: xtb_output_data['lumo_energy'] = self._extract_lumo(i) if 'TOTAL ENERGY' in self.lines[i]: xtb_output_data['energy'] = self._extract_energy(i) if 'TOTAL ENTHALPY' in self.lines[i]: xtb_output_data['enthalpy'] = self._extract_enthalpy(i) if 'TOTAL FREE ENERGY' in self.lines[i]: xtb_output_data['free_energy'] = self._extract_free_energy(i) if 'molecular dipole:' in self.lines[i]: xtb_output_data['dipole_moment'] = self._extract_dipole_moment(i + 3) if 'partition function' in self.lines[i]: xtb_output_data['heat_capacity'] = self._extract_heat_capacity(i + 6) if 'partition function' in self.lines[i]: xtb_output_data['entropy'] = self._extract_entropy(i + 6) if 'zero point energy' in self.lines[i]: xtb_output_data['zpve'] = self._extract_zpve(i) return xtb_output_data def _extract_homo_lumo_gap(self, start_index: int): line_split = self.lines[start_index].split() return float(line_split[3]) def _extract_dipole_moment(self, start_index: int): line_split = self.lines[start_index].split() return float(line_split[4]) def _extract_enthalpy(self, start_index: int): line_split = self.lines[start_index].split() return float(line_split[3]) def _extract_energy(self, start_index: int): line_split = self.lines[start_index].split() return float(line_split[3]) def _extract_free_energy(self, start_index: int): line_split = self.lines[start_index].split() return float(line_split[4]) def _extract_heat_capacity(self, start_index: int): line_split = self.lines[start_index].split() return float(line_split[2]) def _extract_entropy(self, start_index: int): line_split = self.lines[start_index].split() return float(line_split[3]) def _extract_zpve(self, start_index: int): line_split = self.lines[start_index].split() return float(line_split[4]) def _extract_homo(self, start_index: int): line_split = self.lines[start_index].split() return float(line_split[3]) def _extract_lumo(self, start_index: int): line_split = self.lines[start_index].split() return float(line_split[2])
# Author: Jochen Gast <jochen.gast@visinf.tu-darmstadt.de> class MovingAverage: postfix = "avg" def __init__(self): self.sum = 0.0 self.count = 0 def add_value(self, sigma, addcount=1): self.sum += sigma self.count += addcount def add_average(self, avg, addcount): self.sum += avg * addcount self.count += addcount def mean(self): return self.sum / self.count class ExponentialMovingAverage: postfix = "ema" def __init__(self, alpha=0.7): self.weighted_sum = 0.0 self.weighted_count = 0 self.alpha = alpha def add_value(self, sigma): self.weighted_sum = sigma + (1.0 - self.alpha) * self.weighted_sum self.weighted_count = 1 + (1.0 - self.alpha) * self.weighted_count def add_average(self, avg, addcount): self.weighted_sum = avg * addcount + (1.0 - self.alpha) * self.weighted_sum self.weighted_count = addcount + (1.0 - self.alpha) * self.weighted_count def mean(self): return self.weighted_sum / self.weighted_count
class Movingaverage: postfix = 'avg' def __init__(self): self.sum = 0.0 self.count = 0 def add_value(self, sigma, addcount=1): self.sum += sigma self.count += addcount def add_average(self, avg, addcount): self.sum += avg * addcount self.count += addcount def mean(self): return self.sum / self.count class Exponentialmovingaverage: postfix = 'ema' def __init__(self, alpha=0.7): self.weighted_sum = 0.0 self.weighted_count = 0 self.alpha = alpha def add_value(self, sigma): self.weighted_sum = sigma + (1.0 - self.alpha) * self.weighted_sum self.weighted_count = 1 + (1.0 - self.alpha) * self.weighted_count def add_average(self, avg, addcount): self.weighted_sum = avg * addcount + (1.0 - self.alpha) * self.weighted_sum self.weighted_count = addcount + (1.0 - self.alpha) * self.weighted_count def mean(self): return self.weighted_sum / self.weighted_count
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Time : 2020/2/25 15:45 # @Author : Vodka0629 # @Email : 563511@qq.com, ZhangXiangming@gmail.com # @FileName: mj_value.py # @Software: Mahjong II # @Blog : class MjValue(object): __slots__ = ("meld", "orphan", "is_ready", "listening", "mahjong_chance", "count_down", "waiting", "waiting_chance") def __init__(self, meld: int = 0, orphan: int = 0, is_ready: bool = False, listening=None, mahjong_chance=0, count_down: int = 0, waiting=None, waiting_chance=0 ): self.meld = meld self.orphan = orphan self.is_ready = is_ready self.listening = listening self.mahjong_chance = mahjong_chance self.count_down = count_down self.waiting = waiting self.waiting_chance = waiting_chance def __str__(self): waiting = "None" if self.waiting: waiting = "".join(["\n" + str(x) for x in self.waiting]) listening = "None" if self.listening: listening = "".join(["\n" + str(x) for x in self.listening]) text = f"""meld = {self.meld}, orphan = {self.orphan}, is_read = {self.is_ready}, listening = {listening}, mahjong_chance = {self.mahjong_chance}, count_down = {self.count_down}, waiting = {waiting} waiting_chance = {self.waiting_chance} """ return text
class Mjvalue(object): __slots__ = ('meld', 'orphan', 'is_ready', 'listening', 'mahjong_chance', 'count_down', 'waiting', 'waiting_chance') def __init__(self, meld: int=0, orphan: int=0, is_ready: bool=False, listening=None, mahjong_chance=0, count_down: int=0, waiting=None, waiting_chance=0): self.meld = meld self.orphan = orphan self.is_ready = is_ready self.listening = listening self.mahjong_chance = mahjong_chance self.count_down = count_down self.waiting = waiting self.waiting_chance = waiting_chance def __str__(self): waiting = 'None' if self.waiting: waiting = ''.join(['\n' + str(x) for x in self.waiting]) listening = 'None' if self.listening: listening = ''.join(['\n' + str(x) for x in self.listening]) text = f'meld = {self.meld}, \norphan = {self.orphan}, \nis_read = {self.is_ready},\nlistening = {listening}, \nmahjong_chance = {self.mahjong_chance}, \ncount_down = {self.count_down},\nwaiting = {waiting}\nwaiting_chance = {self.waiting_chance}\n' return text
ejem = "esto es un ejemplo" print (ejem) print (ejem[8:18], ejem[5:7], ejem[0:4]) subejem = ejem[8:18] + ejem[4:8] + ejem[0:4] print (subejem) #ejem = ejem.split(" ") #print (ejem[2:4], ejem[1::-1])
ejem = 'esto es un ejemplo' print(ejem) print(ejem[8:18], ejem[5:7], ejem[0:4]) subejem = ejem[8:18] + ejem[4:8] + ejem[0:4] print(subejem)
"""Constants for the Almond integration.""" DOMAIN = "almond" TYPE_OAUTH2 = "oauth2" TYPE_LOCAL = "local"
"""Constants for the Almond integration.""" domain = 'almond' type_oauth2 = 'oauth2' type_local = 'local'
# Copyright 2021 Google LLC # # 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. def verify_capital(answers: dict) -> dict: """ Takes in a dictionary with states as keys and user's answers as values. Attributes: mark_scheme: dicitonary containing the correct answers of the quiz. score: user's total score after quiz. result: a dictionary containing the correct or wrong answers of the user on each question. """ score = 0 mark_scheme = {'CA': 'Sacramento', 'TX': 'Austin', 'WA': 'Olympia', 'DE': 'Dover', 'GA': 'Atlanta'} result = {} for state in answers: if answers[state].lower().title() != mark_scheme[state]: result[state] = False else: result[state] = True score += 1 final_score = (score / 5) * 100 return result, final_score, mark_scheme
def verify_capital(answers: dict) -> dict: """ Takes in a dictionary with states as keys and user's answers as values. Attributes: mark_scheme: dicitonary containing the correct answers of the quiz. score: user's total score after quiz. result: a dictionary containing the correct or wrong answers of the user on each question. """ score = 0 mark_scheme = {'CA': 'Sacramento', 'TX': 'Austin', 'WA': 'Olympia', 'DE': 'Dover', 'GA': 'Atlanta'} result = {} for state in answers: if answers[state].lower().title() != mark_scheme[state]: result[state] = False else: result[state] = True score += 1 final_score = score / 5 * 100 return (result, final_score, mark_scheme)
"""Top-level package for Proto Wind.""" __author__ = """Kais Sghari""" __email__ = 'kais.sghari@gmail.com' __version__ = '0.1.0'
"""Top-level package for Proto Wind.""" __author__ = 'Kais Sghari' __email__ = 'kais.sghari@gmail.com' __version__ = '0.1.0'
""" pytokio implements its command-line tools within this package. Each such CLI tool either implements some useful analysis on top of pytokio connectors, tools, or analysis or maps some of the internal python APIs to command-line arguments. Most of these tools implement a ``--help`` option to explain the command-line options. """
""" pytokio implements its command-line tools within this package. Each such CLI tool either implements some useful analysis on top of pytokio connectors, tools, or analysis or maps some of the internal python APIs to command-line arguments. Most of these tools implement a ``--help`` option to explain the command-line options. """
max_char = 105 sample_rate = 22050 n_fft = 1024 hop_length = 256 win_length = 1024 preemphasis = 0.97 ref_db = 20 max_db = 100 mel_dim = 80 max_length = 780 reduction = 4 embedding_dim = 128 symbol_length = 70 d = 256 c = 512 f = n_fft // 2 + 1 batch_size = 16 checkpoint_step = 500 max_T = 160 learning_rate = 0.0002 beta1 = 0.5 beta2 = 0.9
max_char = 105 sample_rate = 22050 n_fft = 1024 hop_length = 256 win_length = 1024 preemphasis = 0.97 ref_db = 20 max_db = 100 mel_dim = 80 max_length = 780 reduction = 4 embedding_dim = 128 symbol_length = 70 d = 256 c = 512 f = n_fft // 2 + 1 batch_size = 16 checkpoint_step = 500 max_t = 160 learning_rate = 0.0002 beta1 = 0.5 beta2 = 0.9
"""Testes para as rotas de auth""" def test_authentication(fake_user, client_auth_with_one): """Testando a rota authentication""" url = "/api/auth/" data = {"email": fake_user.email, "password": fake_user.password} response = client_auth_with_one.post(url=url, json=data) assert response.status_code == 200 assert isinstance(response.json(), dict) assert response.json()["message"] is not None assert isinstance(response.json()["data"], dict) assert "Authorization" in response.json()["data"] assert "exp" in response.json()["data"] assert "user" in response.json()["data"]
"""Testes para as rotas de auth""" def test_authentication(fake_user, client_auth_with_one): """Testando a rota authentication""" url = '/api/auth/' data = {'email': fake_user.email, 'password': fake_user.password} response = client_auth_with_one.post(url=url, json=data) assert response.status_code == 200 assert isinstance(response.json(), dict) assert response.json()['message'] is not None assert isinstance(response.json()['data'], dict) assert 'Authorization' in response.json()['data'] assert 'exp' in response.json()['data'] assert 'user' in response.json()['data']
''' Problem Description The program takes two dictionaries and concatenates them into one dictionary. Problem Solution 1. Declare and initialize two dictionaries with some key-value pairs 2. Use the update() function to add the key-value pair from the second dictionary to the first dictionary. 3. Print the final dictionary. 4. Exit. ''' d1={'A': 1,'B': 2} d2={'C': 3} d1.update(d2) print(f'First dictionary is: {d1}\nSecon dictionary is: {d2}\nConcatenated dictionary is: {d1}')
""" Problem Description The program takes two dictionaries and concatenates them into one dictionary. Problem Solution 1. Declare and initialize two dictionaries with some key-value pairs 2. Use the update() function to add the key-value pair from the second dictionary to the first dictionary. 3. Print the final dictionary. 4. Exit. """ d1 = {'A': 1, 'B': 2} d2 = {'C': 3} d1.update(d2) print(f'First dictionary is: {d1}\nSecon dictionary is: {d2}\nConcatenated dictionary is: {d1}')
LOC_RECENT = u'/AppData/Roaming/Microsoft/Windows/Recent/' LOC_REG = u'/Windows/System32/config/' LOC_WINEVT = LOC_REG LOC_WINEVTX = u'/Windows/System32/winevt/logs/' LOC_AMCACHE = u'/Windows/AppCompat/Programs/' SYSTEM_FILE = [ # [artifact, src_path, dest_dir] # registry hives ['regb', LOC_REG + u'RegBack/SAM', u'/Registry/RegBack/'], ['regb', LOC_REG + u'RegBack/SECURITY', u'/Registry/RegBack/'], ['regb', LOC_REG + u'RegBack/SOFTWARE', u'/Registry/RegBack/'], ['regb', LOC_REG + u'RegBack/SYSTEM', u'/Registry/RegBack/'], ['regb_xp', LOC_REG + u'Repair/SAM', u'/Registry/Repair/'], ['regb_xp', LOC_REG + u'Repair/SECURITY', u'/Registry/Repair/'], ['regb_xp', LOC_REG + u'Repair/software', u'/Registry/Repair/'], ['regb_xp', LOC_REG + u'Repair/system', u'/Registry/Repair/'], # system logs ['evtl_xp', LOC_WINEVT + u'AppEvent.evt', u'/OSLogs/evtl/'], ['evtl_xp', LOC_WINEVT + u'SecEvent.evt', u'/OSLogs/evtl'], ['evtl_xp', LOC_WINEVT + u'SysEvent.evt', u'/OSLogs/evtl'], ['setupapi', u'/Windows/Inf/setupapi.dev.log', u'/Registry/'], ['setupapi_xp', u'/Windows/setupapi.log', u'/Registry/'], # mru ['amcache', LOC_AMCACHE + u'RecentFileCache.bcf', u'/MRU/Prog/recentfilecache/'], # persistence ['sch_xp', u'/Windows/SchedLgU.txt', u'/Autoruns/sch_tsks/'], # etl ['etl', u'/ProgramData/Microsoft/Windows/Power Efficiency Diagnostics/energy-ntkl.etl', u'/Misc/etl/'], ['etl', u'/ProgramData/Microsoft/Windows/Power Efficiency Diagnostics/energy-trace.etl', u'/Misc/etl/'], ['etl', u'/Windows/System32/LogFiles/WMI/LwtNetLog.etl', u'/Misc/etl/'], ['etl', u'/Windows/System32/LogFiles/WMI/Wifi.etl', u'/Misc/etl/'], # file system ['logfile', u'/$LogFile', u'/Filesystem/'], ['mft', u'/$MFT', u'/Filesystem/'], # others ['bits', u'/ProgramData/Microsoft/Network/Downloader/qmgr.dat', u'/Misc/bits/'], ['pagefile', u'/pagefile.sys', u'/Memory/pagefile/'] ] SYSTEM_DIR = [ # [artifact, src_path, dest_dir, isRecursive, stringToMatch] # registry hives ['reg', LOC_REG[:-1], u'/Registry/', False, u'SAM'], ['reg', LOC_REG[:-1], u'/Registry/', False, u'SECURITY'], ['reg', LOC_REG[:-1], u'/Registry/', False, u'SOFTWARE'], ['reg', LOC_REG[:-1], u'/Registry/', False, u'SYSTEM'], # system logs ['etl', u'/Windows/System32/WDI/LogFiles', u'/OSLogs/etl/', False, u'.etl'], ['evtl', LOC_WINEVTX[:-1], u'/OSLogs/evtl/', False, None], ['ual', u'/Windows/System32/LogFiles/SUM', u'/OSLogs/ual/', False, u'.mdb'], # mru ['amcache', LOC_AMCACHE[:-1], u'/MRU/Prog/amcache/', False, u'Amcache'], ['prefetch', u'/Windows/Prefetch', u'/MRU/Prog/prefetch/', False, u'.pf'], ['sccm', u'/Windows/System32/wbem/Repository', u'/MRU/Prog/sccm/', False, None], ['srum', u'/Windows/System32/sru', u'/MRU/Prog/srum/', False, None], ['sqm', u'/ProgramData/Microsoft/Windows/Sqm/Upload', u'/MRU/Prog/sqm/', False, u'.sqm'], ['syscache', u'/System Volume Information', u'/MRU/Prog/syscache/', False, u'Syscache'], # persistence ['sch_job', u'/Windows/Tasks', u'/Autoruns/sch_tsks/', False, u'.job'], ['sch_xml', u'/Windows/System32/Tasks', u'/Autoruns/sch_tsks/', True, None], ['startupinfo', u'/Windows/System32/wdi/LogFiles/StartupInfo', u'/Autoruns/startupinfo/', False, u'StartupInfo'], # others ['antimalware', u'/ProgramData/Microsoft/Microsoft Antimalware/Support', u'/VirusScans/', False, u'MPLog'], ['defender', u'/ProgramData/Microsoft/Windows Defender/Support', u'/VirusScans/', False, u'MPLog'], ['certutil', u'/Windows/System32/config/systemprofile/AppData/LocalLow/Microsoft/CryptnetUrlCache/MetaData', u'/Misc/certutil/', False, None], ['recycle', u'/$Recycle.Bin', u'/Recycle/', True, None], ['recycle_xp', u'/RECYCLER', u'/Recycle/', True, None], ['sig_ctlg', u'/Windows/System32/CatRoot', u'/Misc/signatures/', True, None], ['wer', u'/ProgramData/Microsoft/Windows/WER', u'/Misc/wer/', True, None] ] USER_FILE = [ # [artifact, src_path, dest_dir] # system logs ['etl', u'/AppData/Local/Microsoft/Windows/Explorer/ExplorerStartupLog.etl', u'/OSLogs/etl/'], ['etl', u'/AppData/Local/Microsoft/Windows/Explorer/ExplorerStartupLog_RunOnce.etl', u'/OSLogs/etl/'], ['etl', u'/AppData/Local/Packages/Microsoft.Windows.Cortana_cw5n1h2txyewy/TempState/Traces/CortanaTrace1.etl', u'/OSLogs/etl/'], ['pshist', u'/AppData/Roaming/Microsoft/Windows/PowerShell/PSReadline/ConsoleHost_history.txt', u'/OSLogs/pshist/'] ] USER_DIR = [ # [artifact, src_path, dest_dir, isRecursive, stringToMatch] # registry hives ['ntuser', u'/', u'/Registry/', False, u'NTUSER'], ['usrclass', u'/AppData/Local/Microsoft/Windows/', u'/Registry/', False, u'UsrClass'], ['usrclass_xp', u'/Local Settings/Application Data/Microsoft/Windows/', u'/Registry/', False, u'UsrClass'], # mru ['iehist', u'/AppData/Local/Microsoft/Windows/WebCache', u'/MRU/Files/iehist/', False, None], ['iehist_xp', u'/Local Settings/History/History.IE5', u'/MRU/Files/iehist/', True, None], ['jmp', LOC_RECENT + u'AutomaticDestinations', u'/MRU/Files/jmp/', False, None], ['jmp', LOC_RECENT + u'CustomDestinations', u'/MRU/Files/jmp/', False, None], ['lnk', LOC_RECENT, u'MRU/Files/lnk', False, None], ['lnk_xp', u'/Recent/', u'MRU/Files/lnk', False, None], ['thumbcache', u'/AppData/Local/Microsoft/Windows/Explorer', u'/MRU/thumbcache/', False, u'thumbcache_'], ['timeline', u'/AppData/Local/ConnectedDevicesPlatform', u'/MRU/timeline/', True, None], # others ['certutil', u'/AppData/LocalLow/Microsoft/CryptnetUrlCache/MetaData', u'/Misc/certutil/', False, None], ['rdpcache', u'/AppData/Local/Microsoft/Terminal Server Client/Cache', u'/Misc/rdpcache/', False, None], ['rdpcache_xp', u'/Local Settings/Application Data/Microsoft/Terminal Server Client/Cache', u'/Misc/rdpcache/', False, None] ] FILE_ADS = [ # [artifact, src_path, dest_dir, ads_name] # file system ['usnjrnl', u'/$Extend/$UsnJrnl', u'/Filesystem/', u'$J'] ]
loc_recent = u'/AppData/Roaming/Microsoft/Windows/Recent/' loc_reg = u'/Windows/System32/config/' loc_winevt = LOC_REG loc_winevtx = u'/Windows/System32/winevt/logs/' loc_amcache = u'/Windows/AppCompat/Programs/' system_file = [['regb', LOC_REG + u'RegBack/SAM', u'/Registry/RegBack/'], ['regb', LOC_REG + u'RegBack/SECURITY', u'/Registry/RegBack/'], ['regb', LOC_REG + u'RegBack/SOFTWARE', u'/Registry/RegBack/'], ['regb', LOC_REG + u'RegBack/SYSTEM', u'/Registry/RegBack/'], ['regb_xp', LOC_REG + u'Repair/SAM', u'/Registry/Repair/'], ['regb_xp', LOC_REG + u'Repair/SECURITY', u'/Registry/Repair/'], ['regb_xp', LOC_REG + u'Repair/software', u'/Registry/Repair/'], ['regb_xp', LOC_REG + u'Repair/system', u'/Registry/Repair/'], ['evtl_xp', LOC_WINEVT + u'AppEvent.evt', u'/OSLogs/evtl/'], ['evtl_xp', LOC_WINEVT + u'SecEvent.evt', u'/OSLogs/evtl'], ['evtl_xp', LOC_WINEVT + u'SysEvent.evt', u'/OSLogs/evtl'], ['setupapi', u'/Windows/Inf/setupapi.dev.log', u'/Registry/'], ['setupapi_xp', u'/Windows/setupapi.log', u'/Registry/'], ['amcache', LOC_AMCACHE + u'RecentFileCache.bcf', u'/MRU/Prog/recentfilecache/'], ['sch_xp', u'/Windows/SchedLgU.txt', u'/Autoruns/sch_tsks/'], ['etl', u'/ProgramData/Microsoft/Windows/Power Efficiency Diagnostics/energy-ntkl.etl', u'/Misc/etl/'], ['etl', u'/ProgramData/Microsoft/Windows/Power Efficiency Diagnostics/energy-trace.etl', u'/Misc/etl/'], ['etl', u'/Windows/System32/LogFiles/WMI/LwtNetLog.etl', u'/Misc/etl/'], ['etl', u'/Windows/System32/LogFiles/WMI/Wifi.etl', u'/Misc/etl/'], ['logfile', u'/$LogFile', u'/Filesystem/'], ['mft', u'/$MFT', u'/Filesystem/'], ['bits', u'/ProgramData/Microsoft/Network/Downloader/qmgr.dat', u'/Misc/bits/'], ['pagefile', u'/pagefile.sys', u'/Memory/pagefile/']] system_dir = [['reg', LOC_REG[:-1], u'/Registry/', False, u'SAM'], ['reg', LOC_REG[:-1], u'/Registry/', False, u'SECURITY'], ['reg', LOC_REG[:-1], u'/Registry/', False, u'SOFTWARE'], ['reg', LOC_REG[:-1], u'/Registry/', False, u'SYSTEM'], ['etl', u'/Windows/System32/WDI/LogFiles', u'/OSLogs/etl/', False, u'.etl'], ['evtl', LOC_WINEVTX[:-1], u'/OSLogs/evtl/', False, None], ['ual', u'/Windows/System32/LogFiles/SUM', u'/OSLogs/ual/', False, u'.mdb'], ['amcache', LOC_AMCACHE[:-1], u'/MRU/Prog/amcache/', False, u'Amcache'], ['prefetch', u'/Windows/Prefetch', u'/MRU/Prog/prefetch/', False, u'.pf'], ['sccm', u'/Windows/System32/wbem/Repository', u'/MRU/Prog/sccm/', False, None], ['srum', u'/Windows/System32/sru', u'/MRU/Prog/srum/', False, None], ['sqm', u'/ProgramData/Microsoft/Windows/Sqm/Upload', u'/MRU/Prog/sqm/', False, u'.sqm'], ['syscache', u'/System Volume Information', u'/MRU/Prog/syscache/', False, u'Syscache'], ['sch_job', u'/Windows/Tasks', u'/Autoruns/sch_tsks/', False, u'.job'], ['sch_xml', u'/Windows/System32/Tasks', u'/Autoruns/sch_tsks/', True, None], ['startupinfo', u'/Windows/System32/wdi/LogFiles/StartupInfo', u'/Autoruns/startupinfo/', False, u'StartupInfo'], ['antimalware', u'/ProgramData/Microsoft/Microsoft Antimalware/Support', u'/VirusScans/', False, u'MPLog'], ['defender', u'/ProgramData/Microsoft/Windows Defender/Support', u'/VirusScans/', False, u'MPLog'], ['certutil', u'/Windows/System32/config/systemprofile/AppData/LocalLow/Microsoft/CryptnetUrlCache/MetaData', u'/Misc/certutil/', False, None], ['recycle', u'/$Recycle.Bin', u'/Recycle/', True, None], ['recycle_xp', u'/RECYCLER', u'/Recycle/', True, None], ['sig_ctlg', u'/Windows/System32/CatRoot', u'/Misc/signatures/', True, None], ['wer', u'/ProgramData/Microsoft/Windows/WER', u'/Misc/wer/', True, None]] user_file = [['etl', u'/AppData/Local/Microsoft/Windows/Explorer/ExplorerStartupLog.etl', u'/OSLogs/etl/'], ['etl', u'/AppData/Local/Microsoft/Windows/Explorer/ExplorerStartupLog_RunOnce.etl', u'/OSLogs/etl/'], ['etl', u'/AppData/Local/Packages/Microsoft.Windows.Cortana_cw5n1h2txyewy/TempState/Traces/CortanaTrace1.etl', u'/OSLogs/etl/'], ['pshist', u'/AppData/Roaming/Microsoft/Windows/PowerShell/PSReadline/ConsoleHost_history.txt', u'/OSLogs/pshist/']] user_dir = [['ntuser', u'/', u'/Registry/', False, u'NTUSER'], ['usrclass', u'/AppData/Local/Microsoft/Windows/', u'/Registry/', False, u'UsrClass'], ['usrclass_xp', u'/Local Settings/Application Data/Microsoft/Windows/', u'/Registry/', False, u'UsrClass'], ['iehist', u'/AppData/Local/Microsoft/Windows/WebCache', u'/MRU/Files/iehist/', False, None], ['iehist_xp', u'/Local Settings/History/History.IE5', u'/MRU/Files/iehist/', True, None], ['jmp', LOC_RECENT + u'AutomaticDestinations', u'/MRU/Files/jmp/', False, None], ['jmp', LOC_RECENT + u'CustomDestinations', u'/MRU/Files/jmp/', False, None], ['lnk', LOC_RECENT, u'MRU/Files/lnk', False, None], ['lnk_xp', u'/Recent/', u'MRU/Files/lnk', False, None], ['thumbcache', u'/AppData/Local/Microsoft/Windows/Explorer', u'/MRU/thumbcache/', False, u'thumbcache_'], ['timeline', u'/AppData/Local/ConnectedDevicesPlatform', u'/MRU/timeline/', True, None], ['certutil', u'/AppData/LocalLow/Microsoft/CryptnetUrlCache/MetaData', u'/Misc/certutil/', False, None], ['rdpcache', u'/AppData/Local/Microsoft/Terminal Server Client/Cache', u'/Misc/rdpcache/', False, None], ['rdpcache_xp', u'/Local Settings/Application Data/Microsoft/Terminal Server Client/Cache', u'/Misc/rdpcache/', False, None]] file_ads = [['usnjrnl', u'/$Extend/$UsnJrnl', u'/Filesystem/', u'$J']]
"""The code template to supply to the front end. This is what the user will be asked to complete and submit for grading. Do not include any imports. This is not a REPL environment so include explicit 'print' statements for any outputs you want to be displayed back to the user. Use triple single quotes to enclose the formatted code block. """ challenge_code = '''dev = qml.device('default.qubit', wires=3) @qml.qnode(dev) def make_basis_state(basis_id): """Produce the 3-qubit basis state corresponding to |basis_id>. Note that the system starts in |000>. Args: basis_id (int): An integer value identifying the basis state to construct. Returns: array[complex]: The computational basis state |basis_id>. """ ################## # YOUR CODE HERE # ################## # CREATE THE BASIS STATE return qml.state() basis_id = 3 print(f"Output state = {make_basis_state(basis_id)}") '''
"""The code template to supply to the front end. This is what the user will be asked to complete and submit for grading. Do not include any imports. This is not a REPL environment so include explicit 'print' statements for any outputs you want to be displayed back to the user. Use triple single quotes to enclose the formatted code block. """ challenge_code = 'dev = qml.device(\'default.qubit\', wires=3)\n\n@qml.qnode(dev)\ndef make_basis_state(basis_id):\n """Produce the 3-qubit basis state corresponding to |basis_id>.\n \n Note that the system starts in |000>.\n\n Args:\n basis_id (int): An integer value identifying the basis state to construct.\n \n Returns:\n array[complex]: The computational basis state |basis_id>.\n """\n\n ##################\n # YOUR CODE HERE #\n ##################\n\n # CREATE THE BASIS STATE\n \n return qml.state()\n\n\nbasis_id = 3\nprint(f"Output state = {make_basis_state(basis_id)}")\n'
class Config(): appId = None apiKey = None domain = None def __init__(self, appId, apiKey, domain): self.appId = appId self.apiKey = apiKey self.domain = domain
class Config: app_id = None api_key = None domain = None def __init__(self, appId, apiKey, domain): self.appId = appId self.apiKey = apiKey self.domain = domain
""" A utility for summing up two numbers. """ def add_two_numbers(first, second): """Adds up both numbers and return the sum. Input values must be numbers.""" if not isinstance(first, (int, float)) or not (isinstance(second, (int, float))): raise ValueError("Inputs must be numbers.") return first + second
""" A utility for summing up two numbers. """ def add_two_numbers(first, second): """Adds up both numbers and return the sum. Input values must be numbers.""" if not isinstance(first, (int, float)) or not isinstance(second, (int, float)): raise value_error('Inputs must be numbers.') return first + second
for i in range(int(input())): array_length = int(input()) array = map(int, input().split()) s = sum(array) if s < array_length: print(1) else: print(s - array_length)
for i in range(int(input())): array_length = int(input()) array = map(int, input().split()) s = sum(array) if s < array_length: print(1) else: print(s - array_length)
def _get_value(obj, key): list_end = key.find("]") is_list = list_end > 0 if is_list: list_index = int(key[list_end - 1]) return obj[list_index] return obj[key] def find(obj, path): try: # Base case if len(path) == 0: return obj key = str(path[0]) rest = path[1:] nested = _get_value(obj, key) return find(nested, rest) except IndexError: raise IndexError except KeyError: raise KeyError except TypeError: raise TypeError
def _get_value(obj, key): list_end = key.find(']') is_list = list_end > 0 if is_list: list_index = int(key[list_end - 1]) return obj[list_index] return obj[key] def find(obj, path): try: if len(path) == 0: return obj key = str(path[0]) rest = path[1:] nested = _get_value(obj, key) return find(nested, rest) except IndexError: raise IndexError except KeyError: raise KeyError except TypeError: raise TypeError
GRAPH = { "A":["B","D","E"], "B":["A","C","D"], "C":["B","G"], "D":["A","B","E","F"], "E":["A","D"], "F":["D"], "G":["C"] } visited_list = [] # an empty list of visited nodes def dfs(graph, current_vertex, visited): visited.append(current_vertex) for vertex in graph[current_vertex]: # check neighbours if vertex not in visited: dfs(graph, vertex, visited) # recursive call # stack will store return address, parameters # and local variables return visited # main program traversal = dfs(GRAPH, 'A', visited_list) print('Nodes visited in this order:', traversal)
graph = {'A': ['B', 'D', 'E'], 'B': ['A', 'C', 'D'], 'C': ['B', 'G'], 'D': ['A', 'B', 'E', 'F'], 'E': ['A', 'D'], 'F': ['D'], 'G': ['C']} visited_list = [] def dfs(graph, current_vertex, visited): visited.append(current_vertex) for vertex in graph[current_vertex]: if vertex not in visited: dfs(graph, vertex, visited) return visited traversal = dfs(GRAPH, 'A', visited_list) print('Nodes visited in this order:', traversal)
class Solution: def minCostClimbingStairs(self, cost): dp = [0] * (len(cost) + 1) for i in range(2, len(dp)): dp[i] = min(dp[i - 2] + cost[i - 2], dp[i - 1] + cost[i - 1]) return dp[-1] s = Solution() print(s.minCostClimbingStairs([10, 15, 20])) print(s.minCostClimbingStairs([1, 100, 1, 1, 1, 100, 1, 1, 100, 1]))
class Solution: def min_cost_climbing_stairs(self, cost): dp = [0] * (len(cost) + 1) for i in range(2, len(dp)): dp[i] = min(dp[i - 2] + cost[i - 2], dp[i - 1] + cost[i - 1]) return dp[-1] s = solution() print(s.minCostClimbingStairs([10, 15, 20])) print(s.minCostClimbingStairs([1, 100, 1, 1, 1, 100, 1, 1, 100, 1]))
#!/usr/bin/env python # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # Version Number # ------------------------------------------------------------------------------ major_version = "1" minor_version = "2" patch_version = "0" # ------------------------------------------------------------------------------ # Help String # ------------------------------------------------------------------------------ HELP = """==================================================== ufolint Copyright 2019 Source Foundry Authors MIT License Source: https://github.com/source-foundry/ufolint ==================================================== ufolint is a UFO source file linter. Usage: $ ufolint [UFO path 1] ([UFO path2] [UFO path ...]) The application returns exit status code 0 if all tests are successful and exit status code 1 if any failures are detected. See documentation on the source repository (link above) for testing details. """ # ------------------------------------------------------------------------------ # Version String # ------------------------------------------------------------------------------ VERSION = "ufolint v" + major_version + "." + minor_version + "." + patch_version # ------------------------------------------------------------------------------ # Usage String # ------------------------------------------------------------------------------ USAGE = "ufolint [UFO path 1] ([UFO path2] [UFO path ...])"
major_version = '1' minor_version = '2' patch_version = '0' help = '====================================================\nufolint\nCopyright 2019 Source Foundry Authors\nMIT License\nSource: https://github.com/source-foundry/ufolint\n====================================================\n\nufolint is a UFO source file linter.\n\nUsage:\n\n $ ufolint [UFO path 1] ([UFO path2] [UFO path ...])\n\nThe application returns exit status code 0 if all tests are successful and\nexit status code 1 if any failures are detected.\n\nSee documentation on the source repository (link above) for testing details.\n\n' version = 'ufolint v' + major_version + '.' + minor_version + '.' + patch_version usage = 'ufolint [UFO path 1] ([UFO path2] [UFO path ...])'
def save_transcriptions(path, transcriptions): with open(path, 'w') as f: for key in transcriptions: f.write('{} {}\n'.format(key, transcriptions[key])) def load_transcriptions(path): transcriptions = {} with open(path, "r") as f: for line_no, line in enumerate(f): if len(line) == 0: continue try: image_id, transcription = parse_transcription_line(line) except ValueError: raise ValueError('Failed to parse line {} of file {}'.format(line_no, path)) transcriptions[image_id] = transcription return transcriptions def parse_transcription_line(line): image_id, transcription = line.split(" ", maxsplit=1) if transcription[-1] == '\n': transcription = transcription[:-1] return image_id, transcription
def save_transcriptions(path, transcriptions): with open(path, 'w') as f: for key in transcriptions: f.write('{} {}\n'.format(key, transcriptions[key])) def load_transcriptions(path): transcriptions = {} with open(path, 'r') as f: for (line_no, line) in enumerate(f): if len(line) == 0: continue try: (image_id, transcription) = parse_transcription_line(line) except ValueError: raise value_error('Failed to parse line {} of file {}'.format(line_no, path)) transcriptions[image_id] = transcription return transcriptions def parse_transcription_line(line): (image_id, transcription) = line.split(' ', maxsplit=1) if transcription[-1] == '\n': transcription = transcription[:-1] return (image_id, transcription)
class Halo_Status_Class(): def __init__(self): # Halos information exist? self.HalosDataExist = False # AGNs information exist? self.AGNsDataExist = False # Solved for Lx, T, flux? self.LxTxSolved = False # Trasformed into XCat prefered coordinate? self.XCatPreferedCoordinate = False def update(self, Halo_data): self.HalosDataExist = True self.AGNsDataExist = False self.LxTxSolved = False self.XCatPreferedCoordinate = False
class Halo_Status_Class: def __init__(self): self.HalosDataExist = False self.AGNsDataExist = False self.LxTxSolved = False self.XCatPreferedCoordinate = False def update(self, Halo_data): self.HalosDataExist = True self.AGNsDataExist = False self.LxTxSolved = False self.XCatPreferedCoordinate = False
def load(info): info['config']['/jquery'] = { 'tools.staticdir.on': 'True', 'tools.staticdir.dir': 'clients/jquery' }
def load(info): info['config']['/jquery'] = {'tools.staticdir.on': 'True', 'tools.staticdir.dir': 'clients/jquery'}
class Foo(object): def __init__(self): with open('b.py'): self.scope = "a" pass def get_scope(self): return self.scope
class Foo(object): def __init__(self): with open('b.py'): self.scope = 'a' pass def get_scope(self): return self.scope
def shell(arr): gap = len(arr) // 2 while gap >= 1: for i in xrange(len(arr)): if i + gap > len(arr) - 1: break insertion_sort_gap(arr, i, gap) gap //= 2 def insertion_sort_gap(arr, start, gap): pos = start + gap while pos - gap >= 0 and arr[pos] < arr[pos - gap]: arr[pos], arr[pos - gap] = arr[pos - gap], arr[pos] pos -= gap if __name__ == '__main__': arrs = [ [4, 3, 3, 7, 6, -1, 10, 3, 8, 4], [10, 11, 9, 8, 13, 21], [99, 87, 76, 65, 54, 43, 32, 21, 10, -1], ] for arr in arrs: print("unsorted: {}".format(arr)) shell(arr) print("sorted: {}".format(arr))
def shell(arr): gap = len(arr) // 2 while gap >= 1: for i in xrange(len(arr)): if i + gap > len(arr) - 1: break insertion_sort_gap(arr, i, gap) gap //= 2 def insertion_sort_gap(arr, start, gap): pos = start + gap while pos - gap >= 0 and arr[pos] < arr[pos - gap]: (arr[pos], arr[pos - gap]) = (arr[pos - gap], arr[pos]) pos -= gap if __name__ == '__main__': arrs = [[4, 3, 3, 7, 6, -1, 10, 3, 8, 4], [10, 11, 9, 8, 13, 21], [99, 87, 76, 65, 54, 43, 32, 21, 10, -1]] for arr in arrs: print('unsorted: {}'.format(arr)) shell(arr) print('sorted: {}'.format(arr))
# This program says hello and asks for my name and show my age. print('Hello, World!') print('What is your name?') #ask for name myName = input() print('It is good to meet you ' + myName) print('The length of your name is :') print(len(myName)) print('Please tell your age:') # ask for age myAge = input() print('You will be ' + str(int(myAge) + 1)+ ' in a year.')
print('Hello, World!') print('What is your name?') my_name = input() print('It is good to meet you ' + myName) print('The length of your name is :') print(len(myName)) print('Please tell your age:') my_age = input() print('You will be ' + str(int(myAge) + 1) + ' in a year.')
# -*- coding: utf-8 -*- """ _app_name_.manage.stores ~~~~~~~~~~~~~~~~~~~~~~ store management commands """
""" _app_name_.manage.stores ~~~~~~~~~~~~~~~~~~~~~~ store management commands """
load("//:third_party/org_sonatype_sisu.bzl", org_sonatype_sisu_deps = "dependencies") load("//:third_party/org_eclipse_sisu.bzl", org_eclipse_sisu_deps = "dependencies") load("//:third_party/org_eclipse_aether.bzl", org_eclipse_aether_deps = "dependencies") load("//:third_party/org_checkerframework.bzl", org_checkerframework_deps = "dependencies") load("//:third_party/javax_enterprise.bzl", javax_enterprise_deps = "dependencies") load("//:third_party/com_google_j2objc.bzl", com_google_j2objc_deps = "dependencies") load("//:third_party/com_google_errorprone.bzl", com_google_errorprone_deps = "dependencies") load("//:third_party/aopalliance.bzl", aopalliance_deps = "dependencies") load("//:third_party/javax_annotation.bzl", javax_annotation_deps = "dependencies") load("//:third_party/org_xmlunit.bzl", org_xmlunit_deps = "dependencies") load("//:third_party/org_eclipse_jetty.bzl", org_eclipse_jetty_deps = "dependencies") load("//:third_party/org_eclipse_jetty_http2.bzl", org_eclipse_jetty_http2_deps = "dependencies") load("//:third_party/org_apache_httpcomponents_core5.bzl", org_apache_httpcomponents_core5_deps = "dependencies") load("//:third_party/org_apache_httpcomponents_client5.bzl", org_apache_httpcomponents_client5_deps = "dependencies") load("//:third_party/net_sf_jopt_simple.bzl", net_sf_jopt_simple_deps = "dependencies") load("//:third_party/net_minidev.bzl", net_minidev_deps = "dependencies") load("//:third_party/net_javacrumbs_json_unit.bzl", net_javacrumbs_json_unit_deps = "dependencies") load("//:third_party/jakarta_xml_bind.bzl", jakarta_xml_bind_deps = "dependencies") load("//:third_party/jakarta_activation.bzl", jakarta_activation_deps = "dependencies") load("//:third_party/commons_fileupload.bzl", commons_fileupload_deps = "dependencies") load("//:third_party/com_jayway_jsonpath.bzl", com_jayway_jsonpath_deps = "dependencies") load("//:third_party/com_github_jknack.bzl", com_github_jknack_deps = "dependencies") load("//:third_party/javax_servlet.bzl", javax_servlet_deps = "dependencies") load("//:third_party/xml_apis.bzl", xml_apis_deps = "dependencies") load("//:third_party/oro.bzl", oro_deps = "dependencies") load("//:third_party/org_typelevel.bzl", org_typelevel_deps = "dependencies") load("//:third_party/org_tukaani.bzl", org_tukaani_deps = "dependencies") load("//:third_party/org_specs2.bzl", org_specs2_deps = "dependencies") load("//:third_party/org_sonatype_plexus.bzl", org_sonatype_plexus_deps = "dependencies") load("//:third_party/org_slf4j.bzl", org_slf4j_deps = "dependencies") load("//:third_party/org_scalaj.bzl", org_scalaj_deps = "dependencies") load("//:third_party/org_scala_sbt.bzl", org_scala_sbt_deps = "dependencies") load("//:third_party/org_scala_lang.bzl", org_scala_lang_deps = "dependencies") load("//:third_party/org_scala_lang_modules.bzl", org_scala_lang_modules_deps = "dependencies") load("//:third_party/org_reflections.bzl", org_reflections_deps = "dependencies") load("//:third_party/org_reactivestreams.bzl", org_reactivestreams_deps = "dependencies") load("//:third_party/org_portable_scala.bzl", org_portable_scala_deps = "dependencies") load("//:third_party/org_ow2_asm.bzl", org_ow2_asm_deps = "dependencies") load("//:third_party/org_objenesis.bzl", org_objenesis_deps = "dependencies") load("//:third_party/org_mockito.bzl", org_mockito_deps = "dependencies") load("//:third_party/org_joda.bzl", org_joda_deps = "dependencies") load("//:third_party/org_javassist.bzl", org_javassist_deps = "dependencies") load("//:third_party/org_iq80_snappy.bzl", org_iq80_snappy_deps = "dependencies") load("//:third_party/org_hamcrest.bzl", org_hamcrest_deps = "dependencies") load("//:third_party/org_fusesource_jansi.bzl", org_fusesource_jansi_deps = "dependencies") load("//:third_party/org_eclipse_jgit.bzl", org_eclipse_jgit_deps = "dependencies") load("//:third_party/org_codehaus_plexus.bzl", org_codehaus_plexus_deps = "dependencies") load("//:third_party/org_codehaus_mojo.bzl", org_codehaus_mojo_deps = "dependencies") load("//:third_party/org_apache_velocity.bzl", org_apache_velocity_deps = "dependencies") load("//:third_party/org_apache_maven_wagon.bzl", org_apache_maven_wagon_deps = "dependencies") load("//:third_party/org_apache_maven_shared.bzl", org_apache_maven_shared_deps = "dependencies") load("//:third_party/org_apache_maven_resolver.bzl", org_apache_maven_resolver_deps = "dependencies") load("//:third_party/org_apache_maven_reporting.bzl", org_apache_maven_reporting_deps = "dependencies") load("//:third_party/org_apache_maven.bzl", org_apache_maven_deps = "dependencies") load("//:third_party/org_apache_maven_doxia.bzl", org_apache_maven_doxia_deps = "dependencies") load("//:third_party/org_apache_maven_archetype.bzl", org_apache_maven_archetype_deps = "dependencies") load("//:third_party/org_apache_jackrabbit.bzl", org_apache_jackrabbit_deps = "dependencies") load("//:third_party/org_apache_httpcomponents.bzl", org_apache_httpcomponents_deps = "dependencies") load("//:third_party/org_apache_commons.bzl", org_apache_commons_deps = "dependencies") load("//:third_party/net_sourceforge_jchardet.bzl", net_sourceforge_jchardet_deps = "dependencies") load("//:third_party/net_bytebuddy.bzl", net_bytebuddy_deps = "dependencies") load("//:third_party/nekohtml.bzl", nekohtml_deps = "dependencies") load("//:third_party/junit.bzl", junit_deps = "dependencies") load("//:third_party/joda_time.bzl", joda_time_deps = "dependencies") load("//:third_party/jdom.bzl", jdom_deps = "dependencies") load("//:third_party/javax_inject.bzl", javax_inject_deps = "dependencies") load("//:third_party/io_github_alexarchambault_windows_ansi.bzl", io_github_alexarchambault_windows_ansi_deps = "dependencies") load("//:third_party/io_github_alexarchambault.bzl", io_github_alexarchambault_deps = "dependencies") load("//:third_party/io_get_coursier.bzl", io_get_coursier_deps = "dependencies") load("//:third_party/io_argonaut.bzl", io_argonaut_deps = "dependencies") load("//:third_party/dom4j.bzl", dom4j_deps = "dependencies") load("//:third_party/commons_lang.bzl", commons_lang_deps = "dependencies") load("//:third_party/commons_io.bzl", commons_io_deps = "dependencies") load("//:third_party/commons_httpclient.bzl", commons_httpclient_deps = "dependencies") load("//:third_party/commons_collections.bzl", commons_collections_deps = "dependencies") load("//:third_party/commons_codec.bzl", commons_codec_deps = "dependencies") load("//:third_party/commons_cli.bzl", commons_cli_deps = "dependencies") load("//:third_party/com_wix.bzl", com_wix_deps = "dependencies") load("//:third_party/com_typesafe.bzl", com_typesafe_deps = "dependencies") load("//:third_party/com_typesafe_akka.bzl", com_typesafe_akka_deps = "dependencies") load("//:third_party/com_thoughtworks_paranamer.bzl", com_thoughtworks_paranamer_deps = "dependencies") load("//:third_party/com_jcraft.bzl", com_jcraft_deps = "dependencies") load("//:third_party/com_googlecode_javaewah.bzl", com_googlecode_javaewah_deps = "dependencies") load("//:third_party/com_google_guava.bzl", com_google_guava_deps = "dependencies") load("//:third_party/com_google_code_findbugs.bzl", com_google_code_findbugs_deps = "dependencies") load("//:third_party/com_github_tomakehurst.bzl", com_github_tomakehurst_deps = "dependencies") load("//:third_party/com_github_scopt.bzl", com_github_scopt_deps = "dependencies") load("//:third_party/com_github_alexarchambault.bzl", com_github_alexarchambault_deps = "dependencies") load("//:third_party/com_fasterxml_jackson_module.bzl", com_fasterxml_jackson_module_deps = "dependencies") load("//:third_party/com_fasterxml_jackson_datatype.bzl", com_fasterxml_jackson_datatype_deps = "dependencies") load("//:third_party/com_fasterxml_jackson_core.bzl", com_fasterxml_jackson_core_deps = "dependencies") load("//:third_party/com_chuusai.bzl", com_chuusai_deps = "dependencies") load("//:third_party/classworlds.bzl", classworlds_deps = "dependencies") load("//:third_party/ch_qos_logback.bzl", ch_qos_logback_deps = "dependencies") load("//:third_party/backport_util_concurrent.bzl", backport_util_concurrent_deps = "dependencies") def managed_third_party_dependencies(): backport_util_concurrent_deps() ch_qos_logback_deps() classworlds_deps() com_chuusai_deps() com_fasterxml_jackson_core_deps() com_fasterxml_jackson_datatype_deps() com_fasterxml_jackson_module_deps() com_github_alexarchambault_deps() com_github_scopt_deps() com_github_tomakehurst_deps() com_google_code_findbugs_deps() com_google_guava_deps() com_googlecode_javaewah_deps() com_jcraft_deps() com_thoughtworks_paranamer_deps() com_typesafe_akka_deps() com_typesafe_deps() com_wix_deps() commons_cli_deps() commons_codec_deps() commons_collections_deps() commons_httpclient_deps() commons_io_deps() commons_lang_deps() dom4j_deps() io_argonaut_deps() io_get_coursier_deps() io_github_alexarchambault_deps() io_github_alexarchambault_windows_ansi_deps() javax_inject_deps() jdom_deps() joda_time_deps() junit_deps() nekohtml_deps() net_bytebuddy_deps() net_sourceforge_jchardet_deps() org_apache_commons_deps() org_apache_httpcomponents_deps() org_apache_jackrabbit_deps() org_apache_maven_archetype_deps() org_apache_maven_doxia_deps() org_apache_maven_deps() org_apache_maven_reporting_deps() org_apache_maven_resolver_deps() org_apache_maven_shared_deps() org_apache_maven_wagon_deps() org_apache_velocity_deps() org_codehaus_mojo_deps() org_codehaus_plexus_deps() org_eclipse_jgit_deps() org_fusesource_jansi_deps() org_hamcrest_deps() org_iq80_snappy_deps() org_javassist_deps() org_joda_deps() org_mockito_deps() org_objenesis_deps() org_ow2_asm_deps() org_portable_scala_deps() org_reactivestreams_deps() org_reflections_deps() org_scala_lang_modules_deps() org_scala_lang_deps() org_scala_sbt_deps() org_scalaj_deps() org_slf4j_deps() org_sonatype_plexus_deps() org_specs2_deps() org_tukaani_deps() org_typelevel_deps() oro_deps() xml_apis_deps() javax_servlet_deps() com_github_jknack_deps() com_jayway_jsonpath_deps() commons_fileupload_deps() jakarta_activation_deps() jakarta_xml_bind_deps() net_javacrumbs_json_unit_deps() net_minidev_deps() net_sf_jopt_simple_deps() org_apache_httpcomponents_client5_deps() org_apache_httpcomponents_core5_deps() org_eclipse_jetty_http2_deps() org_eclipse_jetty_deps() org_xmlunit_deps() javax_annotation_deps() aopalliance_deps() com_google_errorprone_deps() com_google_j2objc_deps() javax_enterprise_deps() org_checkerframework_deps() org_eclipse_aether_deps() org_eclipse_sisu_deps() org_sonatype_sisu_deps()
load('//:third_party/org_sonatype_sisu.bzl', org_sonatype_sisu_deps='dependencies') load('//:third_party/org_eclipse_sisu.bzl', org_eclipse_sisu_deps='dependencies') load('//:third_party/org_eclipse_aether.bzl', org_eclipse_aether_deps='dependencies') load('//:third_party/org_checkerframework.bzl', org_checkerframework_deps='dependencies') load('//:third_party/javax_enterprise.bzl', javax_enterprise_deps='dependencies') load('//:third_party/com_google_j2objc.bzl', com_google_j2objc_deps='dependencies') load('//:third_party/com_google_errorprone.bzl', com_google_errorprone_deps='dependencies') load('//:third_party/aopalliance.bzl', aopalliance_deps='dependencies') load('//:third_party/javax_annotation.bzl', javax_annotation_deps='dependencies') load('//:third_party/org_xmlunit.bzl', org_xmlunit_deps='dependencies') load('//:third_party/org_eclipse_jetty.bzl', org_eclipse_jetty_deps='dependencies') load('//:third_party/org_eclipse_jetty_http2.bzl', org_eclipse_jetty_http2_deps='dependencies') load('//:third_party/org_apache_httpcomponents_core5.bzl', org_apache_httpcomponents_core5_deps='dependencies') load('//:third_party/org_apache_httpcomponents_client5.bzl', org_apache_httpcomponents_client5_deps='dependencies') load('//:third_party/net_sf_jopt_simple.bzl', net_sf_jopt_simple_deps='dependencies') load('//:third_party/net_minidev.bzl', net_minidev_deps='dependencies') load('//:third_party/net_javacrumbs_json_unit.bzl', net_javacrumbs_json_unit_deps='dependencies') load('//:third_party/jakarta_xml_bind.bzl', jakarta_xml_bind_deps='dependencies') load('//:third_party/jakarta_activation.bzl', jakarta_activation_deps='dependencies') load('//:third_party/commons_fileupload.bzl', commons_fileupload_deps='dependencies') load('//:third_party/com_jayway_jsonpath.bzl', com_jayway_jsonpath_deps='dependencies') load('//:third_party/com_github_jknack.bzl', com_github_jknack_deps='dependencies') load('//:third_party/javax_servlet.bzl', javax_servlet_deps='dependencies') load('//:third_party/xml_apis.bzl', xml_apis_deps='dependencies') load('//:third_party/oro.bzl', oro_deps='dependencies') load('//:third_party/org_typelevel.bzl', org_typelevel_deps='dependencies') load('//:third_party/org_tukaani.bzl', org_tukaani_deps='dependencies') load('//:third_party/org_specs2.bzl', org_specs2_deps='dependencies') load('//:third_party/org_sonatype_plexus.bzl', org_sonatype_plexus_deps='dependencies') load('//:third_party/org_slf4j.bzl', org_slf4j_deps='dependencies') load('//:third_party/org_scalaj.bzl', org_scalaj_deps='dependencies') load('//:third_party/org_scala_sbt.bzl', org_scala_sbt_deps='dependencies') load('//:third_party/org_scala_lang.bzl', org_scala_lang_deps='dependencies') load('//:third_party/org_scala_lang_modules.bzl', org_scala_lang_modules_deps='dependencies') load('//:third_party/org_reflections.bzl', org_reflections_deps='dependencies') load('//:third_party/org_reactivestreams.bzl', org_reactivestreams_deps='dependencies') load('//:third_party/org_portable_scala.bzl', org_portable_scala_deps='dependencies') load('//:third_party/org_ow2_asm.bzl', org_ow2_asm_deps='dependencies') load('//:third_party/org_objenesis.bzl', org_objenesis_deps='dependencies') load('//:third_party/org_mockito.bzl', org_mockito_deps='dependencies') load('//:third_party/org_joda.bzl', org_joda_deps='dependencies') load('//:third_party/org_javassist.bzl', org_javassist_deps='dependencies') load('//:third_party/org_iq80_snappy.bzl', org_iq80_snappy_deps='dependencies') load('//:third_party/org_hamcrest.bzl', org_hamcrest_deps='dependencies') load('//:third_party/org_fusesource_jansi.bzl', org_fusesource_jansi_deps='dependencies') load('//:third_party/org_eclipse_jgit.bzl', org_eclipse_jgit_deps='dependencies') load('//:third_party/org_codehaus_plexus.bzl', org_codehaus_plexus_deps='dependencies') load('//:third_party/org_codehaus_mojo.bzl', org_codehaus_mojo_deps='dependencies') load('//:third_party/org_apache_velocity.bzl', org_apache_velocity_deps='dependencies') load('//:third_party/org_apache_maven_wagon.bzl', org_apache_maven_wagon_deps='dependencies') load('//:third_party/org_apache_maven_shared.bzl', org_apache_maven_shared_deps='dependencies') load('//:third_party/org_apache_maven_resolver.bzl', org_apache_maven_resolver_deps='dependencies') load('//:third_party/org_apache_maven_reporting.bzl', org_apache_maven_reporting_deps='dependencies') load('//:third_party/org_apache_maven.bzl', org_apache_maven_deps='dependencies') load('//:third_party/org_apache_maven_doxia.bzl', org_apache_maven_doxia_deps='dependencies') load('//:third_party/org_apache_maven_archetype.bzl', org_apache_maven_archetype_deps='dependencies') load('//:third_party/org_apache_jackrabbit.bzl', org_apache_jackrabbit_deps='dependencies') load('//:third_party/org_apache_httpcomponents.bzl', org_apache_httpcomponents_deps='dependencies') load('//:third_party/org_apache_commons.bzl', org_apache_commons_deps='dependencies') load('//:third_party/net_sourceforge_jchardet.bzl', net_sourceforge_jchardet_deps='dependencies') load('//:third_party/net_bytebuddy.bzl', net_bytebuddy_deps='dependencies') load('//:third_party/nekohtml.bzl', nekohtml_deps='dependencies') load('//:third_party/junit.bzl', junit_deps='dependencies') load('//:third_party/joda_time.bzl', joda_time_deps='dependencies') load('//:third_party/jdom.bzl', jdom_deps='dependencies') load('//:third_party/javax_inject.bzl', javax_inject_deps='dependencies') load('//:third_party/io_github_alexarchambault_windows_ansi.bzl', io_github_alexarchambault_windows_ansi_deps='dependencies') load('//:third_party/io_github_alexarchambault.bzl', io_github_alexarchambault_deps='dependencies') load('//:third_party/io_get_coursier.bzl', io_get_coursier_deps='dependencies') load('//:third_party/io_argonaut.bzl', io_argonaut_deps='dependencies') load('//:third_party/dom4j.bzl', dom4j_deps='dependencies') load('//:third_party/commons_lang.bzl', commons_lang_deps='dependencies') load('//:third_party/commons_io.bzl', commons_io_deps='dependencies') load('//:third_party/commons_httpclient.bzl', commons_httpclient_deps='dependencies') load('//:third_party/commons_collections.bzl', commons_collections_deps='dependencies') load('//:third_party/commons_codec.bzl', commons_codec_deps='dependencies') load('//:third_party/commons_cli.bzl', commons_cli_deps='dependencies') load('//:third_party/com_wix.bzl', com_wix_deps='dependencies') load('//:third_party/com_typesafe.bzl', com_typesafe_deps='dependencies') load('//:third_party/com_typesafe_akka.bzl', com_typesafe_akka_deps='dependencies') load('//:third_party/com_thoughtworks_paranamer.bzl', com_thoughtworks_paranamer_deps='dependencies') load('//:third_party/com_jcraft.bzl', com_jcraft_deps='dependencies') load('//:third_party/com_googlecode_javaewah.bzl', com_googlecode_javaewah_deps='dependencies') load('//:third_party/com_google_guava.bzl', com_google_guava_deps='dependencies') load('//:third_party/com_google_code_findbugs.bzl', com_google_code_findbugs_deps='dependencies') load('//:third_party/com_github_tomakehurst.bzl', com_github_tomakehurst_deps='dependencies') load('//:third_party/com_github_scopt.bzl', com_github_scopt_deps='dependencies') load('//:third_party/com_github_alexarchambault.bzl', com_github_alexarchambault_deps='dependencies') load('//:third_party/com_fasterxml_jackson_module.bzl', com_fasterxml_jackson_module_deps='dependencies') load('//:third_party/com_fasterxml_jackson_datatype.bzl', com_fasterxml_jackson_datatype_deps='dependencies') load('//:third_party/com_fasterxml_jackson_core.bzl', com_fasterxml_jackson_core_deps='dependencies') load('//:third_party/com_chuusai.bzl', com_chuusai_deps='dependencies') load('//:third_party/classworlds.bzl', classworlds_deps='dependencies') load('//:third_party/ch_qos_logback.bzl', ch_qos_logback_deps='dependencies') load('//:third_party/backport_util_concurrent.bzl', backport_util_concurrent_deps='dependencies') def managed_third_party_dependencies(): backport_util_concurrent_deps() ch_qos_logback_deps() classworlds_deps() com_chuusai_deps() com_fasterxml_jackson_core_deps() com_fasterxml_jackson_datatype_deps() com_fasterxml_jackson_module_deps() com_github_alexarchambault_deps() com_github_scopt_deps() com_github_tomakehurst_deps() com_google_code_findbugs_deps() com_google_guava_deps() com_googlecode_javaewah_deps() com_jcraft_deps() com_thoughtworks_paranamer_deps() com_typesafe_akka_deps() com_typesafe_deps() com_wix_deps() commons_cli_deps() commons_codec_deps() commons_collections_deps() commons_httpclient_deps() commons_io_deps() commons_lang_deps() dom4j_deps() io_argonaut_deps() io_get_coursier_deps() io_github_alexarchambault_deps() io_github_alexarchambault_windows_ansi_deps() javax_inject_deps() jdom_deps() joda_time_deps() junit_deps() nekohtml_deps() net_bytebuddy_deps() net_sourceforge_jchardet_deps() org_apache_commons_deps() org_apache_httpcomponents_deps() org_apache_jackrabbit_deps() org_apache_maven_archetype_deps() org_apache_maven_doxia_deps() org_apache_maven_deps() org_apache_maven_reporting_deps() org_apache_maven_resolver_deps() org_apache_maven_shared_deps() org_apache_maven_wagon_deps() org_apache_velocity_deps() org_codehaus_mojo_deps() org_codehaus_plexus_deps() org_eclipse_jgit_deps() org_fusesource_jansi_deps() org_hamcrest_deps() org_iq80_snappy_deps() org_javassist_deps() org_joda_deps() org_mockito_deps() org_objenesis_deps() org_ow2_asm_deps() org_portable_scala_deps() org_reactivestreams_deps() org_reflections_deps() org_scala_lang_modules_deps() org_scala_lang_deps() org_scala_sbt_deps() org_scalaj_deps() org_slf4j_deps() org_sonatype_plexus_deps() org_specs2_deps() org_tukaani_deps() org_typelevel_deps() oro_deps() xml_apis_deps() javax_servlet_deps() com_github_jknack_deps() com_jayway_jsonpath_deps() commons_fileupload_deps() jakarta_activation_deps() jakarta_xml_bind_deps() net_javacrumbs_json_unit_deps() net_minidev_deps() net_sf_jopt_simple_deps() org_apache_httpcomponents_client5_deps() org_apache_httpcomponents_core5_deps() org_eclipse_jetty_http2_deps() org_eclipse_jetty_deps() org_xmlunit_deps() javax_annotation_deps() aopalliance_deps() com_google_errorprone_deps() com_google_j2objc_deps() javax_enterprise_deps() org_checkerframework_deps() org_eclipse_aether_deps() org_eclipse_sisu_deps() org_sonatype_sisu_deps()
#-*-coding:utf-8-*- class Solution(object): def myPow(self, x, n): """ :type x: float :type n: int :rtype: float """ if n == 0: return 1 if n < 0: n = -n x = 1.0 / x return self.myPow(x * x, n/2) if n % 2 == 0 else self.myPow(x * x, n/2) * x
class Solution(object): def my_pow(self, x, n): """ :type x: float :type n: int :rtype: float """ if n == 0: return 1 if n < 0: n = -n x = 1.0 / x return self.myPow(x * x, n / 2) if n % 2 == 0 else self.myPow(x * x, n / 2) * x
""" 1. Clarification 2. Possible solutions - Binary Search 3. Coding 4. Tests """ # T=O(nlg(sigma(w))), S=O(1) class Solution: def shipWithinDays(self, weights: List[int], D: int) -> int: if not weights or D < 1: return 0 left, right = max(weights), sum(weights) while left < right: mid = (left + right) // 2 need, cur = 1, 0 for weight in weights: if cur + weight > mid: need += 1 cur = 0 cur += weight if need <= D: right = mid else: left = mid + 1 return left
""" 1. Clarification 2. Possible solutions - Binary Search 3. Coding 4. Tests """ class Solution: def ship_within_days(self, weights: List[int], D: int) -> int: if not weights or D < 1: return 0 (left, right) = (max(weights), sum(weights)) while left < right: mid = (left + right) // 2 (need, cur) = (1, 0) for weight in weights: if cur + weight > mid: need += 1 cur = 0 cur += weight if need <= D: right = mid else: left = mid + 1 return left
def getFuel(mass): return int(mass/3)-2 def getTotalFuel_1(values): total = 0 for v in values: total += getFuel(v) return total def getTotalFuel_2(values): total = 0 for v in values: while(True): v = getFuel(v) if v < 0: break total += v return total values = [] with open('2019/input1.txt') as f: for l in f: values.append(int(l)) print(getTotalFuel_1(values)) print(getTotalFuel_2(values))
def get_fuel(mass): return int(mass / 3) - 2 def get_total_fuel_1(values): total = 0 for v in values: total += get_fuel(v) return total def get_total_fuel_2(values): total = 0 for v in values: while True: v = get_fuel(v) if v < 0: break total += v return total values = [] with open('2019/input1.txt') as f: for l in f: values.append(int(l)) print(get_total_fuel_1(values)) print(get_total_fuel_2(values))
# -*- coding: utf-8 -*- { 'name': "Merced Report", 'summary': """Informe de Presupuesto""", 'description': """ Este informe imprime el nombre del usuario logueado, el cual crea el informe del presupuesto """, 'author': "Soluciones4G", 'website': "http://www.soluciones4g.com", # Categories can be used to filter modules in modules listing # for the full list 'category': 'Sale', 'version': '1', # any module necessary for this one to work correctly 'depends': ['sale'], # always loaded 'data': [ 'report/informe_view.xml', ], 'intallable': True, 'auto_install': False, }
{'name': 'Merced Report', 'summary': 'Informe de Presupuesto', 'description': '\n Este informe imprime el nombre del usuario logueado, el cual crea el informe del presupuesto\n ', 'author': 'Soluciones4G', 'website': 'http://www.soluciones4g.com', 'category': 'Sale', 'version': '1', 'depends': ['sale'], 'data': ['report/informe_view.xml'], 'intallable': True, 'auto_install': False}
# parsetab.py # This file is automatically generated. Do not edit. # pylint: disable=W,C,R _tabversion = '3.10' _lr_method = 'LALR' _lr_signature = 'leftIGUALDADDESIGUALDADleftMAYORMENORMAYORIGUALMENORIGUALleftSUMARESTAleftMULTIPLICACIONDIVISIONleftPAR_ABREPAR_CIERRALLAVE_ABRELLAVE_CIERRACADENA DECIMAL DESIGUALDAD DIVISION ELSE ENTERO ID IF IGUALDAD IMPRIMIR LLAVE_ABRE LLAVE_CIERRA MAYOR MAYORIGUAL MENOR MENORIGUAL MULTIPLICACION PAR_ABRE PAR_CIERRA PUNTOCOMA RESTA SUMA WHILEinit : instruccionesinstrucciones : instrucciones instruccioninstrucciones : instruccion instruccion : imprimir_\n | if_statement\n | while_statementexpresion_ : expresion_ SUMA expresion_\n | expresion_ RESTA expresion_\n | expresion_ MULTIPLICACION expresion_\n | expresion_ DIVISION expresion_\n | expresion_ IGUALDAD expresion_\n | expresion_ DESIGUALDAD expresion_\n | expresion_ MAYOR expresion_\n | expresion_ MENOR expresion_\n | expresion_ MAYORIGUAL expresion_\n | expresion_ MENORIGUAL expresion_\n | expif_statement : IF PAR_ABRE expresion_ PAR_CIERRA statement else_statementelse_statement : ELSE statement\n | ELSE if_statement\n | while_statement : WHILE PAR_ABRE expresion_ PAR_CIERRA statementstatement : LLAVE_ABRE instrucciones LLAVE_CIERRA\n | LLAVE_ABRE LLAVE_CIERRAimprimir_ : IMPRIMIR PAR_ABRE expresion_ PAR_CIERRA PUNTOCOMAexp : primitivoprimitivo : ENTEROprimitivo : DECIMALprimitivo : CADENAprimitivo : varsvars : ID' _lr_action_items = {'IMPRIMIR':([0,2,3,4,5,6,10,37,48,49,50,51,53,54,55,56,57,],[7,7,-3,-4,-5,-6,-2,-25,-21,7,-22,-18,7,-24,-19,-20,-23,]),'IF':([0,2,3,4,5,6,10,37,48,49,50,51,52,53,54,55,56,57,],[8,8,-3,-4,-5,-6,-2,-25,-21,8,-22,-18,8,8,-24,-19,-20,-23,]),'WHILE':([0,2,3,4,5,6,10,37,48,49,50,51,53,54,55,56,57,],[9,9,-3,-4,-5,-6,-2,-25,-21,9,-22,-18,9,-24,-19,-20,-23,]),'$end':([1,2,3,4,5,6,10,37,48,50,51,54,55,56,57,],[0,-1,-3,-4,-5,-6,-2,-25,-21,-22,-18,-24,-19,-20,-23,]),'LLAVE_CIERRA':([3,4,5,6,10,37,48,49,50,51,53,54,55,56,57,],[-3,-4,-5,-6,-2,-25,-21,54,-22,-18,57,-24,-19,-20,-23,]),'PAR_ABRE':([7,8,9,],[11,12,13,]),'ENTERO':([11,12,13,25,26,27,28,29,30,31,32,33,34,],[17,17,17,17,17,17,17,17,17,17,17,17,17,]),'DECIMAL':([11,12,13,25,26,27,28,29,30,31,32,33,34,],[18,18,18,18,18,18,18,18,18,18,18,18,18,]),'CADENA':([11,12,13,25,26,27,28,29,30,31,32,33,34,],[19,19,19,19,19,19,19,19,19,19,19,19,19,]),'ID':([11,12,13,25,26,27,28,29,30,31,32,33,34,],[21,21,21,21,21,21,21,21,21,21,21,21,21,]),'PAR_CIERRA':([14,15,16,17,18,19,20,21,22,23,38,39,40,41,42,43,44,45,46,47,],[24,-17,-26,-27,-28,-29,-30,-31,35,36,-7,-8,-9,-10,-11,-12,-13,-14,-15,-16,]),'SUMA':([14,15,16,17,18,19,20,21,22,23,38,39,40,41,42,43,44,45,46,47,],[25,-17,-26,-27,-28,-29,-30,-31,25,25,-7,-8,-9,-10,25,25,25,25,25,25,]),'RESTA':([14,15,16,17,18,19,20,21,22,23,38,39,40,41,42,43,44,45,46,47,],[26,-17,-26,-27,-28,-29,-30,-31,26,26,-7,-8,-9,-10,26,26,26,26,26,26,]),'MULTIPLICACION':([14,15,16,17,18,19,20,21,22,23,38,39,40,41,42,43,44,45,46,47,],[27,-17,-26,-27,-28,-29,-30,-31,27,27,27,27,-9,-10,27,27,27,27,27,27,]),'DIVISION':([14,15,16,17,18,19,20,21,22,23,38,39,40,41,42,43,44,45,46,47,],[28,-17,-26,-27,-28,-29,-30,-31,28,28,28,28,-9,-10,28,28,28,28,28,28,]),'IGUALDAD':([14,15,16,17,18,19,20,21,22,23,38,39,40,41,42,43,44,45,46,47,],[29,-17,-26,-27,-28,-29,-30,-31,29,29,-7,-8,-9,-10,-11,-12,-13,-14,-15,-16,]),'DESIGUALDAD':([14,15,16,17,18,19,20,21,22,23,38,39,40,41,42,43,44,45,46,47,],[30,-17,-26,-27,-28,-29,-30,-31,30,30,-7,-8,-9,-10,-11,-12,-13,-14,-15,-16,]),'MAYOR':([14,15,16,17,18,19,20,21,22,23,38,39,40,41,42,43,44,45,46,47,],[31,-17,-26,-27,-28,-29,-30,-31,31,31,-7,-8,-9,-10,31,31,-13,-14,-15,-16,]),'MENOR':([14,15,16,17,18,19,20,21,22,23,38,39,40,41,42,43,44,45,46,47,],[32,-17,-26,-27,-28,-29,-30,-31,32,32,-7,-8,-9,-10,32,32,-13,-14,-15,-16,]),'MAYORIGUAL':([14,15,16,17,18,19,20,21,22,23,38,39,40,41,42,43,44,45,46,47,],[33,-17,-26,-27,-28,-29,-30,-31,33,33,-7,-8,-9,-10,33,33,-13,-14,-15,-16,]),'MENORIGUAL':([14,15,16,17,18,19,20,21,22,23,38,39,40,41,42,43,44,45,46,47,],[34,-17,-26,-27,-28,-29,-30,-31,34,34,-7,-8,-9,-10,34,34,-13,-14,-15,-16,]),'PUNTOCOMA':([24,],[37,]),'LLAVE_ABRE':([35,36,52,],[49,49,49,]),'ELSE':([48,54,57,],[52,-24,-23,]),} _lr_action = {} for _k, _v in _lr_action_items.items(): for _x,_y in zip(_v[0],_v[1]): if not _x in _lr_action: _lr_action[_x] = {} _lr_action[_x][_k] = _y del _lr_action_items _lr_goto_items = {'init':([0,],[1,]),'instrucciones':([0,49,],[2,53,]),'instruccion':([0,2,49,53,],[3,10,3,10,]),'imprimir_':([0,2,49,53,],[4,4,4,4,]),'if_statement':([0,2,49,52,53,],[5,5,5,56,5,]),'while_statement':([0,2,49,53,],[6,6,6,6,]),'expresion_':([11,12,13,25,26,27,28,29,30,31,32,33,34,],[14,22,23,38,39,40,41,42,43,44,45,46,47,]),'exp':([11,12,13,25,26,27,28,29,30,31,32,33,34,],[15,15,15,15,15,15,15,15,15,15,15,15,15,]),'primitivo':([11,12,13,25,26,27,28,29,30,31,32,33,34,],[16,16,16,16,16,16,16,16,16,16,16,16,16,]),'vars':([11,12,13,25,26,27,28,29,30,31,32,33,34,],[20,20,20,20,20,20,20,20,20,20,20,20,20,]),'statement':([35,36,52,],[48,50,55,]),'else_statement':([48,],[51,]),} _lr_goto = {} for _k, _v in _lr_goto_items.items(): for _x, _y in zip(_v[0], _v[1]): if not _x in _lr_goto: _lr_goto[_x] = {} _lr_goto[_x][_k] = _y del _lr_goto_items _lr_productions = [ ("S' -> init","S'",1,None,None,None), ('init -> instrucciones','init',1,'p_init','execute.py',125), ('instrucciones -> instrucciones instruccion','instrucciones',2,'p_instrucciones_lista','execute.py',129), ('instrucciones -> instruccion','instrucciones',1,'p_instrucciones_instruccion','execute.py',134), ('instruccion -> imprimir_','instruccion',1,'p_instruccion','execute.py',138), ('instruccion -> if_statement','instruccion',1,'p_instruccion','execute.py',139), ('instruccion -> while_statement','instruccion',1,'p_instruccion','execute.py',140), ('expresion_ -> expresion_ SUMA expresion_','expresion_',3,'p_expresion_','execute.py',144), ('expresion_ -> expresion_ RESTA expresion_','expresion_',3,'p_expresion_','execute.py',145), ('expresion_ -> expresion_ MULTIPLICACION expresion_','expresion_',3,'p_expresion_','execute.py',146), ('expresion_ -> expresion_ DIVISION expresion_','expresion_',3,'p_expresion_','execute.py',147), ('expresion_ -> expresion_ IGUALDAD expresion_','expresion_',3,'p_expresion_','execute.py',148), ('expresion_ -> expresion_ DESIGUALDAD expresion_','expresion_',3,'p_expresion_','execute.py',149), ('expresion_ -> expresion_ MAYOR expresion_','expresion_',3,'p_expresion_','execute.py',150), ('expresion_ -> expresion_ MENOR expresion_','expresion_',3,'p_expresion_','execute.py',151), ('expresion_ -> expresion_ MAYORIGUAL expresion_','expresion_',3,'p_expresion_','execute.py',152), ('expresion_ -> expresion_ MENORIGUAL expresion_','expresion_',3,'p_expresion_','execute.py',153), ('expresion_ -> exp','expresion_',1,'p_expresion_','execute.py',154), ('if_statement -> IF PAR_ABRE expresion_ PAR_CIERRA statement else_statement','if_statement',6,'p_if_instr','execute.py',170), ('else_statement -> ELSE statement','else_statement',2,'p_else_instr','execute.py',174), ('else_statement -> ELSE if_statement','else_statement',2,'p_else_instr','execute.py',175), ('else_statement -> <empty>','else_statement',0,'p_else_instr','execute.py',176), ('while_statement -> WHILE PAR_ABRE expresion_ PAR_CIERRA statement','while_statement',5,'p_while_instr','execute.py',184), ('statement -> LLAVE_ABRE instrucciones LLAVE_CIERRA','statement',3,'p_statement','execute.py',188), ('statement -> LLAVE_ABRE LLAVE_CIERRA','statement',2,'p_statement','execute.py',189), ('imprimir_ -> IMPRIMIR PAR_ABRE expresion_ PAR_CIERRA PUNTOCOMA','imprimir_',5,'p_imprimir_instr','execute.py',194), ('exp -> primitivo','exp',1,'p_exp_primitivo','execute.py',198), ('primitivo -> ENTERO','primitivo',1,'p_exp_entero','execute.py',202), ('primitivo -> DECIMAL','primitivo',1,'p_exp_decimal','execute.py',207), ('primitivo -> CADENA','primitivo',1,'p_exp_cadena','execute.py',211), ('primitivo -> vars','primitivo',1,'p_exp_variables','execute.py',215), ('vars -> ID','vars',1,'p_exp_id','execute.py',219), ]
_tabversion = '3.10' _lr_method = 'LALR' _lr_signature = 'leftIGUALDADDESIGUALDADleftMAYORMENORMAYORIGUALMENORIGUALleftSUMARESTAleftMULTIPLICACIONDIVISIONleftPAR_ABREPAR_CIERRALLAVE_ABRELLAVE_CIERRACADENA DECIMAL DESIGUALDAD DIVISION ELSE ENTERO ID IF IGUALDAD IMPRIMIR LLAVE_ABRE LLAVE_CIERRA MAYOR MAYORIGUAL MENOR MENORIGUAL MULTIPLICACION PAR_ABRE PAR_CIERRA PUNTOCOMA RESTA SUMA WHILEinit : instruccionesinstrucciones : instrucciones instruccioninstrucciones : instruccion instruccion : imprimir_\n | if_statement\n | while_statementexpresion_ : expresion_ SUMA expresion_\n | expresion_ RESTA expresion_\n | expresion_ MULTIPLICACION expresion_\n | expresion_ DIVISION expresion_\n | expresion_ IGUALDAD expresion_\n | expresion_ DESIGUALDAD expresion_\n | expresion_ MAYOR expresion_\n | expresion_ MENOR expresion_\n | expresion_ MAYORIGUAL expresion_\n | expresion_ MENORIGUAL expresion_\n | expif_statement : IF PAR_ABRE expresion_ PAR_CIERRA statement else_statementelse_statement : ELSE statement\n | ELSE if_statement\n | while_statement : WHILE PAR_ABRE expresion_ PAR_CIERRA statementstatement : LLAVE_ABRE instrucciones LLAVE_CIERRA\n | LLAVE_ABRE LLAVE_CIERRAimprimir_ : IMPRIMIR PAR_ABRE expresion_ PAR_CIERRA PUNTOCOMAexp : primitivoprimitivo : ENTEROprimitivo : DECIMALprimitivo : CADENAprimitivo : varsvars : ID' _lr_action_items = {'IMPRIMIR': ([0, 2, 3, 4, 5, 6, 10, 37, 48, 49, 50, 51, 53, 54, 55, 56, 57], [7, 7, -3, -4, -5, -6, -2, -25, -21, 7, -22, -18, 7, -24, -19, -20, -23]), 'IF': ([0, 2, 3, 4, 5, 6, 10, 37, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57], [8, 8, -3, -4, -5, -6, -2, -25, -21, 8, -22, -18, 8, 8, -24, -19, -20, -23]), 'WHILE': ([0, 2, 3, 4, 5, 6, 10, 37, 48, 49, 50, 51, 53, 54, 55, 56, 57], [9, 9, -3, -4, -5, -6, -2, -25, -21, 9, -22, -18, 9, -24, -19, -20, -23]), '$end': ([1, 2, 3, 4, 5, 6, 10, 37, 48, 50, 51, 54, 55, 56, 57], [0, -1, -3, -4, -5, -6, -2, -25, -21, -22, -18, -24, -19, -20, -23]), 'LLAVE_CIERRA': ([3, 4, 5, 6, 10, 37, 48, 49, 50, 51, 53, 54, 55, 56, 57], [-3, -4, -5, -6, -2, -25, -21, 54, -22, -18, 57, -24, -19, -20, -23]), 'PAR_ABRE': ([7, 8, 9], [11, 12, 13]), 'ENTERO': ([11, 12, 13, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34], [17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17]), 'DECIMAL': ([11, 12, 13, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34], [18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18]), 'CADENA': ([11, 12, 13, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34], [19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19]), 'ID': ([11, 12, 13, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34], [21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21]), 'PAR_CIERRA': ([14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47], [24, -17, -26, -27, -28, -29, -30, -31, 35, 36, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16]), 'SUMA': ([14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47], [25, -17, -26, -27, -28, -29, -30, -31, 25, 25, -7, -8, -9, -10, 25, 25, 25, 25, 25, 25]), 'RESTA': ([14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47], [26, -17, -26, -27, -28, -29, -30, -31, 26, 26, -7, -8, -9, -10, 26, 26, 26, 26, 26, 26]), 'MULTIPLICACION': ([14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47], [27, -17, -26, -27, -28, -29, -30, -31, 27, 27, 27, 27, -9, -10, 27, 27, 27, 27, 27, 27]), 'DIVISION': ([14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47], [28, -17, -26, -27, -28, -29, -30, -31, 28, 28, 28, 28, -9, -10, 28, 28, 28, 28, 28, 28]), 'IGUALDAD': ([14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47], [29, -17, -26, -27, -28, -29, -30, -31, 29, 29, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16]), 'DESIGUALDAD': ([14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47], [30, -17, -26, -27, -28, -29, -30, -31, 30, 30, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16]), 'MAYOR': ([14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47], [31, -17, -26, -27, -28, -29, -30, -31, 31, 31, -7, -8, -9, -10, 31, 31, -13, -14, -15, -16]), 'MENOR': ([14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47], [32, -17, -26, -27, -28, -29, -30, -31, 32, 32, -7, -8, -9, -10, 32, 32, -13, -14, -15, -16]), 'MAYORIGUAL': ([14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47], [33, -17, -26, -27, -28, -29, -30, -31, 33, 33, -7, -8, -9, -10, 33, 33, -13, -14, -15, -16]), 'MENORIGUAL': ([14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47], [34, -17, -26, -27, -28, -29, -30, -31, 34, 34, -7, -8, -9, -10, 34, 34, -13, -14, -15, -16]), 'PUNTOCOMA': ([24], [37]), 'LLAVE_ABRE': ([35, 36, 52], [49, 49, 49]), 'ELSE': ([48, 54, 57], [52, -24, -23])} _lr_action = {} for (_k, _v) in _lr_action_items.items(): for (_x, _y) in zip(_v[0], _v[1]): if not _x in _lr_action: _lr_action[_x] = {} _lr_action[_x][_k] = _y del _lr_action_items _lr_goto_items = {'init': ([0], [1]), 'instrucciones': ([0, 49], [2, 53]), 'instruccion': ([0, 2, 49, 53], [3, 10, 3, 10]), 'imprimir_': ([0, 2, 49, 53], [4, 4, 4, 4]), 'if_statement': ([0, 2, 49, 52, 53], [5, 5, 5, 56, 5]), 'while_statement': ([0, 2, 49, 53], [6, 6, 6, 6]), 'expresion_': ([11, 12, 13, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34], [14, 22, 23, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47]), 'exp': ([11, 12, 13, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34], [15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15]), 'primitivo': ([11, 12, 13, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34], [16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16]), 'vars': ([11, 12, 13, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34], [20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20]), 'statement': ([35, 36, 52], [48, 50, 55]), 'else_statement': ([48], [51])} _lr_goto = {} for (_k, _v) in _lr_goto_items.items(): for (_x, _y) in zip(_v[0], _v[1]): if not _x in _lr_goto: _lr_goto[_x] = {} _lr_goto[_x][_k] = _y del _lr_goto_items _lr_productions = [("S' -> init", "S'", 1, None, None, None), ('init -> instrucciones', 'init', 1, 'p_init', 'execute.py', 125), ('instrucciones -> instrucciones instruccion', 'instrucciones', 2, 'p_instrucciones_lista', 'execute.py', 129), ('instrucciones -> instruccion', 'instrucciones', 1, 'p_instrucciones_instruccion', 'execute.py', 134), ('instruccion -> imprimir_', 'instruccion', 1, 'p_instruccion', 'execute.py', 138), ('instruccion -> if_statement', 'instruccion', 1, 'p_instruccion', 'execute.py', 139), ('instruccion -> while_statement', 'instruccion', 1, 'p_instruccion', 'execute.py', 140), ('expresion_ -> expresion_ SUMA expresion_', 'expresion_', 3, 'p_expresion_', 'execute.py', 144), ('expresion_ -> expresion_ RESTA expresion_', 'expresion_', 3, 'p_expresion_', 'execute.py', 145), ('expresion_ -> expresion_ MULTIPLICACION expresion_', 'expresion_', 3, 'p_expresion_', 'execute.py', 146), ('expresion_ -> expresion_ DIVISION expresion_', 'expresion_', 3, 'p_expresion_', 'execute.py', 147), ('expresion_ -> expresion_ IGUALDAD expresion_', 'expresion_', 3, 'p_expresion_', 'execute.py', 148), ('expresion_ -> expresion_ DESIGUALDAD expresion_', 'expresion_', 3, 'p_expresion_', 'execute.py', 149), ('expresion_ -> expresion_ MAYOR expresion_', 'expresion_', 3, 'p_expresion_', 'execute.py', 150), ('expresion_ -> expresion_ MENOR expresion_', 'expresion_', 3, 'p_expresion_', 'execute.py', 151), ('expresion_ -> expresion_ MAYORIGUAL expresion_', 'expresion_', 3, 'p_expresion_', 'execute.py', 152), ('expresion_ -> expresion_ MENORIGUAL expresion_', 'expresion_', 3, 'p_expresion_', 'execute.py', 153), ('expresion_ -> exp', 'expresion_', 1, 'p_expresion_', 'execute.py', 154), ('if_statement -> IF PAR_ABRE expresion_ PAR_CIERRA statement else_statement', 'if_statement', 6, 'p_if_instr', 'execute.py', 170), ('else_statement -> ELSE statement', 'else_statement', 2, 'p_else_instr', 'execute.py', 174), ('else_statement -> ELSE if_statement', 'else_statement', 2, 'p_else_instr', 'execute.py', 175), ('else_statement -> <empty>', 'else_statement', 0, 'p_else_instr', 'execute.py', 176), ('while_statement -> WHILE PAR_ABRE expresion_ PAR_CIERRA statement', 'while_statement', 5, 'p_while_instr', 'execute.py', 184), ('statement -> LLAVE_ABRE instrucciones LLAVE_CIERRA', 'statement', 3, 'p_statement', 'execute.py', 188), ('statement -> LLAVE_ABRE LLAVE_CIERRA', 'statement', 2, 'p_statement', 'execute.py', 189), ('imprimir_ -> IMPRIMIR PAR_ABRE expresion_ PAR_CIERRA PUNTOCOMA', 'imprimir_', 5, 'p_imprimir_instr', 'execute.py', 194), ('exp -> primitivo', 'exp', 1, 'p_exp_primitivo', 'execute.py', 198), ('primitivo -> ENTERO', 'primitivo', 1, 'p_exp_entero', 'execute.py', 202), ('primitivo -> DECIMAL', 'primitivo', 1, 'p_exp_decimal', 'execute.py', 207), ('primitivo -> CADENA', 'primitivo', 1, 'p_exp_cadena', 'execute.py', 211), ('primitivo -> vars', 'primitivo', 1, 'p_exp_variables', 'execute.py', 215), ('vars -> ID', 'vars', 1, 'p_exp_id', 'execute.py', 219)]
def calculate(expr: str) -> int: """Evaluate 'expr', which contains only non-negative integers, {+,-,*,/} operators and empty spaces.""" plusOrMinus = {'+': lambda x, y: x + y , '-': lambda x, y: x - y} mulOrDiv = {'*': lambda x, y: x * y , '/': lambda x, y: x // y} stack = [] operators = [] number = 0 for char in expr: if char.strip() == '': # Skip whitespace. continue if char.isdigit(): # Add digit to current number. number = number * 10 + int(char) continue stack.append(number) number = 0 if operators and operators[-1] in mulOrDiv: # Perform multiplication or division first. snd = stack.pop() fst = stack.pop() operator = operators.pop() stack.append(mulOrDiv[operator](fst, snd)) operators.append(char) # The last operand must be a number, so add that to the stack. # Also perform multiplication or division if it is the last operator. stack.append(number) if operators and operators[-1] in mulOrDiv: snd = stack.pop() fst = stack.pop() operator = operators.pop() stack.append(mulOrDiv[operator](fst, snd)) # The remaining computations are addition or subtraction. Perform these # in order from left to right. result = stack[0] for snd, operator in zip(stack[1:], operators): result = plusOrMinus[operator](result, snd) return result
def calculate(expr: str) -> int: """Evaluate 'expr', which contains only non-negative integers, {+,-,*,/} operators and empty spaces.""" plus_or_minus = {'+': lambda x, y: x + y, '-': lambda x, y: x - y} mul_or_div = {'*': lambda x, y: x * y, '/': lambda x, y: x // y} stack = [] operators = [] number = 0 for char in expr: if char.strip() == '': continue if char.isdigit(): number = number * 10 + int(char) continue stack.append(number) number = 0 if operators and operators[-1] in mulOrDiv: snd = stack.pop() fst = stack.pop() operator = operators.pop() stack.append(mulOrDiv[operator](fst, snd)) operators.append(char) stack.append(number) if operators and operators[-1] in mulOrDiv: snd = stack.pop() fst = stack.pop() operator = operators.pop() stack.append(mulOrDiv[operator](fst, snd)) result = stack[0] for (snd, operator) in zip(stack[1:], operators): result = plusOrMinus[operator](result, snd) return result
# Python support inheritance from multiple classes. This part will show you: # how multiple inheritance works # how to use super() to call methods inherited from multiple parents # what complexities derive from multiple inheritance # how to write a mixin, which is a common use of multiple inheritance class RightPyramid(Triangle, Square): def __init__(self, base, slant_height): self.base = base self.slant_height = slant_height def what_am_i(self): return "Pyramid" # The Method Resolution Order (MRO) dertermines where Python looks for a method when there is # hierrachy of classes. class A: def __init__(self): print("A") super().__init__() class B(A): def __init__(self): print("B") super().__init__() class X: def __init__(self): print("X") super().__init__() class Forward(B, X): def __init__(self): print("Forward") super().__init__() class Backward(X, B): def __init__(self): print("Backward") super().__init__() # If you combine the MRO and the **kwargs feature for specifying name-value pairs during # construction, you can write code that passes parameters to parent classes even if they have # different name class Rectangle: def __init__(self, length, width, **kwargs): self.length = length self.width = width super().__init__(**kwargs) def area(self): return self.length * self.width def perimeter(self): return 2 * self.length + 2 * self.width class Square(Rectangle): def __init__(self, length, **kwargs): super().__init__(length=length, width=length, **kwargs) class Triangle: def __init__(self, base, height, **kwargs): self.base = base self.heigth = height super().__init__(**kwargs) def tri_area(self): return 0.5 * self.base * self.length class RightPyramid(Square, Triangle): def __init__(self, base, slant_height, *kwargs): self.base = base self.slant_height kwargs["height"] = slant_height kwargs["length"] = base super().__init__(base=base, **kwargs) def area(self): base_area = super().area() perimeter = super().perimeter() return 0.5 * perimeter * self.slant_height + base_area def area_2(self): base_area = super().area() triangle_area = super().tri_area() return triangle_area * 4 + base_area # Multiple inheritance can get tricky quickly. A simple use case that is common in the field is to # write a mixin. A mixin is a class that doesn't care about its position in the hierrachy, but just # provides one or more convenience methods class SurfaceMixin: def surface_area(self): surface_area = 0 for surface in self.surfaces: surface_area += surface.area(self) return surface_area class Cube(Square, SurfaceMixin): def __init__(self, length): super().__init__() self.surfaces = [Square, Square, Square, Square, Square, Square] class RightPyramid(Square, Triangle, SurfaceMixin): def __init__(self, base, slant_height): self.base = base self.slant_height = slant_height self.height = base self.width = base self.surfaces = [Square, Triangle, Triangle, Triangle, Triangle]
class Rightpyramid(Triangle, Square): def __init__(self, base, slant_height): self.base = base self.slant_height = slant_height def what_am_i(self): return 'Pyramid' class A: def __init__(self): print('A') super().__init__() class B(A): def __init__(self): print('B') super().__init__() class X: def __init__(self): print('X') super().__init__() class Forward(B, X): def __init__(self): print('Forward') super().__init__() class Backward(X, B): def __init__(self): print('Backward') super().__init__() class Rectangle: def __init__(self, length, width, **kwargs): self.length = length self.width = width super().__init__(**kwargs) def area(self): return self.length * self.width def perimeter(self): return 2 * self.length + 2 * self.width class Square(Rectangle): def __init__(self, length, **kwargs): super().__init__(length=length, width=length, **kwargs) class Triangle: def __init__(self, base, height, **kwargs): self.base = base self.heigth = height super().__init__(**kwargs) def tri_area(self): return 0.5 * self.base * self.length class Rightpyramid(Square, Triangle): def __init__(self, base, slant_height, *kwargs): self.base = base self.slant_height kwargs['height'] = slant_height kwargs['length'] = base super().__init__(base=base, **kwargs) def area(self): base_area = super().area() perimeter = super().perimeter() return 0.5 * perimeter * self.slant_height + base_area def area_2(self): base_area = super().area() triangle_area = super().tri_area() return triangle_area * 4 + base_area class Surfacemixin: def surface_area(self): surface_area = 0 for surface in self.surfaces: surface_area += surface.area(self) return surface_area class Cube(Square, SurfaceMixin): def __init__(self, length): super().__init__() self.surfaces = [Square, Square, Square, Square, Square, Square] class Rightpyramid(Square, Triangle, SurfaceMixin): def __init__(self, base, slant_height): self.base = base self.slant_height = slant_height self.height = base self.width = base self.surfaces = [Square, Triangle, Triangle, Triangle, Triangle]
# -*- coding: utf-8 -*- E = int(input()) N = int(input()) P = float(input()) SALARY = N * P print("NUMBER = %d" % (E)) print("SALARY = U$ %.2f" % (SALARY))
e = int(input()) n = int(input()) p = float(input()) salary = N * P print('NUMBER = %d' % E) print('SALARY = U$ %.2f' % SALARY)
data = open(r"C:\Users\gifte\Desktop\game\data_number.txt",'r') x = data.readlines() string="" for line in x: for _ in line: if _ =="0": string+="a" elif _ =="1": string+="s" elif _ =="2": string+="d" elif _ =="3": string+="f" elif _ =="4": string+="g" elif _ =="5": string+="h" elif _ =="6": string+="j" elif _ =="7": string+="k" print(string)
data = open('C:\\Users\\gifte\\Desktop\\game\\data_number.txt', 'r') x = data.readlines() string = '' for line in x: for _ in line: if _ == '0': string += 'a' elif _ == '1': string += 's' elif _ == '2': string += 'd' elif _ == '3': string += 'f' elif _ == '4': string += 'g' elif _ == '5': string += 'h' elif _ == '6': string += 'j' elif _ == '7': string += 'k' print(string)
# # PySNMP MIB module ADIC-INTELLIGENT-STORAGE-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ADIC-INTELLIGENT-STORAGE-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 16:58:16 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, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsUnion, ValueRangeConstraint, ValueSizeConstraint, SingleValueConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueRangeConstraint", "ValueSizeConstraint", "SingleValueConstraint", "ConstraintsIntersection") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") Integer32, Counter32, ModuleIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, MibIdentifier, NotificationType, Unsigned32, IpAddress, NotificationType, enterprises, iso, ObjectIdentity, Counter64, Gauge32, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "Counter32", "ModuleIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "MibIdentifier", "NotificationType", "Unsigned32", "IpAddress", "NotificationType", "enterprises", "iso", "ObjectIdentity", "Counter64", "Gauge32", "Bits") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") adic = MibIdentifier((1, 3, 6, 1, 4, 1, 3764)) storage = MibIdentifier((1, 3, 6, 1, 4, 1, 3764, 1)) intelligent = MibIdentifier((1, 3, 6, 1, 4, 1, 3764, 1, 1)) productAgentInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 3764, 1, 1, 10)) globalData = MibIdentifier((1, 3, 6, 1, 4, 1, 3764, 1, 1, 20)) components = MibIdentifier((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30)) software = MibIdentifier((1, 3, 6, 1, 4, 1, 3764, 1, 1, 100)) hardware = MibIdentifier((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200)) powerAndCooling = MibIdentifier((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200)) sml = MibIdentifier((1, 3, 6, 1, 4, 1, 3764, 1, 1, 300)) network = MibIdentifier((1, 3, 6, 1, 4, 1, 3764, 1, 1, 400)) notification = MibIdentifier((1, 3, 6, 1, 4, 1, 3764, 1, 1, 500)) class Boolean(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("true", 1), ("false", 2)) class AdicMibVersion(DisplayString): pass class AdicREDIdentifier(Counter32): pass class AdicEnable(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("enabled", 1), ("disabled", 2)) class AdicAgentStatus(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6)) namedValues = NamedValues(("other", 1), ("unknown", 2), ("ok", 3), ("non-critical", 4), ("critical", 5), ("non-recoverable", 6)) class AdicOnlineStatus(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("online", 1), ("offline", 2), ("shutdown", 3)) class AdicGlobalId(OctetString): subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(8, 8) fixedLength = 8 class AdicComponentType(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8)) namedValues = NamedValues(("mcb", 1), ("cmb", 2), ("ioBlade", 3), ("rcu", 4), ("networkChasis", 5), ("controlModule", 6), ("expansionModule", 7), ("powerSupply", 8)) class AdicInterfaceType(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("scsi", 1), ("fibreChannel", 2)) class AdicSensorStatus(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7)) namedValues = NamedValues(("nominal", 1), ("warningLow", 2), ("warningHigh", 3), ("alarmLow", 4), ("alarmHigh", 5), ("notInstalled", 6), ("noData", 7)) class AdicVoltageType(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("dc", 1), ("ac", 2)) class AdicDateAndTime(OctetString): subtypeSpec = OctetString.subtypeSpec + ConstraintsUnion(ValueSizeConstraint(8, 8), ValueSizeConstraint(11, 11), ) class AdicTrapSeverity(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5)) namedValues = NamedValues(("emergency", 1), ("alarm", 2), ("warning", 3), ("notice", 4), ("informational", 5)) class AdicDoorStatus(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7)) namedValues = NamedValues(("open", 1), ("closed", 2), ("closedAndLocked", 3), ("closedAndUnlocked", 4), ("contollerFailed", 5), ("notInstalled", 6), ("noData", 7)) class AdicDriveStatus(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7)) namedValues = NamedValues(("idle", 1), ("loading", 2), ("ejecting", 3), ("inserted", 4), ("removed", 5), ("notInstalled", 6), ("noData", 7)) class RowStatus(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6)) namedValues = NamedValues(("active", 1), ("notInService", 2), ("notReady", 3), ("createAndGo", 4), ("createAndWait", 5), ("destroy", 6)) productMibVersion = MibScalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 10, 1), AdicMibVersion()).setMaxAccess("readonly") if mibBuilder.loadTexts: productMibVersion.setStatus('mandatory') productSnmpAgentVersion = MibScalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 10, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: productSnmpAgentVersion.setStatus('mandatory') productName = MibScalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 10, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: productName.setStatus('mandatory') productDisplayName = MibScalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 10, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: productDisplayName.setStatus('mandatory') productDescription = MibScalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 10, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: productDescription.setStatus('mandatory') productVendor = MibScalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 10, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: productVendor.setStatus('mandatory') productVersion = MibScalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 10, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: productVersion.setStatus('mandatory') productDisplayVersion = MibScalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 10, 8), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: productDisplayVersion.setStatus('mandatory') productLibraryClass = MibScalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 10, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 10))).clone(namedValues=NamedValues(("basic", 1), ("intelligent", 2), ("virtual", 10)))).setMaxAccess("readonly") if mibBuilder.loadTexts: productLibraryClass.setStatus('mandatory') productSerialNumber = MibScalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 10, 10), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: productSerialNumber.setStatus('mandatory') agentGlobalStatus = MibScalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 20, 1), AdicAgentStatus()).setMaxAccess("readonly") if mibBuilder.loadTexts: agentGlobalStatus.setStatus('mandatory') agentLastGlobalStatus = MibScalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 20, 2), AdicAgentStatus()).setMaxAccess("readonly") if mibBuilder.loadTexts: agentLastGlobalStatus.setStatus('mandatory') agentTimeStamp = MibScalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 20, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: agentTimeStamp.setStatus('mandatory') agentGetTimeOut = MibScalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 20, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: agentGetTimeOut.setStatus('mandatory') agentModifiers = MibScalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 20, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: agentModifiers.setStatus('mandatory') agentRefreshRate = MibScalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 20, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: agentRefreshRate.setStatus('mandatory') componentTable = MibTable((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10), ) if mibBuilder.loadTexts: componentTable.setStatus('mandatory') componentEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1), ).setIndexNames((0, "ADIC-INTELLIGENT-STORAGE-MIB", "componentId")) if mibBuilder.loadTexts: componentEntry.setStatus('mandatory') componentId = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 1), AdicGlobalId()).setMaxAccess("readonly") if mibBuilder.loadTexts: componentId.setStatus('mandatory') componentType = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 2), AdicComponentType()).setMaxAccess("readonly") if mibBuilder.loadTexts: componentType.setStatus('mandatory') componentDisplayName = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 79))).setMaxAccess("readonly") if mibBuilder.loadTexts: componentDisplayName.setStatus('mandatory') componentInfo = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 4), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: componentInfo.setStatus('mandatory') componentLocation = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 79))).setMaxAccess("readonly") if mibBuilder.loadTexts: componentLocation.setStatus('mandatory') componentVendor = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 79))).setMaxAccess("readonly") if mibBuilder.loadTexts: componentVendor.setStatus('mandatory') componentSn = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 79))).setMaxAccess("readonly") if mibBuilder.loadTexts: componentSn.setStatus('mandatory') componentStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("unknown", 1), ("unused", 2), ("ok", 3), ("warning", 4), ("failed", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: componentStatus.setStatus('mandatory') componentControl = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("resetColdStart", 1), ("resetWarmStart", 2), ("offline", 3), ("online", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: componentControl.setStatus('mandatory') componentREDId = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 10), AdicREDIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: componentREDId.setStatus('mandatory') componentFirmwareVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 11), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: componentFirmwareVersion.setStatus('mandatory') componentGeoAddrAisle = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 12), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: componentGeoAddrAisle.setStatus('mandatory') componentGeoAddrFrame = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 13), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: componentGeoAddrFrame.setStatus('mandatory') componentGeoAddrRack = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 14), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: componentGeoAddrRack.setStatus('mandatory') componentGeoAddrChassis = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 15), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: componentGeoAddrChassis.setStatus('mandatory') componentGeoAddrBlade = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 16), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: componentGeoAddrBlade.setStatus('mandatory') componentIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 17), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: componentIpAddress.setStatus('mandatory') powerSupplyTable = MibTable((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 10), ) if mibBuilder.loadTexts: powerSupplyTable.setStatus('optional') powerSupplyEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 10, 1), ).setIndexNames((0, "ADIC-INTELLIGENT-STORAGE-MIB", "componentId"), (0, "ADIC-INTELLIGENT-STORAGE-MIB", "powerSupplyIndex")) if mibBuilder.loadTexts: powerSupplyEntry.setStatus('optional') powerSupplyIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 10, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: powerSupplyIndex.setStatus('optional') powerSupplyName = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 10, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: powerSupplyName.setStatus('optional') powerSupplyWattage = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 10, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: powerSupplyWattage.setStatus('optional') powerSupplyType = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 10, 1, 4), AdicVoltageType()).setMaxAccess("readonly") if mibBuilder.loadTexts: powerSupplyType.setStatus('optional') powerSupplyREDId = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 10, 1, 5), AdicREDIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: powerSupplyREDId.setStatus('optional') powerSupplyRatedVoltage = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 10, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: powerSupplyRatedVoltage.setStatus('optional') powerSupplyLocation = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 10, 1, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: powerSupplyLocation.setStatus('optional') voltageSensorTable = MibTable((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20), ) if mibBuilder.loadTexts: voltageSensorTable.setStatus('optional') voltageSensorEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20, 1), ).setIndexNames((0, "ADIC-INTELLIGENT-STORAGE-MIB", "componentId"), (0, "ADIC-INTELLIGENT-STORAGE-MIB", "powerSupplyIndex"), (0, "ADIC-INTELLIGENT-STORAGE-MIB", "voltageSensorIndex")) if mibBuilder.loadTexts: voltageSensorEntry.setStatus('optional') voltageSensorIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: voltageSensorIndex.setStatus('optional') voltageSensorName = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: voltageSensorName.setStatus('optional') voltageSensorStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20, 1, 3), AdicSensorStatus()).setMaxAccess("readonly") if mibBuilder.loadTexts: voltageSensorStatus.setStatus('optional') voltageSensorMillivolts = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: voltageSensorMillivolts.setStatus('optional') voltageSensorType = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20, 1, 5), AdicVoltageType()).setMaxAccess("readonly") if mibBuilder.loadTexts: voltageSensorType.setStatus('optional') voltageSensorNominalLo = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: voltageSensorNominalLo.setStatus('optional') voltageSensorNominalHi = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: voltageSensorNominalHi.setStatus('optional') voltageSensorWarningLo = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: voltageSensorWarningLo.setStatus('optional') voltageSensorWarningHi = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: voltageSensorWarningHi.setStatus('optional') voltageSensorLocation = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20, 1, 10), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: voltageSensorLocation.setStatus('optional') voltageSensorREDId = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20, 1, 11), AdicREDIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: voltageSensorREDId.setStatus('optional') temperatureSensorTable = MibTable((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 30), ) if mibBuilder.loadTexts: temperatureSensorTable.setStatus('optional') temperatureSensorEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 30, 1), ).setIndexNames((0, "ADIC-INTELLIGENT-STORAGE-MIB", "componentId"), (0, "ADIC-INTELLIGENT-STORAGE-MIB", "temperatureSensorIndex")) if mibBuilder.loadTexts: temperatureSensorEntry.setStatus('optional') temperatureSensorIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 30, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: temperatureSensorIndex.setStatus('optional') temperatureSensorName = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 30, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: temperatureSensorName.setStatus('optional') temperatureSensorStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 30, 1, 3), AdicSensorStatus()).setMaxAccess("readonly") if mibBuilder.loadTexts: temperatureSensorStatus.setStatus('optional') temperatureSensorDegreesCelsius = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 30, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: temperatureSensorDegreesCelsius.setStatus('optional') temperatureSensorNominalLo = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 30, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: temperatureSensorNominalLo.setStatus('optional') temperatureSensorNominalHi = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 30, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: temperatureSensorNominalHi.setStatus('optional') temperatureSensorWarningLo = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 30, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: temperatureSensorWarningLo.setStatus('optional') temperatureSensorWarningHi = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 30, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: temperatureSensorWarningHi.setStatus('optional') temperatureSensorLocation = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 30, 1, 9), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: temperatureSensorLocation.setStatus('optional') temperatureSensorREDId = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 30, 1, 10), AdicREDIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: temperatureSensorREDId.setStatus('optional') coolingFanTable = MibTable((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 40), ) if mibBuilder.loadTexts: coolingFanTable.setStatus('optional') coolingFanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 40, 1), ).setIndexNames((0, "ADIC-INTELLIGENT-STORAGE-MIB", "componentId"), (0, "ADIC-INTELLIGENT-STORAGE-MIB", "coolingFanIndex")) if mibBuilder.loadTexts: coolingFanEntry.setStatus('optional') coolingFanIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 40, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: coolingFanIndex.setStatus('optional') coolingFanName = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 40, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: coolingFanName.setStatus('optional') coolingFanStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 40, 1, 3), AdicSensorStatus()).setMaxAccess("readonly") if mibBuilder.loadTexts: coolingFanStatus.setStatus('optional') coolingFanRPM = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 40, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: coolingFanRPM.setStatus('optional') coolingFanNominalLo = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 40, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: coolingFanNominalLo.setStatus('optional') coolingFanNominalHi = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 40, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: coolingFanNominalHi.setStatus('optional') coolingFanWarningLo = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 40, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: coolingFanWarningLo.setStatus('optional') coolingFanWarningHi = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 40, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: coolingFanWarningHi.setStatus('optional') coolingFanLocation = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 40, 1, 9), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: coolingFanLocation.setStatus('optional') coolingFanREDId = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 40, 1, 10), AdicREDIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: coolingFanREDId.setStatus('optional') trapPayloadTable = MibTable((1, 3, 6, 1, 4, 1, 3764, 1, 1, 500, 10), ) if mibBuilder.loadTexts: trapPayloadTable.setStatus('mandatory') trapPayloadEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3764, 1, 1, 500, 10, 1), ).setIndexNames((0, "ADIC-INTELLIGENT-STORAGE-MIB", "trapSequenceNumber")) if mibBuilder.loadTexts: trapPayloadEntry.setStatus('mandatory') trapSequenceNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 500, 10, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trapSequenceNumber.setStatus('mandatory') trapSeverity = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 500, 10, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trapSeverity.setStatus('mandatory') trapSummaryText = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 500, 10, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: trapSummaryText.setStatus('mandatory') trapIntendedUsage = MibTableColumn((1, 3, 6, 1, 4, 1, 3764, 1, 1, 500, 10, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("public", 1), ("triggerRefresh", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: trapIntendedUsage.setStatus('mandatory') startupSequenceComplete = NotificationType((1, 3, 6, 1, 4, 1, 3764, 1, 1) + (0,500)).setObjects(("ADIC-INTELLIGENT-STORAGE-MIB", "componentId"), ("ADIC-INTELLIGENT-STORAGE-MIB", "trapSummaryText")) shutdownSequenceInitiated = NotificationType((1, 3, 6, 1, 4, 1, 3764, 1, 1) + (0,501)).setObjects(("ADIC-INTELLIGENT-STORAGE-MIB", "componentId"), ("ADIC-INTELLIGENT-STORAGE-MIB", "trapSummaryText")) componentAdded = NotificationType((1, 3, 6, 1, 4, 1, 3764, 1, 1) + (0,502)).setObjects(("ADIC-INTELLIGENT-STORAGE-MIB", "componentId"), ("ADIC-INTELLIGENT-STORAGE-MIB", "componentType")) componentRemoved = NotificationType((1, 3, 6, 1, 4, 1, 3764, 1, 1) + (0,503)).setObjects(("ADIC-INTELLIGENT-STORAGE-MIB", "componentId"), ("ADIC-INTELLIGENT-STORAGE-MIB", "componentType")) productLibraryClassChange = NotificationType((1, 3, 6, 1, 4, 1, 3764, 1, 1) + (0,504)).setObjects(("ADIC-INTELLIGENT-STORAGE-MIB", "productLibraryClass"), ("ADIC-INTELLIGENT-STORAGE-MIB", "productLibraryClass")) mibBuilder.exportSymbols("ADIC-INTELLIGENT-STORAGE-MIB", coolingFanEntry=coolingFanEntry, powerAndCooling=powerAndCooling, componentGeoAddrChassis=componentGeoAddrChassis, agentModifiers=agentModifiers, agentRefreshRate=agentRefreshRate, trapIntendedUsage=trapIntendedUsage, adic=adic, startupSequenceComplete=startupSequenceComplete, AdicSensorStatus=AdicSensorStatus, componentDisplayName=componentDisplayName, voltageSensorEntry=voltageSensorEntry, voltageSensorNominalLo=voltageSensorNominalLo, powerSupplyName=powerSupplyName, componentGeoAddrBlade=componentGeoAddrBlade, productVersion=productVersion, notification=notification, shutdownSequenceInitiated=shutdownSequenceInitiated, temperatureSensorLocation=temperatureSensorLocation, voltageSensorREDId=voltageSensorREDId, temperatureSensorREDId=temperatureSensorREDId, componentControl=componentControl, productMibVersion=productMibVersion, coolingFanLocation=coolingFanLocation, coolingFanNominalLo=coolingFanNominalLo, temperatureSensorWarningLo=temperatureSensorWarningLo, trapSequenceNumber=trapSequenceNumber, coolingFanIndex=coolingFanIndex, AdicGlobalId=AdicGlobalId, coolingFanStatus=coolingFanStatus, agentTimeStamp=agentTimeStamp, trapPayloadEntry=trapPayloadEntry, powerSupplyEntry=powerSupplyEntry, componentEntry=componentEntry, agentGetTimeOut=agentGetTimeOut, voltageSensorLocation=voltageSensorLocation, globalData=globalData, agentLastGlobalStatus=agentLastGlobalStatus, productDisplayVersion=productDisplayVersion, AdicOnlineStatus=AdicOnlineStatus, AdicMibVersion=AdicMibVersion, productSnmpAgentVersion=productSnmpAgentVersion, Boolean=Boolean, voltageSensorType=voltageSensorType, powerSupplyIndex=powerSupplyIndex, AdicComponentType=AdicComponentType, coolingFanWarningLo=coolingFanWarningLo, temperatureSensorEntry=temperatureSensorEntry, coolingFanTable=coolingFanTable, componentStatus=componentStatus, trapSummaryText=trapSummaryText, componentRemoved=componentRemoved, componentGeoAddrAisle=componentGeoAddrAisle, productDescription=productDescription, coolingFanWarningHi=coolingFanWarningHi, productDisplayName=productDisplayName, software=software, componentGeoAddrRack=componentGeoAddrRack, AdicREDIdentifier=AdicREDIdentifier, AdicEnable=AdicEnable, trapSeverity=trapSeverity, productVendor=productVendor, temperatureSensorDegreesCelsius=temperatureSensorDegreesCelsius, componentInfo=componentInfo, AdicDateAndTime=AdicDateAndTime, storage=storage, powerSupplyRatedVoltage=powerSupplyRatedVoltage, voltageSensorName=voltageSensorName, RowStatus=RowStatus, agentGlobalStatus=agentGlobalStatus, powerSupplyType=powerSupplyType, productSerialNumber=productSerialNumber, productLibraryClass=productLibraryClass, voltageSensorIndex=voltageSensorIndex, temperatureSensorIndex=temperatureSensorIndex, voltageSensorStatus=voltageSensorStatus, coolingFanName=coolingFanName, componentSn=componentSn, temperatureSensorNominalHi=temperatureSensorNominalHi, componentLocation=componentLocation, AdicDriveStatus=AdicDriveStatus, trapPayloadTable=trapPayloadTable, AdicVoltageType=AdicVoltageType, productAgentInfo=productAgentInfo, sml=sml, voltageSensorWarningLo=voltageSensorWarningLo, hardware=hardware, coolingFanRPM=coolingFanRPM, voltageSensorTable=voltageSensorTable, componentGeoAddrFrame=componentGeoAddrFrame, coolingFanNominalHi=coolingFanNominalHi, AdicInterfaceType=AdicInterfaceType, productName=productName, voltageSensorNominalHi=voltageSensorNominalHi, network=network, temperatureSensorStatus=temperatureSensorStatus, coolingFanREDId=coolingFanREDId, powerSupplyREDId=powerSupplyREDId, temperatureSensorName=temperatureSensorName, temperatureSensorTable=temperatureSensorTable, componentVendor=componentVendor, componentAdded=componentAdded, voltageSensorWarningHi=voltageSensorWarningHi, productLibraryClassChange=productLibraryClassChange, temperatureSensorNominalLo=temperatureSensorNominalLo, componentTable=componentTable, powerSupplyLocation=powerSupplyLocation, componentId=componentId, AdicDoorStatus=AdicDoorStatus, AdicTrapSeverity=AdicTrapSeverity, componentType=componentType, componentFirmwareVersion=componentFirmwareVersion, temperatureSensorWarningHi=temperatureSensorWarningHi, components=components, powerSupplyWattage=powerSupplyWattage, powerSupplyTable=powerSupplyTable, AdicAgentStatus=AdicAgentStatus, voltageSensorMillivolts=voltageSensorMillivolts, componentIpAddress=componentIpAddress, intelligent=intelligent, componentREDId=componentREDId)
(integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, value_range_constraint, value_size_constraint, single_value_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'ValueRangeConstraint', 'ValueSizeConstraint', 'SingleValueConstraint', 'ConstraintsIntersection') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (integer32, counter32, module_identity, mib_scalar, mib_table, mib_table_row, mib_table_column, time_ticks, mib_identifier, notification_type, unsigned32, ip_address, notification_type, enterprises, iso, object_identity, counter64, gauge32, bits) = mibBuilder.importSymbols('SNMPv2-SMI', 'Integer32', 'Counter32', 'ModuleIdentity', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'TimeTicks', 'MibIdentifier', 'NotificationType', 'Unsigned32', 'IpAddress', 'NotificationType', 'enterprises', 'iso', 'ObjectIdentity', 'Counter64', 'Gauge32', 'Bits') (display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention') adic = mib_identifier((1, 3, 6, 1, 4, 1, 3764)) storage = mib_identifier((1, 3, 6, 1, 4, 1, 3764, 1)) intelligent = mib_identifier((1, 3, 6, 1, 4, 1, 3764, 1, 1)) product_agent_info = mib_identifier((1, 3, 6, 1, 4, 1, 3764, 1, 1, 10)) global_data = mib_identifier((1, 3, 6, 1, 4, 1, 3764, 1, 1, 20)) components = mib_identifier((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30)) software = mib_identifier((1, 3, 6, 1, 4, 1, 3764, 1, 1, 100)) hardware = mib_identifier((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200)) power_and_cooling = mib_identifier((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200)) sml = mib_identifier((1, 3, 6, 1, 4, 1, 3764, 1, 1, 300)) network = mib_identifier((1, 3, 6, 1, 4, 1, 3764, 1, 1, 400)) notification = mib_identifier((1, 3, 6, 1, 4, 1, 3764, 1, 1, 500)) class Boolean(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2)) named_values = named_values(('true', 1), ('false', 2)) class Adicmibversion(DisplayString): pass class Adicredidentifier(Counter32): pass class Adicenable(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2)) named_values = named_values(('enabled', 1), ('disabled', 2)) class Adicagentstatus(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6)) named_values = named_values(('other', 1), ('unknown', 2), ('ok', 3), ('non-critical', 4), ('critical', 5), ('non-recoverable', 6)) class Adiconlinestatus(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3)) named_values = named_values(('online', 1), ('offline', 2), ('shutdown', 3)) class Adicglobalid(OctetString): subtype_spec = OctetString.subtypeSpec + value_size_constraint(8, 8) fixed_length = 8 class Adiccomponenttype(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8)) named_values = named_values(('mcb', 1), ('cmb', 2), ('ioBlade', 3), ('rcu', 4), ('networkChasis', 5), ('controlModule', 6), ('expansionModule', 7), ('powerSupply', 8)) class Adicinterfacetype(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2)) named_values = named_values(('scsi', 1), ('fibreChannel', 2)) class Adicsensorstatus(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7)) named_values = named_values(('nominal', 1), ('warningLow', 2), ('warningHigh', 3), ('alarmLow', 4), ('alarmHigh', 5), ('notInstalled', 6), ('noData', 7)) class Adicvoltagetype(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2)) named_values = named_values(('dc', 1), ('ac', 2)) class Adicdateandtime(OctetString): subtype_spec = OctetString.subtypeSpec + constraints_union(value_size_constraint(8, 8), value_size_constraint(11, 11)) class Adictrapseverity(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4, 5)) named_values = named_values(('emergency', 1), ('alarm', 2), ('warning', 3), ('notice', 4), ('informational', 5)) class Adicdoorstatus(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7)) named_values = named_values(('open', 1), ('closed', 2), ('closedAndLocked', 3), ('closedAndUnlocked', 4), ('contollerFailed', 5), ('notInstalled', 6), ('noData', 7)) class Adicdrivestatus(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7)) named_values = named_values(('idle', 1), ('loading', 2), ('ejecting', 3), ('inserted', 4), ('removed', 5), ('notInstalled', 6), ('noData', 7)) class Rowstatus(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6)) named_values = named_values(('active', 1), ('notInService', 2), ('notReady', 3), ('createAndGo', 4), ('createAndWait', 5), ('destroy', 6)) product_mib_version = mib_scalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 10, 1), adic_mib_version()).setMaxAccess('readonly') if mibBuilder.loadTexts: productMibVersion.setStatus('mandatory') product_snmp_agent_version = mib_scalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 10, 2), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: productSnmpAgentVersion.setStatus('mandatory') product_name = mib_scalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 10, 3), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: productName.setStatus('mandatory') product_display_name = mib_scalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 10, 4), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: productDisplayName.setStatus('mandatory') product_description = mib_scalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 10, 5), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: productDescription.setStatus('mandatory') product_vendor = mib_scalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 10, 6), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: productVendor.setStatus('mandatory') product_version = mib_scalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 10, 7), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: productVersion.setStatus('mandatory') product_display_version = mib_scalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 10, 8), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: productDisplayVersion.setStatus('mandatory') product_library_class = mib_scalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 10, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 10))).clone(namedValues=named_values(('basic', 1), ('intelligent', 2), ('virtual', 10)))).setMaxAccess('readonly') if mibBuilder.loadTexts: productLibraryClass.setStatus('mandatory') product_serial_number = mib_scalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 10, 10), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: productSerialNumber.setStatus('mandatory') agent_global_status = mib_scalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 20, 1), adic_agent_status()).setMaxAccess('readonly') if mibBuilder.loadTexts: agentGlobalStatus.setStatus('mandatory') agent_last_global_status = mib_scalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 20, 2), adic_agent_status()).setMaxAccess('readonly') if mibBuilder.loadTexts: agentLastGlobalStatus.setStatus('mandatory') agent_time_stamp = mib_scalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 20, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: agentTimeStamp.setStatus('mandatory') agent_get_time_out = mib_scalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 20, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: agentGetTimeOut.setStatus('mandatory') agent_modifiers = mib_scalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 20, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: agentModifiers.setStatus('mandatory') agent_refresh_rate = mib_scalar((1, 3, 6, 1, 4, 1, 3764, 1, 1, 20, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: agentRefreshRate.setStatus('mandatory') component_table = mib_table((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10)) if mibBuilder.loadTexts: componentTable.setStatus('mandatory') component_entry = mib_table_row((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1)).setIndexNames((0, 'ADIC-INTELLIGENT-STORAGE-MIB', 'componentId')) if mibBuilder.loadTexts: componentEntry.setStatus('mandatory') component_id = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 1), adic_global_id()).setMaxAccess('readonly') if mibBuilder.loadTexts: componentId.setStatus('mandatory') component_type = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 2), adic_component_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: componentType.setStatus('mandatory') component_display_name = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 3), display_string().subtype(subtypeSpec=value_size_constraint(0, 79))).setMaxAccess('readonly') if mibBuilder.loadTexts: componentDisplayName.setStatus('mandatory') component_info = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 4), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: componentInfo.setStatus('mandatory') component_location = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 5), display_string().subtype(subtypeSpec=value_size_constraint(0, 79))).setMaxAccess('readonly') if mibBuilder.loadTexts: componentLocation.setStatus('mandatory') component_vendor = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 6), display_string().subtype(subtypeSpec=value_size_constraint(0, 79))).setMaxAccess('readonly') if mibBuilder.loadTexts: componentVendor.setStatus('mandatory') component_sn = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 7), display_string().subtype(subtypeSpec=value_size_constraint(0, 79))).setMaxAccess('readonly') if mibBuilder.loadTexts: componentSn.setStatus('mandatory') component_status = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('unknown', 1), ('unused', 2), ('ok', 3), ('warning', 4), ('failed', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: componentStatus.setStatus('mandatory') component_control = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('resetColdStart', 1), ('resetWarmStart', 2), ('offline', 3), ('online', 4)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: componentControl.setStatus('mandatory') component_red_id = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 10), adic_red_identifier()).setMaxAccess('readonly') if mibBuilder.loadTexts: componentREDId.setStatus('mandatory') component_firmware_version = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 11), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: componentFirmwareVersion.setStatus('mandatory') component_geo_addr_aisle = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 12), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: componentGeoAddrAisle.setStatus('mandatory') component_geo_addr_frame = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 13), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: componentGeoAddrFrame.setStatus('mandatory') component_geo_addr_rack = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 14), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: componentGeoAddrRack.setStatus('mandatory') component_geo_addr_chassis = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 15), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: componentGeoAddrChassis.setStatus('mandatory') component_geo_addr_blade = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 16), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: componentGeoAddrBlade.setStatus('mandatory') component_ip_address = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 30, 10, 1, 17), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: componentIpAddress.setStatus('mandatory') power_supply_table = mib_table((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 10)) if mibBuilder.loadTexts: powerSupplyTable.setStatus('optional') power_supply_entry = mib_table_row((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 10, 1)).setIndexNames((0, 'ADIC-INTELLIGENT-STORAGE-MIB', 'componentId'), (0, 'ADIC-INTELLIGENT-STORAGE-MIB', 'powerSupplyIndex')) if mibBuilder.loadTexts: powerSupplyEntry.setStatus('optional') power_supply_index = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 10, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: powerSupplyIndex.setStatus('optional') power_supply_name = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 10, 1, 2), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: powerSupplyName.setStatus('optional') power_supply_wattage = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 10, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: powerSupplyWattage.setStatus('optional') power_supply_type = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 10, 1, 4), adic_voltage_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: powerSupplyType.setStatus('optional') power_supply_red_id = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 10, 1, 5), adic_red_identifier()).setMaxAccess('readonly') if mibBuilder.loadTexts: powerSupplyREDId.setStatus('optional') power_supply_rated_voltage = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 10, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: powerSupplyRatedVoltage.setStatus('optional') power_supply_location = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 10, 1, 7), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: powerSupplyLocation.setStatus('optional') voltage_sensor_table = mib_table((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20)) if mibBuilder.loadTexts: voltageSensorTable.setStatus('optional') voltage_sensor_entry = mib_table_row((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20, 1)).setIndexNames((0, 'ADIC-INTELLIGENT-STORAGE-MIB', 'componentId'), (0, 'ADIC-INTELLIGENT-STORAGE-MIB', 'powerSupplyIndex'), (0, 'ADIC-INTELLIGENT-STORAGE-MIB', 'voltageSensorIndex')) if mibBuilder.loadTexts: voltageSensorEntry.setStatus('optional') voltage_sensor_index = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: voltageSensorIndex.setStatus('optional') voltage_sensor_name = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20, 1, 2), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: voltageSensorName.setStatus('optional') voltage_sensor_status = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20, 1, 3), adic_sensor_status()).setMaxAccess('readonly') if mibBuilder.loadTexts: voltageSensorStatus.setStatus('optional') voltage_sensor_millivolts = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: voltageSensorMillivolts.setStatus('optional') voltage_sensor_type = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20, 1, 5), adic_voltage_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: voltageSensorType.setStatus('optional') voltage_sensor_nominal_lo = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: voltageSensorNominalLo.setStatus('optional') voltage_sensor_nominal_hi = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20, 1, 7), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: voltageSensorNominalHi.setStatus('optional') voltage_sensor_warning_lo = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20, 1, 8), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: voltageSensorWarningLo.setStatus('optional') voltage_sensor_warning_hi = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20, 1, 9), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: voltageSensorWarningHi.setStatus('optional') voltage_sensor_location = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20, 1, 10), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: voltageSensorLocation.setStatus('optional') voltage_sensor_red_id = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 20, 1, 11), adic_red_identifier()).setMaxAccess('readonly') if mibBuilder.loadTexts: voltageSensorREDId.setStatus('optional') temperature_sensor_table = mib_table((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 30)) if mibBuilder.loadTexts: temperatureSensorTable.setStatus('optional') temperature_sensor_entry = mib_table_row((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 30, 1)).setIndexNames((0, 'ADIC-INTELLIGENT-STORAGE-MIB', 'componentId'), (0, 'ADIC-INTELLIGENT-STORAGE-MIB', 'temperatureSensorIndex')) if mibBuilder.loadTexts: temperatureSensorEntry.setStatus('optional') temperature_sensor_index = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 30, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: temperatureSensorIndex.setStatus('optional') temperature_sensor_name = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 30, 1, 2), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: temperatureSensorName.setStatus('optional') temperature_sensor_status = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 30, 1, 3), adic_sensor_status()).setMaxAccess('readonly') if mibBuilder.loadTexts: temperatureSensorStatus.setStatus('optional') temperature_sensor_degrees_celsius = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 30, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: temperatureSensorDegreesCelsius.setStatus('optional') temperature_sensor_nominal_lo = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 30, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: temperatureSensorNominalLo.setStatus('optional') temperature_sensor_nominal_hi = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 30, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: temperatureSensorNominalHi.setStatus('optional') temperature_sensor_warning_lo = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 30, 1, 7), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: temperatureSensorWarningLo.setStatus('optional') temperature_sensor_warning_hi = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 30, 1, 8), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: temperatureSensorWarningHi.setStatus('optional') temperature_sensor_location = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 30, 1, 9), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: temperatureSensorLocation.setStatus('optional') temperature_sensor_red_id = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 30, 1, 10), adic_red_identifier()).setMaxAccess('readonly') if mibBuilder.loadTexts: temperatureSensorREDId.setStatus('optional') cooling_fan_table = mib_table((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 40)) if mibBuilder.loadTexts: coolingFanTable.setStatus('optional') cooling_fan_entry = mib_table_row((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 40, 1)).setIndexNames((0, 'ADIC-INTELLIGENT-STORAGE-MIB', 'componentId'), (0, 'ADIC-INTELLIGENT-STORAGE-MIB', 'coolingFanIndex')) if mibBuilder.loadTexts: coolingFanEntry.setStatus('optional') cooling_fan_index = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 40, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: coolingFanIndex.setStatus('optional') cooling_fan_name = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 40, 1, 2), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: coolingFanName.setStatus('optional') cooling_fan_status = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 40, 1, 3), adic_sensor_status()).setMaxAccess('readonly') if mibBuilder.loadTexts: coolingFanStatus.setStatus('optional') cooling_fan_rpm = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 40, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: coolingFanRPM.setStatus('optional') cooling_fan_nominal_lo = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 40, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: coolingFanNominalLo.setStatus('optional') cooling_fan_nominal_hi = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 40, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: coolingFanNominalHi.setStatus('optional') cooling_fan_warning_lo = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 40, 1, 7), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: coolingFanWarningLo.setStatus('optional') cooling_fan_warning_hi = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 40, 1, 8), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: coolingFanWarningHi.setStatus('optional') cooling_fan_location = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 40, 1, 9), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: coolingFanLocation.setStatus('optional') cooling_fan_red_id = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 200, 200, 40, 1, 10), adic_red_identifier()).setMaxAccess('readonly') if mibBuilder.loadTexts: coolingFanREDId.setStatus('optional') trap_payload_table = mib_table((1, 3, 6, 1, 4, 1, 3764, 1, 1, 500, 10)) if mibBuilder.loadTexts: trapPayloadTable.setStatus('mandatory') trap_payload_entry = mib_table_row((1, 3, 6, 1, 4, 1, 3764, 1, 1, 500, 10, 1)).setIndexNames((0, 'ADIC-INTELLIGENT-STORAGE-MIB', 'trapSequenceNumber')) if mibBuilder.loadTexts: trapPayloadEntry.setStatus('mandatory') trap_sequence_number = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 500, 10, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: trapSequenceNumber.setStatus('mandatory') trap_severity = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 500, 10, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: trapSeverity.setStatus('mandatory') trap_summary_text = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 500, 10, 1, 3), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: trapSummaryText.setStatus('mandatory') trap_intended_usage = mib_table_column((1, 3, 6, 1, 4, 1, 3764, 1, 1, 500, 10, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('public', 1), ('triggerRefresh', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: trapIntendedUsage.setStatus('mandatory') startup_sequence_complete = notification_type((1, 3, 6, 1, 4, 1, 3764, 1, 1) + (0, 500)).setObjects(('ADIC-INTELLIGENT-STORAGE-MIB', 'componentId'), ('ADIC-INTELLIGENT-STORAGE-MIB', 'trapSummaryText')) shutdown_sequence_initiated = notification_type((1, 3, 6, 1, 4, 1, 3764, 1, 1) + (0, 501)).setObjects(('ADIC-INTELLIGENT-STORAGE-MIB', 'componentId'), ('ADIC-INTELLIGENT-STORAGE-MIB', 'trapSummaryText')) component_added = notification_type((1, 3, 6, 1, 4, 1, 3764, 1, 1) + (0, 502)).setObjects(('ADIC-INTELLIGENT-STORAGE-MIB', 'componentId'), ('ADIC-INTELLIGENT-STORAGE-MIB', 'componentType')) component_removed = notification_type((1, 3, 6, 1, 4, 1, 3764, 1, 1) + (0, 503)).setObjects(('ADIC-INTELLIGENT-STORAGE-MIB', 'componentId'), ('ADIC-INTELLIGENT-STORAGE-MIB', 'componentType')) product_library_class_change = notification_type((1, 3, 6, 1, 4, 1, 3764, 1, 1) + (0, 504)).setObjects(('ADIC-INTELLIGENT-STORAGE-MIB', 'productLibraryClass'), ('ADIC-INTELLIGENT-STORAGE-MIB', 'productLibraryClass')) mibBuilder.exportSymbols('ADIC-INTELLIGENT-STORAGE-MIB', coolingFanEntry=coolingFanEntry, powerAndCooling=powerAndCooling, componentGeoAddrChassis=componentGeoAddrChassis, agentModifiers=agentModifiers, agentRefreshRate=agentRefreshRate, trapIntendedUsage=trapIntendedUsage, adic=adic, startupSequenceComplete=startupSequenceComplete, AdicSensorStatus=AdicSensorStatus, componentDisplayName=componentDisplayName, voltageSensorEntry=voltageSensorEntry, voltageSensorNominalLo=voltageSensorNominalLo, powerSupplyName=powerSupplyName, componentGeoAddrBlade=componentGeoAddrBlade, productVersion=productVersion, notification=notification, shutdownSequenceInitiated=shutdownSequenceInitiated, temperatureSensorLocation=temperatureSensorLocation, voltageSensorREDId=voltageSensorREDId, temperatureSensorREDId=temperatureSensorREDId, componentControl=componentControl, productMibVersion=productMibVersion, coolingFanLocation=coolingFanLocation, coolingFanNominalLo=coolingFanNominalLo, temperatureSensorWarningLo=temperatureSensorWarningLo, trapSequenceNumber=trapSequenceNumber, coolingFanIndex=coolingFanIndex, AdicGlobalId=AdicGlobalId, coolingFanStatus=coolingFanStatus, agentTimeStamp=agentTimeStamp, trapPayloadEntry=trapPayloadEntry, powerSupplyEntry=powerSupplyEntry, componentEntry=componentEntry, agentGetTimeOut=agentGetTimeOut, voltageSensorLocation=voltageSensorLocation, globalData=globalData, agentLastGlobalStatus=agentLastGlobalStatus, productDisplayVersion=productDisplayVersion, AdicOnlineStatus=AdicOnlineStatus, AdicMibVersion=AdicMibVersion, productSnmpAgentVersion=productSnmpAgentVersion, Boolean=Boolean, voltageSensorType=voltageSensorType, powerSupplyIndex=powerSupplyIndex, AdicComponentType=AdicComponentType, coolingFanWarningLo=coolingFanWarningLo, temperatureSensorEntry=temperatureSensorEntry, coolingFanTable=coolingFanTable, componentStatus=componentStatus, trapSummaryText=trapSummaryText, componentRemoved=componentRemoved, componentGeoAddrAisle=componentGeoAddrAisle, productDescription=productDescription, coolingFanWarningHi=coolingFanWarningHi, productDisplayName=productDisplayName, software=software, componentGeoAddrRack=componentGeoAddrRack, AdicREDIdentifier=AdicREDIdentifier, AdicEnable=AdicEnable, trapSeverity=trapSeverity, productVendor=productVendor, temperatureSensorDegreesCelsius=temperatureSensorDegreesCelsius, componentInfo=componentInfo, AdicDateAndTime=AdicDateAndTime, storage=storage, powerSupplyRatedVoltage=powerSupplyRatedVoltage, voltageSensorName=voltageSensorName, RowStatus=RowStatus, agentGlobalStatus=agentGlobalStatus, powerSupplyType=powerSupplyType, productSerialNumber=productSerialNumber, productLibraryClass=productLibraryClass, voltageSensorIndex=voltageSensorIndex, temperatureSensorIndex=temperatureSensorIndex, voltageSensorStatus=voltageSensorStatus, coolingFanName=coolingFanName, componentSn=componentSn, temperatureSensorNominalHi=temperatureSensorNominalHi, componentLocation=componentLocation, AdicDriveStatus=AdicDriveStatus, trapPayloadTable=trapPayloadTable, AdicVoltageType=AdicVoltageType, productAgentInfo=productAgentInfo, sml=sml, voltageSensorWarningLo=voltageSensorWarningLo, hardware=hardware, coolingFanRPM=coolingFanRPM, voltageSensorTable=voltageSensorTable, componentGeoAddrFrame=componentGeoAddrFrame, coolingFanNominalHi=coolingFanNominalHi, AdicInterfaceType=AdicInterfaceType, productName=productName, voltageSensorNominalHi=voltageSensorNominalHi, network=network, temperatureSensorStatus=temperatureSensorStatus, coolingFanREDId=coolingFanREDId, powerSupplyREDId=powerSupplyREDId, temperatureSensorName=temperatureSensorName, temperatureSensorTable=temperatureSensorTable, componentVendor=componentVendor, componentAdded=componentAdded, voltageSensorWarningHi=voltageSensorWarningHi, productLibraryClassChange=productLibraryClassChange, temperatureSensorNominalLo=temperatureSensorNominalLo, componentTable=componentTable, powerSupplyLocation=powerSupplyLocation, componentId=componentId, AdicDoorStatus=AdicDoorStatus, AdicTrapSeverity=AdicTrapSeverity, componentType=componentType, componentFirmwareVersion=componentFirmwareVersion, temperatureSensorWarningHi=temperatureSensorWarningHi, components=components, powerSupplyWattage=powerSupplyWattage, powerSupplyTable=powerSupplyTable, AdicAgentStatus=AdicAgentStatus, voltageSensorMillivolts=voltageSensorMillivolts, componentIpAddress=componentIpAddress, intelligent=intelligent, componentREDId=componentREDId)
def get_cleaned_url(url, api_host, api_version): if any(prefix in url for prefix in ["http://", "https://"]): return url cleaned_url = api_host.rstrip("/") if url.startswith("/{}".format(api_version)): cleaned_url += url else: cleaned_url += "/{}{}".format(api_version, url) return cleaned_url
def get_cleaned_url(url, api_host, api_version): if any((prefix in url for prefix in ['http://', 'https://'])): return url cleaned_url = api_host.rstrip('/') if url.startswith('/{}'.format(api_version)): cleaned_url += url else: cleaned_url += '/{}{}'.format(api_version, url) return cleaned_url
def generate_full_name(firstname, lastname): space = ' ' fullname = firstname + space + lastname return fullname
def generate_full_name(firstname, lastname): space = ' ' fullname = firstname + space + lastname return fullname
balance = 1000.00 name = "Chuck Black" account_no = "01123581321" print("name:", name, " account:", account_no, " original balance:", "$" + str(balance)) charge01 = 5.99 charge02 = 12.45 charge03 = 28.05 balance = balance - charge01 print("name:", name, " account:", account_no, " charge:", charge01, " new balance:", "$" + str(balance)) balance = balance - charge02 print("name:", name, " account:", account_no, " charge:", charge02, " new balance:", "$" + str(balance)) balance = balance - charge03 print("name:", name, " account:", account_no, " charge:", charge03, " new balance:", "$" + str(balance))
balance = 1000.0 name = 'Chuck Black' account_no = '01123581321' print('name:', name, ' account:', account_no, ' original balance:', '$' + str(balance)) charge01 = 5.99 charge02 = 12.45 charge03 = 28.05 balance = balance - charge01 print('name:', name, ' account:', account_no, ' charge:', charge01, ' new balance:', '$' + str(balance)) balance = balance - charge02 print('name:', name, ' account:', account_no, ' charge:', charge02, ' new balance:', '$' + str(balance)) balance = balance - charge03 print('name:', name, ' account:', account_no, ' charge:', charge03, ' new balance:', '$' + str(balance))
class Article: url = '' title = '' summary = '' date = '' keywords = '' class Author: url = '' name = '' major = '' sum_publish = '' sum_download = '' class Organization: url = '' name = '' website = '' used_name = '' region = '' class Source: url = '' name = '' basic_info = '' publish_info = '' evaluation = ''
class Article: url = '' title = '' summary = '' date = '' keywords = '' class Author: url = '' name = '' major = '' sum_publish = '' sum_download = '' class Organization: url = '' name = '' website = '' used_name = '' region = '' class Source: url = '' name = '' basic_info = '' publish_info = '' evaluation = ''
# ['alexnet', 'deeplabv3_resnet101', 'deeplabv3_resnet50', 'densenet121', 'densenet161', 'densenet169', 'densenet201', # 'fcn_resnet101', 'fcn_resnet50', 'googlenet', 'inception_v3', 'mnasnet0_5', 'mnasnet0_75', 'mnasnet1_0', 'mnasnet1_3', # 'mobilenet_v2', 'resnet101', 'resnet152', 'resnet18', 'resnet34', 'resnet50', 'resnext101_32x8d', 'resnext50_32x4d', # 'shufflenet_v2_x0_5', 'shufflenet_v2_x1_0', 'squeezenet1_0', 'squeezenet1_1', 'vgg11', 'vgg11_bn', 'vgg13', 'vgg13_bn', # 'vgg16', 'vgg16_bn', 'vgg19', 'vgg19_bn', 'wide_resnet101_2', 'wide_resnet50_2'] # # model settings model_config = dict( model='resnext101_32x8d', num_classes=5, pretrained=True ) # split data settings data_name = 'cassava' data_root = "data/cassava/" # img_save_dir = data_root + "/imgs/" img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) dataset = dict( raw_train_path=data_root + 'train.csv', raw_split=[('train', 0.8), ('val', 1.0)], balance=False, # raw_test_path=data_root + '/annotations/instance_train_alcohol.csv', train=dict( name='train', ann_file=data_root + '/annotations/cls_train.csv', img_prefix=data_root + '/train_images/', img_scale=(224, 224), keep_ratio=False, img_norm_cfg=img_norm_cfg, ), val=dict( name='val', ann_file=data_root + '/annotations/cls_val.csv', img_prefix=data_root + '/train_images/', img_scale=(224, 224), keep_ratio=False, img_norm_cfg=img_norm_cfg, ), test=dict( name='test', ann_file=data_root + '/annotations/cls_test.csv', img_prefix=data_root + '/test_images/', img_scale=(224, 224), keep_ratio=False, img_norm_cfg=img_norm_cfg, ), ) # log settings log = dict( out_file='train_log_out.txt', data_file='train_log_data.json' ) # train process settings train_mode = ['train'] val_mode = ['val'] total_epochs = 12 * 1 work_dir = './work_dirs/' + data_name + '/' + model_config['model'] + '/models' resume_from = work_dir + '/latest.pth' load_from = '/home/lifeng/.cache/torch/hub/checkpoints/resnext101_32x8d-8ba56ff5.pth' # load_from = None mix = dict( type='none', alpha=2.0, ) optimizer = dict( type='SGD', # type='Adam', Adam=dict(lr=0.0025, betas=(0.9, 0.999), eps=1e-8, weight_decay=0, amsgrad=False), SGD=dict(lr=0.0025, momentum=0, dampening=0, weight_decay=0, nesterov=False) ) lr_scheduler = dict( type='CosineAnnealingLR', CosineAnnealingLR=dict(T_max=total_epochs), ) loss = dict( type='CrossEntropyLoss', CrossEntropyLoss=dict(), FocalLoss=dict(), InverseLoss=dict(alpha=1, beta=0.01), ) freq_cfg = dict( checkpoint_save=1, log_print=20, ) gpus = '0' data_loader = dict( batch_size=4, shuffle=True, ) val_data_loader = dict( batch_size=8, shuffle=False, )
model_config = dict(model='resnext101_32x8d', num_classes=5, pretrained=True) data_name = 'cassava' data_root = 'data/cassava/' img_norm_cfg = dict(mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) dataset = dict(raw_train_path=data_root + 'train.csv', raw_split=[('train', 0.8), ('val', 1.0)], balance=False, train=dict(name='train', ann_file=data_root + '/annotations/cls_train.csv', img_prefix=data_root + '/train_images/', img_scale=(224, 224), keep_ratio=False, img_norm_cfg=img_norm_cfg), val=dict(name='val', ann_file=data_root + '/annotations/cls_val.csv', img_prefix=data_root + '/train_images/', img_scale=(224, 224), keep_ratio=False, img_norm_cfg=img_norm_cfg), test=dict(name='test', ann_file=data_root + '/annotations/cls_test.csv', img_prefix=data_root + '/test_images/', img_scale=(224, 224), keep_ratio=False, img_norm_cfg=img_norm_cfg)) log = dict(out_file='train_log_out.txt', data_file='train_log_data.json') train_mode = ['train'] val_mode = ['val'] total_epochs = 12 * 1 work_dir = './work_dirs/' + data_name + '/' + model_config['model'] + '/models' resume_from = work_dir + '/latest.pth' load_from = '/home/lifeng/.cache/torch/hub/checkpoints/resnext101_32x8d-8ba56ff5.pth' mix = dict(type='none', alpha=2.0) optimizer = dict(type='SGD', Adam=dict(lr=0.0025, betas=(0.9, 0.999), eps=1e-08, weight_decay=0, amsgrad=False), SGD=dict(lr=0.0025, momentum=0, dampening=0, weight_decay=0, nesterov=False)) lr_scheduler = dict(type='CosineAnnealingLR', CosineAnnealingLR=dict(T_max=total_epochs)) loss = dict(type='CrossEntropyLoss', CrossEntropyLoss=dict(), FocalLoss=dict(), InverseLoss=dict(alpha=1, beta=0.01)) freq_cfg = dict(checkpoint_save=1, log_print=20) gpus = '0' data_loader = dict(batch_size=4, shuffle=True) val_data_loader = dict(batch_size=8, shuffle=False)
# # PySNMP MIB module SYMMCOMMONNETWORK (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/neermitt/Dev/kusanagi/mibs.snmplabs.com/asn1/SYMMCOMMONNETWORK # Produced by pysmi-0.3.4 at Tue Jul 30 11:34:11 2019 # On host NEERMITT-M-J0NV platform Darwin version 18.6.0 by user neermitt # Using Python version 3.7.4 (default, Jul 9 2019, 18:13:23) # OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, ValueRangeConstraint, ConstraintsUnion, SingleValueConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsUnion", "SingleValueConstraint", "ConstraintsIntersection") entPhysicalIndex, = mibBuilder.importSymbols("ENTITY-MIB", "entPhysicalIndex") ifNumber, ifIndex = mibBuilder.importSymbols("IF-MIB", "ifNumber", "ifIndex") InetAddressIPv6z, InetAddressPrefixLength, InetAddressIPv6, InetAddressIPv4, InetAddressType = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddressIPv6z", "InetAddressPrefixLength", "InetAddressIPv6", "InetAddressIPv4", "InetAddressType") ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup") Unsigned32, Gauge32, Counter32, MibScalar, MibTable, MibTableRow, MibTableColumn, NotificationType, Bits, TimeTicks, Counter64, Integer32, MibIdentifier, ObjectIdentity, ModuleIdentity, iso, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "Unsigned32", "Gauge32", "Counter32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "NotificationType", "Bits", "TimeTicks", "Counter64", "Integer32", "MibIdentifier", "ObjectIdentity", "ModuleIdentity", "iso", "IpAddress") TextualConvention, RowStatus, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "RowStatus", "DisplayString") EnableValue, symmNetwork = mibBuilder.importSymbols("SYMM-COMMON-SMI", "EnableValue", "symmNetwork") symmCommonNetwork = ModuleIdentity((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1)) symmCommonNetwork.setRevisions(('2018-04-10 20:53',)) if mibBuilder.loadTexts: symmCommonNetwork.setLastUpdated('201806280521Z') if mibBuilder.loadTexts: symmCommonNetwork.setOrganization('Symmetricom') class AutoSpeedValue(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4)) namedValues = NamedValues(("eth100m", 1), ("eth1000m", 2), ("all", 3), ("unknown", 4)) class IpAddressOriginTC(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 4, 5, 6)) namedValues = NamedValues(("other", 1), ("manual", 2), ("dhcp", 4), ("linklayer", 5), ("random", 6)) class IPPortStateValue(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("enable", 1), ("disable", 2), ("restart", 3)) class FirewallOnOff(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("allow", 1), ("block", 2)) class ETHAUTOSPEEDTYPE(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4)) namedValues = NamedValues(("eth100m", 1), ("eth1000m", 2), ("all", 3), ("unknown", 4)) class ETHLINKSTATUS(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("ethUp", 1), ("ethDown", 2)) class TPMODULEID(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)) namedValues = NamedValues(("imc", 1), ("ioc1", 2), ("ioc2", 3), ("exp0", 6), ("exp1", 7), ("exp2", 8), ("exp3", 9), ("exp4", 10), ("exp5", 11), ("exp6", 12), ("exp7", 13), ("exp8", 14), ("exp9", 15)) class IPV6SCOPE(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 5, 14)) namedValues = NamedValues(("interface-local", 1), ("link-local", 2), ("site-local", 5), ("global", 14)) class DateAndTime(TextualConvention, OctetString): status = 'current' displayHint = '2d-1d-1d,1d:1d:1d.1d,1a1d:1d' subtypeSpec = OctetString.subtypeSpec + ConstraintsUnion(ValueSizeConstraint(8, 8), ValueSizeConstraint(11, 11), ) class TLatAndLon(TextualConvention, OctetString): status = 'current' displayHint = '1a1d:1d:1d.1d' subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(5, 5) fixedLength = 5 class TAntHeight(TextualConvention, OctetString): status = 'current' displayHint = '1a2d.1d' subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(4, 4) fixedLength = 4 class TLocalTimeOffset(TextualConvention, OctetString): status = 'current' displayHint = '1a1d:1d' subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(3, 3) fixedLength = 3 class TSsm(TextualConvention, Integer32): status = 'current' displayHint = 'x' subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 255) networkEthStatus = MibIdentifier((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 1)) networkEthLinkTable = MibTable((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 1, 1), ) if mibBuilder.loadTexts: networkEthLinkTable.setStatus('current') networkEthLinkEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "SYMMCOMMONNETWORK", "networkEthLinkIndex")) if mibBuilder.loadTexts: networkEthLinkEntry.setStatus('current') networkEthLinkIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1000))) if mibBuilder.loadTexts: networkEthLinkIndex.setStatus('current') networkEthLinkSpeed = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 1, 1, 1, 2), ETHAUTOSPEEDTYPE()).setMaxAccess("readonly") if mibBuilder.loadTexts: networkEthLinkSpeed.setStatus('current') networkEthLinkStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 1, 1, 1, 3), ETHLINKSTATUS()).setMaxAccess("readonly") if mibBuilder.loadTexts: networkEthLinkStatus.setStatus('current') networkEthConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 2)) networkEthAutoNegTable = MibTable((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 2, 1), ) if mibBuilder.loadTexts: networkEthAutoNegTable.setStatus('current') networkEthAutoNegEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 2, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "SYMMCOMMONNETWORK", "networkEthAutoNegIndex")) if mibBuilder.loadTexts: networkEthAutoNegEntry.setStatus('current') networkEthAutoNegIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1000))) if mibBuilder.loadTexts: networkEthAutoNegIndex.setStatus('current') networkEthAutoNegState = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 2, 1, 1, 2), EnableValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: networkEthAutoNegState.setStatus('current') networkEthAutoNegSpeed = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 2, 1, 1, 3), AutoSpeedValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: networkEthAutoNegSpeed.setStatus('current') networkIpConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3)) networkIPv4ConfigTable = MibTable((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 1), ) if mibBuilder.loadTexts: networkIPv4ConfigTable.setStatus('current') networkIPv4ConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "SYMMCOMMONNETWORK", "networkIPv4ConfigIndex")) if mibBuilder.loadTexts: networkIPv4ConfigEntry.setStatus('current') networkIPv4ConfigIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1000))) if mibBuilder.loadTexts: networkIPv4ConfigIndex.setStatus('current') networkIPv4AddressOrigin = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 1, 1, 2), IpAddressOriginTC()).setMaxAccess("readwrite") if mibBuilder.loadTexts: networkIPv4AddressOrigin.setStatus('current') networkIPv4Address = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 1, 1, 3), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: networkIPv4Address.setStatus('current') networkIPv4DefaultRouteAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 1, 1, 4), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: networkIPv4DefaultRouteAddr.setStatus('current') networkIPv4SubnetMask = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 1, 1, 5), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: networkIPv4SubnetMask.setStatus('current') networkIPv4PortState = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 1, 1, 6), IPPortStateValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: networkIPv4PortState.setStatus('current') networkIPv4StaticRouteTable = MibTable((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 2), ) if mibBuilder.loadTexts: networkIPv4StaticRouteTable.setStatus('current') networkIPv4StaticRouteEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "SYMMCOMMONNETWORK", "networkIPv4StaticRouteIndex")) if mibBuilder.loadTexts: networkIPv4StaticRouteEntry.setStatus('current') networkIPv4StaticRouteIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 500))).setMaxAccess("readonly") if mibBuilder.loadTexts: networkIPv4StaticRouteIndex.setStatus('current') networkIPv4StaticRouteIfindex = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 2, 1, 2), Integer32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: networkIPv4StaticRouteIfindex.setStatus('current') networkIPv4StaticDestAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 2, 1, 3), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: networkIPv4StaticDestAddr.setStatus('current') networkIPv4StaticRouteMask = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 2, 1, 4), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: networkIPv4StaticRouteMask.setStatus('current') networkIPv4StaticRouteNextHop = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 2, 1, 5), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: networkIPv4StaticRouteNextHop.setStatus('current') networkIPv4StaticRouteMetric1 = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 65534))).setMaxAccess("readcreate") if mibBuilder.loadTexts: networkIPv4StaticRouteMetric1.setStatus('current') networkIPv4StaticRouteRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 2, 1, 7), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: networkIPv4StaticRouteRowStatus.setStatus('current') networkFirewallTable = MibTable((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 3), ) if mibBuilder.loadTexts: networkFirewallTable.setStatus('current') networkFirewallEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 3, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "SYMMCOMMONNETWORK", "networkFirewallIndex")) if mibBuilder.loadTexts: networkFirewallEntry.setStatus('current') networkFirewallIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1000))) if mibBuilder.loadTexts: networkFirewallIndex.setStatus('current') networkFirewallICMP = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 3, 1, 2), FirewallOnOff()).setMaxAccess("readwrite") if mibBuilder.loadTexts: networkFirewallICMP.setStatus('current') networkFirewallTelnet = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 3, 1, 3), FirewallOnOff()).setMaxAccess("readwrite") if mibBuilder.loadTexts: networkFirewallTelnet.setStatus('current') networkFirewallSSH = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 3, 1, 4), FirewallOnOff()).setMaxAccess("readwrite") if mibBuilder.loadTexts: networkFirewallSSH.setStatus('current') networkFirewallSFTP = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 3, 1, 5), FirewallOnOff()).setMaxAccess("readwrite") if mibBuilder.loadTexts: networkFirewallSFTP.setStatus('current') networkFirewallSNMP = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 3, 1, 6), FirewallOnOff()).setMaxAccess("readwrite") if mibBuilder.loadTexts: networkFirewallSNMP.setStatus('current') networkFirewallFTP = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 3, 1, 7), FirewallOnOff()).setMaxAccess("readwrite") if mibBuilder.loadTexts: networkFirewallFTP.setStatus('current') networkFirewallNTP = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 3, 1, 8), FirewallOnOff()).setMaxAccess("readwrite") if mibBuilder.loadTexts: networkFirewallNTP.setStatus('current') networkIPv6ConfigTable = MibTable((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 4), ) if mibBuilder.loadTexts: networkIPv6ConfigTable.setStatus('current') networkIPv6ConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 4, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "SYMMCOMMONNETWORK", "networkIPv6ConfigIndex")) if mibBuilder.loadTexts: networkIPv6ConfigEntry.setStatus('current') networkIPv6ConfigIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1000))) if mibBuilder.loadTexts: networkIPv6ConfigIndex.setStatus('current') networkIPv6AddressOrigin = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 4, 1, 2), IpAddressOriginTC()).setMaxAccess("readwrite") if mibBuilder.loadTexts: networkIPv6AddressOrigin.setStatus('current') networkIPv6Address = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 4, 1, 3), InetAddressIPv6()).setMaxAccess("readwrite") if mibBuilder.loadTexts: networkIPv6Address.setStatus('current') networkIPv6Prefix = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 4, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 128))).setMaxAccess("readwrite") if mibBuilder.loadTexts: networkIPv6Prefix.setStatus('current') networkIPv6DefaultRouteAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 4, 1, 5), InetAddressIPv6()).setMaxAccess("readwrite") if mibBuilder.loadTexts: networkIPv6DefaultRouteAddr.setStatus('current') networkIPv6PortState = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 4, 1, 6), IPPortStateValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: networkIPv6PortState.setStatus('current') networkIPv6StaticRouteTable = MibTable((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 5), ) if mibBuilder.loadTexts: networkIPv6StaticRouteTable.setStatus('current') networkIPv6StaticRouteEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 5, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "SYMMCOMMONNETWORK", "networkIPv6StaticRouteIndex")) if mibBuilder.loadTexts: networkIPv6StaticRouteEntry.setStatus('current') networkIPv6StaticRouteIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 500))).setMaxAccess("readonly") if mibBuilder.loadTexts: networkIPv6StaticRouteIndex.setStatus('current') networkIPv6StaticRouteIfindex = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 5, 1, 2), Integer32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: networkIPv6StaticRouteIfindex.setStatus('current') networkIPv6StaticRouteDestAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 5, 1, 3), InetAddressIPv6()).setMaxAccess("readcreate") if mibBuilder.loadTexts: networkIPv6StaticRouteDestAddr.setStatus('current') networkIPv6StaticRoutePrefix = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 5, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 128))).setMaxAccess("readcreate") if mibBuilder.loadTexts: networkIPv6StaticRoutePrefix.setStatus('current') networkIPv6StaticRouteNextHop = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 5, 1, 5), InetAddressIPv6z()).setMaxAccess("readcreate") if mibBuilder.loadTexts: networkIPv6StaticRouteNextHop.setStatus('current') networkIPv6StaticRouteMetric1 = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 5, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 65534))).setMaxAccess("readcreate") if mibBuilder.loadTexts: networkIPv6StaticRouteMetric1.setStatus('current') networkIPv6StaticRouteRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 5, 1, 7), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: networkIPv6StaticRouteRowStatus.setStatus('current') networkIPVerTable = MibTable((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 6), ) if mibBuilder.loadTexts: networkIPVerTable.setStatus('current') networkIPVerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 6, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "SYMMCOMMONNETWORK", "networkIPVerIndex")) if mibBuilder.loadTexts: networkIPVerEntry.setStatus('current') networkIPVerIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 6, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1000))) if mibBuilder.loadTexts: networkIPVerIndex.setStatus('current') networkIPVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 6, 1, 2), InetAddressType()).setMaxAccess("readwrite") if mibBuilder.loadTexts: networkIPVersion.setStatus('current') networkIPv6AutoConfigTable = MibTable((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 7), ) if mibBuilder.loadTexts: networkIPv6AutoConfigTable.setStatus('current') networkIPv6AutoConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 7, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "SYMMCOMMONNETWORK", "networkIPv6AutoConfigIndex")) if mibBuilder.loadTexts: networkIPv6AutoConfigEntry.setStatus('current') networkIPv6AutoConfigIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 7, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1))) if mibBuilder.loadTexts: networkIPv6AutoConfigIndex.setStatus('current') networkIPv6AutoConfigMode = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 7, 1, 2), EnableValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: networkIPv6AutoConfigMode.setStatus('current') networkVlanConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 4)) networkIPStatus = MibIdentifier((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5)) networkIPv4StatusTable = MibTable((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 1), ) if mibBuilder.loadTexts: networkIPv4StatusTable.setStatus('current') networkIPv4StatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "SYMMCOMMONNETWORK", "networkIPv4StatusIndex")) if mibBuilder.loadTexts: networkIPv4StatusEntry.setStatus('current') networkIPv4StatusIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1000))) if mibBuilder.loadTexts: networkIPv4StatusIndex.setStatus('current') networkIPv4Module = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 1, 1, 2), TPMODULEID()).setMaxAccess("readonly") if mibBuilder.loadTexts: networkIPv4Module.setStatus('current') networkIPv4VlanID = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(2, 4096))).setMaxAccess("readonly") if mibBuilder.loadTexts: networkIPv4VlanID.setStatus('current') networkIPv4Addr = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 1, 1, 4), InetAddressIPv4()).setMaxAccess("readonly") if mibBuilder.loadTexts: networkIPv4Addr.setStatus('current') networkIPv4Netmask = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 1, 1, 5), InetAddressIPv4()).setMaxAccess("readonly") if mibBuilder.loadTexts: networkIPv4Netmask.setStatus('current') networkIPv4RouteAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 1, 1, 6), InetAddressIPv4()).setMaxAccess("readonly") if mibBuilder.loadTexts: networkIPv4RouteAddr.setStatus('current') networkIPv4Mode = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 1, 1, 7), IpAddressOriginTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: networkIPv4Mode.setStatus('current') networkIPv6StatusTable = MibTable((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 2), ) if mibBuilder.loadTexts: networkIPv6StatusTable.setStatus('current') networkIPv6StatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "SYMMCOMMONNETWORK", "networkIPv6StatusIndex")) if mibBuilder.loadTexts: networkIPv6StatusEntry.setStatus('current') networkIPv6StatusIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1000))) if mibBuilder.loadTexts: networkIPv6StatusIndex.setStatus('current') networkIPv6Module = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 2, 1, 2), TPMODULEID()).setMaxAccess("readonly") if mibBuilder.loadTexts: networkIPv6Module.setStatus('current') networkIPv6VlanID = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(2, 4096))).setMaxAccess("readonly") if mibBuilder.loadTexts: networkIPv6VlanID.setStatus('current') networkIPv6Addr = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 2, 1, 4), InetAddressIPv6()).setMaxAccess("readonly") if mibBuilder.loadTexts: networkIPv6Addr.setStatus('current') networkIPv6PrefixLength = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 2, 1, 5), InetAddressPrefixLength()).setMaxAccess("readonly") if mibBuilder.loadTexts: networkIPv6PrefixLength.setStatus('current') networkIPv6AddrScope = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 2, 1, 6), IPV6SCOPE()).setMaxAccess("readonly") if mibBuilder.loadTexts: networkIPv6AddrScope.setStatus('current') networkIPv6Mode = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 2, 1, 7), IpAddressOriginTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: networkIPv6Mode.setStatus('current') networkConformance = ObjectIdentity((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6)) if mibBuilder.loadTexts: networkConformance.setStatus('current') networkCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 1)) networkBasicCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 1, 1)).setObjects(("SYMMCOMMONNETWORK", "networkEthAutoNetGroup"), ("SYMMCOMMONNETWORK", "networkIPv4ConfigGroup"), ("SYMMCOMMONNETWORK", "networkFirewallGroup"), ("SYMMCOMMONNETWORK", "networkIPv4StaticRouteGroup"), ("SYMMCOMMONNETWORK", "networkEthStatusGroup"), ("SYMMCOMMONNETWORK", "networkIPv6ConfigGroup"), ("SYMMCOMMONNETWORK", "networkIPv6StaticRouteGroup"), ("SYMMCOMMONNETWORK", "networkIPVersionGroup"), ("SYMMCOMMONNETWORK", "networkIPv6AutoConfigGroup"), ("SYMMCOMMONNETWORK", "networkIPv4StatusGroup"), ("SYMMCOMMONNETWORK", "networkIPv6StatusGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): networkBasicCompliance = networkBasicCompliance.setStatus('current') networkUocGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 2)) networkEthAutoNetGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 2, 1)).setObjects(("SYMMCOMMONNETWORK", "networkEthAutoNegState"), ("SYMMCOMMONNETWORK", "networkEthAutoNegSpeed")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): networkEthAutoNetGroup = networkEthAutoNetGroup.setStatus('current') networkIPv4ConfigGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 2, 2)).setObjects(("SYMMCOMMONNETWORK", "networkIPv4AddressOrigin"), ("SYMMCOMMONNETWORK", "networkIPv4Address"), ("SYMMCOMMONNETWORK", "networkIPv4DefaultRouteAddr"), ("SYMMCOMMONNETWORK", "networkIPv4SubnetMask"), ("SYMMCOMMONNETWORK", "networkIPv4PortState")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): networkIPv4ConfigGroup = networkIPv4ConfigGroup.setStatus('current') networkFirewallGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 2, 3)).setObjects(("SYMMCOMMONNETWORK", "networkFirewallICMP"), ("SYMMCOMMONNETWORK", "networkFirewallTelnet"), ("SYMMCOMMONNETWORK", "networkFirewallSSH"), ("SYMMCOMMONNETWORK", "networkFirewallSFTP"), ("SYMMCOMMONNETWORK", "networkFirewallSNMP"), ("SYMMCOMMONNETWORK", "networkFirewallFTP")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): networkFirewallGroup = networkFirewallGroup.setStatus('current') networkIPv4StaticRouteGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 2, 4)).setObjects(("SYMMCOMMONNETWORK", "networkIPv4StaticRouteIndex"), ("SYMMCOMMONNETWORK", "networkIPv4StaticDestAddr"), ("SYMMCOMMONNETWORK", "networkIPv4StaticRouteMask"), ("SYMMCOMMONNETWORK", "networkIPv4StaticRouteNextHop"), ("SYMMCOMMONNETWORK", "networkIPv4StaticRouteMetric1"), ("SYMMCOMMONNETWORK", "networkIPv4StaticRouteRowStatus"), ("SYMMCOMMONNETWORK", "networkIPv4StaticRouteIfindex")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): networkIPv4StaticRouteGroup = networkIPv4StaticRouteGroup.setStatus('current') networkEthStatusGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 2, 5)).setObjects(("SYMMCOMMONNETWORK", "networkEthLinkSpeed"), ("SYMMCOMMONNETWORK", "networkEthLinkStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): networkEthStatusGroup = networkEthStatusGroup.setStatus('current') networkIPv6ConfigGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 2, 6)).setObjects(("SYMMCOMMONNETWORK", "networkIPv6AddressOrigin"), ("SYMMCOMMONNETWORK", "networkIPv6Address"), ("SYMMCOMMONNETWORK", "networkIPv6Prefix"), ("SYMMCOMMONNETWORK", "networkIPv6DefaultRouteAddr"), ("SYMMCOMMONNETWORK", "networkIPv6PortState")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): networkIPv6ConfigGroup = networkIPv6ConfigGroup.setStatus('current') networkIPv6StaticRouteGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 2, 7)).setObjects(("SYMMCOMMONNETWORK", "networkIPv6StaticRouteDestAddr"), ("SYMMCOMMONNETWORK", "networkIPv6StaticRoutePrefix"), ("SYMMCOMMONNETWORK", "networkIPv6StaticRouteNextHop"), ("SYMMCOMMONNETWORK", "networkIPv6StaticRouteMetric1"), ("SYMMCOMMONNETWORK", "networkIPv6StaticRouteIndex"), ("SYMMCOMMONNETWORK", "networkIPv6StaticRouteRowStatus"), ("SYMMCOMMONNETWORK", "networkIPv6StaticRouteIfindex")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): networkIPv6StaticRouteGroup = networkIPv6StaticRouteGroup.setStatus('current') networkIPVersionGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 2, 8)).setObjects(("SYMMCOMMONNETWORK", "networkIPVersion")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): networkIPVersionGroup = networkIPVersionGroup.setStatus('current') networkIPv6AutoConfigGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 2, 9)).setObjects(("SYMMCOMMONNETWORK", "networkIPv6AutoConfigMode")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): networkIPv6AutoConfigGroup = networkIPv6AutoConfigGroup.setStatus('current') networkIPv4StatusGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 2, 10)).setObjects(("SYMMCOMMONNETWORK", "networkIPv4Module"), ("SYMMCOMMONNETWORK", "networkIPv4RouteAddr"), ("SYMMCOMMONNETWORK", "networkIPv4Netmask"), ("SYMMCOMMONNETWORK", "networkIPv4Addr")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): networkIPv4StatusGroup = networkIPv4StatusGroup.setStatus('current') networkIPv6StatusGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 2, 11)).setObjects(("SYMMCOMMONNETWORK", "networkIPv6Module"), ("SYMMCOMMONNETWORK", "networkIPv6Addr"), ("SYMMCOMMONNETWORK", "networkIPv6AddrScope"), ("SYMMCOMMONNETWORK", "networkIPv6Mode"), ("SYMMCOMMONNETWORK", "networkIPv6PrefixLength")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): networkIPv6StatusGroup = networkIPv6StatusGroup.setStatus('current') mibBuilder.exportSymbols("SYMMCOMMONNETWORK", TAntHeight=TAntHeight, networkIPv4StaticRouteMetric1=networkIPv4StaticRouteMetric1, TPMODULEID=TPMODULEID, ETHLINKSTATUS=ETHLINKSTATUS, IPV6SCOPE=IPV6SCOPE, networkIPv6AutoConfigEntry=networkIPv6AutoConfigEntry, networkIPv4VlanID=networkIPv4VlanID, networkIPv6AutoConfigTable=networkIPv6AutoConfigTable, networkIPv6ConfigEntry=networkIPv6ConfigEntry, networkIPv6Mode=networkIPv6Mode, networkFirewallICMP=networkFirewallICMP, networkIPv6AutoConfigGroup=networkIPv6AutoConfigGroup, networkIPVersion=networkIPVersion, FirewallOnOff=FirewallOnOff, networkIPv6ConfigTable=networkIPv6ConfigTable, networkEthAutoNegState=networkEthAutoNegState, networkIPv6AddressOrigin=networkIPv6AddressOrigin, networkEthLinkIndex=networkEthLinkIndex, networkEthAutoNegSpeed=networkEthAutoNegSpeed, networkUocGroups=networkUocGroups, networkFirewallTelnet=networkFirewallTelnet, networkIPv6DefaultRouteAddr=networkIPv6DefaultRouteAddr, networkEthLinkTable=networkEthLinkTable, networkEthLinkStatus=networkEthLinkStatus, networkIPv6StaticRouteIfindex=networkIPv6StaticRouteIfindex, networkIPVerTable=networkIPVerTable, IPPortStateValue=IPPortStateValue, networkBasicCompliance=networkBasicCompliance, networkIPv4StaticDestAddr=networkIPv4StaticDestAddr, networkEthLinkSpeed=networkEthLinkSpeed, networkIPv4StaticRouteIfindex=networkIPv4StaticRouteIfindex, networkIPv4ConfigTable=networkIPv4ConfigTable, networkIPv4Netmask=networkIPv4Netmask, networkIPv4DefaultRouteAddr=networkIPv4DefaultRouteAddr, networkConformance=networkConformance, networkIPv6Module=networkIPv6Module, networkIPv4Module=networkIPv4Module, networkFirewallTable=networkFirewallTable, networkIPv4Mode=networkIPv4Mode, networkIPv6VlanID=networkIPv6VlanID, networkIPv4StaticRouteRowStatus=networkIPv4StaticRouteRowStatus, ETHAUTOSPEEDTYPE=ETHAUTOSPEEDTYPE, networkIPv6PortState=networkIPv6PortState, networkIPv6StaticRouteDestAddr=networkIPv6StaticRouteDestAddr, networkIPv6StatusEntry=networkIPv6StatusEntry, networkIPv4Address=networkIPv4Address, networkIPv4StatusIndex=networkIPv4StatusIndex, networkIPv6StaticRouteRowStatus=networkIPv6StaticRouteRowStatus, networkEthAutoNegIndex=networkEthAutoNegIndex, networkIPStatus=networkIPStatus, networkIPVersionGroup=networkIPVersionGroup, PYSNMP_MODULE_ID=symmCommonNetwork, networkIPv4StatusGroup=networkIPv4StatusGroup, networkFirewallIndex=networkFirewallIndex, networkIPv6StatusIndex=networkIPv6StatusIndex, networkFirewallSSH=networkFirewallSSH, networkFirewallSFTP=networkFirewallSFTP, networkIPv6StaticRouteEntry=networkIPv6StaticRouteEntry, IpAddressOriginTC=IpAddressOriginTC, networkIPVerIndex=networkIPVerIndex, networkIPv6StaticRouteTable=networkIPv6StaticRouteTable, networkEthAutoNegEntry=networkEthAutoNegEntry, networkIPv6StaticRouteGroup=networkIPv6StaticRouteGroup, networkIPv6StatusGroup=networkIPv6StatusGroup, networkIPv4Addr=networkIPv4Addr, networkFirewallEntry=networkFirewallEntry, networkEthStatusGroup=networkEthStatusGroup, DateAndTime=DateAndTime, AutoSpeedValue=AutoSpeedValue, networkIPv4StaticRouteGroup=networkIPv4StaticRouteGroup, networkIPv6StaticRouteNextHop=networkIPv6StaticRouteNextHop, networkIPv4PortState=networkIPv4PortState, networkEthAutoNegTable=networkEthAutoNegTable, networkEthAutoNetGroup=networkEthAutoNetGroup, networkFirewallGroup=networkFirewallGroup, symmCommonNetwork=symmCommonNetwork, networkEthStatus=networkEthStatus, networkIPv6StaticRouteIndex=networkIPv6StaticRouteIndex, networkIPv6AutoConfigIndex=networkIPv6AutoConfigIndex, networkEthConfig=networkEthConfig, networkIPv6AutoConfigMode=networkIPv6AutoConfigMode, TLocalTimeOffset=TLocalTimeOffset, networkIPv6Addr=networkIPv6Addr, networkIPv6StaticRouteMetric1=networkIPv6StaticRouteMetric1, TSsm=TSsm, networkIPv4RouteAddr=networkIPv4RouteAddr, networkEthLinkEntry=networkEthLinkEntry, networkIPv4StaticRouteNextHop=networkIPv4StaticRouteNextHop, networkIPv6Address=networkIPv6Address, networkIPv4StaticRouteEntry=networkIPv4StaticRouteEntry, networkIPv6StaticRoutePrefix=networkIPv6StaticRoutePrefix, networkIPv4StaticRouteMask=networkIPv4StaticRouteMask, networkIPv6ConfigIndex=networkIPv6ConfigIndex, networkIPv6StatusTable=networkIPv6StatusTable, networkIPv4SubnetMask=networkIPv4SubnetMask, networkIPv4ConfigEntry=networkIPv4ConfigEntry, TLatAndLon=TLatAndLon, networkIPv6ConfigGroup=networkIPv6ConfigGroup, networkIpConfig=networkIpConfig, networkIPv4ConfigIndex=networkIPv4ConfigIndex, networkCompliances=networkCompliances, networkIPv4StaticRouteIndex=networkIPv4StaticRouteIndex, networkIPv6Prefix=networkIPv6Prefix, networkIPv4AddressOrigin=networkIPv4AddressOrigin, networkIPv6PrefixLength=networkIPv6PrefixLength, networkFirewallFTP=networkFirewallFTP, networkIPv4StaticRouteTable=networkIPv4StaticRouteTable, networkIPv6AddrScope=networkIPv6AddrScope, networkIPv4StatusEntry=networkIPv4StatusEntry, networkIPv4ConfigGroup=networkIPv4ConfigGroup, networkFirewallNTP=networkFirewallNTP, networkFirewallSNMP=networkFirewallSNMP, networkIPVerEntry=networkIPVerEntry, networkVlanConfig=networkVlanConfig, networkIPv4StatusTable=networkIPv4StatusTable)
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, value_range_constraint, constraints_union, single_value_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ValueRangeConstraint', 'ConstraintsUnion', 'SingleValueConstraint', 'ConstraintsIntersection') (ent_physical_index,) = mibBuilder.importSymbols('ENTITY-MIB', 'entPhysicalIndex') (if_number, if_index) = mibBuilder.importSymbols('IF-MIB', 'ifNumber', 'ifIndex') (inet_address_i_pv6z, inet_address_prefix_length, inet_address_i_pv6, inet_address_i_pv4, inet_address_type) = mibBuilder.importSymbols('INET-ADDRESS-MIB', 'InetAddressIPv6z', 'InetAddressPrefixLength', 'InetAddressIPv6', 'InetAddressIPv4', 'InetAddressType') (object_group, module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ObjectGroup', 'ModuleCompliance', 'NotificationGroup') (unsigned32, gauge32, counter32, mib_scalar, mib_table, mib_table_row, mib_table_column, notification_type, bits, time_ticks, counter64, integer32, mib_identifier, object_identity, module_identity, iso, ip_address) = mibBuilder.importSymbols('SNMPv2-SMI', 'Unsigned32', 'Gauge32', 'Counter32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'NotificationType', 'Bits', 'TimeTicks', 'Counter64', 'Integer32', 'MibIdentifier', 'ObjectIdentity', 'ModuleIdentity', 'iso', 'IpAddress') (textual_convention, row_status, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'RowStatus', 'DisplayString') (enable_value, symm_network) = mibBuilder.importSymbols('SYMM-COMMON-SMI', 'EnableValue', 'symmNetwork') symm_common_network = module_identity((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1)) symmCommonNetwork.setRevisions(('2018-04-10 20:53',)) if mibBuilder.loadTexts: symmCommonNetwork.setLastUpdated('201806280521Z') if mibBuilder.loadTexts: symmCommonNetwork.setOrganization('Symmetricom') class Autospeedvalue(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4)) named_values = named_values(('eth100m', 1), ('eth1000m', 2), ('all', 3), ('unknown', 4)) class Ipaddressorigintc(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 4, 5, 6)) named_values = named_values(('other', 1), ('manual', 2), ('dhcp', 4), ('linklayer', 5), ('random', 6)) class Ipportstatevalue(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3)) named_values = named_values(('enable', 1), ('disable', 2), ('restart', 3)) class Firewallonoff(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2)) named_values = named_values(('allow', 1), ('block', 2)) class Ethautospeedtype(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4)) named_values = named_values(('eth100m', 1), ('eth1000m', 2), ('all', 3), ('unknown', 4)) class Ethlinkstatus(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2)) named_values = named_values(('ethUp', 1), ('ethDown', 2)) class Tpmoduleid(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)) named_values = named_values(('imc', 1), ('ioc1', 2), ('ioc2', 3), ('exp0', 6), ('exp1', 7), ('exp2', 8), ('exp3', 9), ('exp4', 10), ('exp5', 11), ('exp6', 12), ('exp7', 13), ('exp8', 14), ('exp9', 15)) class Ipv6Scope(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 5, 14)) named_values = named_values(('interface-local', 1), ('link-local', 2), ('site-local', 5), ('global', 14)) class Dateandtime(TextualConvention, OctetString): status = 'current' display_hint = '2d-1d-1d,1d:1d:1d.1d,1a1d:1d' subtype_spec = OctetString.subtypeSpec + constraints_union(value_size_constraint(8, 8), value_size_constraint(11, 11)) class Tlatandlon(TextualConvention, OctetString): status = 'current' display_hint = '1a1d:1d:1d.1d' subtype_spec = OctetString.subtypeSpec + value_size_constraint(5, 5) fixed_length = 5 class Tantheight(TextualConvention, OctetString): status = 'current' display_hint = '1a2d.1d' subtype_spec = OctetString.subtypeSpec + value_size_constraint(4, 4) fixed_length = 4 class Tlocaltimeoffset(TextualConvention, OctetString): status = 'current' display_hint = '1a1d:1d' subtype_spec = OctetString.subtypeSpec + value_size_constraint(3, 3) fixed_length = 3 class Tssm(TextualConvention, Integer32): status = 'current' display_hint = 'x' subtype_spec = Integer32.subtypeSpec + value_range_constraint(0, 255) network_eth_status = mib_identifier((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 1)) network_eth_link_table = mib_table((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 1, 1)) if mibBuilder.loadTexts: networkEthLinkTable.setStatus('current') network_eth_link_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 1, 1, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'SYMMCOMMONNETWORK', 'networkEthLinkIndex')) if mibBuilder.loadTexts: networkEthLinkEntry.setStatus('current') network_eth_link_index = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 1, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 1000))) if mibBuilder.loadTexts: networkEthLinkIndex.setStatus('current') network_eth_link_speed = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 1, 1, 1, 2), ethautospeedtype()).setMaxAccess('readonly') if mibBuilder.loadTexts: networkEthLinkSpeed.setStatus('current') network_eth_link_status = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 1, 1, 1, 3), ethlinkstatus()).setMaxAccess('readonly') if mibBuilder.loadTexts: networkEthLinkStatus.setStatus('current') network_eth_config = mib_identifier((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 2)) network_eth_auto_neg_table = mib_table((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 2, 1)) if mibBuilder.loadTexts: networkEthAutoNegTable.setStatus('current') network_eth_auto_neg_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 2, 1, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'SYMMCOMMONNETWORK', 'networkEthAutoNegIndex')) if mibBuilder.loadTexts: networkEthAutoNegEntry.setStatus('current') network_eth_auto_neg_index = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 2, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 1000))) if mibBuilder.loadTexts: networkEthAutoNegIndex.setStatus('current') network_eth_auto_neg_state = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 2, 1, 1, 2), enable_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: networkEthAutoNegState.setStatus('current') network_eth_auto_neg_speed = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 2, 1, 1, 3), auto_speed_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: networkEthAutoNegSpeed.setStatus('current') network_ip_config = mib_identifier((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3)) network_i_pv4_config_table = mib_table((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 1)) if mibBuilder.loadTexts: networkIPv4ConfigTable.setStatus('current') network_i_pv4_config_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 1, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'SYMMCOMMONNETWORK', 'networkIPv4ConfigIndex')) if mibBuilder.loadTexts: networkIPv4ConfigEntry.setStatus('current') network_i_pv4_config_index = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 1000))) if mibBuilder.loadTexts: networkIPv4ConfigIndex.setStatus('current') network_i_pv4_address_origin = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 1, 1, 2), ip_address_origin_tc()).setMaxAccess('readwrite') if mibBuilder.loadTexts: networkIPv4AddressOrigin.setStatus('current') network_i_pv4_address = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 1, 1, 3), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: networkIPv4Address.setStatus('current') network_i_pv4_default_route_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 1, 1, 4), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: networkIPv4DefaultRouteAddr.setStatus('current') network_i_pv4_subnet_mask = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 1, 1, 5), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: networkIPv4SubnetMask.setStatus('current') network_i_pv4_port_state = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 1, 1, 6), ip_port_state_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: networkIPv4PortState.setStatus('current') network_i_pv4_static_route_table = mib_table((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 2)) if mibBuilder.loadTexts: networkIPv4StaticRouteTable.setStatus('current') network_i_pv4_static_route_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 2, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'SYMMCOMMONNETWORK', 'networkIPv4StaticRouteIndex')) if mibBuilder.loadTexts: networkIPv4StaticRouteEntry.setStatus('current') network_i_pv4_static_route_index = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 500))).setMaxAccess('readonly') if mibBuilder.loadTexts: networkIPv4StaticRouteIndex.setStatus('current') network_i_pv4_static_route_ifindex = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 2, 1, 2), integer32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: networkIPv4StaticRouteIfindex.setStatus('current') network_i_pv4_static_dest_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 2, 1, 3), ip_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: networkIPv4StaticDestAddr.setStatus('current') network_i_pv4_static_route_mask = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 2, 1, 4), ip_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: networkIPv4StaticRouteMask.setStatus('current') network_i_pv4_static_route_next_hop = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 2, 1, 5), ip_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: networkIPv4StaticRouteNextHop.setStatus('current') network_i_pv4_static_route_metric1 = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 2, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(-1, 65534))).setMaxAccess('readcreate') if mibBuilder.loadTexts: networkIPv4StaticRouteMetric1.setStatus('current') network_i_pv4_static_route_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 2, 1, 7), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: networkIPv4StaticRouteRowStatus.setStatus('current') network_firewall_table = mib_table((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 3)) if mibBuilder.loadTexts: networkFirewallTable.setStatus('current') network_firewall_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 3, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'SYMMCOMMONNETWORK', 'networkFirewallIndex')) if mibBuilder.loadTexts: networkFirewallEntry.setStatus('current') network_firewall_index = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 1000))) if mibBuilder.loadTexts: networkFirewallIndex.setStatus('current') network_firewall_icmp = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 3, 1, 2), firewall_on_off()).setMaxAccess('readwrite') if mibBuilder.loadTexts: networkFirewallICMP.setStatus('current') network_firewall_telnet = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 3, 1, 3), firewall_on_off()).setMaxAccess('readwrite') if mibBuilder.loadTexts: networkFirewallTelnet.setStatus('current') network_firewall_ssh = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 3, 1, 4), firewall_on_off()).setMaxAccess('readwrite') if mibBuilder.loadTexts: networkFirewallSSH.setStatus('current') network_firewall_sftp = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 3, 1, 5), firewall_on_off()).setMaxAccess('readwrite') if mibBuilder.loadTexts: networkFirewallSFTP.setStatus('current') network_firewall_snmp = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 3, 1, 6), firewall_on_off()).setMaxAccess('readwrite') if mibBuilder.loadTexts: networkFirewallSNMP.setStatus('current') network_firewall_ftp = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 3, 1, 7), firewall_on_off()).setMaxAccess('readwrite') if mibBuilder.loadTexts: networkFirewallFTP.setStatus('current') network_firewall_ntp = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 3, 1, 8), firewall_on_off()).setMaxAccess('readwrite') if mibBuilder.loadTexts: networkFirewallNTP.setStatus('current') network_i_pv6_config_table = mib_table((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 4)) if mibBuilder.loadTexts: networkIPv6ConfigTable.setStatus('current') network_i_pv6_config_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 4, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'SYMMCOMMONNETWORK', 'networkIPv6ConfigIndex')) if mibBuilder.loadTexts: networkIPv6ConfigEntry.setStatus('current') network_i_pv6_config_index = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 4, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 1000))) if mibBuilder.loadTexts: networkIPv6ConfigIndex.setStatus('current') network_i_pv6_address_origin = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 4, 1, 2), ip_address_origin_tc()).setMaxAccess('readwrite') if mibBuilder.loadTexts: networkIPv6AddressOrigin.setStatus('current') network_i_pv6_address = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 4, 1, 3), inet_address_i_pv6()).setMaxAccess('readwrite') if mibBuilder.loadTexts: networkIPv6Address.setStatus('current') network_i_pv6_prefix = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 4, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 128))).setMaxAccess('readwrite') if mibBuilder.loadTexts: networkIPv6Prefix.setStatus('current') network_i_pv6_default_route_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 4, 1, 5), inet_address_i_pv6()).setMaxAccess('readwrite') if mibBuilder.loadTexts: networkIPv6DefaultRouteAddr.setStatus('current') network_i_pv6_port_state = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 4, 1, 6), ip_port_state_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: networkIPv6PortState.setStatus('current') network_i_pv6_static_route_table = mib_table((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 5)) if mibBuilder.loadTexts: networkIPv6StaticRouteTable.setStatus('current') network_i_pv6_static_route_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 5, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'SYMMCOMMONNETWORK', 'networkIPv6StaticRouteIndex')) if mibBuilder.loadTexts: networkIPv6StaticRouteEntry.setStatus('current') network_i_pv6_static_route_index = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 5, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 500))).setMaxAccess('readonly') if mibBuilder.loadTexts: networkIPv6StaticRouteIndex.setStatus('current') network_i_pv6_static_route_ifindex = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 5, 1, 2), integer32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: networkIPv6StaticRouteIfindex.setStatus('current') network_i_pv6_static_route_dest_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 5, 1, 3), inet_address_i_pv6()).setMaxAccess('readcreate') if mibBuilder.loadTexts: networkIPv6StaticRouteDestAddr.setStatus('current') network_i_pv6_static_route_prefix = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 5, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 128))).setMaxAccess('readcreate') if mibBuilder.loadTexts: networkIPv6StaticRoutePrefix.setStatus('current') network_i_pv6_static_route_next_hop = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 5, 1, 5), inet_address_i_pv6z()).setMaxAccess('readcreate') if mibBuilder.loadTexts: networkIPv6StaticRouteNextHop.setStatus('current') network_i_pv6_static_route_metric1 = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 5, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(-1, 65534))).setMaxAccess('readcreate') if mibBuilder.loadTexts: networkIPv6StaticRouteMetric1.setStatus('current') network_i_pv6_static_route_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 5, 1, 7), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: networkIPv6StaticRouteRowStatus.setStatus('current') network_ip_ver_table = mib_table((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 6)) if mibBuilder.loadTexts: networkIPVerTable.setStatus('current') network_ip_ver_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 6, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'SYMMCOMMONNETWORK', 'networkIPVerIndex')) if mibBuilder.loadTexts: networkIPVerEntry.setStatus('current') network_ip_ver_index = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 6, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 1000))) if mibBuilder.loadTexts: networkIPVerIndex.setStatus('current') network_ip_version = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 6, 1, 2), inet_address_type()).setMaxAccess('readwrite') if mibBuilder.loadTexts: networkIPVersion.setStatus('current') network_i_pv6_auto_config_table = mib_table((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 7)) if mibBuilder.loadTexts: networkIPv6AutoConfigTable.setStatus('current') network_i_pv6_auto_config_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 7, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'SYMMCOMMONNETWORK', 'networkIPv6AutoConfigIndex')) if mibBuilder.loadTexts: networkIPv6AutoConfigEntry.setStatus('current') network_i_pv6_auto_config_index = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 7, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 1))) if mibBuilder.loadTexts: networkIPv6AutoConfigIndex.setStatus('current') network_i_pv6_auto_config_mode = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 3, 7, 1, 2), enable_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: networkIPv6AutoConfigMode.setStatus('current') network_vlan_config = mib_identifier((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 4)) network_ip_status = mib_identifier((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5)) network_i_pv4_status_table = mib_table((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 1)) if mibBuilder.loadTexts: networkIPv4StatusTable.setStatus('current') network_i_pv4_status_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 1, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'SYMMCOMMONNETWORK', 'networkIPv4StatusIndex')) if mibBuilder.loadTexts: networkIPv4StatusEntry.setStatus('current') network_i_pv4_status_index = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 1000))) if mibBuilder.loadTexts: networkIPv4StatusIndex.setStatus('current') network_i_pv4_module = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 1, 1, 2), tpmoduleid()).setMaxAccess('readonly') if mibBuilder.loadTexts: networkIPv4Module.setStatus('current') network_i_pv4_vlan_id = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 1, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(2, 4096))).setMaxAccess('readonly') if mibBuilder.loadTexts: networkIPv4VlanID.setStatus('current') network_i_pv4_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 1, 1, 4), inet_address_i_pv4()).setMaxAccess('readonly') if mibBuilder.loadTexts: networkIPv4Addr.setStatus('current') network_i_pv4_netmask = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 1, 1, 5), inet_address_i_pv4()).setMaxAccess('readonly') if mibBuilder.loadTexts: networkIPv4Netmask.setStatus('current') network_i_pv4_route_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 1, 1, 6), inet_address_i_pv4()).setMaxAccess('readonly') if mibBuilder.loadTexts: networkIPv4RouteAddr.setStatus('current') network_i_pv4_mode = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 1, 1, 7), ip_address_origin_tc()).setMaxAccess('readonly') if mibBuilder.loadTexts: networkIPv4Mode.setStatus('current') network_i_pv6_status_table = mib_table((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 2)) if mibBuilder.loadTexts: networkIPv6StatusTable.setStatus('current') network_i_pv6_status_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 2, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'SYMMCOMMONNETWORK', 'networkIPv6StatusIndex')) if mibBuilder.loadTexts: networkIPv6StatusEntry.setStatus('current') network_i_pv6_status_index = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 1000))) if mibBuilder.loadTexts: networkIPv6StatusIndex.setStatus('current') network_i_pv6_module = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 2, 1, 2), tpmoduleid()).setMaxAccess('readonly') if mibBuilder.loadTexts: networkIPv6Module.setStatus('current') network_i_pv6_vlan_id = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 2, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(2, 4096))).setMaxAccess('readonly') if mibBuilder.loadTexts: networkIPv6VlanID.setStatus('current') network_i_pv6_addr = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 2, 1, 4), inet_address_i_pv6()).setMaxAccess('readonly') if mibBuilder.loadTexts: networkIPv6Addr.setStatus('current') network_i_pv6_prefix_length = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 2, 1, 5), inet_address_prefix_length()).setMaxAccess('readonly') if mibBuilder.loadTexts: networkIPv6PrefixLength.setStatus('current') network_i_pv6_addr_scope = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 2, 1, 6), ipv6_scope()).setMaxAccess('readonly') if mibBuilder.loadTexts: networkIPv6AddrScope.setStatus('current') network_i_pv6_mode = mib_table_column((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 5, 2, 1, 7), ip_address_origin_tc()).setMaxAccess('readonly') if mibBuilder.loadTexts: networkIPv6Mode.setStatus('current') network_conformance = object_identity((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6)) if mibBuilder.loadTexts: networkConformance.setStatus('current') network_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 1)) network_basic_compliance = module_compliance((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 1, 1)).setObjects(('SYMMCOMMONNETWORK', 'networkEthAutoNetGroup'), ('SYMMCOMMONNETWORK', 'networkIPv4ConfigGroup'), ('SYMMCOMMONNETWORK', 'networkFirewallGroup'), ('SYMMCOMMONNETWORK', 'networkIPv4StaticRouteGroup'), ('SYMMCOMMONNETWORK', 'networkEthStatusGroup'), ('SYMMCOMMONNETWORK', 'networkIPv6ConfigGroup'), ('SYMMCOMMONNETWORK', 'networkIPv6StaticRouteGroup'), ('SYMMCOMMONNETWORK', 'networkIPVersionGroup'), ('SYMMCOMMONNETWORK', 'networkIPv6AutoConfigGroup'), ('SYMMCOMMONNETWORK', 'networkIPv4StatusGroup'), ('SYMMCOMMONNETWORK', 'networkIPv6StatusGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): network_basic_compliance = networkBasicCompliance.setStatus('current') network_uoc_groups = mib_identifier((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 2)) network_eth_auto_net_group = object_group((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 2, 1)).setObjects(('SYMMCOMMONNETWORK', 'networkEthAutoNegState'), ('SYMMCOMMONNETWORK', 'networkEthAutoNegSpeed')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): network_eth_auto_net_group = networkEthAutoNetGroup.setStatus('current') network_i_pv4_config_group = object_group((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 2, 2)).setObjects(('SYMMCOMMONNETWORK', 'networkIPv4AddressOrigin'), ('SYMMCOMMONNETWORK', 'networkIPv4Address'), ('SYMMCOMMONNETWORK', 'networkIPv4DefaultRouteAddr'), ('SYMMCOMMONNETWORK', 'networkIPv4SubnetMask'), ('SYMMCOMMONNETWORK', 'networkIPv4PortState')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): network_i_pv4_config_group = networkIPv4ConfigGroup.setStatus('current') network_firewall_group = object_group((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 2, 3)).setObjects(('SYMMCOMMONNETWORK', 'networkFirewallICMP'), ('SYMMCOMMONNETWORK', 'networkFirewallTelnet'), ('SYMMCOMMONNETWORK', 'networkFirewallSSH'), ('SYMMCOMMONNETWORK', 'networkFirewallSFTP'), ('SYMMCOMMONNETWORK', 'networkFirewallSNMP'), ('SYMMCOMMONNETWORK', 'networkFirewallFTP')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): network_firewall_group = networkFirewallGroup.setStatus('current') network_i_pv4_static_route_group = object_group((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 2, 4)).setObjects(('SYMMCOMMONNETWORK', 'networkIPv4StaticRouteIndex'), ('SYMMCOMMONNETWORK', 'networkIPv4StaticDestAddr'), ('SYMMCOMMONNETWORK', 'networkIPv4StaticRouteMask'), ('SYMMCOMMONNETWORK', 'networkIPv4StaticRouteNextHop'), ('SYMMCOMMONNETWORK', 'networkIPv4StaticRouteMetric1'), ('SYMMCOMMONNETWORK', 'networkIPv4StaticRouteRowStatus'), ('SYMMCOMMONNETWORK', 'networkIPv4StaticRouteIfindex')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): network_i_pv4_static_route_group = networkIPv4StaticRouteGroup.setStatus('current') network_eth_status_group = object_group((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 2, 5)).setObjects(('SYMMCOMMONNETWORK', 'networkEthLinkSpeed'), ('SYMMCOMMONNETWORK', 'networkEthLinkStatus')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): network_eth_status_group = networkEthStatusGroup.setStatus('current') network_i_pv6_config_group = object_group((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 2, 6)).setObjects(('SYMMCOMMONNETWORK', 'networkIPv6AddressOrigin'), ('SYMMCOMMONNETWORK', 'networkIPv6Address'), ('SYMMCOMMONNETWORK', 'networkIPv6Prefix'), ('SYMMCOMMONNETWORK', 'networkIPv6DefaultRouteAddr'), ('SYMMCOMMONNETWORK', 'networkIPv6PortState')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): network_i_pv6_config_group = networkIPv6ConfigGroup.setStatus('current') network_i_pv6_static_route_group = object_group((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 2, 7)).setObjects(('SYMMCOMMONNETWORK', 'networkIPv6StaticRouteDestAddr'), ('SYMMCOMMONNETWORK', 'networkIPv6StaticRoutePrefix'), ('SYMMCOMMONNETWORK', 'networkIPv6StaticRouteNextHop'), ('SYMMCOMMONNETWORK', 'networkIPv6StaticRouteMetric1'), ('SYMMCOMMONNETWORK', 'networkIPv6StaticRouteIndex'), ('SYMMCOMMONNETWORK', 'networkIPv6StaticRouteRowStatus'), ('SYMMCOMMONNETWORK', 'networkIPv6StaticRouteIfindex')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): network_i_pv6_static_route_group = networkIPv6StaticRouteGroup.setStatus('current') network_ip_version_group = object_group((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 2, 8)).setObjects(('SYMMCOMMONNETWORK', 'networkIPVersion')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): network_ip_version_group = networkIPVersionGroup.setStatus('current') network_i_pv6_auto_config_group = object_group((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 2, 9)).setObjects(('SYMMCOMMONNETWORK', 'networkIPv6AutoConfigMode')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): network_i_pv6_auto_config_group = networkIPv6AutoConfigGroup.setStatus('current') network_i_pv4_status_group = object_group((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 2, 10)).setObjects(('SYMMCOMMONNETWORK', 'networkIPv4Module'), ('SYMMCOMMONNETWORK', 'networkIPv4RouteAddr'), ('SYMMCOMMONNETWORK', 'networkIPv4Netmask'), ('SYMMCOMMONNETWORK', 'networkIPv4Addr')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): network_i_pv4_status_group = networkIPv4StatusGroup.setStatus('current') network_i_pv6_status_group = object_group((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 4, 1, 6, 2, 11)).setObjects(('SYMMCOMMONNETWORK', 'networkIPv6Module'), ('SYMMCOMMONNETWORK', 'networkIPv6Addr'), ('SYMMCOMMONNETWORK', 'networkIPv6AddrScope'), ('SYMMCOMMONNETWORK', 'networkIPv6Mode'), ('SYMMCOMMONNETWORK', 'networkIPv6PrefixLength')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): network_i_pv6_status_group = networkIPv6StatusGroup.setStatus('current') mibBuilder.exportSymbols('SYMMCOMMONNETWORK', TAntHeight=TAntHeight, networkIPv4StaticRouteMetric1=networkIPv4StaticRouteMetric1, TPMODULEID=TPMODULEID, ETHLINKSTATUS=ETHLINKSTATUS, IPV6SCOPE=IPV6SCOPE, networkIPv6AutoConfigEntry=networkIPv6AutoConfigEntry, networkIPv4VlanID=networkIPv4VlanID, networkIPv6AutoConfigTable=networkIPv6AutoConfigTable, networkIPv6ConfigEntry=networkIPv6ConfigEntry, networkIPv6Mode=networkIPv6Mode, networkFirewallICMP=networkFirewallICMP, networkIPv6AutoConfigGroup=networkIPv6AutoConfigGroup, networkIPVersion=networkIPVersion, FirewallOnOff=FirewallOnOff, networkIPv6ConfigTable=networkIPv6ConfigTable, networkEthAutoNegState=networkEthAutoNegState, networkIPv6AddressOrigin=networkIPv6AddressOrigin, networkEthLinkIndex=networkEthLinkIndex, networkEthAutoNegSpeed=networkEthAutoNegSpeed, networkUocGroups=networkUocGroups, networkFirewallTelnet=networkFirewallTelnet, networkIPv6DefaultRouteAddr=networkIPv6DefaultRouteAddr, networkEthLinkTable=networkEthLinkTable, networkEthLinkStatus=networkEthLinkStatus, networkIPv6StaticRouteIfindex=networkIPv6StaticRouteIfindex, networkIPVerTable=networkIPVerTable, IPPortStateValue=IPPortStateValue, networkBasicCompliance=networkBasicCompliance, networkIPv4StaticDestAddr=networkIPv4StaticDestAddr, networkEthLinkSpeed=networkEthLinkSpeed, networkIPv4StaticRouteIfindex=networkIPv4StaticRouteIfindex, networkIPv4ConfigTable=networkIPv4ConfigTable, networkIPv4Netmask=networkIPv4Netmask, networkIPv4DefaultRouteAddr=networkIPv4DefaultRouteAddr, networkConformance=networkConformance, networkIPv6Module=networkIPv6Module, networkIPv4Module=networkIPv4Module, networkFirewallTable=networkFirewallTable, networkIPv4Mode=networkIPv4Mode, networkIPv6VlanID=networkIPv6VlanID, networkIPv4StaticRouteRowStatus=networkIPv4StaticRouteRowStatus, ETHAUTOSPEEDTYPE=ETHAUTOSPEEDTYPE, networkIPv6PortState=networkIPv6PortState, networkIPv6StaticRouteDestAddr=networkIPv6StaticRouteDestAddr, networkIPv6StatusEntry=networkIPv6StatusEntry, networkIPv4Address=networkIPv4Address, networkIPv4StatusIndex=networkIPv4StatusIndex, networkIPv6StaticRouteRowStatus=networkIPv6StaticRouteRowStatus, networkEthAutoNegIndex=networkEthAutoNegIndex, networkIPStatus=networkIPStatus, networkIPVersionGroup=networkIPVersionGroup, PYSNMP_MODULE_ID=symmCommonNetwork, networkIPv4StatusGroup=networkIPv4StatusGroup, networkFirewallIndex=networkFirewallIndex, networkIPv6StatusIndex=networkIPv6StatusIndex, networkFirewallSSH=networkFirewallSSH, networkFirewallSFTP=networkFirewallSFTP, networkIPv6StaticRouteEntry=networkIPv6StaticRouteEntry, IpAddressOriginTC=IpAddressOriginTC, networkIPVerIndex=networkIPVerIndex, networkIPv6StaticRouteTable=networkIPv6StaticRouteTable, networkEthAutoNegEntry=networkEthAutoNegEntry, networkIPv6StaticRouteGroup=networkIPv6StaticRouteGroup, networkIPv6StatusGroup=networkIPv6StatusGroup, networkIPv4Addr=networkIPv4Addr, networkFirewallEntry=networkFirewallEntry, networkEthStatusGroup=networkEthStatusGroup, DateAndTime=DateAndTime, AutoSpeedValue=AutoSpeedValue, networkIPv4StaticRouteGroup=networkIPv4StaticRouteGroup, networkIPv6StaticRouteNextHop=networkIPv6StaticRouteNextHop, networkIPv4PortState=networkIPv4PortState, networkEthAutoNegTable=networkEthAutoNegTable, networkEthAutoNetGroup=networkEthAutoNetGroup, networkFirewallGroup=networkFirewallGroup, symmCommonNetwork=symmCommonNetwork, networkEthStatus=networkEthStatus, networkIPv6StaticRouteIndex=networkIPv6StaticRouteIndex, networkIPv6AutoConfigIndex=networkIPv6AutoConfigIndex, networkEthConfig=networkEthConfig, networkIPv6AutoConfigMode=networkIPv6AutoConfigMode, TLocalTimeOffset=TLocalTimeOffset, networkIPv6Addr=networkIPv6Addr, networkIPv6StaticRouteMetric1=networkIPv6StaticRouteMetric1, TSsm=TSsm, networkIPv4RouteAddr=networkIPv4RouteAddr, networkEthLinkEntry=networkEthLinkEntry, networkIPv4StaticRouteNextHop=networkIPv4StaticRouteNextHop, networkIPv6Address=networkIPv6Address, networkIPv4StaticRouteEntry=networkIPv4StaticRouteEntry, networkIPv6StaticRoutePrefix=networkIPv6StaticRoutePrefix, networkIPv4StaticRouteMask=networkIPv4StaticRouteMask, networkIPv6ConfigIndex=networkIPv6ConfigIndex, networkIPv6StatusTable=networkIPv6StatusTable, networkIPv4SubnetMask=networkIPv4SubnetMask, networkIPv4ConfigEntry=networkIPv4ConfigEntry, TLatAndLon=TLatAndLon, networkIPv6ConfigGroup=networkIPv6ConfigGroup, networkIpConfig=networkIpConfig, networkIPv4ConfigIndex=networkIPv4ConfigIndex, networkCompliances=networkCompliances, networkIPv4StaticRouteIndex=networkIPv4StaticRouteIndex, networkIPv6Prefix=networkIPv6Prefix, networkIPv4AddressOrigin=networkIPv4AddressOrigin, networkIPv6PrefixLength=networkIPv6PrefixLength, networkFirewallFTP=networkFirewallFTP, networkIPv4StaticRouteTable=networkIPv4StaticRouteTable, networkIPv6AddrScope=networkIPv6AddrScope, networkIPv4StatusEntry=networkIPv4StatusEntry, networkIPv4ConfigGroup=networkIPv4ConfigGroup, networkFirewallNTP=networkFirewallNTP, networkFirewallSNMP=networkFirewallSNMP, networkIPVerEntry=networkIPVerEntry, networkVlanConfig=networkVlanConfig, networkIPv4StatusTable=networkIPv4StatusTable)
# AutoTransform # Large scale, component based code modification library # # Licensed under the MIT License <http://opensource.org/licenses/MIT> # SPDX-License-Identifier: MIT # Copyright (c) 2022-present Nathan Rockenbach <http://github.com/nathro> # @black_format """Batchers take filtered Items and separate them in to logical groupings with associated metadata that can be acted on independently."""
"""Batchers take filtered Items and separate them in to logical groupings with associated metadata that can be acted on independently."""
class MergeRequest: class MergeType(str): pass MergeType.DEV = MergeType('dev') MergeType.PROD = MergeType('prod') MergeType.MAINTENANCE = MergeType('maintenance') def __init__(self, merge_type: MergeType, source_branch: str, target_branch: str): self.merge_type = merge_type self.source_branch = source_branch self.target_branch = target_branch def __str__(self): return f'{self.merge_type} ({self.source_branch} -> {self.target_branch})' def create(self): pass
class Mergerequest: class Mergetype(str): pass MergeType.DEV = merge_type('dev') MergeType.PROD = merge_type('prod') MergeType.MAINTENANCE = merge_type('maintenance') def __init__(self, merge_type: MergeType, source_branch: str, target_branch: str): self.merge_type = merge_type self.source_branch = source_branch self.target_branch = target_branch def __str__(self): return f'{self.merge_type} ({self.source_branch} -> {self.target_branch})' def create(self): pass
def calc( X=1, Y=2 ): try: return X % Y except TypeError: return 5 def process( A=0, B=0 ): V, Z = (0, 0) try: Z = calc( int(A), B ) except ValueError: V += 16 except ZeroDivisionError: V += 8 except: V += 4 else: V += 2 finally: V += 1 return (V, Z) print( process( 4.75 ) ) # Line 1 print( process( 10.5, 3 ) ) # Line 2 print( process( "one", 4 ) ) # Line 3 print( process( 8, "two" ) ) # Line 4
def calc(X=1, Y=2): try: return X % Y except TypeError: return 5 def process(A=0, B=0): (v, z) = (0, 0) try: z = calc(int(A), B) except ValueError: v += 16 except ZeroDivisionError: v += 8 except: v += 4 else: v += 2 finally: v += 1 return (V, Z) print(process(4.75)) print(process(10.5, 3)) print(process('one', 4)) print(process(8, 'two'))
# Settings File to declare constants TRAINING__DATA_PATH = '../training.csv' TESTING__DATA_PATH = '../test.csv' SAVE_PREDICTION_PATH = '../predictions.csv' SAVE_MODEL_PATH = '../model.pkl' CELERY_SETTINGS = 'celeryconfig'
training__data_path = '../training.csv' testing__data_path = '../test.csv' save_prediction_path = '../predictions.csv' save_model_path = '../model.pkl' celery_settings = 'celeryconfig'
""" Auto DM Jeremy L Thompson This file provides dictionaries for random modules """ # ------------------------------------------------------------------------------ # Dictionary of Monsters # ------------------------------------------------------------------------------ ALL_MONSTERS = [ # Monster Manual { "Name": "commoner", "CR": "0", "Env": [ "arctic", "coastal", "desert", "forest", "grassland", "hill", "urban" ] }, { "Name": "Owl", "CR": "0", "Env": ["arctic", "forest"] }, { "Name": "bandit", "CR": "1/8", "Env": ["arctic", "costal", "desert", "forest", "hill", "urban"] }, { "Name": "blood hawk", "CR": "1/8", "Env": ["arctic", "coastal", "forest", "grassland", "hill", "mountain"] }, { "Name": "kobold", "CR": "1/8", "Env": [ "arctic", "coastal", "desert", "forest", "hill", "mountain", "swamp", "underdark", "urban" ] }, { "Name": "tribal warrior", "CR": "1/8", "Env": [ "arctic", "coastal", "desert", "forest", "grassland", "hill", "mountain", "swamp", "underdark" ] }, { "Name": "giant owl", "CR": "1/4", "Env": ["arctic"] }, { "Name": "winged kobold", "CR": "1/4", "Env": [ "arctic", "coastal", "desert", "forest", "hill", "mountain", "swamp", "underdark", "urban" ] }, { "Name": "ice mephit", "CR": "1/2", "Env": ["arctic"] }, { "Name": "orc", "CR": "1/2", "Env": [ "arctic", "forest", "grassland", "hill", "mountain", "swamp", "underdark" ] }, { "Name": "scout", "CR": "1/2", "Env": [ "arctic", "coastal", "desert", "forest", "grassland", "hill", "mountain", "swamp", "underdark" ] }, { "Name": "brown bear", "CR": "1", "Env": ["arctic", "forest", "hill"] }, { "Name": "half ogre", "CR": "1", "Env": ["arctic", "forest", "hill", "mountain", "underdark", "urban"] }, { "Name": "crab", "CR": "0", "Env": ["coastal"] }, { "Name": "eagle", "CR": "0", "Env": ["coastal", "grassland", "hill", "mountain"] }, { "Name": "giant crab", "CR": "1/8", "Env": ["coastal"] }, { "Name": "guard", "CR": "1/8", "Env": [ "coastal", "desert", "forest", "grassland", "hill", "mountain", "urban" ] }, { "Name": "merfolk", "CR": "1/8", "Env": ["coastal", "underwater"] }, { "Name": "poisonous snake", "CR": "1/8", "Env": ["coastal", "desert", "forest", "grassland", "hill", "swamp"] }, { "Name": "stirge", "CR": "1/8", "Env": [ "coastal", "desert", "forest", "grassland", "hill", "mountain", "swamp", "underdark", "urban" ] }, { "Name": "giant lizard", "CR": "1/4", "Env": ["coastal", "desert", "forest", "swamp", "underdark"] }, { "Name": "giant wolf spider", "CR": "1/4", "Env": ["coastal", "desert", "forest", "grassland", "hill"] }, { "Name": "pseudodragon", "CR": "1/4", "Env": ["coastal", "desert", "forest", "hill", "mountain", "urban"] }, { "Name": "pteranodon", "CR": "1/4", "Env": ["coastal", "grassland", "mountain"] }, { "Name": "sahuagin", "CR": "1/2", "Env": ["coastal", "underwater"] }, { "Name": "giant eagle", "CR": "1", "Env": ["coastal", "grassland", "hill", "mountain"] }, { "Name": "giant toad", "CR": "1", "Env": ["coastal", "desert", "forest", "swamp", "underdark"] }, { "Name": "harpy", "CR": "1", "Env": ["coastal", "forest", "hill", "mountain"] }, { "Name": "cat", "CR": "0", "Env": ["desert", "forest", "grassland", "urban"] }, { "Name": "hyena", "CR": "0", "Env": ["desert", "forest", "grassland", "hill"] }, { "Name": "jackal", "CR": "0", "Env": ["desert", "grassland"] }, { "Name": "scorpion", "CR": "0", "Env": ["desert"] }, { "Name": "vulture", "CR": "0", "Env": ["desert", "grassland", "hill"] }, { "Name": "camel", "CR": "1/8", "Env": ["desert"] }, { "Name": "flying snake", "CR": "1/8", "Env": ["desert", "forest", "grassland", "urban"] }, { "Name": "mule", "CR": "1/8", "Env": ["desert", "hill", "urban"] }, { "Name": "constrictor snake", "CR": "1/4", "Env": ["desert", "forest", "underwater"] }, { "Name": "giant poisonous snake", "CR": "1/4", "Env": ["desert", "forest", "grassland", "underdark", "urban"] }, { "Name": "dust mephit", "CR": "1/2", "Env": ["desert"] }, { "Name": "gnoll", "CR": "1/2", "Env": ["desert", "forest", "grassland", "hill"] }, { "Name": "hobgoblin", "CR": "1/2", "Env": ["desert", "forest", "grassland", "hill", "underdark"] }, { "Name": "jackalwere", "CR": "1/2", "Env": ["desert", "grassland"] }, { "Name": "swarm of insects", "CR": "1/2", "Env": [ "desert", "forest", "grassland", "hill", "swamp", "underdark", "urban" ] }, { "Name": "death dog", "CR": "1", "Env": ["desert"] }, { "Name": "giant hyena", "CR": "1", "Env": ["desert", "forest", "grassland", "hill"] }, { "Name": "giant spider", "CR": "1", "Env": ["desert", "forest", "underdark", "urban"] }, { "Name": "giant vulture", "CR": "1", "Env": ["desert", "grassland"] }, { "Name": "lion", "CR": "1", "Env": ["desert", "grassland", "hill", "mountain"] }, { "Name": "thri-keen", "CR": "1", "Env": ["desert", "grassland"] }, { "Name": "yuan-ti pureblood", "CR": "1", "Env": ["desert", "forest", "swamp", "urban"] }, { "Name": "awakened shrub", "CR": "0", "Env": ["forest"] }, { "Name": "baboon", "CR": "0", "Env": ["forest", "hill"] }, { "Name": "badger", "CR": "0", "Env": ["forest"] }, { "Name": "deer", "CR": "0", "Env": ["forest", "grassland"] }, { "Name": "giant rat", "CR": "1/8", "Env": ["forest", "swamp", "underdark", "urban"] }, { "Name": "giant weasel", "CR": "1/8", "Env": ["forest", "grassland", "hill"] }, { "Name": "mastiff", "CR": "1/8", "Env": ["forest", "hill", "urban"] }, { "Name": "twig blight", "CR": "1/8", "Env": ["forest"] }, { "Name": "blink dog", "CR": "1/4", "Env": ["forest"] }, { "Name": "boar", "CR": "1/4", "Env": ["forest", "grassland"] }, { "Name": "elk", "CR": "1/4", "Env": ["forest", "grassland", "hill"] }, { "Name": "giant badger", "CR": "1/4", "Env": ["forest"] }, { "Name": "giant frog", "CR": "1/4", "Env": ["forest", "swamp"] }, { "Name": "giant owl", "CR": "1/4", "Env": ["forest"] }, { "Name": "goblin", "CR": "1/4", "Env": ["forest", "grassland", "hill", "underdark"] }, { "Name": "kenku", "CR": "1/4", "Env": ["forest", "urban"] }, { "Name": "needle blight", "CR": "1/4", "Env": ["forest"] }, { "Name": "panther", "CR": "1/4", "Env": ["forest"] }, { "Name": "pixie", "CR": "1/4", "Env": ["forest"] }, { "Name": "sprite", "CR": "1/4", "Env": ["forest"] }, { "Name": "swarm of ravens", "CR": "1/4", "Env": ["forest", "hill", "swamp", "urban"] }, { "Name": "wolf", "CR": "1/4", "Env": ["forest", "grassland", "hill"] }, { "Name": "ape", "CR": "1/2", "Env": ["forest"] }, { "Name": "black bear", "CR": "1/2", "Env": ["forest"] }, { "Name": "giant wasp", "CR": "1/2", "Env": ["forest", "grassland", "urban"] }, { "Name": "lizardfolk", "CR": "1/2", "Env": ["forest", "swamp"] }, { "Name": "satyr", "CR": "1/2", "Env": ["forest"] }, { "Name": "vine blight", "CR": "1/2", "Env": ["forest"] }, { "Name": "worg", "CR": "1/2", "Env": ["forest", "grassland", "hill"] }, { "Name": "bugbear", "CR": "1", "Env": ["forest", "grassland", "underdark"] }, { "Name": "dire wolf", "CR": "1", "Env": ["forest", "hill"] }, { "Name": "dryad", "CR": "1", "Env": ["forest"] }, { "Name": "faerie dragon yellow or younger", "CR": "1", "Env": ["forest"] }, { "Name": "goblin boss", "CR": "1", "Env": ["forest", "grassland", "hill", "underdark"] }, { "Name": "harpy", "CR": "1", "Env": ["forest", "hill", "mountain"] }, { "Name": "tiger", "CR": "1", "Env": ["forest", "grassland"] }, { "Name": "goat", "CR": "0", "Env": ["grassland", "hill", "mountain", "urban"] }, { "Name": "axe beak", "CR": "1/4", "Env": ["grassland", "hill"] }, { "Name": "riding horse", "CR": "1/4", "Env": ["grassland", "urban"] }, { "Name": "cockatrice", "CR": "1/2", "Env": ["grassland"] }, { "Name": "giant goat", "CR": "1/2", "Env": ["grassland", "hill"] }, { "Name": "hippogriff", "CR": "1", "Env": ["grassland", "hill", "mountain"] }, { "Name": "scarecrow", "CR": "1", "Env": ["grassland"] }, { "Name": "raven", "CR": "0", "Env": ["hill", "swamp", "urban"] }, { "Name": "swarm of bats", "CR": "1/4", "Env": ["hill", "mountain", "underdark", "urban"] }, { "Name": "aarakocra", "CR": "1/4", "Env": ["mountain"] }, { "Name": "rat", "CR": "0", "Env": ["swamp", "urban"] }, { "Name": "bullywug", "CR": "1/8", "Env": ["swamp"] }, { "Name": "mud mephit", "CR": "1/8", "Env": ["swamp"] }, { "Name": "crocodile", "CR": "1/2", "Env": ["swamp", "urban"] }, { "Name": "ghoul", "CR": "1", "Env": ["swamp", "underdark", "urban"] }, { "Name": "giant fire beetle", "CR": "0", "Env": ["underdark"] }, { "Name": "shrieker", "CR": "0", "Env": ["underdark"] }, { "Name": "myconid sprout", "CR": "0", "Env": ["underdark"] }, { "Name": "flumph", "CR": "1/8", "Env": ["underdark"] }, { "Name": "drow", "CR": "1/4", "Env": ["underdark"] }, { "Name": "giant bat", "CR": "1/4", "Env": ["underdark"] }, { "Name": "giant centipede", "CR": "1/4", "Env": ["underdark", "urban"] }, { "Name": "grimlock", "CR": "1/4", "Env": ["underdark"] }, { "Name": "kuo-toa", "CR": "1/4", "Env": ["underdark"] }, { "Name": "troglodyte", "CR": "1/4", "Env": ["underdark"] }, { "Name": "violet fungus", "CR": "1/4", "Env": ["underdark"] }, { "Name": "darkmantle", "CR": "1/2", "Env": ["underdark"] }, { "Name": "deep gnome", "CR": "1/2", "Env": ["underdark"] }, { "Name": "gas spore", "CR": "1/2", "Env": ["underdark"] }, { "Name": "gray ooze", "CR": "1/2", "Env": ["underdark"] }, { "Name": "magma mephit", "CR": "1/2", "Env": ["underdark"] }, { "Name": "myconid adult", "CR": "1/2", "Env": ["underdark"] }, { "Name": "piercer", "CR": "1/2", "Env": ["underdark"] }, { "Name": "rust monster", "CR": "1/2", "Env": ["underdark"] }, { "Name": "shadow", "CR": "1/2", "Env": ["underdark", "urban"] }, { "Name": "duergar", "CR": "1", "Env": ["underdark"] }, { "Name": "fire snake", "CR": "1", "Env": ["underdark"] }, { "Name": "kuo-toa whip", "CR": "1", "Env": ["underdark"] }, { "Name": "quaggoth spore servant", "CR": "1", "Env": ["underdark"] }, { "Name": "specter", "CR": "1", "Env": ["underdark", "urban"] }, { "Name": "quipper", "CR": "0", "Env": ["underwater"] }, { "Name": "steam mephit", "CR": "1/4", "Env": ["underwater"] }, { "Name": "giant sea horse", "CR": "1/2", "Env": ["underwater"] }, { "Name": "reef shark", "CR": "1/2", "Env": ["underwater"] }, { "Name": "giant octopus", "CR": "1", "Env": ["underwater"] }, { "Name": "swarm of quippers", "CR": "1", "Env": ["underwater"] }, { "Name": "cultist", "CR": "1/8", "Env": ["urban"] }, { "Name": "noble", "CR": "1/8", "Env": ["urban"] }, { "Name": "pony", "CR": "1/8", "Env": ["urban"] }, { "Name": "acolyte", "CR": "1/4", "Env": ["urban"] }, { "Name": "draft horse", "CR": "1/4", "Env": ["urban"] }, { "Name": "skeleton", "CR": "1/4", "Env": ["urban"] }, { "Name": "smoke mephit", "CR": "1/4", "Env": ["urban"] }, { "Name": "swarm of rats", "CR": "1/4", "Env": ["urban"] }, { "Name": "zombie", "CR": "1/4", "Env": ["urban"] }, { "Name": "thug", "CR": "1/2", "Env": ["urban"] }, { "Name": "warhorse", "CR": "1/2", "Env": ["urban"] }, { "Name": "bandit captain", "CR": "2", "Env": ["arctic", "coastal", "desert", "forest", "hill", "urban"], "NPC": True }, { "Name": "berserker", "CR": "2", "Env": ["arctic", "coastal", "desert", "forest", "hill", "mountain"], "NPC": True }, { "Name": "druid", "CR": "2", "Env": [ "arctic", "coastal", "desert", "forest", "grassland", "hill", "mountain", "swamp", "underdark" ], "NPC": True }, { "Name": "griffon", "CR": "2", "Env": ["arctic", "coastal", "grassland", "hill", "mountain"] }, { "Name": "ogre", "CR": "2", "Env": [ "arctic", "coastal", "desert", "forest", "grassland", "hill", "mountain", "swamp", "underdark" ] }, { "Name": "orc Eye of Gruumsh", "CR": "2", "Env": [ "arctic", "forest", "grassland", "hill", "mountain", "swamp", "underdark" ] }, { "Name": "orog", "CR": "2", "Env": ["arctic", "forest", "grassland", "hill", "mountain", "underdark"] }, { "Name": "polar bear", "CR": "2", "Env": ["arctic", "underdark"] }, { "Name": "saber toothed tiger", "CR": "2", "Env": ["arctic", "mountain"] }, { "Name": "manticore", "CR": "3", "Env": ["arctic", "coastal", "hill", "mountain"] }, { "Name": "veteran", "CR": "3", "Env": [ "arctic", "coastal", "forest", "grassland", "hill", "mountain", "underdark", "urban" ], "NPC": True }, { "Name": "winter wolf", "CR": "3", "Env": ["arctic"] }, { "Name": "yeti", "CR": "3", "Env": ["arctic"] }, { "Name": "revenant", "CR": "5", "Env": ["arctic", "desert", "forest", "hill", "swamp", "urban"] }, { "Name": "merrow", "CR": "2", "Env": ["coastal", "underwater"] }, { "Name": "plesiosaurus", "CR": "2", "Env": ["coastal", "underwater"] }, { "Name": "sahuagin priestess", "CR": "2", "Env": ["coastal", "underwater"] }, { "Name": "sea hag", "CR": "2", "Env": ["coastal", "underwater"] }, { "Name": "banshee", "CR": "4", "Env": ["coastal", "forest"] }, { "Name": "sahuagin baron", "CR": "5", "Env": ["coastal", "underwater"] }, { "Name": "water elemental", "CR": "5", "Env": ["coastal", "underwater"] }, { "Name": "giant constrictor snake", "CR": "2", "Env": ["desert", "forest", "swamp", "underdark"] }, { "Name": "gnoll pack lord", "CR": "2", "Env": ["desert", "forest", "grassland", "hill"], "NPC": True }, { "Name": "giant scorpion", "CR": "3", "Env": ["desert"] }, { "Name": "hobgoblin captain", "CR": "3", "Env": ["desert", "forest", "grassland", "hill", "underdark"], "NPC": True }, { "Name": "mummy", "CR": "3", "Env": ["desert"] }, { "Name": "phase spider", "CR": "3", "Env": ["desert", "forest", "grassland", "hill", "underdark", "urban"] }, { "Name": "wight", "CR": "3", "Env": ["desert", "swamp", "underdark", "urban"] }, { "Name": "yuan-ti malison", "CR": "3", "Env": ["desert", "forest", "swamp"] }, { "Name": "couatl", "CR": "4", "Env": ["desert", "forest", "grassland", "urban"] }, { "Name": "gnoll hand of Yeenoghu", "CR": "4", "Env": ["desert", "forest", "grassland", "hill"] }, { "Name": "lamia", "CR": "4", "Env": ["desert"] }, { "Name": "weretiger", "CR": "4", "Env": ["desert", "forest", "grassland"] }, { "Name": "air elemental", "CR": "5", "Env": ["desert", "mountain"] }, { "Name": "fire elemental", "CR": "5", "Env": ["desert"] }, { "Name": "revenant", "CR": "5", "Env": ["desert", "hill", "swamp"] }, { "Name": "ankheg", "CR": "2", "Env": ["forest"] }, { "Name": "awakened tree", "CR": "2", "Env": ["forest"] }, { "Name": "centaur", "CR": "2", "Env": ["forest", "grassland"], "NPC": True }, { "Name": "ettercap", "CR": "2", "Env": ["forest"] }, { "Name": "faerie dragon green or older", "CR": "2", "Env": ["forest"] }, { "Name": "giant boar", "CR": "2", "Env": ["forest", "grassland", "hill"] }, { "Name": "giant elk", "CR": "2", "Env": ["forest", "grassland", "hill", "mountain"] }, { "Name": "grick", "CR": "2", "Env": ["forest", "underdark"] }, { "Name": "lizardfolk shaman", "CR": "2", "Env": ["forest"] }, { "Name": "pegasus", "CR": "2", "Env": ["forest", "grassland", "hill"] }, { "Name": "swarm of poisonous snakes", "CR": "2", "Env": ["forest", "swamp"] }, { "Name": "wererat", "CR": "2", "Env": ["forest", "urban"] }, { "Name": "will-o-wisp", "CR": "2", "Env": ["forest", "swamp", "urban"] }, { "Name": "displacer beast", "CR": "3", "Env": ["forest"] }, { "Name": "green hag", "CR": "3", "Env": ["forest", "hill", "swamp"], "NPC": True }, { "Name": "owlbear", "CR": "3", "Env": ["forest"] }, { "Name": "werewolf", "CR": "3", "Env": ["forest", "hill"] }, { "Name": "wereboar", "CR": "4", "Env": ["forest", "grassland", "hill"] }, { "Name": "gorgon", "CR": "5", "Env": ["forest", "grassland", "hill"] }, { "Name": "shambling mound", "CR": "5", "Env": ["forest", "swamp"] }, { "Name": "troll", "CR": "5", "Env": ["forest", "hill", "mountain", "swamp", "underdark"] }, { "Name": "unicorn", "CR": "5", "Env": ["forest"] }, { "Name": "allosaurus", "CR": "2", "Env": ["grassland"] }, { "Name": "ankheg", "CR": "2", "Env": ["grassland"] }, { "Name": "rhinoceros", "CR": "2", "Env": ["grassland"] }, { "Name": "ankylosaurus", "CR": "3", "Env": ["grassland"] }, { "Name": "bulette", "CR": "5", "Env": ["grassland", "hill", "mountain"] }, { "Name": "triceratops", "CR": "5", "Env": ["grassland"] }, { "Name": "ettin", "CR": "4", "Env": ["hill", "mountain", "underdark"] }, { "Name": "hill giant", "CR": "5", "Env": ["hill"] }, { "Name": "basilisk", "CR": "3", "Env": ["mountain"] }, { "Name": "hell hound", "CR": "3", "Env": ["mountain", "underdark"] }, { "Name": "ghast", "CR": "2", "Env": ["swamp", "underdark"] }, { "Name": "giant crocodile", "CR": "5", "Env": ["swamp"] }, { "Name": "carrion crawler", "CR": "2", "Env": ["underdark"] }, { "Name": "gargoyle", "CR": "2", "Env": ["underdark", "urban"] }, { "Name": "gelatinous cube", "CR": "2", "Env": ["underdark"] }, { "Name": "gibbering mouther", "CR": "2", "Env": ["underdark"] }, { "Name": "intellect devourer", "CR": "2", "Env": ["underdark"] }, { "Name": "mimic", "CR": "2", "Env": ["underdark", "urban"] }, { "Name": "minotaur skeleton", "CR": "2", "Env": ["underdark"] }, { "Name": "nothic", "CR": "2", "Env": ["underdark"] }, { "Name": "ochre jelly", "CR": "2", "Env": ["underdark"] }, { "Name": "quaggoth", "CR": "2", "Env": ["underdark"] }, { "Name": "doppelganger", "CR": "3", "Env": ["underdark", "urban"] }, { "Name": "grell", "CR": "3", "Env": ["underdark"] }, { "Name": "hook horror", "CR": "3", "Env": ["underdark"] }, { "Name": "kuo-toa monitor", "CR": "3", "Env": ["underdark"] }, { "Name": "minotaur", "CR": "3", "Env": ["underdark"] }, { "Name": "quaggoth thonot", "CR": "3", "Env": ["underdark"] }, { "Name": "spectator", "CR": "3", "Env": ["underdark"] }, { "Name": "water weird", "CR": "3", "Env": ["underdark"] }, { "Name": "black pudding", "CR": "4", "Env": ["underdark"] }, { "Name": "bone naga", "CR": "4", "Env": ["underdark"] }, { "Name": "chuul", "CR": "4", "Env": ["underdark"] }, { "Name": "flameskull", "CR": "4", "Env": ["underdark"] }, { "Name": "ghost", "CR": "4", "Env": ["underdark", "urban"] }, { "Name": "beholder zombie", "CR": "5", "Env": ["underdark"] }, { "Name": "drow elite warrior", "CR": "5", "Env": ["underdark"], "NPC": True }, { "Name": "earth elemental", "CR": "5", "Env": ["underdark"] }, { "Name": "otyugh", "CR": "5", "Env": ["underdark"] }, { "Name": "roper", "CR": "5", "Env": ["underdark"] }, { "Name": "salamander", "CR": "5", "Env": ["underdark"] }, { "Name": "umber hulk", "CR": "5", "Env": ["underdark"] }, { "Name": "vampire spawn", "CR": "5", "Env": ["underdark", "urban"] }, { "Name": "wraith", "CR": "5", "Env": ["underdark"] }, { "Name": "xorn", "CR": "5", "Env": ["underdark"] }, { "Name": "hunter shark", "CR": "2", "Env": ["underwater"] }, { "Name": "killer whale", "CR": "3", "Env": ["underwater"] }, { "Name": "giant shark", "CR": "5", "Env": ["underwater"] }, { "Name": "cult fanatic", "CR": "2", "Env": ["urban"], "NPC": True }, { "Name": "priest", "CR": "2", "Env": ["urban"], "NPC": True }, { "Name": "knight", "CR": "3", "Env": ["urban"], "NPC": True }, { "Name": "succubus", "CR": "4", "Env": ["urban"] }, { "Name": "incubus", "CR": "4", "Env": ["urban"] }, { "Name": "cambion", "CR": "5", "Env": ["urban"] }, { "Name": "gladiator", "CR": "5", "Env": ["urban"], "NPC": True }, { "Name": "mammoth", "CR": "6", "Env": ["arctic"] }, { "Name": "young white dragon", "CR": "6", "Env": ["arctic"] }, { "Name": "frost giant", "CR": "8", "Env": ["arctic", "mountain"] }, { "Name": "abominable yeti", "CR": "9", "Env": ["arctic"] }, { "Name": "remorhaz", "CR": "11", "Env": ["arctic"] }, { "Name": "roc", "CR": "11", "Env": ["arctic", "coastal", "desert", "hill", "mountain"] }, { "Name": "adult white dragon", "CR": "13", "Env": ["arctic"], "NPC": True }, { "Name": "ancient white dragon", "CR": "20", "Env": ["arctic"], "NPC": True }, { "Name": "cyclops", "CR": "6", "Env": ["coastal", "desert", "grassland", "hill", "mountain", "underdark"] }, { "Name": "young bronze dragon", "CR": "8", "Env": ["coastal"] }, { "Name": "young blue dragon", "CR": "9", "Env": ["coastal", "desert"] }, { "Name": "djinni", "CR": "11", "Env": ["coastal"], "NPC": True }, { "Name": "marid", "CR": "11", "Env": ["coastal", "underwater"] }, { "Name": "storm giant", "CR": "13", "Env": ["coastal", "underwater"] }, { "Name": "adult bronze dragon", "CR": "15", "Env": ["coastal"], "NPC": True }, { "Name": "adult blue dragon", "CR": "16", "Env": ["coastal", "desert"], "NPC": True }, { "Name": "dragon turtle", "CR": "17", "Env": ["coastal", "underwater"] }, { "Name": "ancient bronze dragon", "CR": "22", "Env": ["coastal"], "NPC": True }, { "Name": "ancient blue dragon", "CR": "23", "Env": ["coastal", "desert"], "NPC": True }, { "Name": "medusa", "CR": "6", "Env": ["desert"] }, { "Name": "young brass dragon", "CR": "6", "Env": ["desert"] }, { "Name": "yuan-ti abomination", "CR": "7", "Env": ["desert", "forest", "swamp"], "NPC": True }, { "Name": "gaurdian naga", "CR": "10", "Env": ["desert", "forest"] }, { "Name": "efreeti", "CR": "11", "Env": ["desert"] }, { "Name": "gynosphinx", "CR": "11", "Env": ["desert"] }, { "Name": "adult brass dragon", "CR": "13", "Env": ["desert"], "NPC": True }, { "Name": "mummy lord", "CR": "15", "Env": ["desert"] }, { "Name": "purple worm", "CR": "15", "Env": ["desert"] }, { "Name": "adult blue dracolich", "CR": "17", "Env": ["desert"], "NPC": True }, { "Name": "androsphinx", "CR": "17", "Env": ["desert"] }, { "Name": "ancient brass dragon", "CR": "20", "Env": ["desert"], "NPC": True }, { "Name": "giant ape", "CR": "7", "Env": ["forest"] }, { "Name": "grick alpha", "CR": "7", "Env": ["forest", "underdark"] }, { "Name": "oni", "CR": "7", "Env": ["forest", "urban"] }, { "Name": "young green dragon", "CR": "8", "Env": ["forest"] }, { "Name": "treant", "CR": "9", "Env": ["forest"] }, { "Name": "guardian naga", "CR": "10", "Env": ["forest"] }, { "Name": "young gold dragon", "CR": "10", "Env": ["forest", "grassland"] }, { "Name": "adult green dragon", "CR": "15", "Env": ["forest"], "NPC": True }, { "Name": "adult gold dragon", "CR": "17", "Env": ["forest", "grassland"], "NPC": True }, { "Name": "ancient green dragon", "CR": "22", "Env": ["forest"], "NPC": True }, { "Name": "ancient gold dragon", "CR": "24", "Env": ["forest", "grassland"], "NPC": True }, { "Name": "chimera", "CR": "6", "Env": ["grassland", "hill", "mountain", "underdark"] }, { "Name": "tyrannosaurus rex", "CR": "8", "Env": ["grassland"] }, { "Name": "galeb duhr", "CR": "6", "Env": ["hill", "mountain"] }, { "Name": "wyvern", "CR": "6", "Env": ["hill", "mountain"] }, { "Name": "stone giant", "CR": "7", "Env": ["hill", "mountain", "underdark"] }, { "Name": "young copper dragon", "CR": "7", "Env": ["hill"] }, { "Name": "young red dragon", "CR": "10", "Env": ["hill", "mountain"] }, { "Name": "adult copper dragon", "CR": "14", "Env": ["hill"], "NPC": True }, { "Name": "adult red dragon", "CR": "17", "Env": ["hill", "mountain"], "NPC": True }, { "Name": "ancient copper dragon", "CR": "21", "Env": ["hill"], "NPC": True }, { "Name": "ancient red dragon", "CR": "24", "Env": ["hill", "mountain"], "NPC": True }, { "Name": "cloud giant", "CR": "9", "Env": ["mountain"] }, { "Name": "fire giant", "CR": "9", "Env": ["mountain", "underdark"] }, { "Name": "young silver dragon", "CR": "9", "Env": ["mountain"] }, { "Name": "adult silver dragon", "CR": "16", "Env": ["mountain"], "NPC": True }, { "Name": "ancient silver dragon", "CR": "23", "Env": ["mountain"], "NPC": True }, { "Name": "young black dragon", "CR": "7", "Env": ["swamp"] }, { "Name": "hydra", "CR": "8", "Env": ["swamp"] }, { "Name": "adult black dragon", "CR": "14", "Env": ["swamp"], "NPC": True }, { "Name": "ancient black dragon", "CR": "21", "Env": ["swamp"], "NPC": True }, { "Name": "drider", "CR": "6", "Env": ["underdark"] }, { "Name": "drow mage", "CR": "7", "Env": ["underdark"] }, { "Name": "mind flayer", "CR": "8", "Env": ["underdark"], "NPC": True }, { "Name": "arcanist", "CR": "8", "Env": ["underdark"], "NPC": True }, { "Name": "spirit naga", "CR": "8", "Env": ["underdark"] }, { "Name": "aboleth", "CR": "10", "Env": ["underdark"] }, { "Name": "behir", "CR": "11", "Env": ["underdark"] }, { "Name": "dao", "CR": "11", "Env": ["underdark"], "NPC": True }, { "Name": "beholder", "CR": "13", "Env": ["underdark"], "NPC": True }, { "Name": "young red shadow dragon", "CR": "13", "Env": ["underdark"] }, { "Name": "death tyrant", "CR": "14", "Env": ["underdark"] }, { "Name": "purple worm", "CR": "15", "Env": ["underdark"] }, { "Name": "kraken", "CR": "23", "Env": ["underwater"] }, { "Name": "invisible stalker", "CR": "6", "Env": ["urban"] }, { "Name": "mage", "CR": "6", "Env": ["urban"], "NPC": True }, { "Name": "shield guardian", "CR": "7", "Env": ["urban"] }, { "Name": "assassin", "CR": "8", "Env": ["urban"], "NPC": True }, { "Name": "gray slaad", "CR": "9", "Env": ["urban"] }, { "Name": "young silver dragon", "CR": "9", "Env": ["urban"] }, { "Name": "archmage", "CR": "12", "Env": ["urban"], "NPC": True }, { "Name": "rakshasa", "CR": "13", "Env": ["urban"], "NPC": True }, { "Name": "vampire", "CR": "13", "Env": ["urban"], "NPC": True }, { "Name": "spellcaster vampire", "CR": "15", "Env": ["urban"], "NPC": True }, { "Name": "warrior vampire", "CR": "15", "Env": ["urban"], "NPC": True }, { "Name": "adult silver dragon", "CR": "16", "Env": ["urban"], "NPC": True }, { "Name": "ancient silver dragon", "CR": "23", "Env": ["urban"], "NPC": True }, { "Name": "tarrasque", "CR": "30", "Env": ["urban"] }, { "Name": "ice devil", "CR": "14", "Env": [] }, { "Name": "adult blue dracolich", "CR": "17", "Env": [], "NPC": True }, { "Name": "death knight", "CR": "17", "Env": [], "NPC": True }, { "Name": "goristro", "CR": "17", "Env": [] }, { "Name": "demilich not in lair", "CR": "18", "Env": [], "NPC": True }, { "Name": "balor", "CR": "19", "Env": [] }, { "Name": "demilich in lair", "CR": "20", "Env": [], "NPC": True }, { "Name": "pit fiend", "CR": "20", "Env": [] }, { "Name": "lich not in lair", "CR": "21", "Env": [] }, { "Name": "solar", "CR": "21", "Env": [], "NPC": True }, { "Name": "lich in lair", "CR": "22", "Env": [] }, { "Name": "Empyrean", "CR": "23", "Env": [] }, # Volo's Guide to Monsters { "Name": "gnoll witherling", "CR": "1/4", "Env": ["arctic", "forest", "grassland", "hill"] }, { "Name": "gnoll hunter", "CR": "1/2", "Env": ["arctic", "forest", "grassland", "hill"] }, { "Name": "gnolll flesh gnawer", "CR": "1", "Env": ["arctic", "forest", "grassland", "hill"] }, { "Name": "guard drake white", "CR": "2", "Env": ["arctic", "urban"] }, { "Name": "warlock of the archfey", "CR": "4", "Env": ["arctic", "swamp", "urban"], "NPC": True }, { "Name": "warlock of the great old one", "CR": "6", "Env": ["arctic", "hill", "mountain", "urban"], "NPC": True }, { "Name": "bheur hag", "CR": "7", "Env": ["arctic"], "NPC": True }, { "Name": "warlock of the fiend", "CR": "7", "Env": ["arctic", "desert", "underdark", "urban"], "NPC": True }, { "Name": "shoosuva", "CR": "8", "Env": ["arctic", "forest", "grassland", "hill"] }, { "Name": "flind", "CR": "9", "Env": ["arctic", "forest", "grassland", "hill"] }, { "Name": "frost giant everlasting one", "CR": "12", "Env": ["arctic", "coastal"] }, { "Name": "storm giant quintessent", "CR": "16", "Env": ["arctic", "coastal", "underwater"] }, { "Name": "dolphin", "CR": "1/8", "Env": ["coastal", "underwater"] }, { "Name": "dimetrodon", "CR": "1/4", "Env": ["coastal", "swamp"] }, { "Name": "sea spawn", "CR": "1", "Env": ["coastal", "underwater"] }, { "Name": "quetzalcoatlus", "CR": "2", "Env": ["coastal", "hill"] }, { "Name": "deep scion", "CR": "3", "Env": ["coastal", "underwater"] }, { "Name": "swashbuckler", "CR": "3", "Env": ["coastal", "urban"] }, { "Name": "kraken priest", "CR": "5", "Env": ["coastal", "underwater"], "NPC": True }, { "Name": "stone giant dreamwalker", "CR": "10", "Env": ["coastal", "hill", "mountain"] }, { "Name": "morkoth", "CR": "11", "Env": ["coastal", "underwater"] }, { "Name": "ki-rin", "CR": "12", "Env": ["coastal", "grassland", "mountain"] }, { "Name": "firenewt", "CR": "1/2", "Env": ["desert", "hill", "mountain", "underdark"] }, { "Name": "vargouille", "CR": "1", "Env": ["desert", "swamp", "underdark"] }, { "Name": "guard drake blue", "CR": "2", "Env": ["desert", "urban"] }, { "Name": "yuan-ti broodguard", "CR": "2", "Env": ["desert", "forest", "underdark"] }, { "Name": "leucrotta", "CR": "3", "Env": ["desert", "grassland"] }, { "Name": "yuan-ti mind whisperer", "CR": "4", "Env": ["desert", "forest", "underdark"] }, { "Name": "yuan-ti nightmare speaker", "CR": "4", "Env": ["desert", "forest", "underdark"] }, { "Name": "spawn of Kyuss", "CR": "5", "Env": ["desert", "underdark"] }, { "Name": "tlincalli", "CR": "5", "Env": ["desert"] }, { "Name": "yuan-ti pit master", "CR": "5", "Env": ["desert", "forest", "underdark"] }, { "Name": "champion", "CR": "9", "Env": ["desert", "urban"] }, { "Name": "necromancer", "CR": "9", "Env": ["desert", "urban"], "NPC": True }, { "Name": "war priest", "CR": "9", "Env": ["desert", "urban"], "NPC": True }, { "Name": "yuan-ti anathema", "CR": "12", "Env": ["desert", "forest", "underdark"] }, { "Name": "boggle", "CR": "1/8", "Env": ["forest", "hill", "underdark", "urban"] }, { "Name": "grung", "CR": "1/4", "Env": ["forest"] }, { "Name": "kobold inventor", "CR": "1/4", "Env": ["forest", "hill", "mountain", "underdark", "inventor"] }, { "Name": "vegepygmy", "CR": "1/4", "Env": ["forest", "swamp"] }, { "Name": "velociraptor", "CR": "1/4", "Env": ["forest", "grassland"] }, { "Name": "darkling", "CR": "1/2", "Env": ["forest", "swamp", "underdark", "urban"] }, { "Name": "orc nurtured one of yurtrus", "CR": "1/2", "Env": ["forest", "grassland", "hill", "mountain", "underdark"] }, { "Name": "deinonychus", "CR": "1", "Env": ["forest", "grassland", "hill"] }, { "Name": "grung wildling", "CR": "1", "Env": ["forest"] }, { "Name": "kobold dragonshield", "CR": "1", "Env": ["forest", "hill", "mountain", "underdark"] }, { "Name": "kobold scale sorcerer", "CR": "1", "Env": ["forest", "hill", "mountain", "underdark", "urban"] }, { "Name": "nilbog", "CR": "1", "Env": ["forest", "hill", "underdark"] }, { "Name": "quickling", "CR": "1", "Env": ["forest"] }, { "Name": "thorny", "CR": "1", "Env": ["forest", "swamp"] }, { "Name": "darkling elder", "CR": "2", "Env": ["forest", "swamp", "underdark"] }, { "Name": "grung elite warrior", "CR": "2", "Env": ["forest"] }, { "Name": "guard drake green", "CR": "2", "Env": ["forest", "urban"] }, { "Name": "hobgoblin iron shadow", "CR": "2", "Env": ["forest", "grassland", "hill"], "NPC": True }, { "Name": "meenlock", "CR": "2", "Env": ["forest", "swamp", "urban"] }, { "Name": "orc hand of yurtrus", "CR": "2", "Env": ["forest", "grassland", "hill", "mountain", "underdark"] }, { "Name": "shadow mastiff", "CR": "2", "Env": ["forest", "hill", "swamp"] }, { "Name": "vegepygmy chief", "CR": "2", "Env": ["forest", "swamp"], "NPC": True }, { "Name": "archer", "CR": "3", "Env": ["forest", "urban"] }, { "Name": "flail snail", "CR": "3", "Env": ["forest", "swamp", "underdark"] }, { "Name": "orc red fang of shargaas", "CR": "3", "Env": ["forest", "hill", "mountain", "underdark", "urban"] }, { "Name": "redcap", "CR": "3", "Env": ["forest", "hill", "swamp"] }, { "Name": "barghest", "CR": "4", "Env": ["forest", "grassland", "hill", "mountain", "underdark"] }, { "Name": "girallon", "CR": "4", "Env": ["forest"] }, { "Name": "hobgoblin devastator", "CR": "4", "Env": ["forest", "grassland", "hill"], "NPC": True }, { "Name": "orc blade of ilneval", "CR": "4", "Env": ["forest", "grassland", "hill", "mountain", "underdark"] }, { "Name": "stegosaurus", "CR": "4", "Env": ["forest", "grassland"] }, { "Name": "yeth hound", "CR": "4", "Env": ["forest", "grassland", "hill"] }, { "Name": "brontosaurus", "CR": "5", "Env": ["forest", "grassland"] }, { "Name": "wood woad", "CR": "5", "Env": ["forest"] }, { "Name": "korred", "CR": "7", "Env": ["forest"] }, { "Name": "archdruid", "CR": "12", "Env": ["forest", "mountain", "swamp", "underwater"], "NPC": True }, { "Name": "cow", "CR": "1/4", "Env": ["grassland", "underdark", "urban"] }, { "Name": "hadrosaurus", "CR": "1/4", "Env": ["grassland"] }, { "Name": "aurochs", "CR": "2", "Env": ["grassland", "hill", "mountain"] }, { "Name": "stegosaurus", "CR": "3", "Env": ["grassland"] }, { "Name": "mouth of grolantor", "CR": "6", "Env": ["grassland", "hill"] }, { "Name": "neogi hatchling", "CR": "1/8", "Env": ["hill", "underdark"] }, { "Name": "xvart", "CR": "1/8", "Env": ["hill", "underdark"] }, { "Name": "firenewt warlock of imix", "CR": "1", "Env": ["hill", "mountain", "underdark"] }, { "Name": "giant strider", "CR": "1", "Env": ["hill", "mountain", "underdark"] }, { "Name": "xvart marlock of raxivort", "CR": "1", "Env": ["hill", "underdark"] }, { "Name": "quetzalcoatlus", "CR": "2", "Env": ["hill", "mountain"] }, { "Name": "neogi", "CR": "3", "Env": ["hill", "underdark"] }, { "Name": "neogi master", "CR": "4", "Env": ["hill", "underdark"] }, { "Name": "tanarukk", "CR": "5", "Env": ["hill", "mountain", "underdark"] }, { "Name": "annis hag", "CR": "6", "Env": ["hill", "mountain"], "NPC": True }, { "Name": "guard drake red", "CR": "2", "Env": ["mountain", "underdark", "urban"] }, { "Name": "cloud giant smiling one", "CR": "11", "Env": ["mountain"] }, { "Name": "fire giant dreadnought", "CR": "14", "Env": ["mountain", "underdark"] }, { "Name": "dimetrodon", "CR": "1/4", "Env": ["swamp"] }, { "Name": "swarm of rot grubs", "CR": "1/2", "Env": ["swamp", "underdark"] }, { "Name": "vargouille", "CR": "1", "Env": ["swamp", "underdark"] }, { "Name": "guard drake black", "CR": "2", "Env": ["swamp", "urban"] }, { "Name": "catoblepas", "CR": "5", "Env": ["swamp"] }, { "Name": "froghemoth", "CR": "10", "Env": ["swamp", "underdark"] }, { "Name": "cranium rat", "CR": "0", "Env": ["underdark", "urban"] }, { "Name": "chitine", "CR": "1/2", "Env": ["underdark"] }, { "Name": "gazer", "CR": "1/2", "Env": ["underdark"] }, { "Name": "cave fisher", "CR": "3", "Env": ["underdark"] }, { "Name": "choldrith", "CR": "3", "Env": ["underdark"] }, { "Name": "neogi", "CR": "3", "Env": ["underdark"] }, { "Name": "slithering tracker", "CR": "3", "Env": ["underdark", "urban"] }, { "Name": "trapper", "CR": "3", "Env": ["underdark"] }, { "Name": "babau", "CR": "4", "Env": ["underdark", "urban"] }, { "Name": "mindwitness", "CR": "5", "Env": ["underdark"] }, { "Name": "swarm of cranium rats", "CR": "5", "Env": ["underdark", "urban"] }, { "Name": "draegloth", "CR": "7", "Env": ["underdark"] }, { "Name": "blackguard", "CR": "8", "Env": ["underdark", "urban"] }, { "Name": "ulithharid", "CR": "9", "Env": ["underdark"] }, { "Name": "ashoon", "CR": "10", "Env": ["underdark"] }, { "Name": "death kiss", "CR": "10", "Env": ["underdark"] }, { "Name": "devourer", "CR": "13", "Env": ["underdark"] }, { "Name": "neothelid", "CR": "13", "Env": ["underdark"] }, { "Name": "elder brain", "CR": "14", "Env": ["underdark"] }, { "Name": "mind flayer lich", "CR": "22", "Env": ["underdark"], "NPC": True }, { "Name": "apprentice", "CR": "1/8", "Env": ["urban"] }, { "Name": "bard", "CR": "2", "Env": ["urban"] }, { "Name": "illusionist", "CR": "3", "Env": ["urban"], "NPC": True }, { "Name": "martial arts adept", "CR": "3", "Env": ["urban"], "NPC": True }, { "Name": "banderhobb", "CR": "5", "Env": ["urban"] }, { "Name": "enchanter", "CR": "5", "Env": ["urban"], "NPC": True }, { "Name": "master thief", "CR": "5", "Env": ["urban"], "NPC": True }, { "Name": "transmuter", "CR": "5", "Env": ["urban"], "NPC": True }, { "Name": "bodak", "CR": "6", "Env": ["urban"] }, { "Name": "conjurer", "CR": "6", "Env": ["urban"], "NPC": True }, { "Name": "diviner", "CR": "8", "Env": ["urban"], "NPC": True }, { "Name": "abjurer", "CR": "9", "Env": ["urban"], "NPC": True }, { "Name": "evoker", "CR": "9", "Env": ["urban"], "NPC": True }, { "Name": "warlord", "CR": "12", "Env": ["urban"], "NPC": True }, # Mordenkainen's Tome of Foes { "Name": "vampiric mist", "CR": "3", "Env": [ "arctic", "coastal", "forest", "grassland", "mountain", "swamp", "underdark", "urban" ] }, { "Name": "the lost", "CR": "7", "Env": [ "arctic", "desert", "forest", "mountain", "swamp", "underdark", "urban" ] }, { "Name": "frost salamander", "CR": "9", "Env": ["arctic"] }, { "Name": "winter eladrin", "CR": "10", "Env": ["arctic", "forest"], "NPC": True }, { "Name": "boneclaw", "CR": "12", "Env": ["arctic", "desert", "urban"] }, { "Name": "dire troll", "CR": "13", "Env": ["arctic", "forest", "hill", "mountain", "underdark"] }, { "Name": "nightwalker", "CR": "20", "Env": ["arctic", "desert", "swamp", "underdark"] }, { "Name": "elder tempest", "CR": "23", "Env": ["arctic", "grassland", "hill", "mountain"] }, { "Name": "tortle", "CR": "1/4", "Env": ["coastal"] }, { "Name": "skulk", "CR": "1/2", "Env": ["coastal", "forest", "swamp", "underdark", "urban"] }, { "Name": "tortle druid", "CR": "2", "Env": ["coastal"] }, { "Name": "merrenoloth", "CR": "3", "Env": ["coastal"] }, { "Name": "canoloth", "CR": "8", "Env": ["coastal", "underdark", "urban"] }, { "Name": "balhannoth", "CR": "11", "Env": ["coastal", "mountain", "underdark"] }, { "Name": "spirit troll", "CR": "11", "Env": ["coastal", "forest", "swamp", "underdark"] }, { "Name": "eidolon", "CR": "12", "Env": ["coastal", "desert", "forest", "mountain", "urban"] }, { "Name": "wastrilith", "CR": "13", "Env": ["coastal", "swamp", "underdark"] }, { "Name": "blue abishai", "CR": "17", "Env": ["coastal", "urban"] }, { "Name": "nagpa", "CR": "17", "Env": ["coastal", "desert", "forest", "swamp", "underdark", "urban"] }, { "Name": "levithan", "CR": "20", "Env": ["cosatal", "underwater"] }, { "Name": "elder tempest", "CR": "23", "Env": ["coastal", "grassland", "hill", "mountain"] }, { "Name": "young kruthik", "CR": "1/8", "Env": ["desert", "mountain", "underdark"] }, { "Name": "meazel", "CR": "1", "Env": [ "desert", "forest", "grassland", "hill", "mountain", "swamp", "underdark", "urban" ] }, { "Name": "stone cursed", "CR": "1", "Env": ["desert", "mountain", "urban"] }, { "Name": "adult kruthik", "CR": "2", "Env": ["desert", "mountain", "underdark"] }, { "Name": "berbalang", "CR": "2", "Env": ["desert"] }, { "Name": "dybbuk", "CR": "4", "Env": ["desert", "urban"] }, { "Name": "kruthik hive lord", "CR": "5", "Env": ["desert", "mountain", "underdark"] }, { "Name": "howler", "CR": "8", "Env": ["desert", "grassland", "hill", "underdark"] }, { "Name": "rot troll", "CR": "9", "Env": ["desert", "forest", "swamp", "underdark"] }, { "Name": "the lonely", "CR": "9", "Env": ["desert", "mountain", "underdark", "urban"] }, { "Name": "githyanki gish", "CR": "10", "Env": ["desert", "mountain", "urban"], "NPC": True }, { "Name": "githzerai enlightened", "CR": "10", "Env": ["desert", "mountain", "urban"], "NPC": True }, { "Name": "orthon", "CR": "10", "Env": ["desert", "underdark", "urban"] }, { "Name": "summer eladrin", "CR": "10", "Env": ["desert", "forest"], "NPC": True }, { "Name": "githyanki kith'rak", "CR": "12", "Env": ["desert", "mountain", "urban"], "NPC": True }, { "Name": "oinoloth", "CR": "12", "Env": ["desert", "underdark"] }, { "Name": "githyanki supreme commander", "CR": "14", "Env": ["desert", "mountain", "urban"], "NPC": True }, { "Name": "retriever", "CR": "14", "Env": ["desert", "forest", "underdark"] }, { "Name": "skull lord", "CR": "15", "Env": ["desert", "swamp", "underdark"] }, { "Name": "phoenix", "CR": "16", "Env": ["desert", "mountain"] }, { "Name": "zaratan", "CR": "22", "Env": ["desert", "forest", "hill", "mountain", "underdark"] }, { "Name": "bronze scout", "CR": "1", "Env": ["forest", "grassland", "mountain"] }, { "Name": "choker", "CR": "1", "Env": ["forest", "mountain", "underdark"] }, { "Name": "iron cobra", "CR": "4", "Env": ["forest", "grassland", "hill", "mountain"] }, { "Name": "stone defender", "CR": "4", "Env": ["forest", "grassland", "hill", "mountain"] }, { "Name": "oaken bolter", "CR": "5", "Env": ["forest", "grassland", "hill", "mountain"] }, { "Name": "shadow dancer", "CR": "7", "Env": ["forest", "underdark", "urban"] }, { "Name": "venom troll", "CR": "7", "Env": ["forest", "swamp", "underdark"] }, { "Name": "corpse flower", "CR": "8", "Env": ["forest", "swamp", "urban"] }, { "Name": "autumn eladrin", "CR": "10", "Env": ["forest"], "NPC": True }, { "Name": "ogre bolt launcher", "CR": "2", "Env": ["grassland", "hill", "mountain"] }, { "Name": "ogre howdah", "CR": "2", "Env": ["grassland", "hill", "mountain"] }, { "Name": "ogre chain brute", "CR": "3", "Env": ["grassland", "hill", "mountain"] }, { "Name": "sword wraith warrior", "CR": "3", "Env": ["grassland", "swamp"] }, { "Name": "ogre battering ram", "CR": "4", "Env": ["grassland", "hill", "mountain"] }, { "Name": "sword wraith commander", "CR": "8", "Env": ["grassland", "swamp"], "NPC": True }, { "Name": "spring eladrin", "CR": "10", "Env": ["grassland", "forest"] }, { "Name": "cadaver collector", "CR": "14", "Env": ["grassland"] }, { "Name": "gray render", "CR": "12", "Env": ["hill"] }, { "Name": "derro", "CR": "1/4", "Env": ["mountain", "underdark"] }, { "Name": "stap spawn grue", "CR": "1/4", "Env": ["mountain", "swamp"] }, { "Name": "duergar soulblade", "CR": "1", "Env": ["mountain", "underdark"] }, { "Name": "duergar hammerer", "CR": "2", "Env": ["mountain", "underdark"], "NPC": True }, { "Name": "duergar kavalrachni", "CR": "2", "Env": ["mountain", "underdark"], "NPC": True }, { "Name": "duergar mind master", "CR": "2", "Env": ["mountain", "underdark"], "NPC": True }, { "Name": "duergar stone guard", "CR": "2", "Env": ["mountain", "underdark"], "NPC": True }, { "Name": "duergar xarrorn", "CR": "2", "Env": ["mountain", "underdark"], "NPC": True }, { "Name": "duergar screamer", "CR": "3", "Env": ["mountain", "underdark"], "NPC": True }, { "Name": "duergar warlord", "CR": "6", "Env": ["mountain", "underdark"], "NPC": True }, { "Name": "duergar despot", "CR": "12", "Env": ["mountain", "underdark"], "NPC": True }, { "Name": "star spawn seer", "CR": "13", "Env": ["mountain", "swamp", "urban"] }, { "Name": "star spawn larva mage", "CR": "16", "Env": ["mountain"] }, { "Name": "red abishai", "CR": "19", "Env": ["mountain", "urban"] }, { "Name": "oblex spawn", "CR": "1/4", "Env": ["swamp", "underdark", "urban"] }, { "Name": "the wretched", "CR": "1/4", "Env": ["swamp", "underdark", "urban"] }, { "Name": "adult oblex", "CR": "5", "Env": ["swamp", "underdark", "urban"] }, { "Name": "allip", "CR": "5", "Env": ["swamp", "urban"] }, { "Name": "maurezhi", "CR": "7", "Env": ["swamp", "urban"] }, { "Name": "elder oblex", "CR": "10", "Env": ["swamp", "urban"] }, { "Name": "male steeder", "CR": "1/4", "Env": ["underdark"] }, { "Name": "female steeder", "CR": "1", "Env": ["underdark"] }, { "Name": "derro savant", "CR": "3", "Env": ["underdark"] }, { "Name": "armanite", "CR": "7", "Env": ["underdark"] }, { "Name": "dhergoloth", "CR": "7", "Env": ["underdark"] }, { "Name": "drow house captain", "CR": "9", "Env": ["underdark"], "NPC": True }, { "Name": "gloom weaver", "CR": "9", "Env": ["underdark", "urban"] }, { "Name": "alkilith", "CR": "11", "Env": ["underdark", "urban"] }, { "Name": "drow shadowblade", "CR": "11", "Env": ["underdark"], "NPC": True }, { "Name": "soul monger", "CR": "11", "Env": ["underdark", "urban"] }, { "Name": "drow arachnomancer", "CR": "13", "Env": ["underdark"] }, { "Name": "the angry", "CR": "13", "Env": ["underdark", "urban"] }, { "Name": "drow inquisitor", "CR": "14", "Env": ["underdark"] }, { "Name": "nabassu", "CR": "14", "Env": ["underdark", "urban"] }, { "Name": "drow favored consort", "CR": "18", "Env": ["underdark"], "NPC": True }, { "Name": "sibriex", "CR": "18", "Env": ["underdark"] }, { "Name": "drow matron mother", "CR": "20", "Env": ["underdark"], "NPC": True }, { "Name": "giff", "CR": "3", "Env": ["urban"] }, { "Name": "deathlock", "CR": "4", "Env": ["urban"] }, { "Name": "white abishai", "CR": "6", "Env": ["urban"] }, { "Name": "black abishai", "CR": "7", "Env": ["urban"] }, { "Name": "deathlock mastermind", "CR": "8", "Env": ["urban"] }, { "Name": "yagnoloth", "CR": "11", "Env": ["urban"] }, { "Name": "green abishai", "CR": "15", "Env": ["urban"] }, { "Name": "steel predator", "CR": "16", "Env": ["urban"] }, { "Name": "blue abishai", "CR": "17", "Env": ["urban"] }, { "Name": "red abishai", "CR": "19", "Env": ["urban"] }, { "Name": "baphomet", "CR": "23", "Env": [] }, { "Name": "fraz urb'luu", "CR": "23", "Env": [] }, { "Name": "juiblex", "CR": "23", "Env": [] }, { "Name": "zuggtmoy", "CR": "23", "Env": [] }, { "Name": "graz'zt", "CR": "23", "Env": [] }, { "Name": "yeenoghu", "CR": "24", "Env": [] }, { "Name": "marut", "CR": "25", "Env": [] }, { "Name": "demogorgon", "CR": "26", "Env": [] }, { "Name": "orcus", "CR": "26", "Env": [] }, { "Name": "zariel", "CR": "26", "Env": [] }, { "Name": "rutterkin", "CR": "2", "Env": [] }, { "Name": "abyssal wretch", "CR": "1/4", "Env": [] }, { "Name": "molydeus", "CR": "21", "Env": [] }, { "Name": "bael", "CR": "19", "Env": [] }, { "Name": "amnizu", "CR": "18", "Env": [] }, { "Name": "githzerai anarch", "CR": "16", "Env": [] } ] # ------------------------------------------------------------------------------ # Dictionary of NPCs # ------------------------------------------------------------------------------ ALL_NPCs = [npc for npc in ALL_MONSTERS if npc.get("NPC")] # ------------------------------------------------------------------------------ # Dictionaries of Monster Features # ------------------------------------------------------------------------------ ALL_FEATURES = [ "aggressive", "ambusher", "amorphous", "angelic weapons", "antimagic susceptibility", "avoidance", "blind senses", "blood frenzy", "breath weapon", "brute", "chameleon skin", "change shape", "charge", "charm", "constrict", "damage absorption", "damage transfer", "death burst", "devil sight", "dive attack", "echolocation", "elemental body", "enlarge", "ethearlness", "false appearance", "fey ancestry", "fiendish blessing", "flyby", "frightful presence", "grappler", "hold breath", "horrifying visage", "illumination", "illusory appearance", "immutable form", "incorporeal movement", "innate spellcasting", "inscrutable", "invisibility", "keen senses", "labyrinthine recall", "leadership", "legendary resistance", "life drain", "light sensitivity", "magic resistance", "magic weapons", "martial advantage", "mimicry", "nimble escape", "otherworldly perception", "pack tactics", "possession", "pounce", "psychic defense", "rampage", "read thoughts", "reckless", "redirect attack", "reel", "regeneration", "rejuvenation", "relentless", "shadow stealth", "shapechanger", "siege monster", "slippery", "spellcasting", "spider climb", "standing leap", "steadfast", "stench", "sunlight sensitivity", "superior invisibility", "sure footed", "surprise attack", "swallow", "teleport", "terrain camouflage", "tunneler", "turn resistance", "two heads", "undead fortitude", "web", "web sense", "web walker", "wounded fury" ] ALL_CRs = [ "0", "1/8", "1/4", "1/2", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30" ] ALL_PROFICIENCIES = { "0": "2", "1/8": "2", "1/4": "2", "1/2": "2", "1": "2", "2": "2", "3": "2", "4": "2", "5": "3", "6": "3", "7": "3", "8": "3", "9": "4", "10": "4", "11": "4", "12": "4", "13": "5", "14": "5", "15": "5", "16": "5", "17": "6", "18": "6", "19": "6", "20": "6", "21": "7", "22": "7", "23": "7", "24": "7", "25": "8", "26": "8", "27": "8", "28": "8", "29": "9", "30": "9" } ALL_ACs = { "0": "13", "1/8": "13", "1/4": "13", "1/2": "13", "1": "13", "2": "13", "3": "13", "4": "14", "5": "15", "6": "15", "7": "15", "8": "16", "9": "16", "10": "17", "11": "17", "12": "17", "13": "18", "14": "18", "15": "18", "16": "18", "17": "19", "18": "19", "19": "19", "20": "19", "21": "19", "22": "19", "23": "19", "24": "19", "25": "19", "26": "19", "27": "19", "28": "19", "29": "19", "30": "19" } ALL_HP = { "0": [1, 6], "1/8": [7, 35], "1/4": [36, 49], "1/2": [50, 70], "1": [71, 85], "2": [86, 100], "3": [101, 115], "4": [116, 130], "5": [131, 145], "6": [146, 160], "7": [161, 175], "8": [176, 190], "9": [191, 205], "10": [206, 220], "11": [221, 235], "12": [236, 250], "13": [251, 265], "14": [266, 280], "15": [281, 295], "16": [296, 310], "17": [311, 325], "18": [326, 340], "19": [341, 355], "20": [356, 400], "21": [401, 445], "22": [446, 490], "23": [491, 535], "24": [536, 580], "25": [581, 625], "26": [626, 670], "27": [671, 715], "28": [716, 760], "29": [761, 805], "30": [806, 850] } ALL_ATTACK_BONUSES = { "0": "3", "1/8": "3", "1/4": "3", "1/2": "3", "1": "3", "2": "3", "3": "4", "4": "5", "5": "6", "6": "6", "7": "6", "8": "7", "9": "7", "10": "7", "11": "8", "12": "8", "13": "8", "14": "8", "15": "8", "16": "9", "17": "10", "18": "10", "19": "10", "20": "10", "21": "11", "22": "11", "23": "11", "24": "12", "25": "12", "26": "12", "27": "13", "28": "13", "29": "13", "30": "14" } ALL_DPR = { "0": [0, 1], "1/8": [2, 3], "1/4": [4, 5], "1/2": [6, 8], "1": [9, 14], "2": [15, 20], "3": [21, 26], "4": [27, 32], "5": [33, 38], "6": [39, 44], "7": [45, 50], "8": [51, 56], "9": [57, 62], "10": [63, 68], "11": [69, 74], "12": [75, 80], "13": [81, 86], "14": [87, 92], "15": [93, 98], "16": [99, 104], "17": [105, 110], "18": [111, 116], "19": [117, 122], "20": [123, 140], "21": [141, 158], "22": [159, 176], "23": [177, 194], "24": [195, 212], "25": [213, 230], "26": [231, 248], "27": [249, 266], "28": [267, 284], "29": [285, 302], "30": [303, 320] } ALL_DCs = { "0": "13", "1/8": "13", "1/4": "13", "1/2": "13", "1": "13", "2": "13", "3": "13", "4": "14", "5": "15", "6": "15", "7": "15", "8": "16", "9": "16", "10": "16", "11": "17", "12": "17", "13": "18", "14": "18", "15": "18", "16": "18", "17": "19", "18": "19", "19": "19", "20": "19", "21": "20", "22": "20", "23": "20", "24": "21", "25": "21", "26": "21", "27": "22", "28": "22", "29": "22", "30": "23" } # ------------------------------------------------------------------------------ # Dictionary of Names # ------------------------------------------------------------------------------ ALL_NAMES = [ # Female Dragonborn "Akra", "Aasathra", "Antrara", "Arava", "Biri", "Blendaeth", "Burana", "Chassath", "Daar", "Dentratha", "Doudra", "Driindar", "Eggren", "Farideh", "Findex", "Furrele", "Gesrethe", "Gilkass", "Harann", "Havilar", "Hethress", "Hillanot", "Jaxi", "Jezean", "Jheri", "Kadana", "Kava", "Korinn", "Megren", "Mijira", "Mishann", "Nala", "Nuthra", "Perra", "Pogranix", "Pyxrin", "Quespa", "Raiann", "Rezena", "Ruloth", "Saphara", "Savaran", "Sora", "Surina", "Synthrin", "Tatyan", "Thava", "Uadjit", "Vezera", "Zykroff", # Male Dragonborn "Adrex", "Arjhan", "Azzakh", "Balasar", "Baradad", "Bharash", "Bidreked", "Dadalan", "Dazzazn", "Direcris", "Donaar", "Fax", "Gargax", "Ghesh", "Gorbundus", "Greethen", "Heskan", "Hirrathak", "Ildrex", "Kaladan", "Kerkad", "Kiirith", "Kriv", "Maagog", "Medrash", "Mehen", "Mozikth", "Mreksh", "Mugrunden", "Nadarr", "Nithther", "Norkruuth", "Nykkan", "Pandjed", "Patrin", "Pijjirik", "Quarethon", "Rathkran", "Rhogar", "Rivaan", "Sethrekar", "Shamash", "Shedinn", "Srorthen", "Tarhun", "Torinn", "Trynnicus", "Valorean", "Vrondiss", "Zedaar", # Female Dwarf "Anbera", "Artin", "Audhild", "Balifra", "Barbena", "Bardryn", "Bolhild", "Dagnal", "Dariff", "Delre", "Diesa", "Eldeth", "Eridred", "Falkrunn", "Fallthra", "Finellen", "Gillydd", "Gunnloda", "Gurdis", "Helgret", "Helja", "Hlin", "Ilde", "Jarana", "Kathra", "Kilia", "Kristryd", "Liftrasa", "Marastyr", "Mardred", "Morana", "Nalaed", "Nora", "Nurkara", "Oriff", "Ovina", "Riswynn", "Sannl", "Therlin", "Thodris", "Torbera", "Tordrid", "Torgga", "Urshar", "Valida", "Vistra", "Vonana", "Werydd", "Whurdred", "Yurgunn", # Male Dwarf "Adrik", "Alberich", "Baern", "Barendd", "Beloril", "Brottor", "Dain", "Dalgal", "Darrak", "Delg", "Duergath", "Dworic", "Eberk", "Einkil", "Elaim", "Erias", "Fallond", "Fargrim", "Gardain", "Gilthur", "Gimgen", "Gimurt", "Harbek", "Kildrak", "Kilvar", "Morgran", "Morkral", "Nalral", "Nordak", "Nuraval", "Oloric", "Olunt", "Orsik", "Oskar", "Rangrim", "Reirak", "Rurik", "Taklinn", "Thoradin", "Thorin", "Thradal", "Tordek", "Traubon", "Travok", "Ulfgar", "Uraim", "Veit", "Vonbin", "Vondal", "Whurbin", # Female Elf "Adrie", "Ahinar", "Althaea", "Anastrianna", "Andraste", "Antinua", "Arara", "Baelitae", "Bethrynna", "Birel", "Caelynn", "Chaedi", "Claira", "Dara", "Drusilia", "Elama", "Enna", "Faral", "Felosial", "Hatae", "Ielenia", "Ilanis", "Irann", "Jarsali", "Jelenneth", "Keyleth", "Leshanna", "Lia", "Maiathah", "Malquis", "Meriele", "Mialee", "Myathethil", "Naivara", "Quelenna", "Quillathe", "Ridaro", "Sariel", "Shanairla", "Shava", "Silaqui", "Sumnes", "Theirastra", "Thiala", "Tiaathque", "Traulam", "Vadania", "Valanthe", "Valna", "Xanaphia", # Male Elf "Adran", "Aelar", "Aerdeth", "Ahvain", "Aramil", "Arannis", "Aust", "Azaki", "Beiro", "Berrian", "Caeldrim", "Carric", "Dayereth", "Dreali", "Efferil", "Eiravel", "Enialis", "Erdan", "Erevan", "Fivin", "Galinndan", "Gennal", "Hadarai", "Halimath", "Heian", "Himo", "Immeral", "Ivellios", "Korfel", "Lamlis", "Laucian", "Lucan", "Mindartis", "Naal", "Nutae", "Paelias", "Peren", "Quarion", "Riardon", "Rolen", "Soveliss", "Suhnae", "Thamior", "Tharivol", "Theren", "Theriatis", "Thervan", "Uthemar", "Vanuath", "Varis", # Female Gnome "Abalaba", "Bimpnottin", "Breena", "Buvvie", "Callybon", "Caramip", "Carlin", "Cumpen", "Dalaba", "Donella", "Duvamil", "Ella", "Ellyjoybell", "Ellywick", "Enidda", "Lilli", "Loopmottin", "Lorilla", "Luthra", "Mardnab", "Meena", "Menny", "Mumpena", "Nissa", "Numba", "Nyx", "Oda", "Oppah", "Orla", "Panana", "Pyntle", "Quilla", "Ranala", "Reddlepop", "Roywyn", "Salanop", "Shamil", "Siffress", "Symma", "Tana", "Tenena", "Tervaround", "Tippletoe", "Ulla", "Unvera", "Veloptima", "Virra", "Waywocket", "Yebe", "Zanna", # Male Gnome "Alston", "Alvyn", "Anverth", "Arumawann", "Bilbron", "Boddynock", "Brocc", "Burgell", "Cockaby", "Crampernap", "Dabbledob", "Delebean", "Dimble", "Eberdeb", "Eldon", "Erky", "Fablen", "Fibblestib", "Fonkin", "Frouse", "Frug", "Gerbo", "Gimble", "Glim", "Igden", "Jabble", "Jebeddo", "Kellen", "Kipper", "Namfoodle", "Oppleby", "Orryn", "Paggen", "Pallabar", "Pog", "Qualen", "Ribbles", "Rimple", "Roondar", "Sapply", "Seebo", "Senteq", "Sindri", "Umpen", "Warryn", "Wiggens", "Wobbles", "Wrenn", "Zaffrab", "Zook", # Halfling Female "Alain", "Andry", "Anne", "Bella", "Blossom", "Bree", "Callie", "Chenna", "Cora", "Dee", "Dell", "Eida", "Eran", "Euphemia", "Georgina", "Gynnie", "Harriet", "Jasmine", "Jillian", "Jo", "Kithri", "Lavinia", "Lidda", "Maegan", "Marigold", "Merla", "Myria", "Nedda", "Nikki", "Nora", "Olivia", "Paela", "Pearl", "Pennie", "Philomena", "Portia", "Robbie", "Rose", "Saral", "Seraphina", "Shaena", "Stacee", "Tawna", "Thea", "Trym", "Tyna", "Vani", "Verna", "Wella", "Willow", # Male Halfling "Alton", "Ander", "Bernie", "Bobbin", "Cade", "Callus", "Corrin", "Dannad", "Danniel", "Eddie", "Egart", "Eldon", "Errich", "Fildo", "Finnan", "Franklin", "Garret", "Garth", "Gilbert", "Gob", "Harol", "Igor", "Jasper", "Keith", "Kevin", "Lazam", "Lerry", "Lindal", "Lyle", "Merric", "Mican", "Milo", "Morrin", "Nebin", "Nevil", "Osborn", "Ostran", "Oswalt", "Perrin", "Poppy", "Reed", "Roscoe", "Sam", "Shardon", "Tye", "Ulmo", "Wellby", "Wendel", "Wenner", "Wes", # Female Half-Orc "Arha", "Baggi", "Bendoo", "Bilga", "Brakka", "Creega", "Drenna", "Ekk", "Emen", "Engong", "Fistula", "Gaaki", "Gorga", "Grai", "Greeba", "Grigi", "Gynk", "Hrathy", "Huru", "Ilga", "Kabbarg", "Kansif", "Lagazi", "Lezre", "Murgen", "Murook", "Myev", "Nagrette", "Neega", "Nella", "Nogu", "Oolah", "Ootah", "Ovak", "Ownka", "Puyet", "Reeza", "Shautha", "Silgre", "Sutha", "Tagga", "Tawar", "Tomph", "Ubada", "Vanchu", "Vola", "Volen", "Vorka", "Yevelda", "Zagga", # Male Half-Orc "Argran", "Braak", "Brug", "Cagak", "Dench", "Dorn", "Dren", "Druuk", "Feng", "Gell", "Gnarsh", "Grumbar", "Gubrash", "Hagren", "Henk", "Hogar", "Holg", "Imsh", "Karash", "Karg", "Keth", "Korag", "Krusk", "Lubash", "Megged", "Mhurren", "Mord", "Morg", "Nil", "Nybarg", "Odorr", "Ohr", "Rendar", "Resh", "Ront", "Rrath", "Sark", "Scrag", "Sheggen", "Shump", "Tanglar", "Tarak", "Thar", "Thokk", "Trag", "Ugarth", "Varg", "Vilberg", "Yurk", "Zed", # Female Tiefling "Akta", "Anakis", "Armara", "Astaro", "Aym", "Azza", "Beleth", "Bryseis", "Bune", "Criella", "Damaia", "Decarabia", "Ea", "Gadreel", "Gomory", "Hecat", "Ishte", "Jezebeth", "Kali", "Kallista", "Kasdeya", "Lerissa", "Lilith", "Makaria", "Manea", "Markosian", "Mastema", "Naamah", "Nemeia", "Nija", "Orianna", "Osah", "Phelaia", "Prosperine", "Purah", "Pyra", "Rieta", "Ronobe", "Ronwe", "Seddit", "Seere", "Sekhmet", "Semyaza", "Shava", "Shax", "Sorath", "Uzza", "Vapula", "Vepar", "Verin", # Male Tiefling "Abad", "Ahrim", "Akmen", "Amnon", "Andram", "Astar", "Balam", "Barakas", "Bathin", "Caim", "Chem", "Cimer", "Cressel", "Damakos", "Ekemon", "Euron", "Fenriz", "Forcas", "Habor", "Iados", "Kairon", "Leucis", "Mamnen", "Mantus", "Marbas", "Melech", "Merihim", "Modean", "Mordai", "Mormo", "Morthos", "Nicor", "Nirgel", "Oriax", "Paymon", "Pelaios", "Purson", "Qemuel", "Raam", "Rimmon", "Sammal", "Skamos", "Tethren", "Thamuz", "Therai", "Valafar", "Vassago", "Xappan", "Zepar", "Zephan", # Female Human "Alfhild", "Arnbjorg", "Ase", "Aslog", "Astrid", "Auda", "Audhid", "Bergljot", "Birghild", "Bodil", "Brenna", "Brynhild", "Dagmar", "Eerika", "Eira", "Gudrun", "Gunborg", "Gunhild", "Gunvor", "Helga", "Hertha", "Hilde", "Hillevi", "Ingrid", "Iona", "Jorunn", "Kari", "Kenna", "Magnhild", "Nanna", "Olga", "Ragna", "Ragnhild", "Ranveig", "Runa", "Saga", "Sigfrid", "Signe", "Sigrid", "Sigrunn", "Solveg", "Svanhild", "Thora", "Torborg", "Torunn", "Tove", "Unn", "Vigdis", "Ylva", "Yngvild", "Adelaide", "Agatha", "Agnes", "Alice", "Aline", "Anne", "Avelina", "Avice", "Beatrice", "Cecily", "Egelina", "Eleanor", "Elizabeth", "Ella", "Eloise", "Elysande", "Emeny", "Emma", "Emmeline", "Ermina", "Eva", "Galiena", "Geva", "Giselle", "Griselda", "Hadwisa", "Helen", "Herleva", "Hugolina", "Ida", "Isabella", "Jacoba", "Jane", "Joan", "Juliana", "Katherine", "Margery", "Mary", "Matilda", "Maynild", "Millicent", "Oriel", "Rohesia", "Rosalind", "Rosamund", "Sarah", "Susannah", "Sybil", "Williamina", "Yvonne", "Aelia", "Aemilia", "Agrippina", "Alba", "Antonia", "Aquila", "Augusta", "Aurelia", "Balbina", "Blandina", "Caelia", "Camilla", "Casia", "Claudia", "Cloelia", "Domitia", "Drusa", "Fabia", "Fabricia", "Fausta", "Flavia", "Floriana", "Fulvia", "Germana", "Glaucia", "Gratiana", "Hadriana", "Hermina", "Horatia", "Hortensia", "Iovita", "Iulia", "Laelia", "Laurentia", "Livia", "Longina", "Lucilla", "Lucretia", "Marcella", "Marcia", "Maxima", "Nona", "Octavia", "Paulina", "Petronia", "Porcia", "Tacita", "Tullia", "Verginia", "Vita", # Male Human "Agni", "Alaric", "Anvindr", "Arvid", "Asger", "Asmund", "Bjarte", "Bjorg", "Bjorn", "Brandr", "Brandt", "Brynjar", "Calder", "Colborn", "Cuyler", "Egil", "Einar", "Eric", "Erland", "Fiske", "Folkvar", "Fritjof", "Frode", "Geir", "Halvar", "Hemming", "Hjalmar", "Hjortr", "Ingimarr", "Ivar", "Knud", "Leif", "Liufr", "Manning", "Oddr", "Olin", "Ormr", "Ove", "Rannulfr", "Sigurd", "Skari", "Snorri", "Sten", "Stigandr", "Stigr", "Sven", "Trygve", "Ulf", "Vali", "Vidar", "Adam", "Adelard", "Aldous", "Anselm", "Arnold", "Bernard", "Bertram", "Charles", "Clerebold", "Conrad", "Diggory", "Drogo", "Everard", "Frederick", "Geoffrey", "Gerald", "Gilbert", "Godfrey", "Gunter", "Guy", "Henry", "Heward", "Hubert", "Hugh", "Jocelyn", "John", "Lance", "Manfred", "Miles", "Nicholas", "Norman", "Odo", "Percival", "Peter", "Ralf", "Randal", "Raymond", "Reynard", "Richard", "Robert", "Roger", "Roland", "Rolf", "Simon", "Theobald", "Theodoric", "Thomas", "Timm", "William", "Wymar", "Aelius", "Aetius", "Agrippa", "Albanus", "Albus", "Antonius", "Appius", "Aquilinus", "Atilus", "Augustus", "Aurelius", "Avitus", "Balbus", "Blandus", "Blasius", "Brutus", "Caelius", "Caius", "Casian", "Cassius", "Cato", "Celsus", "Claudius", "Cloelius", "Cnaeus", "Crispus", "Cyprianus", "Diocletianus", "Egnatius", "Ennius", "Fabricius", "Faustus", "Gaius", "Germanus", "Gnaeus", "Horatius", "Iovianus", "Iulius", "Lucilius", "Manius", "Marcus", "Marius", "Maximus", "Octavius", "Paulus", "Quintilian", "Regulus", "Servius", "Tacitus", "Varius" ] # ------------------------------------------------------------------------------ # Dictionary of Plot Arcs # ------------------------------------------------------------------------------ ALL_PLOTS = [ "is searching for a powerful artifact", "wants to live forever", "wants revenge for the death of their family", "seeks to overthrow the government", "is trying to impress a love interest", "has kidnapped someone for ransom", "is searching for a missing person", "has lost a valuable item", "wants to acquire a legendary item to prolong life", "wants to ascend to godhood", "is trying to become undead", "is trying to obtain a younger body", "seeks to seize a position of power", "seeks to seize a title", "wants to win a contest", "wishes to win favor with a powerful individual", "is trying to place a pawn in a position of power", "wants to obtain an ancient artifact", "is trying to build a construct or magical device", "is carrying out a deity's wishes", "is offering sacrifices to a deity", "is trying to contact a lost deity or power", "wants to open a gate to another world", "is trying to fulfill an apocalyptic prophecy", "is enacting the vengeful will of a god", "is enacting the vengeful will of a patron", "is spreading a vile contagion", "wants to trigger a natural disaster", "seeks to utterly destroy a bloodline or clan", "wishes to prolong the life of a loved one", "wants to raise a dead loved one", "is destroying rivals for another person's affection", "wants to conquer a region", "is inciting a rebellion", "is trying to seize control of the army", "is working to become the power behind the throne", "seeks the favor of a ruler", "wants to avenge a past humiliation or insult", "wants to avenge a past imprisonment or injury", "seeks to recover stolen property and punish the thief", "wishes to control natural resources", "wishes to control trade", "is trying to marry into wealth", "is trying to plunder ancient ruins", "is stealing land", "is stealing goods", "is stealing money" ] # ------------------------------------------------------------------------------ # Table of Difficulty Scaling # ------------------------------------------------------------------------------ ALL_CR_SCALES = [(1, 1.0), (2, 1.5), (6, 2.0), (10, 2.5), (14, 3.0), (100, 4.0)] ALL_CR_SCALES.sort() # ------------------------------------------------------------------------------
""" Auto DM Jeremy L Thompson This file provides dictionaries for random modules """ all_monsters = [{'Name': 'commoner', 'CR': '0', 'Env': ['arctic', 'coastal', 'desert', 'forest', 'grassland', 'hill', 'urban']}, {'Name': 'Owl', 'CR': '0', 'Env': ['arctic', 'forest']}, {'Name': 'bandit', 'CR': '1/8', 'Env': ['arctic', 'costal', 'desert', 'forest', 'hill', 'urban']}, {'Name': 'blood hawk', 'CR': '1/8', 'Env': ['arctic', 'coastal', 'forest', 'grassland', 'hill', 'mountain']}, {'Name': 'kobold', 'CR': '1/8', 'Env': ['arctic', 'coastal', 'desert', 'forest', 'hill', 'mountain', 'swamp', 'underdark', 'urban']}, {'Name': 'tribal warrior', 'CR': '1/8', 'Env': ['arctic', 'coastal', 'desert', 'forest', 'grassland', 'hill', 'mountain', 'swamp', 'underdark']}, {'Name': 'giant owl', 'CR': '1/4', 'Env': ['arctic']}, {'Name': 'winged kobold', 'CR': '1/4', 'Env': ['arctic', 'coastal', 'desert', 'forest', 'hill', 'mountain', 'swamp', 'underdark', 'urban']}, {'Name': 'ice mephit', 'CR': '1/2', 'Env': ['arctic']}, {'Name': 'orc', 'CR': '1/2', 'Env': ['arctic', 'forest', 'grassland', 'hill', 'mountain', 'swamp', 'underdark']}, {'Name': 'scout', 'CR': '1/2', 'Env': ['arctic', 'coastal', 'desert', 'forest', 'grassland', 'hill', 'mountain', 'swamp', 'underdark']}, {'Name': 'brown bear', 'CR': '1', 'Env': ['arctic', 'forest', 'hill']}, {'Name': 'half ogre', 'CR': '1', 'Env': ['arctic', 'forest', 'hill', 'mountain', 'underdark', 'urban']}, {'Name': 'crab', 'CR': '0', 'Env': ['coastal']}, {'Name': 'eagle', 'CR': '0', 'Env': ['coastal', 'grassland', 'hill', 'mountain']}, {'Name': 'giant crab', 'CR': '1/8', 'Env': ['coastal']}, {'Name': 'guard', 'CR': '1/8', 'Env': ['coastal', 'desert', 'forest', 'grassland', 'hill', 'mountain', 'urban']}, {'Name': 'merfolk', 'CR': '1/8', 'Env': ['coastal', 'underwater']}, {'Name': 'poisonous snake', 'CR': '1/8', 'Env': ['coastal', 'desert', 'forest', 'grassland', 'hill', 'swamp']}, {'Name': 'stirge', 'CR': '1/8', 'Env': ['coastal', 'desert', 'forest', 'grassland', 'hill', 'mountain', 'swamp', 'underdark', 'urban']}, {'Name': 'giant lizard', 'CR': '1/4', 'Env': ['coastal', 'desert', 'forest', 'swamp', 'underdark']}, {'Name': 'giant wolf spider', 'CR': '1/4', 'Env': ['coastal', 'desert', 'forest', 'grassland', 'hill']}, {'Name': 'pseudodragon', 'CR': '1/4', 'Env': ['coastal', 'desert', 'forest', 'hill', 'mountain', 'urban']}, {'Name': 'pteranodon', 'CR': '1/4', 'Env': ['coastal', 'grassland', 'mountain']}, {'Name': 'sahuagin', 'CR': '1/2', 'Env': ['coastal', 'underwater']}, {'Name': 'giant eagle', 'CR': '1', 'Env': ['coastal', 'grassland', 'hill', 'mountain']}, {'Name': 'giant toad', 'CR': '1', 'Env': ['coastal', 'desert', 'forest', 'swamp', 'underdark']}, {'Name': 'harpy', 'CR': '1', 'Env': ['coastal', 'forest', 'hill', 'mountain']}, {'Name': 'cat', 'CR': '0', 'Env': ['desert', 'forest', 'grassland', 'urban']}, {'Name': 'hyena', 'CR': '0', 'Env': ['desert', 'forest', 'grassland', 'hill']}, {'Name': 'jackal', 'CR': '0', 'Env': ['desert', 'grassland']}, {'Name': 'scorpion', 'CR': '0', 'Env': ['desert']}, {'Name': 'vulture', 'CR': '0', 'Env': ['desert', 'grassland', 'hill']}, {'Name': 'camel', 'CR': '1/8', 'Env': ['desert']}, {'Name': 'flying snake', 'CR': '1/8', 'Env': ['desert', 'forest', 'grassland', 'urban']}, {'Name': 'mule', 'CR': '1/8', 'Env': ['desert', 'hill', 'urban']}, {'Name': 'constrictor snake', 'CR': '1/4', 'Env': ['desert', 'forest', 'underwater']}, {'Name': 'giant poisonous snake', 'CR': '1/4', 'Env': ['desert', 'forest', 'grassland', 'underdark', 'urban']}, {'Name': 'dust mephit', 'CR': '1/2', 'Env': ['desert']}, {'Name': 'gnoll', 'CR': '1/2', 'Env': ['desert', 'forest', 'grassland', 'hill']}, {'Name': 'hobgoblin', 'CR': '1/2', 'Env': ['desert', 'forest', 'grassland', 'hill', 'underdark']}, {'Name': 'jackalwere', 'CR': '1/2', 'Env': ['desert', 'grassland']}, {'Name': 'swarm of insects', 'CR': '1/2', 'Env': ['desert', 'forest', 'grassland', 'hill', 'swamp', 'underdark', 'urban']}, {'Name': 'death dog', 'CR': '1', 'Env': ['desert']}, {'Name': 'giant hyena', 'CR': '1', 'Env': ['desert', 'forest', 'grassland', 'hill']}, {'Name': 'giant spider', 'CR': '1', 'Env': ['desert', 'forest', 'underdark', 'urban']}, {'Name': 'giant vulture', 'CR': '1', 'Env': ['desert', 'grassland']}, {'Name': 'lion', 'CR': '1', 'Env': ['desert', 'grassland', 'hill', 'mountain']}, {'Name': 'thri-keen', 'CR': '1', 'Env': ['desert', 'grassland']}, {'Name': 'yuan-ti pureblood', 'CR': '1', 'Env': ['desert', 'forest', 'swamp', 'urban']}, {'Name': 'awakened shrub', 'CR': '0', 'Env': ['forest']}, {'Name': 'baboon', 'CR': '0', 'Env': ['forest', 'hill']}, {'Name': 'badger', 'CR': '0', 'Env': ['forest']}, {'Name': 'deer', 'CR': '0', 'Env': ['forest', 'grassland']}, {'Name': 'giant rat', 'CR': '1/8', 'Env': ['forest', 'swamp', 'underdark', 'urban']}, {'Name': 'giant weasel', 'CR': '1/8', 'Env': ['forest', 'grassland', 'hill']}, {'Name': 'mastiff', 'CR': '1/8', 'Env': ['forest', 'hill', 'urban']}, {'Name': 'twig blight', 'CR': '1/8', 'Env': ['forest']}, {'Name': 'blink dog', 'CR': '1/4', 'Env': ['forest']}, {'Name': 'boar', 'CR': '1/4', 'Env': ['forest', 'grassland']}, {'Name': 'elk', 'CR': '1/4', 'Env': ['forest', 'grassland', 'hill']}, {'Name': 'giant badger', 'CR': '1/4', 'Env': ['forest']}, {'Name': 'giant frog', 'CR': '1/4', 'Env': ['forest', 'swamp']}, {'Name': 'giant owl', 'CR': '1/4', 'Env': ['forest']}, {'Name': 'goblin', 'CR': '1/4', 'Env': ['forest', 'grassland', 'hill', 'underdark']}, {'Name': 'kenku', 'CR': '1/4', 'Env': ['forest', 'urban']}, {'Name': 'needle blight', 'CR': '1/4', 'Env': ['forest']}, {'Name': 'panther', 'CR': '1/4', 'Env': ['forest']}, {'Name': 'pixie', 'CR': '1/4', 'Env': ['forest']}, {'Name': 'sprite', 'CR': '1/4', 'Env': ['forest']}, {'Name': 'swarm of ravens', 'CR': '1/4', 'Env': ['forest', 'hill', 'swamp', 'urban']}, {'Name': 'wolf', 'CR': '1/4', 'Env': ['forest', 'grassland', 'hill']}, {'Name': 'ape', 'CR': '1/2', 'Env': ['forest']}, {'Name': 'black bear', 'CR': '1/2', 'Env': ['forest']}, {'Name': 'giant wasp', 'CR': '1/2', 'Env': ['forest', 'grassland', 'urban']}, {'Name': 'lizardfolk', 'CR': '1/2', 'Env': ['forest', 'swamp']}, {'Name': 'satyr', 'CR': '1/2', 'Env': ['forest']}, {'Name': 'vine blight', 'CR': '1/2', 'Env': ['forest']}, {'Name': 'worg', 'CR': '1/2', 'Env': ['forest', 'grassland', 'hill']}, {'Name': 'bugbear', 'CR': '1', 'Env': ['forest', 'grassland', 'underdark']}, {'Name': 'dire wolf', 'CR': '1', 'Env': ['forest', 'hill']}, {'Name': 'dryad', 'CR': '1', 'Env': ['forest']}, {'Name': 'faerie dragon yellow or younger', 'CR': '1', 'Env': ['forest']}, {'Name': 'goblin boss', 'CR': '1', 'Env': ['forest', 'grassland', 'hill', 'underdark']}, {'Name': 'harpy', 'CR': '1', 'Env': ['forest', 'hill', 'mountain']}, {'Name': 'tiger', 'CR': '1', 'Env': ['forest', 'grassland']}, {'Name': 'goat', 'CR': '0', 'Env': ['grassland', 'hill', 'mountain', 'urban']}, {'Name': 'axe beak', 'CR': '1/4', 'Env': ['grassland', 'hill']}, {'Name': 'riding horse', 'CR': '1/4', 'Env': ['grassland', 'urban']}, {'Name': 'cockatrice', 'CR': '1/2', 'Env': ['grassland']}, {'Name': 'giant goat', 'CR': '1/2', 'Env': ['grassland', 'hill']}, {'Name': 'hippogriff', 'CR': '1', 'Env': ['grassland', 'hill', 'mountain']}, {'Name': 'scarecrow', 'CR': '1', 'Env': ['grassland']}, {'Name': 'raven', 'CR': '0', 'Env': ['hill', 'swamp', 'urban']}, {'Name': 'swarm of bats', 'CR': '1/4', 'Env': ['hill', 'mountain', 'underdark', 'urban']}, {'Name': 'aarakocra', 'CR': '1/4', 'Env': ['mountain']}, {'Name': 'rat', 'CR': '0', 'Env': ['swamp', 'urban']}, {'Name': 'bullywug', 'CR': '1/8', 'Env': ['swamp']}, {'Name': 'mud mephit', 'CR': '1/8', 'Env': ['swamp']}, {'Name': 'crocodile', 'CR': '1/2', 'Env': ['swamp', 'urban']}, {'Name': 'ghoul', 'CR': '1', 'Env': ['swamp', 'underdark', 'urban']}, {'Name': 'giant fire beetle', 'CR': '0', 'Env': ['underdark']}, {'Name': 'shrieker', 'CR': '0', 'Env': ['underdark']}, {'Name': 'myconid sprout', 'CR': '0', 'Env': ['underdark']}, {'Name': 'flumph', 'CR': '1/8', 'Env': ['underdark']}, {'Name': 'drow', 'CR': '1/4', 'Env': ['underdark']}, {'Name': 'giant bat', 'CR': '1/4', 'Env': ['underdark']}, {'Name': 'giant centipede', 'CR': '1/4', 'Env': ['underdark', 'urban']}, {'Name': 'grimlock', 'CR': '1/4', 'Env': ['underdark']}, {'Name': 'kuo-toa', 'CR': '1/4', 'Env': ['underdark']}, {'Name': 'troglodyte', 'CR': '1/4', 'Env': ['underdark']}, {'Name': 'violet fungus', 'CR': '1/4', 'Env': ['underdark']}, {'Name': 'darkmantle', 'CR': '1/2', 'Env': ['underdark']}, {'Name': 'deep gnome', 'CR': '1/2', 'Env': ['underdark']}, {'Name': 'gas spore', 'CR': '1/2', 'Env': ['underdark']}, {'Name': 'gray ooze', 'CR': '1/2', 'Env': ['underdark']}, {'Name': 'magma mephit', 'CR': '1/2', 'Env': ['underdark']}, {'Name': 'myconid adult', 'CR': '1/2', 'Env': ['underdark']}, {'Name': 'piercer', 'CR': '1/2', 'Env': ['underdark']}, {'Name': 'rust monster', 'CR': '1/2', 'Env': ['underdark']}, {'Name': 'shadow', 'CR': '1/2', 'Env': ['underdark', 'urban']}, {'Name': 'duergar', 'CR': '1', 'Env': ['underdark']}, {'Name': 'fire snake', 'CR': '1', 'Env': ['underdark']}, {'Name': 'kuo-toa whip', 'CR': '1', 'Env': ['underdark']}, {'Name': 'quaggoth spore servant', 'CR': '1', 'Env': ['underdark']}, {'Name': 'specter', 'CR': '1', 'Env': ['underdark', 'urban']}, {'Name': 'quipper', 'CR': '0', 'Env': ['underwater']}, {'Name': 'steam mephit', 'CR': '1/4', 'Env': ['underwater']}, {'Name': 'giant sea horse', 'CR': '1/2', 'Env': ['underwater']}, {'Name': 'reef shark', 'CR': '1/2', 'Env': ['underwater']}, {'Name': 'giant octopus', 'CR': '1', 'Env': ['underwater']}, {'Name': 'swarm of quippers', 'CR': '1', 'Env': ['underwater']}, {'Name': 'cultist', 'CR': '1/8', 'Env': ['urban']}, {'Name': 'noble', 'CR': '1/8', 'Env': ['urban']}, {'Name': 'pony', 'CR': '1/8', 'Env': ['urban']}, {'Name': 'acolyte', 'CR': '1/4', 'Env': ['urban']}, {'Name': 'draft horse', 'CR': '1/4', 'Env': ['urban']}, {'Name': 'skeleton', 'CR': '1/4', 'Env': ['urban']}, {'Name': 'smoke mephit', 'CR': '1/4', 'Env': ['urban']}, {'Name': 'swarm of rats', 'CR': '1/4', 'Env': ['urban']}, {'Name': 'zombie', 'CR': '1/4', 'Env': ['urban']}, {'Name': 'thug', 'CR': '1/2', 'Env': ['urban']}, {'Name': 'warhorse', 'CR': '1/2', 'Env': ['urban']}, {'Name': 'bandit captain', 'CR': '2', 'Env': ['arctic', 'coastal', 'desert', 'forest', 'hill', 'urban'], 'NPC': True}, {'Name': 'berserker', 'CR': '2', 'Env': ['arctic', 'coastal', 'desert', 'forest', 'hill', 'mountain'], 'NPC': True}, {'Name': 'druid', 'CR': '2', 'Env': ['arctic', 'coastal', 'desert', 'forest', 'grassland', 'hill', 'mountain', 'swamp', 'underdark'], 'NPC': True}, {'Name': 'griffon', 'CR': '2', 'Env': ['arctic', 'coastal', 'grassland', 'hill', 'mountain']}, {'Name': 'ogre', 'CR': '2', 'Env': ['arctic', 'coastal', 'desert', 'forest', 'grassland', 'hill', 'mountain', 'swamp', 'underdark']}, {'Name': 'orc Eye of Gruumsh', 'CR': '2', 'Env': ['arctic', 'forest', 'grassland', 'hill', 'mountain', 'swamp', 'underdark']}, {'Name': 'orog', 'CR': '2', 'Env': ['arctic', 'forest', 'grassland', 'hill', 'mountain', 'underdark']}, {'Name': 'polar bear', 'CR': '2', 'Env': ['arctic', 'underdark']}, {'Name': 'saber toothed tiger', 'CR': '2', 'Env': ['arctic', 'mountain']}, {'Name': 'manticore', 'CR': '3', 'Env': ['arctic', 'coastal', 'hill', 'mountain']}, {'Name': 'veteran', 'CR': '3', 'Env': ['arctic', 'coastal', 'forest', 'grassland', 'hill', 'mountain', 'underdark', 'urban'], 'NPC': True}, {'Name': 'winter wolf', 'CR': '3', 'Env': ['arctic']}, {'Name': 'yeti', 'CR': '3', 'Env': ['arctic']}, {'Name': 'revenant', 'CR': '5', 'Env': ['arctic', 'desert', 'forest', 'hill', 'swamp', 'urban']}, {'Name': 'merrow', 'CR': '2', 'Env': ['coastal', 'underwater']}, {'Name': 'plesiosaurus', 'CR': '2', 'Env': ['coastal', 'underwater']}, {'Name': 'sahuagin priestess', 'CR': '2', 'Env': ['coastal', 'underwater']}, {'Name': 'sea hag', 'CR': '2', 'Env': ['coastal', 'underwater']}, {'Name': 'banshee', 'CR': '4', 'Env': ['coastal', 'forest']}, {'Name': 'sahuagin baron', 'CR': '5', 'Env': ['coastal', 'underwater']}, {'Name': 'water elemental', 'CR': '5', 'Env': ['coastal', 'underwater']}, {'Name': 'giant constrictor snake', 'CR': '2', 'Env': ['desert', 'forest', 'swamp', 'underdark']}, {'Name': 'gnoll pack lord', 'CR': '2', 'Env': ['desert', 'forest', 'grassland', 'hill'], 'NPC': True}, {'Name': 'giant scorpion', 'CR': '3', 'Env': ['desert']}, {'Name': 'hobgoblin captain', 'CR': '3', 'Env': ['desert', 'forest', 'grassland', 'hill', 'underdark'], 'NPC': True}, {'Name': 'mummy', 'CR': '3', 'Env': ['desert']}, {'Name': 'phase spider', 'CR': '3', 'Env': ['desert', 'forest', 'grassland', 'hill', 'underdark', 'urban']}, {'Name': 'wight', 'CR': '3', 'Env': ['desert', 'swamp', 'underdark', 'urban']}, {'Name': 'yuan-ti malison', 'CR': '3', 'Env': ['desert', 'forest', 'swamp']}, {'Name': 'couatl', 'CR': '4', 'Env': ['desert', 'forest', 'grassland', 'urban']}, {'Name': 'gnoll hand of Yeenoghu', 'CR': '4', 'Env': ['desert', 'forest', 'grassland', 'hill']}, {'Name': 'lamia', 'CR': '4', 'Env': ['desert']}, {'Name': 'weretiger', 'CR': '4', 'Env': ['desert', 'forest', 'grassland']}, {'Name': 'air elemental', 'CR': '5', 'Env': ['desert', 'mountain']}, {'Name': 'fire elemental', 'CR': '5', 'Env': ['desert']}, {'Name': 'revenant', 'CR': '5', 'Env': ['desert', 'hill', 'swamp']}, {'Name': 'ankheg', 'CR': '2', 'Env': ['forest']}, {'Name': 'awakened tree', 'CR': '2', 'Env': ['forest']}, {'Name': 'centaur', 'CR': '2', 'Env': ['forest', 'grassland'], 'NPC': True}, {'Name': 'ettercap', 'CR': '2', 'Env': ['forest']}, {'Name': 'faerie dragon green or older', 'CR': '2', 'Env': ['forest']}, {'Name': 'giant boar', 'CR': '2', 'Env': ['forest', 'grassland', 'hill']}, {'Name': 'giant elk', 'CR': '2', 'Env': ['forest', 'grassland', 'hill', 'mountain']}, {'Name': 'grick', 'CR': '2', 'Env': ['forest', 'underdark']}, {'Name': 'lizardfolk shaman', 'CR': '2', 'Env': ['forest']}, {'Name': 'pegasus', 'CR': '2', 'Env': ['forest', 'grassland', 'hill']}, {'Name': 'swarm of poisonous snakes', 'CR': '2', 'Env': ['forest', 'swamp']}, {'Name': 'wererat', 'CR': '2', 'Env': ['forest', 'urban']}, {'Name': 'will-o-wisp', 'CR': '2', 'Env': ['forest', 'swamp', 'urban']}, {'Name': 'displacer beast', 'CR': '3', 'Env': ['forest']}, {'Name': 'green hag', 'CR': '3', 'Env': ['forest', 'hill', 'swamp'], 'NPC': True}, {'Name': 'owlbear', 'CR': '3', 'Env': ['forest']}, {'Name': 'werewolf', 'CR': '3', 'Env': ['forest', 'hill']}, {'Name': 'wereboar', 'CR': '4', 'Env': ['forest', 'grassland', 'hill']}, {'Name': 'gorgon', 'CR': '5', 'Env': ['forest', 'grassland', 'hill']}, {'Name': 'shambling mound', 'CR': '5', 'Env': ['forest', 'swamp']}, {'Name': 'troll', 'CR': '5', 'Env': ['forest', 'hill', 'mountain', 'swamp', 'underdark']}, {'Name': 'unicorn', 'CR': '5', 'Env': ['forest']}, {'Name': 'allosaurus', 'CR': '2', 'Env': ['grassland']}, {'Name': 'ankheg', 'CR': '2', 'Env': ['grassland']}, {'Name': 'rhinoceros', 'CR': '2', 'Env': ['grassland']}, {'Name': 'ankylosaurus', 'CR': '3', 'Env': ['grassland']}, {'Name': 'bulette', 'CR': '5', 'Env': ['grassland', 'hill', 'mountain']}, {'Name': 'triceratops', 'CR': '5', 'Env': ['grassland']}, {'Name': 'ettin', 'CR': '4', 'Env': ['hill', 'mountain', 'underdark']}, {'Name': 'hill giant', 'CR': '5', 'Env': ['hill']}, {'Name': 'basilisk', 'CR': '3', 'Env': ['mountain']}, {'Name': 'hell hound', 'CR': '3', 'Env': ['mountain', 'underdark']}, {'Name': 'ghast', 'CR': '2', 'Env': ['swamp', 'underdark']}, {'Name': 'giant crocodile', 'CR': '5', 'Env': ['swamp']}, {'Name': 'carrion crawler', 'CR': '2', 'Env': ['underdark']}, {'Name': 'gargoyle', 'CR': '2', 'Env': ['underdark', 'urban']}, {'Name': 'gelatinous cube', 'CR': '2', 'Env': ['underdark']}, {'Name': 'gibbering mouther', 'CR': '2', 'Env': ['underdark']}, {'Name': 'intellect devourer', 'CR': '2', 'Env': ['underdark']}, {'Name': 'mimic', 'CR': '2', 'Env': ['underdark', 'urban']}, {'Name': 'minotaur skeleton', 'CR': '2', 'Env': ['underdark']}, {'Name': 'nothic', 'CR': '2', 'Env': ['underdark']}, {'Name': 'ochre jelly', 'CR': '2', 'Env': ['underdark']}, {'Name': 'quaggoth', 'CR': '2', 'Env': ['underdark']}, {'Name': 'doppelganger', 'CR': '3', 'Env': ['underdark', 'urban']}, {'Name': 'grell', 'CR': '3', 'Env': ['underdark']}, {'Name': 'hook horror', 'CR': '3', 'Env': ['underdark']}, {'Name': 'kuo-toa monitor', 'CR': '3', 'Env': ['underdark']}, {'Name': 'minotaur', 'CR': '3', 'Env': ['underdark']}, {'Name': 'quaggoth thonot', 'CR': '3', 'Env': ['underdark']}, {'Name': 'spectator', 'CR': '3', 'Env': ['underdark']}, {'Name': 'water weird', 'CR': '3', 'Env': ['underdark']}, {'Name': 'black pudding', 'CR': '4', 'Env': ['underdark']}, {'Name': 'bone naga', 'CR': '4', 'Env': ['underdark']}, {'Name': 'chuul', 'CR': '4', 'Env': ['underdark']}, {'Name': 'flameskull', 'CR': '4', 'Env': ['underdark']}, {'Name': 'ghost', 'CR': '4', 'Env': ['underdark', 'urban']}, {'Name': 'beholder zombie', 'CR': '5', 'Env': ['underdark']}, {'Name': 'drow elite warrior', 'CR': '5', 'Env': ['underdark'], 'NPC': True}, {'Name': 'earth elemental', 'CR': '5', 'Env': ['underdark']}, {'Name': 'otyugh', 'CR': '5', 'Env': ['underdark']}, {'Name': 'roper', 'CR': '5', 'Env': ['underdark']}, {'Name': 'salamander', 'CR': '5', 'Env': ['underdark']}, {'Name': 'umber hulk', 'CR': '5', 'Env': ['underdark']}, {'Name': 'vampire spawn', 'CR': '5', 'Env': ['underdark', 'urban']}, {'Name': 'wraith', 'CR': '5', 'Env': ['underdark']}, {'Name': 'xorn', 'CR': '5', 'Env': ['underdark']}, {'Name': 'hunter shark', 'CR': '2', 'Env': ['underwater']}, {'Name': 'killer whale', 'CR': '3', 'Env': ['underwater']}, {'Name': 'giant shark', 'CR': '5', 'Env': ['underwater']}, {'Name': 'cult fanatic', 'CR': '2', 'Env': ['urban'], 'NPC': True}, {'Name': 'priest', 'CR': '2', 'Env': ['urban'], 'NPC': True}, {'Name': 'knight', 'CR': '3', 'Env': ['urban'], 'NPC': True}, {'Name': 'succubus', 'CR': '4', 'Env': ['urban']}, {'Name': 'incubus', 'CR': '4', 'Env': ['urban']}, {'Name': 'cambion', 'CR': '5', 'Env': ['urban']}, {'Name': 'gladiator', 'CR': '5', 'Env': ['urban'], 'NPC': True}, {'Name': 'mammoth', 'CR': '6', 'Env': ['arctic']}, {'Name': 'young white dragon', 'CR': '6', 'Env': ['arctic']}, {'Name': 'frost giant', 'CR': '8', 'Env': ['arctic', 'mountain']}, {'Name': 'abominable yeti', 'CR': '9', 'Env': ['arctic']}, {'Name': 'remorhaz', 'CR': '11', 'Env': ['arctic']}, {'Name': 'roc', 'CR': '11', 'Env': ['arctic', 'coastal', 'desert', 'hill', 'mountain']}, {'Name': 'adult white dragon', 'CR': '13', 'Env': ['arctic'], 'NPC': True}, {'Name': 'ancient white dragon', 'CR': '20', 'Env': ['arctic'], 'NPC': True}, {'Name': 'cyclops', 'CR': '6', 'Env': ['coastal', 'desert', 'grassland', 'hill', 'mountain', 'underdark']}, {'Name': 'young bronze dragon', 'CR': '8', 'Env': ['coastal']}, {'Name': 'young blue dragon', 'CR': '9', 'Env': ['coastal', 'desert']}, {'Name': 'djinni', 'CR': '11', 'Env': ['coastal'], 'NPC': True}, {'Name': 'marid', 'CR': '11', 'Env': ['coastal', 'underwater']}, {'Name': 'storm giant', 'CR': '13', 'Env': ['coastal', 'underwater']}, {'Name': 'adult bronze dragon', 'CR': '15', 'Env': ['coastal'], 'NPC': True}, {'Name': 'adult blue dragon', 'CR': '16', 'Env': ['coastal', 'desert'], 'NPC': True}, {'Name': 'dragon turtle', 'CR': '17', 'Env': ['coastal', 'underwater']}, {'Name': 'ancient bronze dragon', 'CR': '22', 'Env': ['coastal'], 'NPC': True}, {'Name': 'ancient blue dragon', 'CR': '23', 'Env': ['coastal', 'desert'], 'NPC': True}, {'Name': 'medusa', 'CR': '6', 'Env': ['desert']}, {'Name': 'young brass dragon', 'CR': '6', 'Env': ['desert']}, {'Name': 'yuan-ti abomination', 'CR': '7', 'Env': ['desert', 'forest', 'swamp'], 'NPC': True}, {'Name': 'gaurdian naga', 'CR': '10', 'Env': ['desert', 'forest']}, {'Name': 'efreeti', 'CR': '11', 'Env': ['desert']}, {'Name': 'gynosphinx', 'CR': '11', 'Env': ['desert']}, {'Name': 'adult brass dragon', 'CR': '13', 'Env': ['desert'], 'NPC': True}, {'Name': 'mummy lord', 'CR': '15', 'Env': ['desert']}, {'Name': 'purple worm', 'CR': '15', 'Env': ['desert']}, {'Name': 'adult blue dracolich', 'CR': '17', 'Env': ['desert'], 'NPC': True}, {'Name': 'androsphinx', 'CR': '17', 'Env': ['desert']}, {'Name': 'ancient brass dragon', 'CR': '20', 'Env': ['desert'], 'NPC': True}, {'Name': 'giant ape', 'CR': '7', 'Env': ['forest']}, {'Name': 'grick alpha', 'CR': '7', 'Env': ['forest', 'underdark']}, {'Name': 'oni', 'CR': '7', 'Env': ['forest', 'urban']}, {'Name': 'young green dragon', 'CR': '8', 'Env': ['forest']}, {'Name': 'treant', 'CR': '9', 'Env': ['forest']}, {'Name': 'guardian naga', 'CR': '10', 'Env': ['forest']}, {'Name': 'young gold dragon', 'CR': '10', 'Env': ['forest', 'grassland']}, {'Name': 'adult green dragon', 'CR': '15', 'Env': ['forest'], 'NPC': True}, {'Name': 'adult gold dragon', 'CR': '17', 'Env': ['forest', 'grassland'], 'NPC': True}, {'Name': 'ancient green dragon', 'CR': '22', 'Env': ['forest'], 'NPC': True}, {'Name': 'ancient gold dragon', 'CR': '24', 'Env': ['forest', 'grassland'], 'NPC': True}, {'Name': 'chimera', 'CR': '6', 'Env': ['grassland', 'hill', 'mountain', 'underdark']}, {'Name': 'tyrannosaurus rex', 'CR': '8', 'Env': ['grassland']}, {'Name': 'galeb duhr', 'CR': '6', 'Env': ['hill', 'mountain']}, {'Name': 'wyvern', 'CR': '6', 'Env': ['hill', 'mountain']}, {'Name': 'stone giant', 'CR': '7', 'Env': ['hill', 'mountain', 'underdark']}, {'Name': 'young copper dragon', 'CR': '7', 'Env': ['hill']}, {'Name': 'young red dragon', 'CR': '10', 'Env': ['hill', 'mountain']}, {'Name': 'adult copper dragon', 'CR': '14', 'Env': ['hill'], 'NPC': True}, {'Name': 'adult red dragon', 'CR': '17', 'Env': ['hill', 'mountain'], 'NPC': True}, {'Name': 'ancient copper dragon', 'CR': '21', 'Env': ['hill'], 'NPC': True}, {'Name': 'ancient red dragon', 'CR': '24', 'Env': ['hill', 'mountain'], 'NPC': True}, {'Name': 'cloud giant', 'CR': '9', 'Env': ['mountain']}, {'Name': 'fire giant', 'CR': '9', 'Env': ['mountain', 'underdark']}, {'Name': 'young silver dragon', 'CR': '9', 'Env': ['mountain']}, {'Name': 'adult silver dragon', 'CR': '16', 'Env': ['mountain'], 'NPC': True}, {'Name': 'ancient silver dragon', 'CR': '23', 'Env': ['mountain'], 'NPC': True}, {'Name': 'young black dragon', 'CR': '7', 'Env': ['swamp']}, {'Name': 'hydra', 'CR': '8', 'Env': ['swamp']}, {'Name': 'adult black dragon', 'CR': '14', 'Env': ['swamp'], 'NPC': True}, {'Name': 'ancient black dragon', 'CR': '21', 'Env': ['swamp'], 'NPC': True}, {'Name': 'drider', 'CR': '6', 'Env': ['underdark']}, {'Name': 'drow mage', 'CR': '7', 'Env': ['underdark']}, {'Name': 'mind flayer', 'CR': '8', 'Env': ['underdark'], 'NPC': True}, {'Name': 'arcanist', 'CR': '8', 'Env': ['underdark'], 'NPC': True}, {'Name': 'spirit naga', 'CR': '8', 'Env': ['underdark']}, {'Name': 'aboleth', 'CR': '10', 'Env': ['underdark']}, {'Name': 'behir', 'CR': '11', 'Env': ['underdark']}, {'Name': 'dao', 'CR': '11', 'Env': ['underdark'], 'NPC': True}, {'Name': 'beholder', 'CR': '13', 'Env': ['underdark'], 'NPC': True}, {'Name': 'young red shadow dragon', 'CR': '13', 'Env': ['underdark']}, {'Name': 'death tyrant', 'CR': '14', 'Env': ['underdark']}, {'Name': 'purple worm', 'CR': '15', 'Env': ['underdark']}, {'Name': 'kraken', 'CR': '23', 'Env': ['underwater']}, {'Name': 'invisible stalker', 'CR': '6', 'Env': ['urban']}, {'Name': 'mage', 'CR': '6', 'Env': ['urban'], 'NPC': True}, {'Name': 'shield guardian', 'CR': '7', 'Env': ['urban']}, {'Name': 'assassin', 'CR': '8', 'Env': ['urban'], 'NPC': True}, {'Name': 'gray slaad', 'CR': '9', 'Env': ['urban']}, {'Name': 'young silver dragon', 'CR': '9', 'Env': ['urban']}, {'Name': 'archmage', 'CR': '12', 'Env': ['urban'], 'NPC': True}, {'Name': 'rakshasa', 'CR': '13', 'Env': ['urban'], 'NPC': True}, {'Name': 'vampire', 'CR': '13', 'Env': ['urban'], 'NPC': True}, {'Name': 'spellcaster vampire', 'CR': '15', 'Env': ['urban'], 'NPC': True}, {'Name': 'warrior vampire', 'CR': '15', 'Env': ['urban'], 'NPC': True}, {'Name': 'adult silver dragon', 'CR': '16', 'Env': ['urban'], 'NPC': True}, {'Name': 'ancient silver dragon', 'CR': '23', 'Env': ['urban'], 'NPC': True}, {'Name': 'tarrasque', 'CR': '30', 'Env': ['urban']}, {'Name': 'ice devil', 'CR': '14', 'Env': []}, {'Name': 'adult blue dracolich', 'CR': '17', 'Env': [], 'NPC': True}, {'Name': 'death knight', 'CR': '17', 'Env': [], 'NPC': True}, {'Name': 'goristro', 'CR': '17', 'Env': []}, {'Name': 'demilich not in lair', 'CR': '18', 'Env': [], 'NPC': True}, {'Name': 'balor', 'CR': '19', 'Env': []}, {'Name': 'demilich in lair', 'CR': '20', 'Env': [], 'NPC': True}, {'Name': 'pit fiend', 'CR': '20', 'Env': []}, {'Name': 'lich not in lair', 'CR': '21', 'Env': []}, {'Name': 'solar', 'CR': '21', 'Env': [], 'NPC': True}, {'Name': 'lich in lair', 'CR': '22', 'Env': []}, {'Name': 'Empyrean', 'CR': '23', 'Env': []}, {'Name': 'gnoll witherling', 'CR': '1/4', 'Env': ['arctic', 'forest', 'grassland', 'hill']}, {'Name': 'gnoll hunter', 'CR': '1/2', 'Env': ['arctic', 'forest', 'grassland', 'hill']}, {'Name': 'gnolll flesh gnawer', 'CR': '1', 'Env': ['arctic', 'forest', 'grassland', 'hill']}, {'Name': 'guard drake white', 'CR': '2', 'Env': ['arctic', 'urban']}, {'Name': 'warlock of the archfey', 'CR': '4', 'Env': ['arctic', 'swamp', 'urban'], 'NPC': True}, {'Name': 'warlock of the great old one', 'CR': '6', 'Env': ['arctic', 'hill', 'mountain', 'urban'], 'NPC': True}, {'Name': 'bheur hag', 'CR': '7', 'Env': ['arctic'], 'NPC': True}, {'Name': 'warlock of the fiend', 'CR': '7', 'Env': ['arctic', 'desert', 'underdark', 'urban'], 'NPC': True}, {'Name': 'shoosuva', 'CR': '8', 'Env': ['arctic', 'forest', 'grassland', 'hill']}, {'Name': 'flind', 'CR': '9', 'Env': ['arctic', 'forest', 'grassland', 'hill']}, {'Name': 'frost giant everlasting one', 'CR': '12', 'Env': ['arctic', 'coastal']}, {'Name': 'storm giant quintessent', 'CR': '16', 'Env': ['arctic', 'coastal', 'underwater']}, {'Name': 'dolphin', 'CR': '1/8', 'Env': ['coastal', 'underwater']}, {'Name': 'dimetrodon', 'CR': '1/4', 'Env': ['coastal', 'swamp']}, {'Name': 'sea spawn', 'CR': '1', 'Env': ['coastal', 'underwater']}, {'Name': 'quetzalcoatlus', 'CR': '2', 'Env': ['coastal', 'hill']}, {'Name': 'deep scion', 'CR': '3', 'Env': ['coastal', 'underwater']}, {'Name': 'swashbuckler', 'CR': '3', 'Env': ['coastal', 'urban']}, {'Name': 'kraken priest', 'CR': '5', 'Env': ['coastal', 'underwater'], 'NPC': True}, {'Name': 'stone giant dreamwalker', 'CR': '10', 'Env': ['coastal', 'hill', 'mountain']}, {'Name': 'morkoth', 'CR': '11', 'Env': ['coastal', 'underwater']}, {'Name': 'ki-rin', 'CR': '12', 'Env': ['coastal', 'grassland', 'mountain']}, {'Name': 'firenewt', 'CR': '1/2', 'Env': ['desert', 'hill', 'mountain', 'underdark']}, {'Name': 'vargouille', 'CR': '1', 'Env': ['desert', 'swamp', 'underdark']}, {'Name': 'guard drake blue', 'CR': '2', 'Env': ['desert', 'urban']}, {'Name': 'yuan-ti broodguard', 'CR': '2', 'Env': ['desert', 'forest', 'underdark']}, {'Name': 'leucrotta', 'CR': '3', 'Env': ['desert', 'grassland']}, {'Name': 'yuan-ti mind whisperer', 'CR': '4', 'Env': ['desert', 'forest', 'underdark']}, {'Name': 'yuan-ti nightmare speaker', 'CR': '4', 'Env': ['desert', 'forest', 'underdark']}, {'Name': 'spawn of Kyuss', 'CR': '5', 'Env': ['desert', 'underdark']}, {'Name': 'tlincalli', 'CR': '5', 'Env': ['desert']}, {'Name': 'yuan-ti pit master', 'CR': '5', 'Env': ['desert', 'forest', 'underdark']}, {'Name': 'champion', 'CR': '9', 'Env': ['desert', 'urban']}, {'Name': 'necromancer', 'CR': '9', 'Env': ['desert', 'urban'], 'NPC': True}, {'Name': 'war priest', 'CR': '9', 'Env': ['desert', 'urban'], 'NPC': True}, {'Name': 'yuan-ti anathema', 'CR': '12', 'Env': ['desert', 'forest', 'underdark']}, {'Name': 'boggle', 'CR': '1/8', 'Env': ['forest', 'hill', 'underdark', 'urban']}, {'Name': 'grung', 'CR': '1/4', 'Env': ['forest']}, {'Name': 'kobold inventor', 'CR': '1/4', 'Env': ['forest', 'hill', 'mountain', 'underdark', 'inventor']}, {'Name': 'vegepygmy', 'CR': '1/4', 'Env': ['forest', 'swamp']}, {'Name': 'velociraptor', 'CR': '1/4', 'Env': ['forest', 'grassland']}, {'Name': 'darkling', 'CR': '1/2', 'Env': ['forest', 'swamp', 'underdark', 'urban']}, {'Name': 'orc nurtured one of yurtrus', 'CR': '1/2', 'Env': ['forest', 'grassland', 'hill', 'mountain', 'underdark']}, {'Name': 'deinonychus', 'CR': '1', 'Env': ['forest', 'grassland', 'hill']}, {'Name': 'grung wildling', 'CR': '1', 'Env': ['forest']}, {'Name': 'kobold dragonshield', 'CR': '1', 'Env': ['forest', 'hill', 'mountain', 'underdark']}, {'Name': 'kobold scale sorcerer', 'CR': '1', 'Env': ['forest', 'hill', 'mountain', 'underdark', 'urban']}, {'Name': 'nilbog', 'CR': '1', 'Env': ['forest', 'hill', 'underdark']}, {'Name': 'quickling', 'CR': '1', 'Env': ['forest']}, {'Name': 'thorny', 'CR': '1', 'Env': ['forest', 'swamp']}, {'Name': 'darkling elder', 'CR': '2', 'Env': ['forest', 'swamp', 'underdark']}, {'Name': 'grung elite warrior', 'CR': '2', 'Env': ['forest']}, {'Name': 'guard drake green', 'CR': '2', 'Env': ['forest', 'urban']}, {'Name': 'hobgoblin iron shadow', 'CR': '2', 'Env': ['forest', 'grassland', 'hill'], 'NPC': True}, {'Name': 'meenlock', 'CR': '2', 'Env': ['forest', 'swamp', 'urban']}, {'Name': 'orc hand of yurtrus', 'CR': '2', 'Env': ['forest', 'grassland', 'hill', 'mountain', 'underdark']}, {'Name': 'shadow mastiff', 'CR': '2', 'Env': ['forest', 'hill', 'swamp']}, {'Name': 'vegepygmy chief', 'CR': '2', 'Env': ['forest', 'swamp'], 'NPC': True}, {'Name': 'archer', 'CR': '3', 'Env': ['forest', 'urban']}, {'Name': 'flail snail', 'CR': '3', 'Env': ['forest', 'swamp', 'underdark']}, {'Name': 'orc red fang of shargaas', 'CR': '3', 'Env': ['forest', 'hill', 'mountain', 'underdark', 'urban']}, {'Name': 'redcap', 'CR': '3', 'Env': ['forest', 'hill', 'swamp']}, {'Name': 'barghest', 'CR': '4', 'Env': ['forest', 'grassland', 'hill', 'mountain', 'underdark']}, {'Name': 'girallon', 'CR': '4', 'Env': ['forest']}, {'Name': 'hobgoblin devastator', 'CR': '4', 'Env': ['forest', 'grassland', 'hill'], 'NPC': True}, {'Name': 'orc blade of ilneval', 'CR': '4', 'Env': ['forest', 'grassland', 'hill', 'mountain', 'underdark']}, {'Name': 'stegosaurus', 'CR': '4', 'Env': ['forest', 'grassland']}, {'Name': 'yeth hound', 'CR': '4', 'Env': ['forest', 'grassland', 'hill']}, {'Name': 'brontosaurus', 'CR': '5', 'Env': ['forest', 'grassland']}, {'Name': 'wood woad', 'CR': '5', 'Env': ['forest']}, {'Name': 'korred', 'CR': '7', 'Env': ['forest']}, {'Name': 'archdruid', 'CR': '12', 'Env': ['forest', 'mountain', 'swamp', 'underwater'], 'NPC': True}, {'Name': 'cow', 'CR': '1/4', 'Env': ['grassland', 'underdark', 'urban']}, {'Name': 'hadrosaurus', 'CR': '1/4', 'Env': ['grassland']}, {'Name': 'aurochs', 'CR': '2', 'Env': ['grassland', 'hill', 'mountain']}, {'Name': 'stegosaurus', 'CR': '3', 'Env': ['grassland']}, {'Name': 'mouth of grolantor', 'CR': '6', 'Env': ['grassland', 'hill']}, {'Name': 'neogi hatchling', 'CR': '1/8', 'Env': ['hill', 'underdark']}, {'Name': 'xvart', 'CR': '1/8', 'Env': ['hill', 'underdark']}, {'Name': 'firenewt warlock of imix', 'CR': '1', 'Env': ['hill', 'mountain', 'underdark']}, {'Name': 'giant strider', 'CR': '1', 'Env': ['hill', 'mountain', 'underdark']}, {'Name': 'xvart marlock of raxivort', 'CR': '1', 'Env': ['hill', 'underdark']}, {'Name': 'quetzalcoatlus', 'CR': '2', 'Env': ['hill', 'mountain']}, {'Name': 'neogi', 'CR': '3', 'Env': ['hill', 'underdark']}, {'Name': 'neogi master', 'CR': '4', 'Env': ['hill', 'underdark']}, {'Name': 'tanarukk', 'CR': '5', 'Env': ['hill', 'mountain', 'underdark']}, {'Name': 'annis hag', 'CR': '6', 'Env': ['hill', 'mountain'], 'NPC': True}, {'Name': 'guard drake red', 'CR': '2', 'Env': ['mountain', 'underdark', 'urban']}, {'Name': 'cloud giant smiling one', 'CR': '11', 'Env': ['mountain']}, {'Name': 'fire giant dreadnought', 'CR': '14', 'Env': ['mountain', 'underdark']}, {'Name': 'dimetrodon', 'CR': '1/4', 'Env': ['swamp']}, {'Name': 'swarm of rot grubs', 'CR': '1/2', 'Env': ['swamp', 'underdark']}, {'Name': 'vargouille', 'CR': '1', 'Env': ['swamp', 'underdark']}, {'Name': 'guard drake black', 'CR': '2', 'Env': ['swamp', 'urban']}, {'Name': 'catoblepas', 'CR': '5', 'Env': ['swamp']}, {'Name': 'froghemoth', 'CR': '10', 'Env': ['swamp', 'underdark']}, {'Name': 'cranium rat', 'CR': '0', 'Env': ['underdark', 'urban']}, {'Name': 'chitine', 'CR': '1/2', 'Env': ['underdark']}, {'Name': 'gazer', 'CR': '1/2', 'Env': ['underdark']}, {'Name': 'cave fisher', 'CR': '3', 'Env': ['underdark']}, {'Name': 'choldrith', 'CR': '3', 'Env': ['underdark']}, {'Name': 'neogi', 'CR': '3', 'Env': ['underdark']}, {'Name': 'slithering tracker', 'CR': '3', 'Env': ['underdark', 'urban']}, {'Name': 'trapper', 'CR': '3', 'Env': ['underdark']}, {'Name': 'babau', 'CR': '4', 'Env': ['underdark', 'urban']}, {'Name': 'mindwitness', 'CR': '5', 'Env': ['underdark']}, {'Name': 'swarm of cranium rats', 'CR': '5', 'Env': ['underdark', 'urban']}, {'Name': 'draegloth', 'CR': '7', 'Env': ['underdark']}, {'Name': 'blackguard', 'CR': '8', 'Env': ['underdark', 'urban']}, {'Name': 'ulithharid', 'CR': '9', 'Env': ['underdark']}, {'Name': 'ashoon', 'CR': '10', 'Env': ['underdark']}, {'Name': 'death kiss', 'CR': '10', 'Env': ['underdark']}, {'Name': 'devourer', 'CR': '13', 'Env': ['underdark']}, {'Name': 'neothelid', 'CR': '13', 'Env': ['underdark']}, {'Name': 'elder brain', 'CR': '14', 'Env': ['underdark']}, {'Name': 'mind flayer lich', 'CR': '22', 'Env': ['underdark'], 'NPC': True}, {'Name': 'apprentice', 'CR': '1/8', 'Env': ['urban']}, {'Name': 'bard', 'CR': '2', 'Env': ['urban']}, {'Name': 'illusionist', 'CR': '3', 'Env': ['urban'], 'NPC': True}, {'Name': 'martial arts adept', 'CR': '3', 'Env': ['urban'], 'NPC': True}, {'Name': 'banderhobb', 'CR': '5', 'Env': ['urban']}, {'Name': 'enchanter', 'CR': '5', 'Env': ['urban'], 'NPC': True}, {'Name': 'master thief', 'CR': '5', 'Env': ['urban'], 'NPC': True}, {'Name': 'transmuter', 'CR': '5', 'Env': ['urban'], 'NPC': True}, {'Name': 'bodak', 'CR': '6', 'Env': ['urban']}, {'Name': 'conjurer', 'CR': '6', 'Env': ['urban'], 'NPC': True}, {'Name': 'diviner', 'CR': '8', 'Env': ['urban'], 'NPC': True}, {'Name': 'abjurer', 'CR': '9', 'Env': ['urban'], 'NPC': True}, {'Name': 'evoker', 'CR': '9', 'Env': ['urban'], 'NPC': True}, {'Name': 'warlord', 'CR': '12', 'Env': ['urban'], 'NPC': True}, {'Name': 'vampiric mist', 'CR': '3', 'Env': ['arctic', 'coastal', 'forest', 'grassland', 'mountain', 'swamp', 'underdark', 'urban']}, {'Name': 'the lost', 'CR': '7', 'Env': ['arctic', 'desert', 'forest', 'mountain', 'swamp', 'underdark', 'urban']}, {'Name': 'frost salamander', 'CR': '9', 'Env': ['arctic']}, {'Name': 'winter eladrin', 'CR': '10', 'Env': ['arctic', 'forest'], 'NPC': True}, {'Name': 'boneclaw', 'CR': '12', 'Env': ['arctic', 'desert', 'urban']}, {'Name': 'dire troll', 'CR': '13', 'Env': ['arctic', 'forest', 'hill', 'mountain', 'underdark']}, {'Name': 'nightwalker', 'CR': '20', 'Env': ['arctic', 'desert', 'swamp', 'underdark']}, {'Name': 'elder tempest', 'CR': '23', 'Env': ['arctic', 'grassland', 'hill', 'mountain']}, {'Name': 'tortle', 'CR': '1/4', 'Env': ['coastal']}, {'Name': 'skulk', 'CR': '1/2', 'Env': ['coastal', 'forest', 'swamp', 'underdark', 'urban']}, {'Name': 'tortle druid', 'CR': '2', 'Env': ['coastal']}, {'Name': 'merrenoloth', 'CR': '3', 'Env': ['coastal']}, {'Name': 'canoloth', 'CR': '8', 'Env': ['coastal', 'underdark', 'urban']}, {'Name': 'balhannoth', 'CR': '11', 'Env': ['coastal', 'mountain', 'underdark']}, {'Name': 'spirit troll', 'CR': '11', 'Env': ['coastal', 'forest', 'swamp', 'underdark']}, {'Name': 'eidolon', 'CR': '12', 'Env': ['coastal', 'desert', 'forest', 'mountain', 'urban']}, {'Name': 'wastrilith', 'CR': '13', 'Env': ['coastal', 'swamp', 'underdark']}, {'Name': 'blue abishai', 'CR': '17', 'Env': ['coastal', 'urban']}, {'Name': 'nagpa', 'CR': '17', 'Env': ['coastal', 'desert', 'forest', 'swamp', 'underdark', 'urban']}, {'Name': 'levithan', 'CR': '20', 'Env': ['cosatal', 'underwater']}, {'Name': 'elder tempest', 'CR': '23', 'Env': ['coastal', 'grassland', 'hill', 'mountain']}, {'Name': 'young kruthik', 'CR': '1/8', 'Env': ['desert', 'mountain', 'underdark']}, {'Name': 'meazel', 'CR': '1', 'Env': ['desert', 'forest', 'grassland', 'hill', 'mountain', 'swamp', 'underdark', 'urban']}, {'Name': 'stone cursed', 'CR': '1', 'Env': ['desert', 'mountain', 'urban']}, {'Name': 'adult kruthik', 'CR': '2', 'Env': ['desert', 'mountain', 'underdark']}, {'Name': 'berbalang', 'CR': '2', 'Env': ['desert']}, {'Name': 'dybbuk', 'CR': '4', 'Env': ['desert', 'urban']}, {'Name': 'kruthik hive lord', 'CR': '5', 'Env': ['desert', 'mountain', 'underdark']}, {'Name': 'howler', 'CR': '8', 'Env': ['desert', 'grassland', 'hill', 'underdark']}, {'Name': 'rot troll', 'CR': '9', 'Env': ['desert', 'forest', 'swamp', 'underdark']}, {'Name': 'the lonely', 'CR': '9', 'Env': ['desert', 'mountain', 'underdark', 'urban']}, {'Name': 'githyanki gish', 'CR': '10', 'Env': ['desert', 'mountain', 'urban'], 'NPC': True}, {'Name': 'githzerai enlightened', 'CR': '10', 'Env': ['desert', 'mountain', 'urban'], 'NPC': True}, {'Name': 'orthon', 'CR': '10', 'Env': ['desert', 'underdark', 'urban']}, {'Name': 'summer eladrin', 'CR': '10', 'Env': ['desert', 'forest'], 'NPC': True}, {'Name': "githyanki kith'rak", 'CR': '12', 'Env': ['desert', 'mountain', 'urban'], 'NPC': True}, {'Name': 'oinoloth', 'CR': '12', 'Env': ['desert', 'underdark']}, {'Name': 'githyanki supreme commander', 'CR': '14', 'Env': ['desert', 'mountain', 'urban'], 'NPC': True}, {'Name': 'retriever', 'CR': '14', 'Env': ['desert', 'forest', 'underdark']}, {'Name': 'skull lord', 'CR': '15', 'Env': ['desert', 'swamp', 'underdark']}, {'Name': 'phoenix', 'CR': '16', 'Env': ['desert', 'mountain']}, {'Name': 'zaratan', 'CR': '22', 'Env': ['desert', 'forest', 'hill', 'mountain', 'underdark']}, {'Name': 'bronze scout', 'CR': '1', 'Env': ['forest', 'grassland', 'mountain']}, {'Name': 'choker', 'CR': '1', 'Env': ['forest', 'mountain', 'underdark']}, {'Name': 'iron cobra', 'CR': '4', 'Env': ['forest', 'grassland', 'hill', 'mountain']}, {'Name': 'stone defender', 'CR': '4', 'Env': ['forest', 'grassland', 'hill', 'mountain']}, {'Name': 'oaken bolter', 'CR': '5', 'Env': ['forest', 'grassland', 'hill', 'mountain']}, {'Name': 'shadow dancer', 'CR': '7', 'Env': ['forest', 'underdark', 'urban']}, {'Name': 'venom troll', 'CR': '7', 'Env': ['forest', 'swamp', 'underdark']}, {'Name': 'corpse flower', 'CR': '8', 'Env': ['forest', 'swamp', 'urban']}, {'Name': 'autumn eladrin', 'CR': '10', 'Env': ['forest'], 'NPC': True}, {'Name': 'ogre bolt launcher', 'CR': '2', 'Env': ['grassland', 'hill', 'mountain']}, {'Name': 'ogre howdah', 'CR': '2', 'Env': ['grassland', 'hill', 'mountain']}, {'Name': 'ogre chain brute', 'CR': '3', 'Env': ['grassland', 'hill', 'mountain']}, {'Name': 'sword wraith warrior', 'CR': '3', 'Env': ['grassland', 'swamp']}, {'Name': 'ogre battering ram', 'CR': '4', 'Env': ['grassland', 'hill', 'mountain']}, {'Name': 'sword wraith commander', 'CR': '8', 'Env': ['grassland', 'swamp'], 'NPC': True}, {'Name': 'spring eladrin', 'CR': '10', 'Env': ['grassland', 'forest']}, {'Name': 'cadaver collector', 'CR': '14', 'Env': ['grassland']}, {'Name': 'gray render', 'CR': '12', 'Env': ['hill']}, {'Name': 'derro', 'CR': '1/4', 'Env': ['mountain', 'underdark']}, {'Name': 'stap spawn grue', 'CR': '1/4', 'Env': ['mountain', 'swamp']}, {'Name': 'duergar soulblade', 'CR': '1', 'Env': ['mountain', 'underdark']}, {'Name': 'duergar hammerer', 'CR': '2', 'Env': ['mountain', 'underdark'], 'NPC': True}, {'Name': 'duergar kavalrachni', 'CR': '2', 'Env': ['mountain', 'underdark'], 'NPC': True}, {'Name': 'duergar mind master', 'CR': '2', 'Env': ['mountain', 'underdark'], 'NPC': True}, {'Name': 'duergar stone guard', 'CR': '2', 'Env': ['mountain', 'underdark'], 'NPC': True}, {'Name': 'duergar xarrorn', 'CR': '2', 'Env': ['mountain', 'underdark'], 'NPC': True}, {'Name': 'duergar screamer', 'CR': '3', 'Env': ['mountain', 'underdark'], 'NPC': True}, {'Name': 'duergar warlord', 'CR': '6', 'Env': ['mountain', 'underdark'], 'NPC': True}, {'Name': 'duergar despot', 'CR': '12', 'Env': ['mountain', 'underdark'], 'NPC': True}, {'Name': 'star spawn seer', 'CR': '13', 'Env': ['mountain', 'swamp', 'urban']}, {'Name': 'star spawn larva mage', 'CR': '16', 'Env': ['mountain']}, {'Name': 'red abishai', 'CR': '19', 'Env': ['mountain', 'urban']}, {'Name': 'oblex spawn', 'CR': '1/4', 'Env': ['swamp', 'underdark', 'urban']}, {'Name': 'the wretched', 'CR': '1/4', 'Env': ['swamp', 'underdark', 'urban']}, {'Name': 'adult oblex', 'CR': '5', 'Env': ['swamp', 'underdark', 'urban']}, {'Name': 'allip', 'CR': '5', 'Env': ['swamp', 'urban']}, {'Name': 'maurezhi', 'CR': '7', 'Env': ['swamp', 'urban']}, {'Name': 'elder oblex', 'CR': '10', 'Env': ['swamp', 'urban']}, {'Name': 'male steeder', 'CR': '1/4', 'Env': ['underdark']}, {'Name': 'female steeder', 'CR': '1', 'Env': ['underdark']}, {'Name': 'derro savant', 'CR': '3', 'Env': ['underdark']}, {'Name': 'armanite', 'CR': '7', 'Env': ['underdark']}, {'Name': 'dhergoloth', 'CR': '7', 'Env': ['underdark']}, {'Name': 'drow house captain', 'CR': '9', 'Env': ['underdark'], 'NPC': True}, {'Name': 'gloom weaver', 'CR': '9', 'Env': ['underdark', 'urban']}, {'Name': 'alkilith', 'CR': '11', 'Env': ['underdark', 'urban']}, {'Name': 'drow shadowblade', 'CR': '11', 'Env': ['underdark'], 'NPC': True}, {'Name': 'soul monger', 'CR': '11', 'Env': ['underdark', 'urban']}, {'Name': 'drow arachnomancer', 'CR': '13', 'Env': ['underdark']}, {'Name': 'the angry', 'CR': '13', 'Env': ['underdark', 'urban']}, {'Name': 'drow inquisitor', 'CR': '14', 'Env': ['underdark']}, {'Name': 'nabassu', 'CR': '14', 'Env': ['underdark', 'urban']}, {'Name': 'drow favored consort', 'CR': '18', 'Env': ['underdark'], 'NPC': True}, {'Name': 'sibriex', 'CR': '18', 'Env': ['underdark']}, {'Name': 'drow matron mother', 'CR': '20', 'Env': ['underdark'], 'NPC': True}, {'Name': 'giff', 'CR': '3', 'Env': ['urban']}, {'Name': 'deathlock', 'CR': '4', 'Env': ['urban']}, {'Name': 'white abishai', 'CR': '6', 'Env': ['urban']}, {'Name': 'black abishai', 'CR': '7', 'Env': ['urban']}, {'Name': 'deathlock mastermind', 'CR': '8', 'Env': ['urban']}, {'Name': 'yagnoloth', 'CR': '11', 'Env': ['urban']}, {'Name': 'green abishai', 'CR': '15', 'Env': ['urban']}, {'Name': 'steel predator', 'CR': '16', 'Env': ['urban']}, {'Name': 'blue abishai', 'CR': '17', 'Env': ['urban']}, {'Name': 'red abishai', 'CR': '19', 'Env': ['urban']}, {'Name': 'baphomet', 'CR': '23', 'Env': []}, {'Name': "fraz urb'luu", 'CR': '23', 'Env': []}, {'Name': 'juiblex', 'CR': '23', 'Env': []}, {'Name': 'zuggtmoy', 'CR': '23', 'Env': []}, {'Name': "graz'zt", 'CR': '23', 'Env': []}, {'Name': 'yeenoghu', 'CR': '24', 'Env': []}, {'Name': 'marut', 'CR': '25', 'Env': []}, {'Name': 'demogorgon', 'CR': '26', 'Env': []}, {'Name': 'orcus', 'CR': '26', 'Env': []}, {'Name': 'zariel', 'CR': '26', 'Env': []}, {'Name': 'rutterkin', 'CR': '2', 'Env': []}, {'Name': 'abyssal wretch', 'CR': '1/4', 'Env': []}, {'Name': 'molydeus', 'CR': '21', 'Env': []}, {'Name': 'bael', 'CR': '19', 'Env': []}, {'Name': 'amnizu', 'CR': '18', 'Env': []}, {'Name': 'githzerai anarch', 'CR': '16', 'Env': []}] all_np_cs = [npc for npc in ALL_MONSTERS if npc.get('NPC')] all_features = ['aggressive', 'ambusher', 'amorphous', 'angelic weapons', 'antimagic susceptibility', 'avoidance', 'blind senses', 'blood frenzy', 'breath weapon', 'brute', 'chameleon skin', 'change shape', 'charge', 'charm', 'constrict', 'damage absorption', 'damage transfer', 'death burst', 'devil sight', 'dive attack', 'echolocation', 'elemental body', 'enlarge', 'ethearlness', 'false appearance', 'fey ancestry', 'fiendish blessing', 'flyby', 'frightful presence', 'grappler', 'hold breath', 'horrifying visage', 'illumination', 'illusory appearance', 'immutable form', 'incorporeal movement', 'innate spellcasting', 'inscrutable', 'invisibility', 'keen senses', 'labyrinthine recall', 'leadership', 'legendary resistance', 'life drain', 'light sensitivity', 'magic resistance', 'magic weapons', 'martial advantage', 'mimicry', 'nimble escape', 'otherworldly perception', 'pack tactics', 'possession', 'pounce', 'psychic defense', 'rampage', 'read thoughts', 'reckless', 'redirect attack', 'reel', 'regeneration', 'rejuvenation', 'relentless', 'shadow stealth', 'shapechanger', 'siege monster', 'slippery', 'spellcasting', 'spider climb', 'standing leap', 'steadfast', 'stench', 'sunlight sensitivity', 'superior invisibility', 'sure footed', 'surprise attack', 'swallow', 'teleport', 'terrain camouflage', 'tunneler', 'turn resistance', 'two heads', 'undead fortitude', 'web', 'web sense', 'web walker', 'wounded fury'] all_c_rs = ['0', '1/8', '1/4', '1/2', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30'] all_proficiencies = {'0': '2', '1/8': '2', '1/4': '2', '1/2': '2', '1': '2', '2': '2', '3': '2', '4': '2', '5': '3', '6': '3', '7': '3', '8': '3', '9': '4', '10': '4', '11': '4', '12': '4', '13': '5', '14': '5', '15': '5', '16': '5', '17': '6', '18': '6', '19': '6', '20': '6', '21': '7', '22': '7', '23': '7', '24': '7', '25': '8', '26': '8', '27': '8', '28': '8', '29': '9', '30': '9'} all_a_cs = {'0': '13', '1/8': '13', '1/4': '13', '1/2': '13', '1': '13', '2': '13', '3': '13', '4': '14', '5': '15', '6': '15', '7': '15', '8': '16', '9': '16', '10': '17', '11': '17', '12': '17', '13': '18', '14': '18', '15': '18', '16': '18', '17': '19', '18': '19', '19': '19', '20': '19', '21': '19', '22': '19', '23': '19', '24': '19', '25': '19', '26': '19', '27': '19', '28': '19', '29': '19', '30': '19'} all_hp = {'0': [1, 6], '1/8': [7, 35], '1/4': [36, 49], '1/2': [50, 70], '1': [71, 85], '2': [86, 100], '3': [101, 115], '4': [116, 130], '5': [131, 145], '6': [146, 160], '7': [161, 175], '8': [176, 190], '9': [191, 205], '10': [206, 220], '11': [221, 235], '12': [236, 250], '13': [251, 265], '14': [266, 280], '15': [281, 295], '16': [296, 310], '17': [311, 325], '18': [326, 340], '19': [341, 355], '20': [356, 400], '21': [401, 445], '22': [446, 490], '23': [491, 535], '24': [536, 580], '25': [581, 625], '26': [626, 670], '27': [671, 715], '28': [716, 760], '29': [761, 805], '30': [806, 850]} all_attack_bonuses = {'0': '3', '1/8': '3', '1/4': '3', '1/2': '3', '1': '3', '2': '3', '3': '4', '4': '5', '5': '6', '6': '6', '7': '6', '8': '7', '9': '7', '10': '7', '11': '8', '12': '8', '13': '8', '14': '8', '15': '8', '16': '9', '17': '10', '18': '10', '19': '10', '20': '10', '21': '11', '22': '11', '23': '11', '24': '12', '25': '12', '26': '12', '27': '13', '28': '13', '29': '13', '30': '14'} all_dpr = {'0': [0, 1], '1/8': [2, 3], '1/4': [4, 5], '1/2': [6, 8], '1': [9, 14], '2': [15, 20], '3': [21, 26], '4': [27, 32], '5': [33, 38], '6': [39, 44], '7': [45, 50], '8': [51, 56], '9': [57, 62], '10': [63, 68], '11': [69, 74], '12': [75, 80], '13': [81, 86], '14': [87, 92], '15': [93, 98], '16': [99, 104], '17': [105, 110], '18': [111, 116], '19': [117, 122], '20': [123, 140], '21': [141, 158], '22': [159, 176], '23': [177, 194], '24': [195, 212], '25': [213, 230], '26': [231, 248], '27': [249, 266], '28': [267, 284], '29': [285, 302], '30': [303, 320]} all_d_cs = {'0': '13', '1/8': '13', '1/4': '13', '1/2': '13', '1': '13', '2': '13', '3': '13', '4': '14', '5': '15', '6': '15', '7': '15', '8': '16', '9': '16', '10': '16', '11': '17', '12': '17', '13': '18', '14': '18', '15': '18', '16': '18', '17': '19', '18': '19', '19': '19', '20': '19', '21': '20', '22': '20', '23': '20', '24': '21', '25': '21', '26': '21', '27': '22', '28': '22', '29': '22', '30': '23'} all_names = ['Akra', 'Aasathra', 'Antrara', 'Arava', 'Biri', 'Blendaeth', 'Burana', 'Chassath', 'Daar', 'Dentratha', 'Doudra', 'Driindar', 'Eggren', 'Farideh', 'Findex', 'Furrele', 'Gesrethe', 'Gilkass', 'Harann', 'Havilar', 'Hethress', 'Hillanot', 'Jaxi', 'Jezean', 'Jheri', 'Kadana', 'Kava', 'Korinn', 'Megren', 'Mijira', 'Mishann', 'Nala', 'Nuthra', 'Perra', 'Pogranix', 'Pyxrin', 'Quespa', 'Raiann', 'Rezena', 'Ruloth', 'Saphara', 'Savaran', 'Sora', 'Surina', 'Synthrin', 'Tatyan', 'Thava', 'Uadjit', 'Vezera', 'Zykroff', 'Adrex', 'Arjhan', 'Azzakh', 'Balasar', 'Baradad', 'Bharash', 'Bidreked', 'Dadalan', 'Dazzazn', 'Direcris', 'Donaar', 'Fax', 'Gargax', 'Ghesh', 'Gorbundus', 'Greethen', 'Heskan', 'Hirrathak', 'Ildrex', 'Kaladan', 'Kerkad', 'Kiirith', 'Kriv', 'Maagog', 'Medrash', 'Mehen', 'Mozikth', 'Mreksh', 'Mugrunden', 'Nadarr', 'Nithther', 'Norkruuth', 'Nykkan', 'Pandjed', 'Patrin', 'Pijjirik', 'Quarethon', 'Rathkran', 'Rhogar', 'Rivaan', 'Sethrekar', 'Shamash', 'Shedinn', 'Srorthen', 'Tarhun', 'Torinn', 'Trynnicus', 'Valorean', 'Vrondiss', 'Zedaar', 'Anbera', 'Artin', 'Audhild', 'Balifra', 'Barbena', 'Bardryn', 'Bolhild', 'Dagnal', 'Dariff', 'Delre', 'Diesa', 'Eldeth', 'Eridred', 'Falkrunn', 'Fallthra', 'Finellen', 'Gillydd', 'Gunnloda', 'Gurdis', 'Helgret', 'Helja', 'Hlin', 'Ilde', 'Jarana', 'Kathra', 'Kilia', 'Kristryd', 'Liftrasa', 'Marastyr', 'Mardred', 'Morana', 'Nalaed', 'Nora', 'Nurkara', 'Oriff', 'Ovina', 'Riswynn', 'Sannl', 'Therlin', 'Thodris', 'Torbera', 'Tordrid', 'Torgga', 'Urshar', 'Valida', 'Vistra', 'Vonana', 'Werydd', 'Whurdred', 'Yurgunn', 'Adrik', 'Alberich', 'Baern', 'Barendd', 'Beloril', 'Brottor', 'Dain', 'Dalgal', 'Darrak', 'Delg', 'Duergath', 'Dworic', 'Eberk', 'Einkil', 'Elaim', 'Erias', 'Fallond', 'Fargrim', 'Gardain', 'Gilthur', 'Gimgen', 'Gimurt', 'Harbek', 'Kildrak', 'Kilvar', 'Morgran', 'Morkral', 'Nalral', 'Nordak', 'Nuraval', 'Oloric', 'Olunt', 'Orsik', 'Oskar', 'Rangrim', 'Reirak', 'Rurik', 'Taklinn', 'Thoradin', 'Thorin', 'Thradal', 'Tordek', 'Traubon', 'Travok', 'Ulfgar', 'Uraim', 'Veit', 'Vonbin', 'Vondal', 'Whurbin', 'Adrie', 'Ahinar', 'Althaea', 'Anastrianna', 'Andraste', 'Antinua', 'Arara', 'Baelitae', 'Bethrynna', 'Birel', 'Caelynn', 'Chaedi', 'Claira', 'Dara', 'Drusilia', 'Elama', 'Enna', 'Faral', 'Felosial', 'Hatae', 'Ielenia', 'Ilanis', 'Irann', 'Jarsali', 'Jelenneth', 'Keyleth', 'Leshanna', 'Lia', 'Maiathah', 'Malquis', 'Meriele', 'Mialee', 'Myathethil', 'Naivara', 'Quelenna', 'Quillathe', 'Ridaro', 'Sariel', 'Shanairla', 'Shava', 'Silaqui', 'Sumnes', 'Theirastra', 'Thiala', 'Tiaathque', 'Traulam', 'Vadania', 'Valanthe', 'Valna', 'Xanaphia', 'Adran', 'Aelar', 'Aerdeth', 'Ahvain', 'Aramil', 'Arannis', 'Aust', 'Azaki', 'Beiro', 'Berrian', 'Caeldrim', 'Carric', 'Dayereth', 'Dreali', 'Efferil', 'Eiravel', 'Enialis', 'Erdan', 'Erevan', 'Fivin', 'Galinndan', 'Gennal', 'Hadarai', 'Halimath', 'Heian', 'Himo', 'Immeral', 'Ivellios', 'Korfel', 'Lamlis', 'Laucian', 'Lucan', 'Mindartis', 'Naal', 'Nutae', 'Paelias', 'Peren', 'Quarion', 'Riardon', 'Rolen', 'Soveliss', 'Suhnae', 'Thamior', 'Tharivol', 'Theren', 'Theriatis', 'Thervan', 'Uthemar', 'Vanuath', 'Varis', 'Abalaba', 'Bimpnottin', 'Breena', 'Buvvie', 'Callybon', 'Caramip', 'Carlin', 'Cumpen', 'Dalaba', 'Donella', 'Duvamil', 'Ella', 'Ellyjoybell', 'Ellywick', 'Enidda', 'Lilli', 'Loopmottin', 'Lorilla', 'Luthra', 'Mardnab', 'Meena', 'Menny', 'Mumpena', 'Nissa', 'Numba', 'Nyx', 'Oda', 'Oppah', 'Orla', 'Panana', 'Pyntle', 'Quilla', 'Ranala', 'Reddlepop', 'Roywyn', 'Salanop', 'Shamil', 'Siffress', 'Symma', 'Tana', 'Tenena', 'Tervaround', 'Tippletoe', 'Ulla', 'Unvera', 'Veloptima', 'Virra', 'Waywocket', 'Yebe', 'Zanna', 'Alston', 'Alvyn', 'Anverth', 'Arumawann', 'Bilbron', 'Boddynock', 'Brocc', 'Burgell', 'Cockaby', 'Crampernap', 'Dabbledob', 'Delebean', 'Dimble', 'Eberdeb', 'Eldon', 'Erky', 'Fablen', 'Fibblestib', 'Fonkin', 'Frouse', 'Frug', 'Gerbo', 'Gimble', 'Glim', 'Igden', 'Jabble', 'Jebeddo', 'Kellen', 'Kipper', 'Namfoodle', 'Oppleby', 'Orryn', 'Paggen', 'Pallabar', 'Pog', 'Qualen', 'Ribbles', 'Rimple', 'Roondar', 'Sapply', 'Seebo', 'Senteq', 'Sindri', 'Umpen', 'Warryn', 'Wiggens', 'Wobbles', 'Wrenn', 'Zaffrab', 'Zook', 'Alain', 'Andry', 'Anne', 'Bella', 'Blossom', 'Bree', 'Callie', 'Chenna', 'Cora', 'Dee', 'Dell', 'Eida', 'Eran', 'Euphemia', 'Georgina', 'Gynnie', 'Harriet', 'Jasmine', 'Jillian', 'Jo', 'Kithri', 'Lavinia', 'Lidda', 'Maegan', 'Marigold', 'Merla', 'Myria', 'Nedda', 'Nikki', 'Nora', 'Olivia', 'Paela', 'Pearl', 'Pennie', 'Philomena', 'Portia', 'Robbie', 'Rose', 'Saral', 'Seraphina', 'Shaena', 'Stacee', 'Tawna', 'Thea', 'Trym', 'Tyna', 'Vani', 'Verna', 'Wella', 'Willow', 'Alton', 'Ander', 'Bernie', 'Bobbin', 'Cade', 'Callus', 'Corrin', 'Dannad', 'Danniel', 'Eddie', 'Egart', 'Eldon', 'Errich', 'Fildo', 'Finnan', 'Franklin', 'Garret', 'Garth', 'Gilbert', 'Gob', 'Harol', 'Igor', 'Jasper', 'Keith', 'Kevin', 'Lazam', 'Lerry', 'Lindal', 'Lyle', 'Merric', 'Mican', 'Milo', 'Morrin', 'Nebin', 'Nevil', 'Osborn', 'Ostran', 'Oswalt', 'Perrin', 'Poppy', 'Reed', 'Roscoe', 'Sam', 'Shardon', 'Tye', 'Ulmo', 'Wellby', 'Wendel', 'Wenner', 'Wes', 'Arha', 'Baggi', 'Bendoo', 'Bilga', 'Brakka', 'Creega', 'Drenna', 'Ekk', 'Emen', 'Engong', 'Fistula', 'Gaaki', 'Gorga', 'Grai', 'Greeba', 'Grigi', 'Gynk', 'Hrathy', 'Huru', 'Ilga', 'Kabbarg', 'Kansif', 'Lagazi', 'Lezre', 'Murgen', 'Murook', 'Myev', 'Nagrette', 'Neega', 'Nella', 'Nogu', 'Oolah', 'Ootah', 'Ovak', 'Ownka', 'Puyet', 'Reeza', 'Shautha', 'Silgre', 'Sutha', 'Tagga', 'Tawar', 'Tomph', 'Ubada', 'Vanchu', 'Vola', 'Volen', 'Vorka', 'Yevelda', 'Zagga', 'Argran', 'Braak', 'Brug', 'Cagak', 'Dench', 'Dorn', 'Dren', 'Druuk', 'Feng', 'Gell', 'Gnarsh', 'Grumbar', 'Gubrash', 'Hagren', 'Henk', 'Hogar', 'Holg', 'Imsh', 'Karash', 'Karg', 'Keth', 'Korag', 'Krusk', 'Lubash', 'Megged', 'Mhurren', 'Mord', 'Morg', 'Nil', 'Nybarg', 'Odorr', 'Ohr', 'Rendar', 'Resh', 'Ront', 'Rrath', 'Sark', 'Scrag', 'Sheggen', 'Shump', 'Tanglar', 'Tarak', 'Thar', 'Thokk', 'Trag', 'Ugarth', 'Varg', 'Vilberg', 'Yurk', 'Zed', 'Akta', 'Anakis', 'Armara', 'Astaro', 'Aym', 'Azza', 'Beleth', 'Bryseis', 'Bune', 'Criella', 'Damaia', 'Decarabia', 'Ea', 'Gadreel', 'Gomory', 'Hecat', 'Ishte', 'Jezebeth', 'Kali', 'Kallista', 'Kasdeya', 'Lerissa', 'Lilith', 'Makaria', 'Manea', 'Markosian', 'Mastema', 'Naamah', 'Nemeia', 'Nija', 'Orianna', 'Osah', 'Phelaia', 'Prosperine', 'Purah', 'Pyra', 'Rieta', 'Ronobe', 'Ronwe', 'Seddit', 'Seere', 'Sekhmet', 'Semyaza', 'Shava', 'Shax', 'Sorath', 'Uzza', 'Vapula', 'Vepar', 'Verin', 'Abad', 'Ahrim', 'Akmen', 'Amnon', 'Andram', 'Astar', 'Balam', 'Barakas', 'Bathin', 'Caim', 'Chem', 'Cimer', 'Cressel', 'Damakos', 'Ekemon', 'Euron', 'Fenriz', 'Forcas', 'Habor', 'Iados', 'Kairon', 'Leucis', 'Mamnen', 'Mantus', 'Marbas', 'Melech', 'Merihim', 'Modean', 'Mordai', 'Mormo', 'Morthos', 'Nicor', 'Nirgel', 'Oriax', 'Paymon', 'Pelaios', 'Purson', 'Qemuel', 'Raam', 'Rimmon', 'Sammal', 'Skamos', 'Tethren', 'Thamuz', 'Therai', 'Valafar', 'Vassago', 'Xappan', 'Zepar', 'Zephan', 'Alfhild', 'Arnbjorg', 'Ase', 'Aslog', 'Astrid', 'Auda', 'Audhid', 'Bergljot', 'Birghild', 'Bodil', 'Brenna', 'Brynhild', 'Dagmar', 'Eerika', 'Eira', 'Gudrun', 'Gunborg', 'Gunhild', 'Gunvor', 'Helga', 'Hertha', 'Hilde', 'Hillevi', 'Ingrid', 'Iona', 'Jorunn', 'Kari', 'Kenna', 'Magnhild', 'Nanna', 'Olga', 'Ragna', 'Ragnhild', 'Ranveig', 'Runa', 'Saga', 'Sigfrid', 'Signe', 'Sigrid', 'Sigrunn', 'Solveg', 'Svanhild', 'Thora', 'Torborg', 'Torunn', 'Tove', 'Unn', 'Vigdis', 'Ylva', 'Yngvild', 'Adelaide', 'Agatha', 'Agnes', 'Alice', 'Aline', 'Anne', 'Avelina', 'Avice', 'Beatrice', 'Cecily', 'Egelina', 'Eleanor', 'Elizabeth', 'Ella', 'Eloise', 'Elysande', 'Emeny', 'Emma', 'Emmeline', 'Ermina', 'Eva', 'Galiena', 'Geva', 'Giselle', 'Griselda', 'Hadwisa', 'Helen', 'Herleva', 'Hugolina', 'Ida', 'Isabella', 'Jacoba', 'Jane', 'Joan', 'Juliana', 'Katherine', 'Margery', 'Mary', 'Matilda', 'Maynild', 'Millicent', 'Oriel', 'Rohesia', 'Rosalind', 'Rosamund', 'Sarah', 'Susannah', 'Sybil', 'Williamina', 'Yvonne', 'Aelia', 'Aemilia', 'Agrippina', 'Alba', 'Antonia', 'Aquila', 'Augusta', 'Aurelia', 'Balbina', 'Blandina', 'Caelia', 'Camilla', 'Casia', 'Claudia', 'Cloelia', 'Domitia', 'Drusa', 'Fabia', 'Fabricia', 'Fausta', 'Flavia', 'Floriana', 'Fulvia', 'Germana', 'Glaucia', 'Gratiana', 'Hadriana', 'Hermina', 'Horatia', 'Hortensia', 'Iovita', 'Iulia', 'Laelia', 'Laurentia', 'Livia', 'Longina', 'Lucilla', 'Lucretia', 'Marcella', 'Marcia', 'Maxima', 'Nona', 'Octavia', 'Paulina', 'Petronia', 'Porcia', 'Tacita', 'Tullia', 'Verginia', 'Vita', 'Agni', 'Alaric', 'Anvindr', 'Arvid', 'Asger', 'Asmund', 'Bjarte', 'Bjorg', 'Bjorn', 'Brandr', 'Brandt', 'Brynjar', 'Calder', 'Colborn', 'Cuyler', 'Egil', 'Einar', 'Eric', 'Erland', 'Fiske', 'Folkvar', 'Fritjof', 'Frode', 'Geir', 'Halvar', 'Hemming', 'Hjalmar', 'Hjortr', 'Ingimarr', 'Ivar', 'Knud', 'Leif', 'Liufr', 'Manning', 'Oddr', 'Olin', 'Ormr', 'Ove', 'Rannulfr', 'Sigurd', 'Skari', 'Snorri', 'Sten', 'Stigandr', 'Stigr', 'Sven', 'Trygve', 'Ulf', 'Vali', 'Vidar', 'Adam', 'Adelard', 'Aldous', 'Anselm', 'Arnold', 'Bernard', 'Bertram', 'Charles', 'Clerebold', 'Conrad', 'Diggory', 'Drogo', 'Everard', 'Frederick', 'Geoffrey', 'Gerald', 'Gilbert', 'Godfrey', 'Gunter', 'Guy', 'Henry', 'Heward', 'Hubert', 'Hugh', 'Jocelyn', 'John', 'Lance', 'Manfred', 'Miles', 'Nicholas', 'Norman', 'Odo', 'Percival', 'Peter', 'Ralf', 'Randal', 'Raymond', 'Reynard', 'Richard', 'Robert', 'Roger', 'Roland', 'Rolf', 'Simon', 'Theobald', 'Theodoric', 'Thomas', 'Timm', 'William', 'Wymar', 'Aelius', 'Aetius', 'Agrippa', 'Albanus', 'Albus', 'Antonius', 'Appius', 'Aquilinus', 'Atilus', 'Augustus', 'Aurelius', 'Avitus', 'Balbus', 'Blandus', 'Blasius', 'Brutus', 'Caelius', 'Caius', 'Casian', 'Cassius', 'Cato', 'Celsus', 'Claudius', 'Cloelius', 'Cnaeus', 'Crispus', 'Cyprianus', 'Diocletianus', 'Egnatius', 'Ennius', 'Fabricius', 'Faustus', 'Gaius', 'Germanus', 'Gnaeus', 'Horatius', 'Iovianus', 'Iulius', 'Lucilius', 'Manius', 'Marcus', 'Marius', 'Maximus', 'Octavius', 'Paulus', 'Quintilian', 'Regulus', 'Servius', 'Tacitus', 'Varius'] all_plots = ['is searching for a powerful artifact', 'wants to live forever', 'wants revenge for the death of their family', 'seeks to overthrow the government', 'is trying to impress a love interest', 'has kidnapped someone for ransom', 'is searching for a missing person', 'has lost a valuable item', 'wants to acquire a legendary item to prolong life', 'wants to ascend to godhood', 'is trying to become undead', 'is trying to obtain a younger body', 'seeks to seize a position of power', 'seeks to seize a title', 'wants to win a contest', 'wishes to win favor with a powerful individual', 'is trying to place a pawn in a position of power', 'wants to obtain an ancient artifact', 'is trying to build a construct or magical device', "is carrying out a deity's wishes", 'is offering sacrifices to a deity', 'is trying to contact a lost deity or power', 'wants to open a gate to another world', 'is trying to fulfill an apocalyptic prophecy', 'is enacting the vengeful will of a god', 'is enacting the vengeful will of a patron', 'is spreading a vile contagion', 'wants to trigger a natural disaster', 'seeks to utterly destroy a bloodline or clan', 'wishes to prolong the life of a loved one', 'wants to raise a dead loved one', "is destroying rivals for another person's affection", 'wants to conquer a region', 'is inciting a rebellion', 'is trying to seize control of the army', 'is working to become the power behind the throne', 'seeks the favor of a ruler', 'wants to avenge a past humiliation or insult', 'wants to avenge a past imprisonment or injury', 'seeks to recover stolen property and punish the thief', 'wishes to control natural resources', 'wishes to control trade', 'is trying to marry into wealth', 'is trying to plunder ancient ruins', 'is stealing land', 'is stealing goods', 'is stealing money'] all_cr_scales = [(1, 1.0), (2, 1.5), (6, 2.0), (10, 2.5), (14, 3.0), (100, 4.0)] ALL_CR_SCALES.sort()